/// <summary> /// Lot行改变重新加载Process数据 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void gridView1_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e) { MES_M002_Job_Lot lotMsg = this.mESM002JobLotBindingSource.Current as MES_M002_Job_Lot; if (lotMsg != null) { this.mESM002JobLotProcessBindingSource.DataSource = GetProcessList(lotMsg.JobNo, lotMsg.LotNo); this.gridView4.RefreshData(); } }
public void Create(MES_M002_Job_Lot MES_M002_Job_Lot) { MES_M002_Job_Lot.CreateDt = DateTime.Now; tb_Sys_User tempUser = appCacheService.GetItem("user") as tb_Sys_User; MES_M002_Job_Lot.CreateUser = tempUser.UserName; MES_M002_Job_Lot.CompCode = tempUser.CompCode; MES_M002_Job_Lot.Validate(); this.MES_M002_Job_LotRepository.Add(MES_M002_Job_Lot); this.runtimeService.Commit(); }
public void Update(MES_M002_Job_Lot MES_M002_Job_Lot) { MES_M002_Job_Lot.ModifyDt = DateTime.Now; tb_Sys_User tempUser = appCacheService.GetItem("user") as tb_Sys_User; MES_M002_Job_Lot.ModifyUser = tempUser.UserName; MES_M002_Job_Lot.Validate(); var existstb_Sys_Menu = this.GetById(MES_M002_Job_Lot.Id); this.MES_M002_Job_LotRepository.SetValues(MES_M002_Job_Lot, existstb_Sys_Menu); this.runtimeService.Commit(); }
/// <summary> /// 生成Lot数 Lot个数 == 工单数量/(每板数量*板数量) 每个Lot数量 ==每板数量*板数量 /// </summary> /// <param name="jobQty">工单数量</param> /// <param name="panelQty">板数量</param> /// <param name="stripPerPanel">每板数量</param> /// <returns></returns> public List <MES_M002_Job_Lot> CreateJobLots(decimal jobQty, decimal panelQty, decimal stripPerPanel, string jobNo) { if (string.IsNullOrWhiteSpace(jobNo)) { throw new AppException("工作单号不能为空"); } if (jobQty <= 0) { throw new AppException("开单数量必须大于0"); } if (stripPerPanel <= 0) { throw new AppException("条/板数量必须大于0"); } if (panelQty <= 0) { throw new AppException("板数量必须大于0"); } else if ((stripPerPanel * panelQty) > jobQty) { throw new AppException("条/板数量与板数量乘积不得大于开单数量"); } decimal modNumber = jobQty % (stripPerPanel * panelQty); //每Lot数量数是否相等,看下是否有余数 int totalLotNo = Convert.ToInt32((Math.Ceiling(jobQty / (stripPerPanel * panelQty)))); //总Lot数 tb_Sys_User tempUser = appCacheService.GetItem("user") as tb_Sys_User; List <MES_M002_Job_Lot> jobLotList = new List <MES_M002_Job_Lot>(); for (int i = 1; i <= (modNumber > 0 && totalLotNo > 1 ? totalLotNo - 1 : totalLotNo); i++) { MES_M002_Job_Lot jobLot = new MES_M002_Job_Lot(); jobLot.CompCode = tempUser.CompCode; jobLot.CreateDt = DateTime.Now; jobLot.CreateUser = tempUser.UserCode; jobLot.JobNo = jobNo; jobLot.LotNo = i < 10 ? 0 + i.ToString() : i.ToString(); jobLot.LotQty = stripPerPanel * panelQty; jobLotList.Add(jobLot); } if (modNumber > 0) //最后一Lot的数量 { MES_M002_Job_Lot jobLot = new MES_M002_Job_Lot(); jobLot.CompCode = tempUser.CompCode; jobLot.CreateDt = DateTime.Now; jobLot.CreateUser = tempUser.UserCode; jobLot.JobNo = jobNo; jobLot.LotNo = totalLotNo < 10 ? 0 + totalLotNo.ToString() : totalLotNo.ToString(); jobLot.LotQty = modNumber; jobLotList.Add(jobLot); } return(jobLotList); }
void gridView1_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e) { if (e.Column == colLotQty) { SetJobQtyAndLotCount(); } else if (e.Column == colLotNo) { MES_M002_Job_Lot lotMsg = this.mESM002JobLotBindingSource.Current as MES_M002_Job_Lot; if (lotMsg != null) { this.mESM002JobLotProcessBindingSource.DataSource = GetProcessList(lotMsg.JobNo, lotMsg.LotNo); this.gridView4.RefreshData(); } } }