Exemplo n.º 1
0
        public void GetPasteurizationDetails(int RMRId)
        {
            DataSet           DS    = new DataSet();
            BPasteurizationQC bdata = new BPasteurizationQC();

            DS = bdata.GetPasteurizationDetabyId(RMRId);
            if (!Comman.Comman.IsDataSetEmpty(DS))
            {
                string DATE = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["PastProcessDate"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["PastProcessDate"].ToString();
                if (DATE == "")
                {
                    txtDate.Text = "";
                }
                else
                {
                    DateTime date1 = Convert.ToDateTime(DATE, System.Globalization.CultureInfo.GetCultureInfo("ur-PK").DateTimeFormat);
                    txtDate.Text = (Convert.ToDateTime(date1).ToString("yyyy-MM-dd"));
                }
                txtBatchNo.Text         = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["BatchNo"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["BatchNo"].ToString();
                txtTemperatureHeat.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["TemperatureHeat"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["TemperatureHeat"].ToString();
                txtTempChill.Text       = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["TempChill"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["TempChill"].ToString();
                txtDoneBy.Text          = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["DoneBy"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["DoneBy"].ToString();
                txtRemarks.Text         = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["Remarks"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["Remarks"].ToString();
                dpShiftDetails.ClearSelection();

                try
                {
                    if (dpShiftDetails.Items.FindByValue(Convert.ToInt32(DS.Tables[0].Rows[0]["PastQCShiftId"]).ToString()) != null)
                    {
                        dpShiftDetails.Items.FindByValue(Convert.ToInt32(DS.Tables[0].Rows[0]["PastQCShiftId"]).ToString()).Selected = true;
                    }
                }
                catch (InvalidCastException)
                {
                    dpShiftDetails.Items.FindByValue(Convert.ToInt32(DS.Tables[0].Rows[0]["PastShiftId"]).ToString()).Selected = true;
                }



                dpQCDetails.ClearSelection();
                try
                {
                    if (dpQCDetails.Items.FindByValue(Convert.ToInt32(DS.Tables[0].Rows[0]["QCStatus"]).ToString()) != null)
                    {
                        dpQCDetails.Items.FindByValue(Convert.ToInt32(DS.Tables[0].Rows[0]["QCStatus"]).ToString()).Selected = true;
                    }
                }
                catch (InvalidCastException)
                {
                    dpQCDetails.SelectedIndex = 0;
                }
            }
        }
Exemplo n.º 2
0
        public void GetPasteurizationDetails(string dates)
        {
            bdata = new BPasteurizationQC();
            DataSet DS = new DataSet();

            DS = bdata.GetPasteurizationDetails(dates);

            if (!Comman.Comman.IsDataSetEmpty(DS))
            {
                rpPasteurizationQCList.DataSource = DS;
                rpPasteurizationQCList.DataBind();
            }
            else
            {
                DS.Clear();
                rpPasteurizationQCList.DataSource = DS;
                rpPasteurizationQCList.DataBind();
            }
        }
Exemplo n.º 3
0
        public void GetPasteurizationDetails(RMRecieve R)
        {
            bdata = new BPasteurizationQC();
            DataSet DS = new DataSet();

            DS = bdata.GetPasteurizationDetails(R);

            if (!Comman.Comman.IsDataSetEmpty(DS))
            {
                rpPasteurizationQCList.DataSource = DS;
                rpPasteurizationQCList.DataBind();
            }
            else
            {
                // this.BindRepeater(dt);
                rpPasteurizationQCList.DataSource = DS;
                rpPasteurizationQCList.DataBind();
            }
        }
Exemplo n.º 4
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            MPasteurizationQC mdata = new MPasteurizationQC();
            BPasteurizationQC bdata = new BPasteurizationQC();
            int Result = 0;

            mdata.PastQCId = 0;


            // mdata.RMRId = string.IsNullOrEmpty(hId.Value) ? 0 : Convert.ToInt32(hId.Value);
            mdata.PastQCDate      = Convert.ToDateTime(txtDate.Text).ToString("dd-MM-yyyy");
            mdata.PastQCShiftId   = Convert.ToInt32(dpShiftDetails.SelectedItem.Value);
            mdata.TemperatureHeat = string.IsNullOrEmpty(txtTemperatureHeat.Text) ? 0 : Convert.ToDouble(txtTemperatureHeat.Text);
            mdata.TempChill       = string.IsNullOrEmpty(txtTempChill.Text) ? 0 : Convert.ToDouble(txtTempChill.Text);
            mdata.DoneBy          = txtDoneBy.Text;
            mdata.Remarks         = txtRemarks.Text;
            mdata.QCStatus        = Convert.ToInt32(dpQCDetails.SelectedItem.Value);
            mdata.flag            = "Update";
            Result = bdata.PasteurizationData(mdata);
            if (Result > 0)
            {
                divDanger.Visible   = false;
                divwarning.Visible  = false;
                divSusccess.Visible = true;
                lblSuccess.Text     = "Pasteurization Data Updated  Successfully";
                ScriptManager.RegisterStartupScript(this, this.GetType(), "sel3", "$('#bx1').addClass('collapsed-box');", true);
                pnlError.Update();
                string dates;
                dates = string.IsNullOrEmpty(txtSearchDate.Text) ? string.Empty : Convert.ToDateTime(txtSearchDate.Text).ToString("dd-MM-yyyy");
                GetPasteurizationDetails(dates);
                uprouteList.Update();
            }
            else
            {
                divDanger.Visible   = false;
                divwarning.Visible  = true;
                divSusccess.Visible = false;
                lblSuccess.Text     = "Something went wrong plz contact site admin";
                pnlError.Update();
            }
        }
Exemplo n.º 5
0
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            MPasteurizationQC mdata = new MPasteurizationQC();
            BPasteurizationQC bdata = new BPasteurizationQC();
            int Result = 0;

            mdata.PastQCId = 0;

            foreach (RepeaterItem item in rpPasteurizationQCList.Items)
            {
                HiddenField hdfID = item.FindControl("hfPastProcessId") as HiddenField;
                if (hdfID != null)
                {
                    mdata.PastProcessId = string.IsNullOrEmpty(hdfID.Value) ? 0 : Convert.ToInt32(hdfID.Value);
                }
            }
            foreach (RepeaterItem item in rpPasteurizationQCList.Items)
            {
                HiddenField hdfID1 = item.FindControl("hfStdId") as HiddenField;
                if (hdfID1 != null)
                {
                    mdata.StdId = string.IsNullOrEmpty(hdfID1.Value) ? 0 : Convert.ToInt32(hdfID1.Value);
                }
            }
            foreach (RepeaterItem item in rpPasteurizationQCList.Items)
            {
                HiddenField hdfID2 = item.FindControl("hfQualityId") as HiddenField;
                if (hdfID2 != null)
                {
                    mdata.QualityId = string.IsNullOrEmpty(hdfID2.Value) ? 0 : Convert.ToInt32(hdfID2.Value);
                }
            }
            mdata.RMRId           = string.IsNullOrEmpty(hId.Value) ? 0 : Convert.ToInt32(hId.Value);
            mdata.PastQCDate      = Convert.ToDateTime(txtDate.Text).ToString("dd-MM-yyyy");
            mdata.PastQCShiftId   = Convert.ToInt32(dpShiftDetails.SelectedItem.Value);
            mdata.TemperatureHeat = string.IsNullOrEmpty(txtTemperatureHeat.Text) ? 0 : Convert.ToDouble(txtTemperatureHeat.Text);
            mdata.TempChill       = string.IsNullOrEmpty(txtTempChill.Text) ? 0 : Convert.ToDouble(txtTempChill.Text);
            mdata.DoneBy          = txtDoneBy.Text;
            mdata.Remarks         = txtRemarks.Text;
            mdata.QCStatus        = Convert.ToInt32(dpQCDetails.SelectedItem.Value);
            mdata.flag            = "Insert";
            Result = bdata.PasteurizationData(mdata);
            if (Result > 0)
            {
                divDanger.Visible   = false;
                divwarning.Visible  = false;
                divSusccess.Visible = true;
                lblSuccess.Text     = "Pasteurization Data Add  Successfully";
                ScriptManager.RegisterStartupScript(this, this.GetType(), "sel3", "$('#bx1').addClass('collapsed-box');", true);
                pnlError.Update();
                string dates;
                dates = string.IsNullOrEmpty(txtSearchDate.Text) ? string.Empty : Convert.ToDateTime(txtSearchDate.Text).ToString("dd-MM-yyyy");
                GetPasteurizationDetails(dates);
                uprouteList.Update();
            }
            else
            {
                divDanger.Visible   = false;
                divwarning.Visible  = true;
                divSusccess.Visible = false;
                lblSuccess.Text     = "Something went wrong plz contact site admin";
                pnlError.Update();
            }

            //return Result;
        }