123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- using System;
- using System.Data;
- using System.Windows.Forms;
- using UAS_MES_NEW.DataOperate;
- using UAS_MES_NEW.Entity;
- using UAS_MES_NEW.PublicMethod;
- namespace UAS_MES_NEW.Special
- {
- public partial class Special_CancelImei : Form
- {
- DataHelper dh;
- LogStringBuilder sql = new LogStringBuilder();
- public Special_CancelImei()
- {
- InitializeComponent();
- }
- private void Special_BoxSplit_Load(object sender, EventArgs e)
- {
- dh = SystemInf.dh;
- }
- private void Split_Click(object sender, EventArgs e)
- {
- }
- private void SaveRepairInf_Click(object sender, EventArgs e)
- {
- barcode_KeyDown(sender, new KeyEventArgs(Keys.Enter));
- }
- private void barcode_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyCode == Keys.Enter)
- {
- if (Reason.Text == "")
- {
- MessageBox.Show("必须填写原因");
- return;
- }
- DataTable dt = (DataTable)dh.ExecuteSql("select pa_id,nvl(pa_downstatus,0)pa_downstatus from package where pa_outboxcode='" + barcode.Text + "'", "select");
- if (dt.Rows.Count > 0)
- {
- if (Down.Checked)
- {
- string pa_downstatus = dt.Rows[0]["pa_downstatus"].ToString();
- if (pa_downstatus == "-1")
- {
- OperateResult.AppendText(barcode.Text + "已被冻结", System.Drawing.Color.Red);
- return;
- }
- dh.ExecuteSql("update package set pa_downstatus=-1 where pa_outboxcode='" + barcode.Text + "'", "update");
- LogicHandler.DoCommandLog("DownPackage", User.UserName, "", User.UserLineCode, User.UserSourceCode, "箱号冻结", "冻结成功" + Reason.Text, barcode.Text, "");
- OperateResult.AppendText(barcode.Text + "冻结成功", System.Drawing.Color.Green);
- }
- if (Up.Checked)
- {
- string pa_downstatus = dt.Rows[0]["pa_downstatus"].ToString();
- if (pa_downstatus != "-1")
- {
- OperateResult.AppendText(barcode.Text + "未被冻结", System.Drawing.Color.Red);
- return;
- }
- dh.ExecuteSql("update package set pa_downstatus=0 where pa_outboxcode='" + barcode.Text + "'", "update");
- LogicHandler.DoCommandLog("DownPackage", User.UserName, "", User.UserLineCode, User.UserSourceCode, "箱号冻结", "取消冻结成功" + Reason.Text, barcode.Text, "");
- OperateResult.AppendText(barcode.Text + "取消冻结成功", System.Drawing.Color.Green);
- }
- }
- else
- {
- OperateResult.AppendText(barcode.Text + "不存在", System.Drawing.Color.Red);
- }
- }
- }
- }
- }
|