public void loadData() { string strsql = "select distinct tap_no,production_date as logtime from cbfiron where production_date >sysdate-1.1 order by production_date desc"; var dtiron = MESTool.GetData(Adapter, strsql); dataGridView1.DataSource = dtiron; }
private void toolStripButton1_Click(object sender, EventArgs e) { string strSql = "call xgmes.Change_irontie()"; MESTool.exeSql(Adapter, strSql); MessageBox.Show("操作完成!"); }
public void loadData() { // select materialid,production_date as logtime,gross_weight,curr_tare,net_weight from cbfiron where production_date >sysdate-1.1 order by production_date desc string strsql = "select materialid,production_date as logtime,gross_weight,curr_tare,net_weight from cbfiron where production_date >sysdate-1.1 order by production_date desc"; var dtiron = MESTool.GetData(Adapter, strsql); dataGridView1.DataSource = dtiron; }
private void button1_Click(object sender, EventArgs e) { //update cbfiron set production_date = TO_DATE('2020-06-23 15:33:32', 'yyyy-MM-dd HH24:MI:SS') where tap_no = '160050461' if (MessageBox.Show(textBox1.Text + "铁次确定要修正重量吗", "请确认", MessageBoxButtons.YesNo) == DialogResult.Yes) { string lastgross = Math.Round(Convert.ToDouble(dataGridView1.CurrentRow.Cells["colgrossWeight"].Value), 2).ToString(); string lasttare = Math.Round(Convert.ToDouble(dataGridView1.CurrentRow.Cells["coltareWeight"].Value), 2).ToString(); string lastnet = Math.Round(Convert.ToDouble(dataGridView1.CurrentRow.Cells["colnetWeight"].Value), 2).ToString(); string curgross = Math.Round(Convert.ToDouble(txtgrossWeight.Text), 2).ToString(); string curtare = Math.Round(Convert.ToDouble(txttareWeight.Text), 2).ToString(); string curnet = Math.Round(Convert.ToDouble(txtnetWeight.Text), 2).ToString(); string updatesql = ""; string logtext = "ip地址" + GetLocalIP() + ",铁次号:" + textBox1.Text + ","; if (lastgross != curgross) { updatesql += "gross_weight=" + Convert.ToDouble(curgross); logtext += "毛重原来是:" + lastgross + ",改为:" + curgross; } if (lasttare != curtare) { if (updatesql == "") { updatesql += "curr_tare=" + Convert.ToDouble(curtare); } else { updatesql += ",curr_tare=" + Convert.ToDouble(curtare); } logtext += "皮重原来是:" + lasttare + ",改为:" + curtare; } if (lastnet != curnet) { if (updatesql == "") { updatesql += "net_weight=" + Convert.ToDouble(curnet); } else { updatesql += ",net_weight=" + Convert.ToDouble(curnet); } logtext += "净重重原来是:" + lastnet + ",改为:" + curnet; } if (updatesql == "") { MessageBox.Show("数据没有变化!"); return; } string strsql = "update cbfiron set " + updatesql + " where materialid = '" + textBox1.Text + "'"; MESTool.exeSql(Adapter, strsql); strsql = " insert into TS_sys_log(note) values('" + logtext + "')"; MESTool.exeSql(Adapter, strsql); MessageBox.Show("操作成功!"); this.Close(); } }
private void button1_Click(object sender, EventArgs e) { //update cbfiron set production_date = TO_DATE('2020-06-23 15:33:32', 'yyyy-MM-dd HH24:MI:SS') where tap_no = '160050461' if (MessageBox.Show(textBox1.Text + "铁次确定要修正出铁时间吗", "请确认", MessageBoxButtons.YesNo) == DialogResult.Yes) { string strsql = "update cbfiron set production_date = TO_DATE('" + dateTimePicker2.Text + "', 'yyyy-MM-dd HH24:MI:SS') where tap_no = '" + textBox1.Text + "'"; MESTool.exeSql(Adapter, strsql); string note = "ip地址" + GetLocalIP() + ",铁次号:" + textBox1.Text + ",原来时间:" + Convert.ToDateTime(dataGridView1.CurrentRow.Cells["collogtime"].Value).ToString("yyyy-MM-dd HH:mm:ss") + "更改为:" + dateTimePicker2.Text; strsql = " insert into TS_sys_log(note) values('" + note + "')"; MESTool.exeSql(Adapter, strsql); MessageBox.Show("操作成功!"); this.Close(); } }
private void ccmReScrapFrm_Load(object sender, EventArgs e) { string strsql = " select materialid from cbloom_data where status<=9 and status >5 "; strsql += " and materialid in (select heatid from cccm_base_data where productiondate > sysdate-1)"; var dtheatid = MESTool.GetData(Adapter, strsql); if (dtheatid != null && dtheatid.Rows.Count > 0) { for (int i = 0; i < dtheatid.Rows.Count; i++) { comboBox1.Items.Add(dtheatid.Rows[i][0].ToString()); } } }
private void button1_Click(object sender, EventArgs e) { if (comboBox1.Text.Trim() == "") { return; } if (MessageBox.Show(comboBox1.Text.Trim() + "炉次确定要做甩废吗", "请确认", MessageBoxButtons.YesNo) == DialogResult.Yes) { string strsql = "call waster('" + comboBox1.Text.Trim() + "')"; MESTool.exeSql(Adapter, strsql); string note = "ip地址" + GetLocalIP() + ",重新甩废炉号:" + comboBox1.Text.Trim(); strsql = " insert into TS_sys_log(note) values('" + note + "')"; MESTool.exeSql(Adapter, strsql); MessageBox.Show("操作成功!"); this.Close(); } }
private void btnOK_Click(object sender, EventArgs e) { try { bsMain.EndEdit(); dsMain.AcceptChanges(); //float fTare = float.Parse(txtNet.Text.Trim()); //float fNetWeight = fGross - fTare; float fNetWeight = float.Parse(txtNet.Text.Trim()); float fTare = fGross - fNetWeight; if (fTare < 0) { MessageBox.Show("皮重不能小于0t!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (fNetWeight < 0) { MessageBox.Show("当前净重小于0t!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } string check = MessageBox.Show("确认净重吗?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question).ToString(); if (check != "OK") { return; } int iRet = cmdAcceptWeightData.Execute(); if (iRet != 0 || !(Convert.ToBoolean(cmdAcceptWeightData.Command.Return))) { MessageBox.Show("设定净重失败!"); //MessageBox.Show(string.Format("失败!错误:{0:X},{1:X}", cmdAcceptWeightData.Command.ErrorCode, iRet)); } else { string note = "ip地址" + GetLocalIP() + ",手工输入净重铁次号:" + txtTapNo.Text.Trim() + ",罐号:" + txtTpcNo.Text.Trim(); string strsql = " insert into TS_sys_log(note) values('" + note + "')"; MESTool.exeSql(Adapter, strsql); MessageBox.Show("设定净重成功!"); this.Close(); } } catch { } }
/// <summary> /// 获取出钢量、终点c /// </summary> public void getweight() { string strSql = "select reblow_count,tapping_weight,reblow_time from cbof_process_data where heatid='" + tbheatid.Text.Trim() + "'"; var dt = UnitMag.MESTool.GetData(Adapter, strSql); if (dt != null && dt.Rows.Count > 0) { if (Convert.ToDouble(dt.Rows[0]["tapping_weight"].ToString()) < 10) { if (tbheatid.Text.Trim().StartsWith("24")) { tbweight.Text = "78"; } else { tbweight.Text = "48"; } } else { tbweight.Text = Math.Round(Convert.ToDouble(dt.Rows[0]["tapping_weight"].ToString()), 3).ToString(); tbweight.Enabled = false; } bc_time = Convert.ToDouble(dt.Rows[0]["reblow_time"].ToString()); lbre_time.Text = dt.Rows[0]["reblow_time"].ToString(); strSql = "select c,si,mn,cr from cqa_lab_element where unittypeid='2' and heatid='" + tbheatid.Text.Trim() + "' order by sample_count desc"; var zddb = MESTool.GetData(Adapter, strSql); if (zddb != null && zddb.Rows.Count > 0) { zd_c = Convert.ToDouble(zddb.Rows[0][0].ToString()); tbzdc.Text = zddb.Rows[0][0].ToString(); tbzdc.Enabled = false; zd_si = Convert.ToDouble(zddb.Rows[0][1].ToString()); tbzdsi.Text = zddb.Rows[0][1].ToString(); tbzdsi.Enabled = false; zd_mn = Convert.ToDouble(zddb.Rows[0][2].ToString()); tbzdmn.Text = zddb.Rows[0][2].ToString(); tbzdmn.Enabled = false; zd_cr = Convert.ToDouble(zddb.Rows[0][3].ToString()); tbzdcr.Text = zddb.Rows[0][3].ToString(); tbzdcr.Enabled = false; } //补吹时间 大于 0 if (bc_time > 0) { ckbReblow.Checked = true; ckbReblow.Enabled = false; if (Convert.ToDouble(dt.Rows[0]["tapping_weight"].ToString()) > 60) { bc_zd_c = zd_c - bc_time * 0.01 / 4; bc_zd_mn = zd_mn - bc_time * 0.01 / 8; } else { bc_zd_c = zd_c - bc_time * 0.01 / 3; bc_zd_mn = zd_mn - bc_time * 0.01 / 8; } if (bc_zd_c < 0.03) { bc_zd_c = 0.03; } if (bc_zd_mn < 0.07) { bc_zd_mn = 0.07; } labelc.Text = Math.Round(bc_zd_c, 4).ToString(); labelmn.Text = Math.Round(bc_zd_mn, 4).ToString(); } else { bc_zd_c = zd_c; bc_zd_mn = zd_mn; labelc.Text = ""; labelmn.Text = ""; } } }