Exemplo n.º 1
0
        //中包上线
        private void btnONLine_Click(object sender, EventArgs e)
        {
            //string strTundishID=
            dvTundish.EndEdit();
            bsTundish.EndEdit();
            string strCondition = "CheckFlag = 1 and (STATUS = '" + CommDataMag.CommonData.CTUNDISH_STATUS_HOT + "' and Cast_ID is not null)";

            DataRow[] dr = dsTundish.Tables[0].Select(strCondition);

            if (dr.Length < 1)
            {
                MessageBox.Show("请选中已经\"指定去向\"并且状态为\"热备\"的中包!", "提示");
                return;
            }
            if (dr.Length > 1)
            {
                MessageBox.Show("只能选择\"一个中包\"进行操作!", "提示");
                return;
            }
            string strCastID = dr[0]["Cast_ID"].ToString();

            strCondition = "STATUS = '" + CommDataMag.CommonData.CTUNDISH_STATUS_USE + "' and Cast_ID = '" + strCastID + "'";

            DataRow[] drUse = dsTundish.Tables[0].Select(strCondition);
            if (drUse.Length > 0)
            {
                MessageBox.Show("请先将\"" + drUse[0]["TundishID"].ToString() + "中包\"进行下线操作!", "提示");
                return;
            }

            TundishONorOFFLine onFrm = new TundishONorOFFLine();

            onFrm.ShowDialogEx(Adapter.Session, true, dr[0]["TundishID"].ToString(), dr[0]["TundishNO"].ToString(), dr[0]["Cast_ID"].ToString());
        }
Exemplo n.º 2
0
        //中包下线
        private void btnOFFLine_Click(object sender, EventArgs e)
        {
            dvTundish.EndEdit();
            bsTundish.EndEdit();

            DataRow[] dr = dsTundish.Tables[0].Select("CheckFlag = 1 and STATUS = '" + CommDataMag.CommonData.CTUNDISH_STATUS_USE + "' and Cast_ID is not null");
            if (dr.Length < 1)
            {
                MessageBox.Show("请选中状态为\"使用(周转)\"的中包!", "提示");
                return;
            }
            if (dr.Length > 1)
            {
                MessageBox.Show("只能选择\"一个中包\"进行操作!", "提示");
                return;
            }
            TundishONorOFFLine onFrm = new TundishONorOFFLine();

            onFrm.ShowDialogEx(Adapter.Session, false, dr[0]["TundishID"].ToString(), dr[0]["TundishNO"].ToString(), dr[0]["Cast_ID"].ToString());
        }