private void toolStripButton1_Click(object sender, EventArgs e) { string strSql = "call xgmes.Change_irontie()"; MESTool.exeSql(Adapter, strSql); MessageBox.Show("操作完成!"); }
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 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 { } }