示例#1
0
        private void PartsMange_MaterialPropertyBuild_ChooseMaterialType_ConfirmMaterialType_SimpleButton_Click(object sender, EventArgs e)
        {
            var materialType = new Material_Type();
            var focusNode = PartsMange_MaterialPropertyBuild_ChooseMaterialType_MaterialClassify_TreeList.FocusedNode;
            materialType.Id = Convert.ToInt32(focusNode.GetValue(MaterialType_Id));
            materialType.Mark = focusNode.GetValue(MaterialType_Mark).ToString();
            materialType.Name = focusNode.GetValue(MaterialType_Name).ToString();
            materialTypeList.Add(materialType);
            if (is_extend)
            {
                GetChildByParentId(materialType.Id, ref materialTypeList);
            }

            this.DialogResult = DialogResult.OK;
            this.Close();
        }
示例#2
0
 private Material_Type MaterialType()
 {
     var index = PartsMange_MaterialBankManage_AddType_MaterialBasicType_IsLast_RadioGroup.SelectedIndex;
     var materialType = new Material_Type
     {
         Id = type.Id + 1,
         Name = PartsMange_MaterialBankManage_AddType_MaterialBasicType_TextEdit.Text,
         Mark = PartsMange_MaterialBankManage_AddType_MaterialBasicIdentification_TextEdit.Text,
         Is_Last = PartsMange_MaterialBankManage_AddType_MaterialBasicType_IsLast_RadioGroup.Properties.Items[index].Description,
         Child_Mark_Length = PartsMange_MaterialBankManage_AddType_IdentificationLength_ComboBoxEdit.SelectedIndex.ToString(),
         Code_Start = PartsMange_MaterialBankManage_AddType_MaterialBasicType_CodeStart_RadioGroup.SelectedIndex.ToString(),
         Code_Length = PartsMange_MaterialBankManage_AddType_WaterCodeLength_ComboBoxEdit.SelectedIndex.ToString(),
         Parent_Id = type.Parent_Id,
         Create_Date = DateTime.Now,
         Create_User_Id = 1
     };
     return materialType;
 }
示例#3
0
 private void PartsMange_MaterialBankManage_MaterialBankManage_MaterialManage_TreeList_MouseDown(object sender, MouseEventArgs e)
 {
     if (e.Clicks > 1 && e.Button == MouseButtons.Left)
     {
         var treeList = (TreeList)sender;
         var hitInfo = treeList.CalcHitInfo(e.Location);
         if (hitInfo == null) return;
         if (hitInfo.Node == null) return;
         var id = hitInfo.Node.GetValue(Type_Id);
         var is_last = hitInfo.Node.GetValue(Is_Last);
         if (is_last.Equals("0"))
         {
             MessageBox.Show("请选择最小类型的物料类型!", "提示信息!", MessageBoxButtons.OK, MessageBoxIcon.Information);
             return;
         }
         else
         {
             materialType = materialTypeList.Find(t => t.Id == Convert.ToInt32(id));
         }
         this.DialogResult = DialogResult.OK;
         this.Close();
     }
 }
示例#4
0
        public IList<Material_Type> MaterType()
        {
            IList<Material_Type> Mat = new BindingList<Material_Type>();
            Material_Type M = new Material_Type();

            M.Child_Mark_Length = "20";
            M.Code_Length = "15";
            M.Code_Start = "10";
            M.Create_Date = new DateTime();
            M.Create_User_Id = 1;
            M.Id = 1;
            M.Is_Delete = "是";
            M.Is_Last = "是";
            M.Modify_Date = new DateTime();
            M.Modify_User_Id = 1;
            M.Name = "物料编号";
            M.Parent_Id = 1;
            M.Mark = "用于物料的";
            Mat.Add(M);

            M = new Material_Type();
            M.Child_Mark_Length = "10";
            M.Code_Length = "25";
            M.Code_Start = "100";
            M.Create_Date = new DateTime();
            M.Create_User_Id = 1;
            M.Id = 1;
            M.Is_Delete = "否";
            M.Is_Last = "是";
            M.Modify_Date = new DateTime();
            M.Modify_User_Id = 1;
            M.Name = "文档编号";
            M.Parent_Id = 1;
            M.Mark = "";
            Mat.Add(M);
            return Mat;
        }
示例#5
0
 private bool UpdateMaterialType(Material_Type type)
 {
     return false;
 }
示例#6
0
 private bool AddMaterialType(Material_Type type)
 {
     return true;
 }
示例#7
0
 public bool AddORUpdateType(Material_Type type)
 {
     return type.Id != 0 ? UpdateMaterialType(type) : AddMaterialType(type);
 }
