protected override void InitData() { var materialList = materialService.GetMaterial().ToList().Select(a => new InputItem { Value = a.MatCode, DisPlayName = a.MatCode, InputCode1 = a.MatName, InputCode2 = a.MatSpec, InputCode3 = a.MatClass2 }).ToList(); SetGridLookUpEdit(repositoryItemMatSpecCode, materialList, 3); //SetGridLookUpEdit(RemarksTextEdit, materialList, "物料代号", "物料名称"); repositoryItemMatSpecCode.View.Columns[0].Caption = "物料代号"; repositoryItemMatSpecCode.View.Columns[1].Caption = "物料名称"; repositoryItemMatSpecCode.View.Columns[2].Caption = "物料规格"; repositoryItemMatSpecCode.View.Columns[3].Caption = "材质"; suppList = supplierService.GetSuppler().ToList().Select(a => new InputItem { Value = a.SuppCode, DisPlayName = a.Alias, InputCode1 = a.SuppCode }).ToList(); SetGridLookUpEdit(repositoryItemSupplier, suppList, 1); repositoryItemMatSpecCode.View.Columns[0].Caption = "供应商简称"; repositoryItemMatSpecCode.View.Columns[1].Caption = "供应商编号"; this.wMSM105MatReturnBindingSource.DataSource = tempData; var matDetailList = matReturnService.GetMatDetailQuery().Where(a => a.ReturnNo == tempData.ReturnNo).ToList(); var count = matDetailList.Count; for (int i = 0; i < 20 - count; i++) { WMS_M105_MatReturnDetail bomMat = new WMS_M105_MatReturnDetail(); bomMat.ReturnNo = tempData.ReturnNo; matDetailList.Add(bomMat); } this.wMSM105MatReturnDetailBindingSource.DataSource = matDetailList; }
public void Create(WMS_M105_MatReturnDetail WMS_M105_MatReturnDetail) { WMS_M105_MatReturnDetail.CreateDt = DateTime.Now; tb_Sys_User tempUser = appCacheService.GetItem("user") as tb_Sys_User; WMS_M105_MatReturnDetail.CreateUser = tempUser.UserName; WMS_M105_MatReturnDetail.Validate(); this.WMS_M105_MatReturnDetailRepository.Add(WMS_M105_MatReturnDetail); this.runtimeService.Commit(); }
public void Update(WMS_M105_MatReturnDetail WMS_M105_MatReturnDetail) { WMS_M105_MatReturnDetail.ModifyDt = DateTime.Now; tb_Sys_User tempUser = appCacheService.GetItem("user") as tb_Sys_User; WMS_M105_MatReturnDetail.ModifyUser = tempUser.UserName; WMS_M105_MatReturnDetail.Validate(); var existstb_Sys_Menu = this.GetById(WMS_M105_MatReturnDetail.Id); this.WMS_M105_MatReturnDetailRepository.SetValues(WMS_M105_MatReturnDetail, existstb_Sys_Menu); this.runtimeService.Commit(); }