private void GetFocus(int rowid) { //this.GridQuality.Rows[rowid].Cells["colDetectValue"].Selected = true; //SendKeys.Send("+{Home}"); try { this.GridQuality.CurrentCell = GridQuality.Rows[rowid].Cells["colAnswer"]; GridQuality.Focus(); GridQuality.BeginEdit(false); } catch { } }
public ctrl_quality(string type, string sn, string stationcode1) { InitializeComponent(); CompanyCode = LoginInfo.CompanyInfo.COMPANY_CODE; PlineID = LoginInfo.ProductLineInfo.RMES_ID; PlineCode = LoginInfo.ProductLineInfo.PLINE_CODE; StationCode = LoginInfo.StationInfo.STATION_CODE; stationname = LoginInfo.StationInfo.STATION_NAME; GridQuality.AutoGenerateColumns = false; GridQuality.RowHeadersVisible = false; GridQuality.DataSource = null; Thetype = type; TheSn = sn; 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, stationcode1);//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 { } //this.RMesDataChanged += new RMesEventHandler(ctrl_Tj_RMesDataChanged); }
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 { } // } }