public IList<MaterialBaseProperty> MaterialMessage(int id) { IList<MaterialBaseProperty> mater = new BindingList<MaterialBaseProperty>(); MaterialBaseProperty m = new MaterialBaseProperty(); m.cn_name = ""; m.create_date = new DateTime(); m.create_user_id = 1; m.data_length = ""; m.data_type = ""; m.default_value = ""; m.en_name = ""; m.id = 1; m.input_type = ""; m.is_delete = ""; m.is_extends = ""; m.is_query = ""; m.material_property_type_id = 1; m.modify_date = new DateTime(); m.modify_user_id = 1; m.property_type = ""; m.required = ""; m.width = ""; mater.Add(m); return mater; }
private void CheckResult_Modify_BarButtonItem_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { MaterbasePro = (MaterialBaseProperty)PartsMange_MaterialReviewRuleManage_CheckResult_Material_GridView.GetFocusedRow(); AddMaterialInfor AM = new AddMaterialInfor(); AM.Tag = "Modify"; //AM.MaterBase = MaterbasePro; AM.ShowDialog(); }
//public IList<MaterialBaseProperty> AddMaterialcs() //{ // IList<MaterialBaseProperty> MP = new BindingList<MaterialBaseProperty>(); // MaterialBaseProperty m = new MaterialBaseProperty(); // MaterialBaseProperty m1 = new MaterialBaseProperty(); // m.cn_name = "零件"; // m.data_type = ""; // m.data_length = "10"; // m.input_type = ""; // m.is_extends = "是"; // m.create_date = new DateTime(); // m.create_user_id = 001; // m.default_value = "1"; // m.en_name = ""; // m.id = 001; // m.is_delete = "否"; // m.is_query = "是"; // m.material_property_type_id = 001; // m.modify_date = new DateTime(); // m.modify_user_id = 001; // m.property_type = ""; // m.required = "是"; // m.width = "50px"; // m1.cn_name = "物料"; // m1.data_type = ""; // m1.data_length = "20"; // m1.input_type = ""; // m1.is_extends = "否"; // m1.create_date = new DateTime(); // m1.create_user_id = 002; // m1.default_value = "2"; // m1.en_name = ""; // m1.id = 002; // m1.is_delete = "否"; // m1.is_query = "否"; // m1.material_property_type_id = 002; // m1.modify_date = new DateTime(); // m1.modify_user_id = 002; // m1.property_type = ""; // m1.required = "否"; // m1.width = "100px"; // MP.Add(m1); // MP.Add(m); // return MP; //} public IList<MaterialBaseProperty> Mat() { IList<MaterialBaseProperty> M = new BindingList<MaterialBaseProperty>(); MaterialBaseProperty mab = new MaterialBaseProperty(); MaterialBaseProperty mab1 = new MaterialBaseProperty(); mab.is_extends = "是"; mab.cn_name = "小灰灰"; mab.create_date = new DateTime(); mab.create_user_id = 1001; mab.data_length = "11"; mab.data_type = ""; mab.default_value = "01"; mab.en_name = ""; mab.id = 1001; mab.input_type = ""; mab.is_delete = "是"; mab.is_query = "否"; mab.material_property_type_id = 1001; mab.modify_date = new DateTime(); mab.modify_user_id = 1001; mab.property_type = ""; mab.required = "是"; mab.width = "100px"; mab1.is_extends = "否"; mab1.cn_name = "大灰灰"; mab1.create_date = new DateTime(); mab1.create_user_id = 1; mab1.data_length = ""; mab1.data_type = ""; mab1.default_value = ""; mab1.en_name = ""; mab1.id = 1; mab1.input_type = ""; mab1.is_delete = ""; mab1.is_query = ""; mab1.material_property_type_id = 1; mab1.modify_date = new DateTime(); mab1.modify_user_id = 1; mab1.property_type = ""; mab1.required = ""; mab1.width = ""; M.Add(mab); M.Add(mab1); return M; }
private void GetCheckDataList() { var rowCount = PartsMange_MaterialPropertyBuild_MaterialPropertyBuild_MaterialPropertyList_GridView.RowCount; for (int i = 0; i < rowCount; i++) { var value = PartsMange_MaterialPropertyBuild_MaterialPropertyBuild_MaterialPropertyList_GridView.GetRowCellValue(i, "checkStatus").ToString(); var id = Convert.ToInt32(PartsMange_MaterialPropertyBuild_MaterialPropertyBuild_MaterialPropertyList_GridView.GetRowCellValue(i, "id").ToString()); var property = new MaterialBaseProperty(); property.id = id; if (value == "True") { checkPropertyList.Add(property); } } }
private void PartsMange_MaterialReviewRuleManage_CheckResult_SelectAlreadyMaterial_SimpleButton_Click(object sender, EventArgs e) { MaterbasePro =(MaterialBaseProperty)PartsMange_MaterialReviewRuleManage_CheckResult_Material_GridView.GetFocusedValue(); AddMaterialInfor AM = new AddMaterialInfor(); AM.Tag = "select"; //AM.MaterBase = MaterbasePro; AM.ShowDialog(); }
/// <summary> /// 获取所有物料属性集合[基础属性和附加属性] /// </summary> /// <returns></returns> public List<MaterialBaseProperty> GetAllMaterialProperty() { var propertyList = new List<MaterialBaseProperty>(); string sql = "select * from material_base_property union select * from material_attached_property"; var baseProperty = new MaterialBaseProperty { cn_name = "轴承", en_name = "zhoucheng", data_type = "1", data_length = "20", default_value = "是", is_extends = "true", material_property_type_id = 1, width = "54px", required = "true", id = 1, input_type = "1", is_show = true, property_type = "物料基本属性" }; propertyList.Add(baseProperty); baseProperty = new MaterialBaseProperty { cn_name = "轮胎", en_name = "luntai", data_type = "0", data_length = "100", default_value = "是", is_extends = "false", material_property_type_id = 2, width = "100px", is_show = true, input_type = "0", required = "false", id = 2, property_type = "BOM自定义属性" }; propertyList.Add(baseProperty); baseProperty = new MaterialBaseProperty { cn_name = "自行车", en_name = "bike", required = "false", data_type = "0", data_length = "100", default_value = "是", is_extends = "false", material_property_type_id = 2, width = "100px", id = 3, is_show = true, input_type = "1", property_type = "BOM自定义属性" }; propertyList.Add(baseProperty); baseProperty = new MaterialBaseProperty { cn_name = "骑车", en_name = "qiche", required = "true", data_type = "0", data_length = "100", default_value = "是", is_extends = "false", material_property_type_id = 2, width = "100px", id = 4, is_show = true, input_type = "0", property_type = "BOM自定义属性" }; propertyList.Add(baseProperty); return propertyList; }
private bool UpdateProperty(MaterialBaseProperty baseProperty) { return true; }
public bool AddORUpdateProperty(MaterialBaseProperty baseProperty) { return baseProperty.id == 0 ? AddProperty(baseProperty) : UpdateProperty(baseProperty); }
private bool AddProperty(MaterialBaseProperty baseProperty) { //在物料表中动态创建名称为en_name值的字段 return true; }