public void Create(MES_M201_Plan_Detail MES_M201_Plan_Detail) { MES_M201_Plan_Detail.CreateDt = DateTime.Now; tb_Sys_User tempUser = appCacheService.GetItem("user") as tb_Sys_User; MES_M201_Plan_Detail.CreateUser = tempUser.UserName; MES_M201_Plan_Detail.Validate(); this.MES_M201_Plan_DetailRepository.Add(MES_M201_Plan_Detail); this.runtimeService.Commit(); }
public void Update(MES_M201_Plan_Detail MES_M201_Plan_Detail) { MES_M201_Plan_Detail.ModifyDt = DateTime.Now; tb_Sys_User tempUser = appCacheService.GetItem("user") as tb_Sys_User; MES_M201_Plan_Detail.ModifyUser = tempUser.UserName; MES_M201_Plan_Detail.Validate(); var existstb_Sys_Menu = this.GetById(MES_M201_Plan_Detail.Id); this.MES_M201_Plan_DetailRepository.SetValues(MES_M201_Plan_Detail, existstb_Sys_Menu); this.runtimeService.Commit(); }
public void MarkDelProduct(MES_M201_Plan_Detail temp) { var existsDetail = this.planDetailRepository.GetByID(temp.Id); if (existsDetail != null) { this.planDetailRepository.Delete(existsDetail); var materialList = planMaterialRepository.GetMany(i => i.PlanDetailId == existsDetail.Id).ToList(); foreach (var material in materialList) { this.planMaterialRepository.Delete(material); } } }
protected override void InitData() { //级别 SetGridLookUpEdit(repositoryItemLevel, codeService.GetCodeDataByCodeId("PLLEVEL"), 1); //状态 SetGridLookUpEdit(repositoryItemStatus, codeService.GetCodeDataByCodeId("PLSTATUS"), 1); SetGridLookUpEdit(repositoryItemUnit, codeService.GetCodeDataByCodeId("UNIT"), 1); this.mESM201PlanDetailBindingSource.CurrentChanged += mESM201PlanDetailBindingSource_CurrentChanged; var productData = productService.GetProductInputData(); SetGridLookUpEdit(repositoryProduct, productData, 1); var customerData = customerServer.GetCustomerInputData(); SetGridLookUpEdit(repositoryItemCustomer, customerData, 1); repositoryProduct.DisplayMember = "Value"; this.mESM201PlanBindingSource.DataSource = tempData; var productList = planService.GetProductQuery().Where(a => a.PlanId == tempData.Id).ToList(); //var count = productList.Count; //for (int i = 0; i < 20 - count; i++) //{ // MES_M201_Plan_Detail bomMat = new MES_M201_Plan_Detail(); // bomMat.PlanId = tempData.Id; // productList.Add(bomMat); //} if (this.Tag.ToStr() == BtnCommandEnum.Add) { for (int i = 0; i < 20; i++) { MES_M201_Plan_Detail bomMat = new MES_M201_Plan_Detail(); bomMat.PlanId = tempData.Id; bomMat.Status = "01"; bomMat.PLevel = "01"; productList.Add(bomMat); } } //else //{ // colQty.OptionsColumn.AllowEdit = false; //} this.mESM201PlanDetailBindingSource.DataSource = productList; this.mESM201PlanMaterialBindingSource.DataSource = planService.GetMaterialQuery().Where(a => a.PLNo == tempData.PLNo).ToList(); this.mESM201PlanDailyBindingSource.DataSource = planService.GetPlanDailiesQuery().Where(a => a.PLNo == tempData.PLNo).ToList(); //this.gridProduct.BestFitColumns(); //this.gridMaterial.BestFitColumns(); }