示例#8
0
        public List<Material_Type> GetAllMaterialType()
        {
            var list = new List<Material_Type>();
            var materialType = new Material_Type();
            materialType.Child_Mark_Length = "20";
            materialType.Code_Length = "15";
            materialType.Code_Start = "10";
            materialType.Create_Date = new DateTime();
            materialType.Create_User_Id = 1;
            materialType.Id = 1;
            materialType.Is_Delete = "1";//0:否 1:是
            materialType.Is_Last = "1";//0:否 1:是
            materialType.Modify_Date = new DateTime();
            materialType.Modify_User_Id = 1;
            materialType.Name = "物料编号";
            materialType.Parent_Id = 0;
            materialType.Mark = "用于物料的";
            list.Add(materialType);

            materialType = new Material_Type();
            materialType.Child_Mark_Length = "10";
            materialType.Code_Length = "25";
            materialType.Code_Start = "100";
            materialType.Create_Date = new DateTime();
            materialType.Create_User_Id = 1;
            materialType.Id = 2;
            materialType.Is_Delete = "0";//0:否 1:是
            materialType.Is_Last = "0";//0:否 1:是
            materialType.Modify_Date = new DateTime();
            materialType.Modify_User_Id = 1;
            materialType.Name = "文档编号";
            materialType.Parent_Id = 0;
            materialType.Mark = "";
            list.Add(materialType);

            materialType = new Material_Type();
            materialType.Child_Mark_Length = "10";
            materialType.Code_Length = "25";
            materialType.Code_Start = "100";
            materialType.Create_Date = new DateTime();
            materialType.Create_User_Id = 1;
            materialType.Id = 3;
            materialType.Is_Delete = "0";//0:否 1:是
            materialType.Is_Last = "0";//0:否 1:是
            materialType.Modify_Date = new DateTime();
            materialType.Modify_User_Id = 1;
            materialType.Name = "文档编号1";
            materialType.Parent_Id = 2;
            materialType.Mark = "";
            list.Add(materialType);

            materialType = new Material_Type();
            materialType.Child_Mark_Length = "10";
            materialType.Code_Length = "25";
            materialType.Code_Start = "100";
            materialType.Create_Date = new DateTime();
            materialType.Create_User_Id = 1;
            materialType.Id = 4;
            materialType.Is_Delete = "0";//0:否 1:是
            materialType.Is_Last = "0";//0:否 1:是
            materialType.Modify_Date = new DateTime();
            materialType.Modify_User_Id = 1;
            materialType.Name = "文档编号2";
            materialType.Parent_Id = 2;
            materialType.Mark = "";
            list.Add(materialType);
            return list;
        }
示例#9
0
        public IList<Material_Type> MT()
        {
            IList<Material_Type> Ma = new BindingList<Material_Type>();
            var materialType = new Material_Type();

            materialType.Child_Mark_Length = "10";
            materialType.Code_Length = "8";
            materialType.Code_Start = "10";
            materialType.Create_Date = new DateTime();
            materialType.Create_User_Id = 1001;
            materialType.Id = 001;
            materialType.Is_Delete = "是";
            materialType.Is_Last = "是";
            materialType.Modify_Date = new DateTime();
            materialType.Modify_User_Id = 10001;
            materialType.Name = "气囊";
            materialType.Parent_Id = 1;
            materialType.Mark = "保命用具";
            Ma.Add(materialType);

            materialType.Child_Mark_Length = "12";
            materialType.Code_Length = "8";
            materialType.Code_Start = "10";
            materialType.Create_Date = new DateTime();
            materialType.Create_User_Id = 1002;
            materialType.Id = 002;
            materialType.Is_Delete = "否";
            materialType.Is_Last = "是";
            materialType.Modify_Date = new DateTime();
            materialType.Modify_User_Id = 10002;
            materialType.Name = "油箱";
            materialType.Parent_Id = 2;
            materialType.Mark = "汽车命脉";
            Ma.Add(materialType);

            materialType.Child_Mark_Length = "15";
            materialType.Code_Length = "8";
            materialType.Code_Start = "10";
            materialType.Create_Date = new DateTime();
            materialType.Create_User_Id = 1003;
            materialType.Id = 003;
            materialType.Is_Delete = "否";
            materialType.Is_Last = "否";
            materialType.Modify_Date = new DateTime();
            materialType.Modify_User_Id = 10003;
            materialType.Name = "方向盘";
            materialType.Parent_Id = 3;
            materialType.Mark = "汽车眼睛";
            Ma.Add(materialType);
            return Ma;
        }
示例#10
0
        public List<Material_Type> GetAllMaterailType()
        {
            var typeList = new List<Material_Type>();
            var type = new Material_Type();
            type.Id = 1;
            type.Name = "测试类型1";
            type.Parent_Id = 0;
            type.Mark = "备注1";
            type.Is_Delete = "0";
            typeList.Add(type);

            type = new Material_Type();
            type.Id = 2;
            type.Name = "测试类型11";
            type.Parent_Id = 1;
            type.Mark = "备注11";
            type.Is_Delete = "0";
            typeList.Add(type);

            return typeList;
        }
示例#11
0
 //右键菜单修改 物料分类
 private void MaterialType_Modify_BarButtonItem_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     materialType = (Material_Type)PartsMange_MaterialPropertyBuild_AddMaterialProperty_MaterialClassify_GridView.GetFocusedRow();
     ChooseMaterialType CM = new ChooseMaterialType();
     CM.Tag = "Modify";
     CM.ShowDialog();
 }
示例#12
0
 private void SaveORUpdateClick(object sender, EventArgs e)
 {
     type = MaterialType();
     materialService.AddORUpdateType(type);
     this.DialogResult = DialogResult.OK;
     this.Close();
 }
示例#13
0
 private void TreeAddParnetORChild(int parent_id)
 {
     var type = new Material_Type();
     if (materialTypeList.Count > 0)
         type.Id = materialTypeList[materialTypeList.Count - 1].Id;
     type.Parent_Id = Convert.ToInt32(parent_id);
     var addType = new AddType();
     addType.type = type;
     addType.ShowDialog();
     if (addType.DialogResult == DialogResult.OK)
     {
         materialTypeList.Add(addType.type);
         TreeDataBind(materialTypeList);
     }
 }