示例#1
0
        protected void drpStopPO_SelectedIndexChanged(object sender, EventArgs e)
        {
            //lblStopMessage.Text = string.Empty;
            if (drpStopPO.SelectedValue != "" && Session["DtStopPO"] != null)
            {
                DataTable DtProcessOrders = (DataTable)(Session["DtStopPO"]);

                DataRow[] results = DtProcessOrders.Select("ProcessOrder =" + drpStopPO.SelectedValue);

                if (results != null && results.Count() > 0)
                {
                    txtMaterialStopPO.Text = Convert.ToString(results[0]["MaterialCode"]);
                }
                else
                {
                    txtMaterialStopPO.Text = string.Empty;
                }
            }
            else
            {
                txtMaterialStopPO.Text = string.Empty;
            }

            MPStopPO.Show();
        }
示例#2
0
 protected void btnStop_Click(object sender, EventArgs e)
 {
     lblStopMessage.Text = string.Empty;
     BindStopPO();
     txtStopDate.Text = lbldate.Text;
     txtStopDate.Attributes.Add("readonly", "true");
     BindTimeControl(drpTimeStopPO);
     MPStopPO.Show();
 }
示例#3
0
        protected void btnStopPO_Click(object sender, EventArgs e)
        {
            lblStopMessage.Text = string.Empty;
            if (drpStopPO.SelectedValue == "")
            {
                lblStopMessage.Text      = "Process Order Empty !";
                lblStopMessage.ForeColor = Color.Red;
                MPStopPO.Show();
            }
            else if (txtStopDate.Text == "")
            {
                lblStopMessage.Text      = "Stop Date empty!";
                lblStopMessage.ForeColor = Color.Red;
                MPStopPO.Show();
            }
            else if (drpTimeStopPO.SelectedValue == "")
            {
                lblStopMessage.Text      = "Stop Time empty!";
                lblStopMessage.ForeColor = Color.Red;
                MPStopPO.Show();
            }
            else
            {
                object         result;
                SqlParameter[] param = new SqlParameter[]
                {
                    new SqlParameter("@OPR", 3),
                    new SqlParameter("@PlantCode", lblplantcode.Text),
                    new SqlParameter("@Line", lblline.Text),
                    new SqlParameter("@PONumber", Convert.ToString(drpStopPO.SelectedValue)),
                    new SqlParameter("@StoppageDate", Convert.ToString(txtStopDate.Text)),
                    new SqlParameter("@StoppageTime", Convert.ToString(drpTimeStopPO.SelectedValue)),
                    new SqlParameter("@StoppageBy", Convert.ToString(Session["username"])),
                    new SqlParameter("@CurrentStatus", "Completed")
                };

                result = DBClass.ExecuteScalar_WithParam(param, "DM_SP_DML_DATA");

                if (Convert.ToInt64(result) > 0)
                {
                    ViewState["Active"]      = null;
                    lblStopMessage.Text      = "PO Stop Run Success";
                    lblStopMessage.ForeColor = Color.Green;
                    CheckandSplitProductionEntry(drpStopPO.SelectedValue);
                    ClearStopPO();
                    BindActiveAndScheduledGrid();
                    MPStopPO.Hide();
                }
                else if (Convert.ToInt64(result) == -1)
                {
                    lblStopMessage.Text      = "Error, Future Date time not allowed!";
                    lblStopMessage.ForeColor = Color.Red;
                    MPStopPO.Show();
                }
                else
                {
                    lblStopMessage.Text      = "Error, Something went wrong!";
                    lblStopMessage.ForeColor = Color.Red;
                    MPStopPO.Show();
                }
            }
        }