private void gridProcessList_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex < 0) { return; } if (gridProcessList.Rows[e.RowIndex].Cells["colProcessCode"].Value == null) { return; } string process_code = gridProcessList.Rows[e.RowIndex].Cells["colProcessCode"].Value.ToString().Trim(); PlanEntity ent = PlanFactory.GetByKey(this.plancode); if (ent.PRODUCT_SERIES == null) { MessageBox.Show("此计划工序没有定义相应的工序指导文件"); return; } RMESEventArgs args = new RMESEventArgs(); args.MessageHead = "INFO"; args.MessageBody = process_code; args.MessageBody += "^" + plancode; SendDataChangeMessage(args); FrmShowProcessNote spn = new FrmShowProcessNote(plancode, process_code); spn.Show(); }
private void InitItems(string pPlanCode,string pStationCode) { StationEntity ent1 = StationFactory.GetByKey(pStationCode); WorkunitCode = ""; txtWorkUnit.Text = ent1.STATION_NAME; PlanEntity ent2 = PlanFactory.GetByKey(pPlanCode); OrderCode = ent2.ORDER_CODE; List<PlanStandardBOMEntity> lstBom = PlanStandardBOMFactory.GetByOrderCode(OrderCode); List<PlanStandardBOMEntity> lstBom1 = (from p in lstBom where p.VIRTUAL_ITEM_CODE == "X" && p.WORKUNIT_CODE == WorkunitCode select p).ToList<PlanStandardBOMEntity>(); if (lstBom1.Count == 0) { cmbVItemCode.SelectedIndex = -1; cmbVItemCode.Enabled = false; } else { cmbVItemCode.Items.Clear(); cmbVItemCode.Items.Add("总装件"); for (int i = 0; i < lstBom1.Count; i++) { cmbVItemCode.Items.Add(lstBom1[i].ITEM_CODE + "-" + lstBom1[i].ITEM_NAME); } cmbVItemCode.Enabled = true; } }
private void InitPlan(string PlanCode) { PlanEntity en1 = PlanFactory.GetByKey(PlanCode); planCode = PlanCode; sn_flag = en1.SN_FLAG; CurPlancode = PlanCode; }
protected void ctrlProcessComplete_RmesDataChanged(object obj, Rmes.WinForm.Base.RMESEventArgs e) { if (e.MessageHead == "SN") { //gridProcessList.Enabled = true; //sn = e.MessageBody as string; //PlanSnEntity ent_sn = PlanSnFactory.GetBySn(sn); //ordercode=ent_sn.ORDER_CODE; //if (ent_sn.PLAN_CODE != null) plancode = ent_sn.PLAN_CODE; //else plancode = PlanFactory.GetByOrder(ent_sn.ORDER_CODE).PLAN_CODE; InitProcessList(); ShowProcessList(); return; } if (e.MessageHead == "PLAN") { gridProcessList.Enabled = true; plancode = e.MessageBody as string; PlanEntity plan = PlanFactory.GetByKey(plancode); if (plan != null) { ordercode = plan.ORDER_CODE; InitProcessList(); ShowProcessList(); } } else if (e.MessageHead == "PRCS") { //string[] msgbdy = (e.MessageBody as string).Split('^'); //string process_code = msgbdy[0]; //string complete_flag = msgbdy[1]; //DealProcessComplete(process_code, complete_flag); } else if (e.MessageHead == "PAUSE") { this.gridProcessList.DataSource = null; return; } else if (e.MessageHead == "SCP" || e.MessageHead == "OFFLINE") { this.gridProcessList.DataSource = null; ProductDataFactory.ProcessControlComplete(company_code, pline_code, station_code, plancode, sn); } else if (e.MessageHead == "MESLL") { this.Visible = false; return; } if (e.MessageHead.ToString() == "WORK" || e.MessageHead.ToString() == "QUA") { this.Visible = true; return; } }
public List <PlanSnEntity> GetByOrderCode(string orderCode) { PlanEntity ent = PlanFactory.GetByKey(orderCode); if (ent != null) { string SQL = "WHERE ORDER_CODE=@0 AND COMPANY_CODE=@1 ORDER BY SN"; return(db.Fetch <PlanSnEntity>(SQL, orderCode, LoginInfo.CompanyInfo.COMPANY_CODE)); } return(null); }
public List <PlanSnEntity> GetByPlanCodedesc(string planCode) { PlanEntity ent = PlanFactory.GetByKey(planCode); if (ent != null) { //string order_code = ent.ORDER_CODE; string SQL = "WHERE is_valid='Y' and COMPANY_CODE=@0 and plan_code=@1 ORDER BY SN_FLAG desc,SN desc"; return(db.Fetch <PlanSnEntity>(SQL, LoginInfo.CompanyInfo.COMPANY_CODE, planCode)); } return(null); }
private void InitPlan(string PlanCode) { PlanEntity en1 = PlanFactory.GetByKey(PlanCode); planCode = PlanCode; txtPlanCode.Text = PlanCode; txtPlanRemark.Text = en1.REMARK; txtPlanSo.Text = en1.PLAN_SO; txtPlanQty.Text = en1.PLAN_QTY.ToString(); txtPModel.Text = en1.PRODUCT_MODEL; sn_flag = en1.SN_FLAG; CurPlancode = PlanCode; }
private void HandleExit(string pPlanCode) { if (string.IsNullOrWhiteSpace(pPlanCode)) { return; } string order_code = PlanFactory.GetOrderCodeByPlan(pPlanCode); List <PlanProcessEntity> ent_process = PlanProcessFactory.GetByOrderCode(order_code); var s = from a in ent_process where a.ORDER_CODE == orderCode && a.WORKUNIT_CODE == WorkunitCode orderby a.PROCESS_CODE select a.PROCESS_CODE; if (s.Count() == 0) { return; } string process_code = s.First(); if (process_code != "0010") { return; } List <ProductCompleteEntity> lst = ProductCompleteFactory.GetByPlanStation(planCode, StationCode); var s1 = from a in lst where a.COMPLETE_FLAG == "0" select a; if (s1.Count() == 0) { return; } //如果有complete_time=null记录,则此站点未完成操作 var s2 = from a in lst where a.COMPLETE_FLAG != "0" select a.BATCH_QTY; int complete_qty = s2.Sum(); PlanEntity ent = PlanFactory.GetByKey(planCode); ent.ONLINE_QTY = complete_qty; DB.GetInstance().Update(ent); DB.GetInstance().Delete(s1.First() as ProductCompleteEntity); }