private void AddProperty(object sender, EventArgs e) { property = new BOMProperty(); //property.Id = 1; property.CN_Name = txtCnName.Text; property.EN_Name = txtEnName.Text; property.DataType = cboDataType.Text; property.DataLength = txtDataLength.Text; property.DefaultValue = txtDefaultValue.Text; property.InputType = radioGroup1.SelectedIndex.ToString(); property.Required = chkRequired.Checked.ToString(); property.Is_Delete = "0"; property.Is_Query = "0"; property.Width = "100"; property.Create_Date = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss")); property.Create_User_Id = 1; structService.AddORUpdatePorperty(property); this.DialogResult = DialogResult.OK; }
private bool UpdateProperty(BOMProperty property) { return(false); }
public bool AddORUpdatePorperty(BOMProperty property) { return(property.Id == 0 ? AddProperty(property) : UpdateProperty(property)); }
private bool AddProperty(BOMProperty property) { //在BOM表中动态创建名称为en_name值的字段名称 return(true); }
public List <BOMProperty> GetAllBOMProperty() { var propertyList = new List <BOMProperty>(); string sql = "select * from bom_base_property union select * from bom_attached_property"; var baseProperty = new BOMProperty { CN_Name = "轴承", EN_Name = "zhoucheng", DataType = "1", DataLength = "20", DefaultValue = "是", Width = "54px", Required = "true", Id = 1, InputType = "1", Is_Show = true, PropertyType = "基础属性" }; propertyList.Add(baseProperty); baseProperty = new BOMProperty { CN_Name = "轮胎", EN_Name = "luntai", DataType = "0", DataLength = "100", DefaultValue = "是", Width = "100px", Is_Show = true, InputType = "0", Required = "false", Id = 2, PropertyType = "自定义属性" }; propertyList.Add(baseProperty); baseProperty = new BOMProperty { CN_Name = "自行车", EN_Name = "bike", Required = "false", DataType = "0", DataLength = "100", DefaultValue = "是", Width = "100px", Id = 3, Is_Show = true, InputType = "1", PropertyType = "自定义属性" }; propertyList.Add(baseProperty); baseProperty = new BOMProperty { CN_Name = "骑车", EN_Name = "qiche", Required = "true", DataType = "0", DataLength = "100", DefaultValue = "是", Width = "100px", Id = 4, Is_Show = true, InputType = "0", PropertyType = "BOM自定义属性" }; propertyList.Add(baseProperty); return(propertyList); }