Example #1
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();
            }
        }
Example #2
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;
        }