protected void ctrlStationOffline_RmesDataChanged(object obj, Rmes.WinForm.Base.RMESEventArgs e) { if (e.MessageHead == "OFFLINE") { //string[] txt = e.MessageBody.ToString().Split('^'); //string sn = txt[0]; //string quality_status = txt[1]; string sn = e.MessageBody.ToString(); ProductInfoEntity product = ProductInfoFactory.GetByCompanyCodeSNSingle(CompanyCode, sn); //获取sn信息 //PlanSnEntity plansn1 = PlanSnFactory.GetBySn(sn); string plan_code = product.PLAN_CODE; //modify by thl 20161212 下线点对应的操作改到发动机第一次入库处执行 if (dataConn.GetValue("select count(1) from data_complete where sn='" + sn + "' and plan_code='" + plan_code + "' and station_code='" + LoginInfo.StationInfo.STATION_CODE + "' ") == "1") { dataConn.ExeSql("UPDATE DATA_PLAN SET OFFLINE_QTY=OFFLINE_QTY+1 WHERE plan_code='" + plan_code + "' "); } if (LoginInfo.ProductLineInfo.PLINE_CODE == "CL") { ProductDataFactory.Station_OffLine(product.PLAN_CODE, sn, "Y"); } } //else if (e.MessageHead == "SN") //{ // RMESEventArgs args = new RMESEventArgs(); // args.MessageHead = "OFFCTRL"; // args.MessageBody = ""; // SendDataChangeMessage(args); //} }
protected void ctrlProductScan_RmesDataChanged(object obj, Rmes.WinForm.Base.RMESEventArgs e) { string sn, quality_status = "A"; RMESEventArgs arg = new RMESEventArgs(); arg.MessageHead = ""; arg.MessageBody = ""; if (e.MessageHead == null) { return; } if (e.MessageHead == "SN") { //上线后打印条码 sn = e.MessageBody.ToString(); product = ProductInfoFactory.GetByCompanyCodeSNSingle(CompanyCode, sn);//获取sn信息 ThisSmTm = product.PLAN_SO + "^DCEC^" + sn; PublicClass.PrintTmISDE(product.PLAN_CODE, ThisSmTm); arg.MessageHead = "CLEAR1"; arg.MessageBody = ""; SendDataChangeMessage(arg); timer1.Enabled = true; } if (e.MessageHead == "REFRESHCLPLAN") { timer1.Enabled = true; } }
void ctrl_Fx_RMesDataChanged(object obj, Rmes.WinForm.Base.RMESEventArgs e) { try { RMESEventArgs arg = new RMESEventArgs(); arg.MessageHead = ""; arg.MessageBody = ""; if (e.MessageHead == null) { return; } if (e.MessageHead == "SN") { TheSn = e.MessageBody.ToString(); product = ProductInfoFactory.GetByCompanyCodeSNSingle(CompanyCode, TheSn);//获取sn信息 if (product == null) { return; } TheSo = product.PLAN_SO; ThePlancode = product.PLAN_CODE; } } catch (Exception e1) { MessageBox.Show(e1.Message); } }
protected void ctrlInitOnline_RmesDataChanged(object obj, Rmes.WinForm.Base.RMESEventArgs e) { if (e.MessageHead == null) { return; } if (e.MessageHead == "ONLINEONLINE") { //上线完成 自动刷下一个 打印条码 string sn = e.MessageBody.ToString(); product = ProductInfoFactory.GetByCompanyCodeSNSingle(CompanyCode, sn);//获取sn信息 if (product == null) { return; } //if (check1.Checked) if (LoginInfo.ProductLineInfo.PLINE_CODE == "Z") { PublicClass.PrintTmFz(sn, product.PLAN_SO, product.CUSTOMER_NAME, "", product.PRODUCT_MODEL, 2, product.PLAN_CODE); } else { PublicClass.PrintTmFz(sn, product.PLAN_SO, product.CUSTOMER_NAME, "", product.PRODUCT_MODEL, 2, product.PLAN_CODE); } //timer1.Enabled = true; //timer1.Start(); //timer1_Tick(timer1, new EventArgs()); } }
public virtual void OnRMesDataChanged(RMESEventArgs e) { if (RMesDataChanged != null) { RMesDataChanged(this, e); } }
protected void ctrlProductScan_RmesDataChanged(object obj, Rmes.WinForm.Base.RMESEventArgs e) { string sn, quality_status = "A"; if (e.MessageHead == null) { return; } if (e.MessageHead == "SN") { //上线后打印条码 sn = e.MessageBody.ToString(); product = ProductInfoFactory.GetByCompanyCodeSNSingle(CompanyCode, sn);//获取sn信息 ThePlancode = product.PLAN_CODE; TheSo = product.PLAN_SO; PublicClass.PrintTmISDE(product.PLAN_CODE, ThisSmTm); txtGTH.Text = ""; arg.MessageHead = "CLEAR1"; arg.MessageBody = ""; SendDataChangeMessage(arg); timer1.Enabled = true; } if (e.MessageHead == "ONLINEONLINE") { DataTable dt = dataConn.GetTable("select plan_code from data_plan where plan_qty<=online_qty and plan_code='" + ThePlancode + "'"); if (dt.Rows.Count > 0) { ProductDataFactory.ISDE_CREATE_JK_SJJHB(PlineCode1); } timer1.Enabled = true; } }
void ctrlShowZjts_RmesDataChanged(object obj, Rmes.WinForm.Base.RMESEventArgs e) { if (e.MessageHead == null) { return; } if (e.MessageHead == "SHOWZJTS") { string item_info = e.MessageBody.ToString();//消息体是sn^stationcode^stationname string[] cmd_info = item_info.Split('^'); string SN1 = cmd_info[0]; string stationcode_fx = cmd_info[1]; string stationname_fx = cmd_info[2]; richTextBox1.Text = ""; string sql = "select gwdm,czts,nvl(note_color,''),nvl(note_font,'') from rstbomts where zddm='" + stationcode_fx + "' order by gwdm,czts"; DataTable dt = dataConn.GetTable(sql); for (int i = 0; i < dt.Rows.Count; i++) { try { string note = "*" + dt.Rows[i][1].ToString().Replace((char)13, ' ').Trim(); string notecolor = dt.Rows[i][2].ToString(); richTextBox1.AppendText(note + (char)13 + (char)10); if (notecolor != "") { Color fontColor = System.Drawing.ColorTranslator.FromHtml(notecolor); int p1 = richTextBox1.Text.IndexOf(note); int p2 = note.Length; //richTextBox1.ForeColor = fontColor; richTextBox1.Select(richTextBox1.Text.Length - p2 - 1, p2); richTextBox1.SelectionColor = fontColor; } string notefont = dt.Rows[i][3].ToString(); if (notefont != "") { FontFamily myFontFamily = new FontFamily("微软雅黑"); //采用哪种字体 int font1 = Convert.ToInt32(notefont); Font myFont = new Font(myFontFamily, font1, FontStyle.Regular); //字是那种字体(幼圆),显示的风格(粗体) int p1 = richTextBox1.Text.IndexOf(note); int p2 = note.Length; richTextBox1.Select(richTextBox1.Text.Length - p2 - 1, p2); richTextBox1.SelectionFont = myFont; } //richTextBox1.Text = richTextBox1.Text + note + (char)13 + (char)10; } catch { string note = dt.Rows[i][1].ToString(); richTextBox1.AppendText("*" + note + (char)13 + (char)10); } } } if (e.MessageHead == "ZJTSADD") { richTextBox1.Text = e.MessageBody.ToString() + (char)13 + (char)10 + richTextBox1.Text; } }
protected void ctrlOptionComplete_RmesDataChanged(object obj, Rmes.WinForm.Base.RMESEventArgs e) { if (e.MessageHead == "VIN") { gridOptionList.Enabled = true; ProductInfoEntity product = (ProductInfoEntity)e.MessageBody; sn = product.SN; switch (type) { case "0": //站点 initials(); break; case "1": //工序 initial(); break; default: break; } OptionShow_Load(); if (state == 0) //报完工发送消息 { RMESEventArgs args = new RMESEventArgs(); args.MessageHead = "OPTIONCOMPLETES"; args.MessageBody = null; UiFactory.CallDataChanged(this, args); } } }
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; } }
void ctrQCFaultTree_RMesDataChanged(object obj, Rmes.WinForm.Base.RMESEventArgs e) { if (e.MessageHead.ToString() != "VIN") { return; } product = e.MessageBody as ProductEntity; VIN = product.SN; //VIN = e.MessageBody.ToString(); }
void ctrl_Tj_RMesDataChanged(object obj, Rmes.WinForm.Base.RMESEventArgs e) { RMESEventArgs arg = new RMESEventArgs(); arg.MessageHead = ""; arg.MessageBody = ""; if (e.MessageHead == null) { return; } }
protected void ctrlInitOnline_RmesDataChanged(object obj, Rmes.WinForm.Base.RMESEventArgs e) { if (e.MessageHead == null) { return; } if (e.MessageHead == "SN") { //上线完成 自动刷下一个 timer1.Enabled = true; } }
void ctrlProductQuality_RMesDataChanged(object obj, Rmes.WinForm.Base.RMESEventArgs e) { switch (e.MessageHead) { case "VIN": VINScanned(obj, e); break; default: break; } }
protected void ctrlProductScan_RmesDataChanged(object obj, Rmes.WinForm.Base.RMESEventArgs e) { string sn, quality_status = "A"; RMESEventArgs arg = new RMESEventArgs(); arg.MessageHead = ""; arg.MessageBody = ""; if (e.MessageHead == null) { return; } }
void ctrl_sub_RMesDataChanged(object obj, Rmes.WinForm.Base.RMESEventArgs e) { try { RMESEventArgs arg = new RMESEventArgs(); arg.MessageHead = ""; arg.MessageBody = ""; if (e.MessageHead == null) { return; } if (e.MessageHead == "SN") { SN = e.MessageBody.ToString(); } //BOM展示完成后校验总成零件是否存在 //if (e.MessageHead == "SHOWBOMOK") //{ // string subzc = ""; // try // { // subzc = dc.GetValue("select sub_zc from code_station_sub where substation_code='" + StationCode + "' and pline_code='" + PlineID + "'"); // } // catch { subzc = ""; } // if (subzc != "") // { // arg.MessageHead = "SUBCHECK"; // arg.MessageBody = SN + "^" + subzc; // SendDataChangeMessage(arg); // } //} //if (e.MessageHead == "SUBCHECKOK") //{ // string item_info = e.MessageBody.ToString();//消息体是三段码 // string[] cmd_info = item_info.Split('^'); // string subzc = cmd_info[1]; // string subItem = ""; // if (subzc != "") // { // //判断bom中是否包含该总成零件 // //分装总成零件不为空 则打印分装总成零件条码 // subItem = subzc + "^SUB^" + SN; // //Print // PublicClass.PrintSub(SN, "", subItem); // } //} } catch (Exception e1) { MessageBox.Show(e1.Message); } }
static void mainform_FormClosing(object sender, System.Windows.Forms.FormClosingEventArgs e) { if (MessageBox.Show("确认要退出系统吗?", "退出提示", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes) { RMESEventArgs args = new RMESEventArgs(); args.MessageHead = "EXIT"; (mainform.Controls[0] as BaseControl).SendDataChangeMessage(args); e.Cancel = false; } else { e.Cancel = true; } }
public static void CallDataChanged(Object obj, RMESEventArgs e) { if (_controls.Count() > 0) { BaseControl co = obj as BaseControl; RMESEventArgs newe = e; foreach (BaseControl c in _controls) { if (co != null) { c.OnRMesDataChanged(newe); } } } }
private void ctrlShowPic_RmesDataChanged(object obj, Rmes.WinForm.Base.RMESEventArgs e) { if (e.MessageHead == null) { return; } if (e.MessageHead == "SHOWPICTURE") { this.Visible = false; string sql = "select wjpath from rstbomts where zddm='" + Station_Code + "' and wjpath is not null "; DataTable dt = dataConn.GetTable(sql); for (int i = 0; i < dt.Rows.Count; i++) { string[] s = dt.Rows[i][0].ToString().Split('$'); for (int j = 0; j < s.Length; j++) { string path1 = wjlj + "\\" + PlineCode + "\\" + s[j]; if (File.Exists(path1)) { if (!wjpath.Contains(path1)) { wjpath.Add(path1); } } } } curcount1 = 0; count1 = wjpath.Count; label1.Text = "显示" + count1 + "张图片"; if (count1 > 0) { this.Visible = true; //FrmShowProcessPic form1 = new FrmShowProcessPic(); //form1.ShowDialog(); pictureBox1.Image = Image.FromFile(wjpath[0].ToString()); timer1.Enabled = true; } else { (Parent as FrmShowProcessPic).Hide(); } return; } }
protected void ctrlPrintOffline_RmesDataChanged(object obj, Rmes.WinForm.Base.RMESEventArgs e) { if (e.MessageHead == "OFFLINE") { string[] txt = e.MessageBody.ToString().Split('^'); Sn = txt[0]; string quality_status = txt[1]; PlanSnEntity plansn1 = PlanSnFactory.GetBySn(Sn); PlanCode = plansn1.PLAN_CODE; PrintOfflineLabel(); } else if (e.MessageHead == "SN") { RMESEventArgs args = new RMESEventArgs(); args.MessageHead = "OFFCTRL"; args.MessageBody = ""; SendDataChangeMessage(args); } }
void ctrProductComplete_RMesDataChanged(object obj, Rmes.WinForm.Base.RMESEventArgs e) { if (e.MessageHead.ToString() == "MESLL") { this.Visible = false; return; } if (e.MessageHead.ToString() == "WORK") { this.Visible = true; return; } if (e.MessageHead.ToString() == "SN") { SN = e.MessageBody.ToString(); SetMenuItemStatus(true); List <ProductInfoEntity> product = ProductInfoFactory.GetByCompanyCodeSN(CompanyCode, SN); if (product.Count > 0) { PlanCode = product.First().PLAN_CODE; } } else if (e.MessageHead.ToString() == "PLAN") { PlanCode = e.MessageBody.ToString(); SetMenuItemStatus(true); } else if (e.MessageHead == "SCP" || e.MessageHead == "OFFLINE") { SetMenuItemStatus(false); ItemQualifiedOffline.Enabled = false; ItemFailedOffline.Enabled = false; } else if (e.MessageHead == "OFFCTRL") { ItemQualifiedOffline.Enabled = true; ItemFailedOffline.Enabled = true; } }
protected void ctrlNavigation_RmesDataChanged(object obj, Rmes.WinForm.Base.RMESEventArgs e) { //if (e.MessageHead == "QUACTRL") mnuQuality.Enabled = true; RMESEventArgs arg = new RMESEventArgs(); arg.MessageHead = ""; arg.MessageBody = ""; if (e.MessageHead == null) { return; } if (e.MessageHead == "SN" || e.MessageHead == "RECHECK" || e.MessageHead == "CHECKOK") { Thesn = e.MessageBody.ToString(); } if (e.MessageHead == "PRINTISDE") { string[] txt = e.MessageBody.ToString().Split('|'); TheSmTm = txt[0]; ThePlanCode = txt[1]; } if (e.MessageHead == "SHOWBOMLQ") { string txt = e.MessageBody.ToString(); ProductInfoEntity product = ProductInfoFactory.GetByCompanyCodeSNSingle(LoginInfo.CompanyInfo.COMPANY_CODE, txt); if (product == null) { return; } string oldplancode = ""; oldplancode = dataConn.GetValue("select jhmcold from atpujhsn where jhmc='" + product.PLAN_CODE + "' and is_valid='N' and rownum=1"); if (oldplancode == "") { return; } ProductInfoEntity productold = ProductInfoFactory.GetByCompanyCodeSNSingleLQ(LoginInfo.CompanyInfo.COMPANY_CODE, txt, oldplancode); oldPlinecode = productold.PLINE_CODE; } }
protected void ctrlStationOnline_RmesDataChanged(object obj, Rmes.WinForm.Base.RMESEventArgs e) { string plan_code, sn, order_code, sn_flag; if (e.MessageHead == null) { return; } if (e.MessageHead == "ONLINE") { //DialogResult dlg=MessageBox.Show("是否上线", "提示信息", MessageBoxButtons.YesNo, MessageBoxIcon.Question) ; //if (dlg == DialogResult.No) return; sn = e.MessageBody.ToString(); //获取当前第一条计划的未上线流水号,打印流水号 //流水号做上线 PlanSnEntity ent_sn = PlanSnFactory.GetBySn(sn); if (ent_sn == null)//如果没有sn,则msgbd为plancode { plan_code = ""; sn = ""; MessageBox.Show("流水号非法!", "提示"); //sn = PlanFactory.GetByKey(plan_code).PLAN_BATCH; } else { //order_code = PlanSnFactory.GetBySn(sn).ORDER_CODE; //plan_code = PlanFactory.GetByOrder(order_code).PLAN_CODE; plan_code = ent_sn.PLAN_CODE; } ProductDataFactory.Station_OnLine(plan_code, sn, DateTime.Now.ToString("yyyy-MM-dd"), LoginInfo.StationInfo.STATION_CODE, LoginInfo.ShiftInfo.SHIFT_CODE, LoginInfo.TeamInfo.TEAM_CODE, LoginInfo.UserInfo.USER_CODE); RMESEventArgs arg = new RMESEventArgs(); arg.MessageHead = "SN"; arg.MessageBody = sn; SendDataChangeMessage(arg); } }
void ctrQuality_RMesDataChanged(object obj, Rmes.WinForm.Base.RMESEventArgs e) { string stationCode = LoginInfo.StationInfo.RMES_ID; if (e.MessageHead == null) { return; } if (e.MessageHead.ToString() == "SN") { SN = e.MessageBody as string; ProductInfoEntity product = ProductInfoFactory.GetByCompanyCodeSNSingle(LoginInfo.CompanyInfo.COMPANY_CODE, SN); if (product == null) { return; //SN = product.SN; } List <QualitySnItem> QualitySn = QualityFactory.GetAll(); GridQuality.DataSource = QualitySn; //ShowQualityList(); } }
void ctrQuality_RMesDataChanged(object obj, Rmes.WinForm.Base.RMESEventArgs e) { string stationCode = LoginInfo.StationInfo.RMES_ID; if (e.MessageHead == null) { return; } if (e.MessageHead.ToString() == "SN") { SN = e.MessageBody as string; ProductInfoEntity product = ProductInfoFactory.GetByCompanyCodeSNSingle(LoginInfo.CompanyInfo.COMPANY_CODE, SN); if (product == null) { return; //SN = product.SN; } //质量点的sn与计划一一对应 此处只返回一条计划 _product = product; ShowQualityList(); } }
void ctrl_Tj_RMesDataChanged(object obj, Rmes.WinForm.Base.RMESEventArgs e) { RMESEventArgs arg = new RMESEventArgs(); arg.MessageHead = ""; arg.MessageBody = ""; if (e.MessageHead == null) { return; } if (e.MessageHead == "SN" || e.MessageHead == "RECHECK" || e.MessageHead == "CHECKOK") { string sn = e.MessageBody.ToString(); product = ProductInfoFactory.GetByCompanyCodeSNSingle(CompanyCode, sn);//获取sn信息 string str1 = ""; try { str1 = dataConn.GetValue("select fr from data_sn_fr where sn='" + sn + "' and plan_code='" + product.PLAN_CODE + "' "); } catch { } txtRemark.Text = str1 + "||" + product.REMARK; } }
void ctrl_Tj_RMesDataChanged(object obj, Rmes.WinForm.Base.RMESEventArgs e) { RMESEventArgs arg = new RMESEventArgs(); arg.MessageHead = ""; arg.MessageBody = ""; if (e.MessageHead == null) { return; } if (e.MessageHead == "GETSUB") { //BOM扫描完成后刷新流水号 TheSn = e.MessageBody.ToString(); string sql = "select rmes_id,sn,plan_so,plan_code,pline_code,station_code,sub_zc,check_flag from DATA_SUBPACK where WORK_FLAG='N' and station_code='" + StationCode + "' and sn!='" + TheSn + "' order by start_time "; DataTable dt = dataConn.GetTable(sql); if (dt.Rows.Count > 0) { string planmodel = ""; try { planmodel = dataConn.GetValue("select product_model from data_plan where plan_code='" + dt.Rows[0]["PLAN_CODE"].ToString() + "' and rownum=1"); } catch { } arg.MessageHead = "FILLSN"; arg.MessageBody = dt.Rows[0]["SN"].ToString() + "^" + dt.Rows[0]["PLAN_SO"].ToString() + "^" + planmodel + "^" + dt.Rows[0]["PLAN_CODE"].ToString(); SendDataChangeMessage(arg); } else { arg.MessageHead = "FILLSN"; arg.MessageBody = "" + "^" + "" + "^" + "" + "^" + ""; SendDataChangeMessage(arg); } } }
void ctrl_Tj_RMesDataChanged(object obj, Rmes.WinForm.Base.RMESEventArgs e) { RMESEventArgs arg = new RMESEventArgs(); arg.MessageHead = ""; arg.MessageBody = ""; if (e.MessageHead == null) { return; } if (e.MessageHead == "SN" || e.MessageHead == "RESN" || e.MessageHead == "RECHECK") { TheSn = e.MessageBody.ToString(); product = ProductInfoFactory.GetByCompanyCodeSNSingle(CompanyCode, TheSn);//获取sn信息 if (product == null) { return; } ThePlancode = product.PLAN_CODE; //初始化质量数据 //string sql = "select count(1) from data_sn_qa where company_code='"+CompanyCode+"' and plan_code='"+product.PLAN_CODE+"' and sn='"+TheSn+"' and station_code='"+StationCode+"' and pline_code='"+PlineCode+"' "; //if (dataConn.GetValue(sql) == "0") //{ // //插入data_sn_qa // sql = " insert into data_sn_qa(rmes_id,sn,company_code,plan_code,pline_code,location_code,station_code,question,standard_answer,station_name) values " // + " select seq_rmes_id.nextval,'"+TheSn+"','" + CompanyCode + "','" + product.PLAN_CODE + "','" + PlineCode + "',gwdm,'" + StationCode + "',question,answer,'"+stationname+"' from RSTBOMQATS where zddm='" + StationCode + "' "; // dataConn.ExeSql(sql); //} string type = "B"; Thetype = type; string sn = TheSn; product = ProductInfoFactory.GetByCompanyCodeSNSingle(CompanyCode, TheSn);//获取sn信息 if (product == null) { return; } //执行存储过程 获取RSTBOMQATS ProductDataFactory.PL_QUERY_QAZJTS(product.PLAN_SO, StationCode, PlineCode, "", product.PLAN_CODE, sn); string sql = "select count(1) from data_sn_qa where company_code='" + CompanyCode + "' and plan_code='" + product.PLAN_CODE + "' and sn='" + TheSn + "' and station_code='" + StationCode + "' and pline_code='" + PlineCode + "' "; if (dataConn.GetValue(sql) == "0") { //插入data_sn_qa sql = " insert into data_sn_qa(rmes_id,sn,company_code,plan_code,pline_code,location_code,station_code,question,standard_answer,station_name) " + " select seq_rmes_id.nextval,'" + TheSn + "','" + CompanyCode + "','" + product.PLAN_CODE + "','" + PlineCode + "',gwdm,'" + StationCode + "',question,answer,'" + stationname + "' from RSTBOMQATS where zddm='" + StationCode + "' "; dataConn.ExeSql(sql); } ThePlancode = product.PLAN_CODE; GridQuality.Focus(); IsABC = false; ShowData(type, TheSn, StationCode);//A显示前道站点质量信息 B 显示当前站点质量信息 try { if (GridQuality.Rows.Count > 0 && IsABC) { PlanSnFactory.InitStationControl(CompanyCode, PlineID, LoginInfo.StationInfo.RMES_ID, product.PLAN_CODE, product.SN, "Rmes.WinForm.Controls.ctrl_quality"); dataConn.ExeSql("update data_sn_controls_complete set complete_flag='A' where station_code='" + LoginInfo.StationInfo.RMES_ID + "' and control_name='Rmes.WinForm.Controls.ctrl_quality' and sn='" + product.SN + "' and plan_code='" + product.PLAN_CODE + "' "); } } catch { } // } }
void ctrlShowQuaZjts_RmesDataChanged(object obj, Rmes.WinForm.Base.RMESEventArgs e) { if (e.MessageHead == null) { return; } if (e.MessageHead == "SHOWQUATS") //质量警示 { richTextBox1.Text = ""; string sql = "select gwdm,czts,nvl(note_color,''),nvl(note_font,''),wjpath from rstbomquats where zddm='" + stationcode + "' order by gwdm"; DataTable dt = dataConn.GetTable(sql); for (int i = 0; i < dt.Rows.Count; i++) { try { string note = dt.Rows[i][1].ToString(); string notecolor = dt.Rows[i][2].ToString(); string wjpath1 = dt.Rows[i][4].ToString(); string[] s = wjpath1.Split('$'); for (int j = 0; j < s.Length; j++) { string path1 = wjlj + "\\" + pline_code + "\\" + s[j]; if (File.Exists(path1)) { if (!wjpath.Contains(path1)) { wjpath.Add(path1); } } } richTextBox1.AppendText(note + (char)13 + (char)10); if (notecolor != "") { Color fontColor = System.Drawing.ColorTranslator.FromHtml(notecolor); int p1 = richTextBox1.Text.IndexOf(note); int p2 = note.Length; //richTextBox1.ForeColor = fontColor; richTextBox1.Select(richTextBox1.Text.Length - p2 - 1, p2); richTextBox1.SelectionColor = fontColor; } string notefont = dt.Rows[i][3].ToString(); if (notefont != "") { FontFamily myFontFamily = new FontFamily("微软雅黑"); //采用哪种字体 int font1 = Convert.ToInt32(notefont); Font myFont = new Font(myFontFamily, font1, FontStyle.Regular); //字是那种字体(幼圆),显示的风格(粗体) int p1 = richTextBox1.Text.IndexOf(note); int p2 = note.Length; richTextBox1.Select(richTextBox1.Text.Length - p2 - 1, p2); richTextBox1.SelectionFont = myFont; } //for (int k = 0; k < wjpath.Count; k++) //{ // LinkLabel link1 = new LinkLabel(); // link1.Text = wjpath[k].ToString(); // link1.LinkClicked+= new LinkLabelLinkClickedEventHandler(link1_LinkClicked); // this.richTextBox1.Controls.Add(link1); //} for (int k = 0; k < wjpath.Count; k++) { int w = richTextBox1.Text.Length; richTextBox1.AppendText(wjpath[k].ToString()); this.richTextBox1.Select(w, wjpath[k].ToString().Length); richTextBox1.InsertLink(wjpath[k].ToString()); richTextBox1.SelectedText = " ";//+(char)13 if (k + 1 == wjpath.Count) { richTextBox1.SelectedText = "" + (char)13; } } //richTextBox1.Text = richTextBox1.Text + note + (char)13 + (char)10; } catch { string note = dt.Rows[i][1].ToString(); richTextBox1.AppendText(note + (char)13 + (char)10); } } richTextBox1.Select(0, 0); richTextBox1.ScrollToCaret(); } if (e.MessageHead == "ZJTSADD") { richTextBox1.Text = e.MessageBody.ToString() + (char)13 + (char)10 + richTextBox1.Text; } }
void ctrlProductInfo_RMesDataChanged(object obj, Rmes.WinForm.Base.RMESEventArgs e) { if (e.MessageHead == null) { return; } if (e.MessageHead == "SN" || e.MessageHead == "ONLINE" || e.MessageHead == "OFFLINE" || e.MessageHead == "RECHECK" || e.MessageHead == "RESN") { //ProductInfoEntity product = e.MessageBody as ProductInfoEntity; string sn = e.MessageBody as string; ProductInfoEntity product = ProductInfoFactory.GetByCompanyCodeSNSingle(LoginInfo.CompanyInfo.COMPANY_CODE, sn); if (product == null) { return; } label1.Text = product.PLAN_CODE; //计划号 label2.Text = product.PLAN_SO; //SO label3.Text = product.PRODUCT_MODEL; //机型 //label2.BackColor = SystemColors.GradientInactiveCaption; } if (e.MessageHead == "FILLSN")//初始化控件 { string[] txt = e.MessageBody.ToString().Split('^'); string sn1 = txt[0]; label1.Text = txt[3]; //计划号 label2.Text = txt[1]; //SO label3.Text = txt[2]; //机型 } if (e.MessageHead == "FILLSN2") //初始化控件 { string[] txt = e.MessageBody.ToString().Split('^'); label1.Text = txt[2]; //计划号 label2.Text = txt[0]; //SO label3.Text = txt[1]; //机型 } if (e.MessageHead == "CLEAR") //初始化控件 { label1.Text = ""; //计划号 label2.Text = ""; //SO label3.Text = ""; //机型 } //////if (e.MessageHead == "YT") //////{ ////// label2.BackColor = Color.Green; //SO ////// label3.BackColor = Color.Green; //机型 //////} //////if (e.MessageHead == "JC") //////{ ////// label2.BackColor = Color.Red; //SO ////// label3.BackColor = Color.Red; //机型 //////} //////if (e.MessageHead == "FYT") //////{ ////// label2.BackColor = SystemColors.GradientInactiveCaption; //SO ////// label3.BackColor = SystemColors.GradientInactiveCaption; //机型 //////} //////if (e.MessageHead == "FJC") //////{ ////// label2.BackColor = SystemColors.GradientInactiveCaption; //SO ////// label3.BackColor = SystemColors.GradientInactiveCaption; //机型 //////} //else if(e.MessageHead==null) //{ // label1.Text = ""; // label2.Text = ""; // label3.Text = ""; //} //if (e.MessageHead == "SCP") //{ // label1.Text = ""; // label2.Text = ""; // label3.Text = ""; //} //if (e.MessageHead == "MESLL") //{ // this.Visible = false; // return; //} //if (e.MessageHead.ToString() == "WORK") //{ // this.Visible = true; // return; //} if (e.MessageHead == "JC") { label2.BackColor = Color.Red; } if (e.MessageHead == "FJC") { label2.BackColor = SystemColors.GradientInactiveCaption; } if (e.MessageHead == "YT") { label2.BackColor = Color.Green; //SO label3.BackColor = Color.Green; //机型 } if (e.MessageHead == "FYT") { label2.BackColor = SystemColors.GradientInactiveCaption; label3.BackColor = SystemColors.GradientInactiveCaption; //机型 } }
void ctrl_Fx_RMesDataChanged(object obj, Rmes.WinForm.Base.RMESEventArgs e) { try { RMESEventArgs arg = new RMESEventArgs(); arg.MessageHead = ""; arg.MessageBody = ""; if (e.MessageHead == null) { return; } if (e.MessageHead == "SN") { TheSn = e.MessageBody.ToString(); product = ProductInfoFactory.GetByCompanyCodeSNSingle(CompanyCode, TheSn);//获取sn信息 if (product == null) { return; } TheSo = product.PLAN_SO; ThePlancode = product.PLAN_CODE; } if (e.MessageHead == "CHECKFX") { //检查返修站点提交的流水号信息 做如下处理: 获取流水号对应的信息;线下返修做返修上线; TheSn = e.MessageBody.ToString(); PlanSnEntity ent = PlanSnFactory.GetBySnPline(TheSn, PlineCode); //获取sn信息 product = ProductInfoFactory.GetByCompanyCodeSNSingle(CompanyCode, TheSn); //获取sn信息 if (product == null) { return; } TheSo = product.PLAN_SO; ThePlancode = product.PLAN_CODE; //判断是否线下返修未上线 if (ent.SN_FLAG == "P" || ent.SN_FLAG == "N") //未上线 初始为N 打印为P 上线未Y { if (LoginInfo.StationInfo.STATION_TYPE == "ST05") //当前站点是返修站点 { arg.MessageHead = "ONLINE"; arg.MessageBody = TheSn; SendDataChangeMessage(arg); } else { MessageBox.Show("此发动机流水号未上线"); return; } } else { arg.MessageHead = "SN"; arg.MessageBody = TheSn; SendDataChangeMessage(arg); } //显示BOM 显示装机提示 arg.MessageHead = "SHOWBOMFX1"; arg.MessageBody = TheSn; SendDataChangeMessage(arg); //显示检测数据 arg.MessageHead = "SHOWDETECTFX1"; arg.MessageBody = TheSn; SendDataChangeMessage(arg); } } catch (Exception e1) { MessageBox.Show(e1.Message); } }