本文整理汇总了C#中DBManager.saveAssembly方法的典型用法代码示例。如果您正苦于以下问题:C# DBManager.saveAssembly方法的具体用法?C# DBManager.saveAssembly怎么用?C# DBManager.saveAssembly使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DBManager
的用法示例。
在下文中一共展示了DBManager.saveAssembly方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: btnSaveOption_Click
private void btnSaveOption_Click(object sender, EventArgs e)
{
double duration = 0;
if (String.IsNullOrEmpty(txtName.Text))
MessageBox.Show("Please enter a valid Assembly Name.");
else if (String.IsNullOrEmpty(txtCode.Text))
MessageBox.Show("Please enter a valid Assembly Code.");
else if (String.IsNullOrEmpty(txtDuration.Text) || !Double.TryParse(txtDuration.Text, out duration))
MessageBox.Show("Please enter a valid duration.");
else if (CreatedOption.Materials.Count() <= 0)
MessageBox.Show("Assembly must contain at least one material.");
else
{
CreatedOption.AssemblyName = txtName.Text;
CreatedOption.AssemblyCode = txtCode.Text;
CreatedOption.Description = txtDesc.Text;
CreatedOption.Cost = Double.Parse(txtCost.Text);
CreatedOption.CO2 = Double.Parse(txtEI.Text);
CreatedOption.Duration = Double.Parse(txtDuration.Text);
CreatedOption.Category = this.AssemCategory;
DBManager manager = new DBManager(RevitDocument);
if (!manager.saveAssembly(CreatedOption))
MessageBox.Show("Failed to save Option.");
}
}