public override global::System.Data.DataSet Clone() { Dataset1 cln = ((Dataset1)(base.Clone())); cln.InitVars(); cln.SchemaSerializationMode = this.SchemaSerializationMode; return(cln); }
//NG原因记录 public static int getNgreasonRecord(string tt_taskcode, string tt_mac, string tt_local, string tt_ng, string tt_code, string tt_conn) { int tt_int = 0; string tt_sql = "insert into odc_ng(Taskcode,Mac,Flocal,Fng,Fcode,Fdate) " + "values('" + tt_taskcode + "','" + tt_mac + "','" + tt_local + "','" + tt_ng + "','" + tt_code + "',getdate()) "; tt_int = Dataset1.ExecCommand(tt_sql, tt_conn); return(tt_int); }
private void UpMessage_Load(object sender, EventArgs e) { tt_conn = @"server=" + sip + @";database=oracle;uid=sa;pwd=adminsa"; string tt_sql = "select top 1 up_message from printsoft_up_messages order by id desc"; DataSet ds = Dataset1.GetDataSet(tt_sql, tt_conn); string Messageshow_Text = ds.Tables[0].Rows[0].ItemArray[0].ToString(); this.Messageshow.Text = "打印软件有更新,原因是:\n" + Messageshow_Text + ",\n立刻更新打印软件吗?"; }
//查询确定 private void button7_Click(object sender, EventArgs e) { this.dataGridView2.DataSource = null; //-----不良时间 string tt_date1 = this.dateTimePicker1.Text; string tt_date2 = this.dateTimePicker2.Text; //工单号 string tt_task = ""; if (this.textBox5.Text != "") { tt_task = " and Ftaskscode = '" + this.textBox5.Text + "' "; } //单板号 string tt_pcba = ""; if (this.textBox6.Text != "") { tt_pcba = " and SN = '" + this.textBox6.Text + "' "; } //主机条码 string tt_hostlable = ""; if (this.textBox7.Text != "") { tt_hostlable = " and CMCC_SN = '" + this.textBox7.Text + "' "; } //MAC string tt_mac = ""; if (this.textBox8.Text != "") { tt_hostlable = " and Fmac = '" + this.textBox8.Text + "' "; } string tt_sql1 = "select Ftaskscode 工单号, SN 单板号, CMCC_SN 主机条码, Fmac MAC, analysisDate 过站日期,Fcode 过站站位, Ffilename 过站文件 " + "from ODC_Analysis_Log " + "where analysisDate between '" + tt_date1 + "' and '" + tt_date2 + "' " + tt_task + tt_pcba + tt_hostlable + tt_mac; DataSet ds1 = Dataset1.GetDataSet(tt_sql1, tt_conn); if (ds1.Tables.Count > 0 && ds1.Tables[0].Rows.Count > 0) { dataGridView2.DataSource = ds1; dataGridView2.DataMember = "Table"; } else { MessageBox.Show("sorry,没有查询到数据"); } }
//获取生产信息 private void GetProductNumInfo() { string tt_sql = "select count(1),0,0 " + "from odc_insertcode where taskcode = '" + this.textBox1.Text + "' "; string[] tt_array = new string[3]; tt_array = Dataset1.GetDatasetArray(tt_sql, tt_conn); this.label59.Text = tt_array[0]; }
//记录铭牌重打信息 private void putMacrePrintInfo(string tt_taskscode, string tt_maclable, string tt_hostlable, string tt_user, string tt_local, string tt_remark) { string tt_sql = "insert into odc_lablereprint (Ftaskcode,Fmaclable,Fhostlable,Flocal,Fname,Fdate,Fremark) " + "values('" + tt_taskscode + "','" + tt_maclable + "','" + tt_hostlable + "','" + tt_local + "','" + tt_user + "',getdate(),'" + tt_remark + "')"; if (tt_maclable != "" && tt_hostlable != "") { int tt_execint = Dataset1.ExecCommand(tt_sql, tt_conn); } }
//获取生产信息 private void GetProductNumInfo() { string tt_sql = "select count(1),count(case when hprinttime is not null then 1 end),0 " + "from odc_alllable where taskscode = '" + this.textBox1.Text + "' "; string[] tt_array = new string[3]; tt_array = Dataset1.GetDatasetArray(tt_sql, tt_conn); this.label58.Text = tt_array[0]; this.label59.Text = tt_array[1]; }
//获取MAC全部过站信息 public static DataSet getMacAllCodeInfo(string tt_shortmac, string tt_conn) { DataSet tt_dt = null; string tt_sql1 = "select Id,Ccode,Ncode,Napplytype,Fremark from odc_routingtasklist " + "where pcba_pn = '" + tt_shortmac + "' order by id "; tt_dt = Dataset1.GetDataSet(tt_sql1, tt_conn); return(tt_dt); }
//确定 private void button2_Click(object sender, EventArgs e) { this.label16.Text = null; this.dataGridView1.DataSource = null; bool tt_flag = false; if (this.textBox5.Text != "") { tt_flag = true; } else { MessageBox.Show("工单号不能为空!"); } if (tt_flag) { string tt_task = this.textBox5.Text.ToUpper().Trim(); string tt_sql = "select 1 "; string tt_sql1 = "select taskcode 工单号,count(1) 数量 from odc_insertcode " + "where taskcode = '" + tt_task + "' group by taskcode "; string tt_sql2 = "select Taskcode 工单号,MAC,PCBA 单板号,Ncode 跳转站位,Fdate 日期 from odc_insertcode " + "where Taskcode = '" + tt_task + "' "; if (this.radioButton1.Checked) { tt_sql = tt_sql1; } if (this.radioButton2.Checked) { tt_sql = tt_sql2; } DataSet ds1 = Dataset1.GetDataSet(tt_sql, tt_conn); if (ds1.Tables.Count > 0 && ds1.Tables[0].Rows.Count > 0) { dataGridView1.DataSource = ds1; dataGridView1.DataMember = "Table"; if (this.radioButton2.Checked) { this.label16.Text = ds1.Tables[0].Rows.Count.ToString(); } } else { MessageBox.Show("sorry,没有查询到数据"); } } }
//工单锁定 private void checkBox1_CheckedChanged(object sender, EventArgs e) { if (this.checkBox1.Checked) { string tt_sql1 = "select tasksquantity,product_name,areacode,Gyid " + "from odc_tasks where taskscode = '" + this.textBox1.Text + "' "; DataSet ds1 = Dataset1.GetDataSetTwo(tt_sql1, tt_conn); if (ds1.Tables.Count > 0 && ds1.Tables[0].Rows.Count > 0) { this.label20.Text = ds1.Tables[0].Rows[0].ItemArray[0].ToString(); //工单数量 this.label23.Text = ds1.Tables[0].Rows[0].ItemArray[1].ToString(); //产品名称 this.label24.Text = ds1.Tables[0].Rows[0].ItemArray[2].ToString(); //地区编码 this.label27.Text = ds1.Tables[0].Rows[0].ItemArray[3].ToString(); //流程 //第一步、流程检查 Boolean tt_flag1 = false; if (!this.label27.Text.Equals("")) { bool tt_flag = GetNextCode(this.textBox1.Text, str); if (tt_flag) { tt_flag1 = true; } } else { MessageBox.Show("该工单没有配置流程,请检查"); } if (tt_flag1) { this.textBox1.Enabled = false; this.button1.Visible = true; this.button3.Visible = true; this.button4.Visible = true; } } else { MessageBox.Show("没有查询此工单,请确认!"); } } else { this.textBox1.Enabled = true; clearItem1(); this.button1.Visible = false; this.button3.Visible = false; this.button4.Visible = false; } }
//生产数据记录 private void GetProductInfo() { string tt_sql = "select top 10 count(1),count(case when boxlable is not null then 1 end),count(case when bosasn is not null then 1 end) " + "from odc_alllable where taskscode ='" + this.textBox1.Text + "' "; string[] tt_array = new string[3]; tt_array = Dataset1.GetDatasetArray(tt_sql, tt_conn); this.label10.Text = tt_array[0]; this.label12.Text = tt_array[1]; this.label13.Text = tt_array[2]; }
//获取生产信息 private void GetProductInfor() { string tt_sql = "select COUNT(1),sum(case when ageing = '1' then 1 else 0 end) N01,0 " + "from ODC_ALLLABLE where TASKSCODE = '" + this.textBox1.Text + "' "; string[] tt_array1 = new string[3]; tt_array1 = Dataset1.GetDatasetArray(tt_sql, tt_conn); this.label17.Text = tt_array1[0]; this.label19.Text = tt_array1[1]; tt_shouldoldnumber = Convert.ToInt32(tt_array1[2]); }
private string getSaveorUploadRemark(string tt_user) { string tt_remark = ""; string tt_sql = "select count(1),min(Fcode),0 from odc_fhpassword " + "where fname = '" + tt_user + "' "; string[] tt_array3 = new string[3]; tt_array3 = Dataset1.GetDatasetArray(tt_sql, tt_conn); tt_remark = tt_array3[1]; return(tt_remark); }
//获取MAC打印信息信息 private void GetMACPrintNumInfo() { string tt_sql = "select count(1),count(case when state is NULL then 1 end) Fcount1, " + "count(case when state is not NULL then 1 end) Fcount2 " + "from odc_macinfo where taskscode = '" + this.textBox1.Text + "'"; string[] tt_array = new string[3]; tt_array = Dataset1.GetDatasetArray(tt_sql, tt_conn); this.label46.Text = tt_array[0]; this.label47.Text = tt_array[1]; this.label4.Text = tt_array[2]; }
//获取未比对信息 private string getCheckNumber(string tt_task, string tt_package) { string tt_checknum = "0"; string tt_sql = "select count(1),0,0 from odc_package " + "where taskcode = '" + tt_task + "' and pagesn = '" + tt_package + "' and pageperson = '中箱已比对' "; string[] tt_array = new string[3]; tt_array = Dataset1.GetDatasetArray(tt_sql, tt_conn); tt_checknum = tt_array[0]; return(tt_checknum); }
public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs) { Dataset1 ds = new Dataset1(); global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType(); global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence(); global::System.Xml.Schema.XmlSchemaAny any = new global::System.Xml.Schema.XmlSchemaAny(); any.Namespace = ds.Namespace; sequence.Items.Add(any); type.Particle = sequence; global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable(); if (xs.Contains(dsSchema.TargetNamespace)) { global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream(); global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream(); try { global::System.Xml.Schema.XmlSchema schema = null; dsSchema.Write(s1); for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext();) { schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current)); s2.SetLength(0); schema.Write(s2); if ((s1.Length == s2.Length)) { s1.Position = 0; s2.Position = 0; for (; ((s1.Position != s1.Length) && (s1.ReadByte() == s2.ReadByte()));) { ; } if ((s1.Position == s1.Length)) { return(type); } } } } finally { if ((s1 != null)) { s1.Close(); } if ((s2 != null)) { s2.Close(); } } } xs.Add(dsSchema); return(type); }
//-------以下专门流程检验相关的,以及数据集操作---------- #region 1、获取信息辅助方法 //从流程表process获取全部流程字符串 public static string getGyidAllProcess(string tt_gyid, string tt_conn) { string tt_gyidprocess = "单板工单流程没有找到"; string tt_sql = "select count(1),min(process),0 from odc_process where id = " + tt_gyid; string[] tt_array = new string[3]; tt_array = Dataset1.GetDatasetArray(tt_sql, tt_conn); if (tt_array[0] == "1") { tt_gyidprocess = tt_array[1]; } return(tt_gyidprocess); }
//重置 private void button10_Click(object sender, EventArgs e) { this.dataGridView1.DataSource = null; Boolean tt_flag = false; if (this.textBox4.Text == "" && this.textBox5.Text == "") { MessageBox.Show("工单号和MAC不能都为空!"); } else { tt_flag = true; } if (tt_flag) { //工单号 string tt_task = ""; if (this.textBox4.Text.Trim() != "") { tt_task = " and taskscode = '" + this.textBox4.Text.Trim() + "' "; } //MAC string tt_mac = ""; if (this.textBox5.Text.Trim() != "") { tt_mac = " and mac = '" + this.textBox5.Text.Trim() + "' "; } string tt_sql = "select taskscode 工单号,MAC, barcode 设备标示符, SN GPSN,state 打印次数, Fusestate 是否使用, Fnameplate 打印时间 " + "from odc_macinfo " + "where 1=1 " + tt_task + tt_mac; DataSet ds = Dataset1.GetDataSet(tt_sql, tt_conn); if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { dataGridView1.DataSource = ds; dataGridView1.DataMember = "Table"; } else { MessageBox.Show("sorry,没有查询到数据"); } } }
//获取产品地区 private string Getproductarea(string tt_mac) { string tt_productname = ""; string tt_sql = "select areacode from ODC_TASKS " + "where taskscode in " + "(select taskscode from odc_alllable where maclable = '" + tt_mac + "')"; DataSet ds = Dataset1.GetDataSet(tt_sql, tt_conn); if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { tt_productname = ds.Tables[0].Rows[0][0].ToString(); } return(tt_productname); }
//刷新站位 private void CheckStation(string tt_mac) { string tt_sql = "select ccode 前站 ,Ncode 后站,napplytype 过站,taskscode 工单,pcba_pn MAC, createtime,fremark " + "from ODC_ROUTINGTASKLIST where pcba_pn = '" + tt_mac + "' order by id desc"; DataSet ds1 = Dataset1.GetDataSet(tt_sql, tt_conn); if (ds1.Tables.Count > 0 && ds1.Tables[0].Rows.Count > 0) { dataGridView1.DataSource = ds1; dataGridView1.DataMember = "Table"; this.label55.Text = ds1.Tables[0].Rows[0].ItemArray[1].ToString(); //当前站位 } }
//获取可跳站位 private string GetNcode(string tt_code) { string tt_routnum = "0"; string tt_sql = "select ncode from odc_routing_change where ccode = '" + tt_code + "'"; DataSet ds = Dataset1.GetDataSet(tt_sql, tt_conn); if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { tt_routnum = ds.Tables[0].Rows[0].ItemArray[0].ToString(); } return(tt_routnum); }
//从routing表获取全流程数据集 public static DataSet getGyidAllProcessDt(string tt_gyid, string tt_conn) { DataSet tt_dt = null; string tt_sql = "select pxid,lcbz from odc_routing where pid = " + tt_gyid; tt_dt = Dataset1.GetDataSetTwo(tt_sql, tt_conn); if (tt_dt.Tables.Count > 0 && tt_dt.Tables[0].Rows.Count > 0) { } else { MessageBox.Show("getGyidAllProcessDt,没有找到流程:" + tt_gyid + ",的流程数据集Dataset,请流程设置!"); } return(tt_dt); }
//记录信息 private Boolean CheckInfoIntoDataBase() { Boolean tt_flag = false; string tt_update = "update odc_alllable set bosasn = '信息已比对' " + "where taskscode = '" + this.textBox1.Text + "' and hostlable = '" + tt_hostlable + "' and id = '" + tt_id + "'"; int tt_exuct = Dataset1.ExecCommand(tt_update, tt_conn); if (tt_exuct > 0) { tt_flag = true; } return(tt_flag); }
//获取站位顺序号 private string GetNcodeSerialNo(string tt_gyid, string tt_code) { string tt_routnum = "0"; string tt_sql = "select count(1),min(lcbz),0 from odc_routing " + "where pid = " + tt_gyid + " and pxid = " + tt_code; string[] tt_array = new string[3]; tt_array = Dataset1.GetDatasetArray(tt_sql, tt_conn); if (tt_array[0] == "1") { tt_routnum = tt_array[1]; } return(tt_routnum); }
//获取当前账号的测试站位 private string getTestCode(string tt_username) { string tt_testcode = ""; string tt_sql1 = "select count(1),min(Fcode),0 " + " from odc_fhpassword where Fname = '" + tt_username + "' "; string[] tt_array1 = new string[3]; tt_array1 = Dataset1.GetDatasetArrayTwo(tt_sql1, tt_conn); if (tt_array1[0] == "1") { tt_testcode = tt_array1[1]; } else { MessageBox.Show("当前用户号:" + tt_username + "没有找到设定的待测站位,请确认"); } return(tt_testcode); }
//获取站位的数量 private DataSet GetStationInfo() { string tt_sql = "select T1.pcba_pn MAC, T2.pcbasn 单板,T2.hostlable 主机码,T2.smtaskscode 移动码,T1.ccode 前站,T1.ncode 后站 " + "from odc_routingtasklist T1 " + "left outer join odc_alllable T2 " + "on T1.pcba_pn = T2.maclable " + "where T1.taskscode = '" + this.textBox1.Text + "' and T1.Napplytype is null and T1.Ncode = '" + this.textBox2.Text + "' "; DataSet ds1 = Dataset1.GetDataSet(tt_sql, tt_conn); if (ds1.Tables.Count > 0 && ds1.Tables[0].Rows.Count > 0) { dataGridView1.DataSource = ds1; dataGridView1.DataMember = "Table"; this.label10.Text = ds1.Tables[0].Rows.Count.ToString(); } return(ds1); }
//获取未比对信息列表 private void getCheckNumber2(string tt_task, string tt_package) { this.richTextBox2.Text = null; string tt_sql = "select T2.boxlable " + "from odc_package T1 " + "left outer join odc_alllable T2 " + "on T1.pasn = T2.pcbasn " + "where T1.taskcode = '" + tt_task + "' and T1.pagesn = '" + tt_package + "' and T1.pageperson <> '中箱已比对' "; DataSet ds3 = Dataset1.GetDataSet(tt_sql, tt_conn); if (ds3.Tables.Count > 0 && ds3.Tables[0].Rows.Count > 0) { //遍历一个表多行一列 foreach (DataRow row in ds3.Tables[0].Rows) { this.richTextBox2.Text = row[0].ToString() + "\n" + this.richTextBox2.Text; } } }
//查询确定 private void button15_Click(object sender, EventArgs e) { this.dataGridView3.DataSource = null; //-----日期---- string tt_date1 = this.dateTimePicker4.Text; string tt_date2 = this.dateTimePicker3.Text; //----工单---- string tt_ftask = ""; if (!this.textBox10.Text.Equals("")) { tt_ftask = " and Ftask = '" + this.textBox10.Text + "' "; } //-----文件名---- string tt_fsn = ""; if (!this.textBox11.Text.Equals("")) { tt_fsn = " and Fsn = '" + this.textBox11.Text + "' "; } string tt_sql = "select ID,Fsn,Fpc,Fcode," + "FN01,FN02,FN03,FN04,FN05,FN06,FN07,FN08,FN09,FN10,FN11,FN12,FN13,FN14,FN15,FN16,FN17,FN18,FN19,FN20," + "Fid,Ftask,Ffilename,Fdate " + "from odc_wifilog " + "where Fdate between '" + tt_date1 + "' and '" + tt_date2 + "' " + tt_ftask + tt_fsn; DataSet ds1 = Dataset1.GetDataSet(tt_sql, tt_conn); if (ds1.Tables.Count > 0 && ds1.Tables[0].Rows.Count > 0) { dataGridView3.DataSource = ds1; dataGridView3.DataMember = "Table"; } else { MessageBox.Show("sorry,没有查询到数据!"); } }
//获取密码 private string GetUserPassword(string tt_username) { string tt_password = "******"; string tt_sql = "select count(1),min(fpassword),min(Fcode) " + " from odc_fhpassword where Fname = '" + tt_username + "' "; string[] tt_array = new string[3]; tt_array = Dataset1.GetDatasetArrayTwo(tt_sql, tt_conn); if (tt_array[0] == "1") { tt_password = tt_array[1]; } else { MessageBox.Show("网络连接失败,或没有" + tt_username + "此账号,请确认"); } return(tt_password); }
//工单锁定 private void checkBox1_CheckedChanged(object sender, EventArgs e) { if (this.checkBox1.Checked) { string tt_sql1 = "select tasksquantity,product_name " + "from odc_tasks where taskscode = '" + this.textBox1.Text + "' "; DataSet ds1 = Dataset1.GetDataSetTwo(tt_sql1, tt_conn); if (ds1.Tables.Count > 0 && ds1.Tables[0].Rows.Count > 0) { this.label4.Text = ds1.Tables[0].Rows[0].ItemArray[0].ToString(); //工单数量 this.label5.Text = ds1.Tables[0].Rows[0].ItemArray[1].ToString(); this.textBox1.Enabled = false; GetProductInfo(); this.textBox2.Enabled = true; this.textBox7.Enabled = true; this.textBox17.Enabled = true; this.textBox10.Enabled = true; this.textBox13.Enabled = true; } else { MessageBox.Show("没有查询此工单,请确认!"); } } else { this.label4.Text = null; this.label5.Text = null; this.textBox1.Enabled = true; this.textBox2.Enabled = false; this.textBox7.Enabled = false; this.textBox17.Enabled = false; this.textBox10.Enabled = false; this.textBox13.Enabled = false; ClearLabelInfo(); } }