public int microbiologicalmilkproductdata(MMicrobiologicalAnalysisForMilkAndMilkProductsQC receive)
        {
            int result = 0;

            try
            {
                DBParameterCollection paramcollection = new DBParameterCollection();
                paramcollection.Add(new DBParameter("@MicrobiologicalAnalysisForMilkAndMilkProductsQCId", receive.MicrobiologicalAnalysisForMilkAndMilkProductsQCId));
                paramcollection.Add(new DBParameter("@MicrobiologicalAnalysisForMilkAndMilkProductsQCDate", receive.MicrobiologicalAnalysisForMilkAndMilkProductsQCDate));
                paramcollection.Add(new DBParameter("@MicrobiologicalAnalysisForMilkAndMilkProductsQCShiftId", receive.MicrobiologicalAnalysisForMilkAndMilkProductsQCShiftId));
                paramcollection.Add(new DBParameter("@TestedBy", receive.TestedBy));
                paramcollection.Add(new DBParameter("@ActionTakenBy", receive.ActionTakenBy));
                paramcollection.Add(new DBParameter("@VerifiedBy", receive.VerifiedBy));
                paramcollection.Add(new DBParameter("@SampleTakenPlace", receive.SampleTakenPlace));
                paramcollection.Add(new DBParameter("@SampleTestingTime", receive.SampleTestingTime));
                paramcollection.Add(new DBParameter("@ColiForm", receive.ColiForm));
                paramcollection.Add(new DBParameter("@TBCCFUAndML", receive.TBCCFUAndML));
                paramcollection.Add(new DBParameter("@YeastAndMouldCFUAndML", receive.YeastAndMouldCFUAndML));
                paramcollection.Add(new DBParameter("@CorrectiveActionRequired", receive.CorrectiveActionRequired));
                paramcollection.Add(new DBParameter("@Remarks", receive.Remarks));
                paramcollection.Add(new DBParameter("@flag", receive.flag));
                result = _DBHelper.ExecuteNonQuery("sp_Prod_MicrobiologicalAnalysisForMilkAndMilkProductsQCDetails", paramcollection, CommandType.StoredProcedure);
            }
            catch (Exception EX)
            {
                string MSG = EX.ToString();
            }
            return(result);
        }
        public int microbiologicalmilkproductdata(MMicrobiologicalAnalysisForMilkAndMilkProductsQC receive)
        {
            dambafmampqc = new DAMicrobiologicalAnalysisForMilkAndMilkProductsQC();
            int Result = 0;

            try
            {
                Result = dambafmampqc.microbiologicalmilkproductdata(receive);
            }
            catch (Exception)
            {
                throw;
            }
            return(Result);
        }
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            mmbafmampqc = new MMicrobiologicalAnalysisForMilkAndMilkProductsQC();
            bmbafmampqc = new BMicrobiologicalAnalysisForMilkAndMilkProductsQC();
            int Result = 0;

            mmbafmampqc.MicrobiologicalAnalysisForMilkAndMilkProductsQCId      = string.IsNullOrEmpty(hId.Value) ? 0 : Convert.ToInt32(hId.Value);
            mmbafmampqc.MicrobiologicalAnalysisForMilkAndMilkProductsQCDate    = Convert.ToDateTime(txtDate.Text.ToString());
            mmbafmampqc.MicrobiologicalAnalysisForMilkAndMilkProductsQCShiftId = Convert.ToInt32(dpShiftDetails.SelectedItem.Value);
            mmbafmampqc.TestedBy                 = string.IsNullOrEmpty(txtTestedBy.Text) ? string.Empty : txtTestedBy.Text;
            mmbafmampqc.ActionTakenBy            = string.IsNullOrEmpty(txtActionTakenBy.Text) ? string.Empty : txtActionTakenBy.Text;
            mmbafmampqc.VerifiedBy               = string.IsNullOrEmpty(txtVerifiedBy.Text) ? string.Empty : txtVerifiedBy.Text;
            mmbafmampqc.SampleTakenPlace         = string.IsNullOrEmpty(txtSampleTakenPlace.Text) ? string.Empty : txtSampleTakenPlace.Text;
            mmbafmampqc.SampleTestingTime        = string.IsNullOrEmpty(txtSampleTestingTime.Text) ? string.Empty : txtSampleTestingTime.Text;
            mmbafmampqc.ColiForm                 = string.IsNullOrEmpty(txtColiForm.Text) ? string.Empty : txtColiForm.Text;
            mmbafmampqc.TBCCFUAndML              = string.IsNullOrEmpty(txtTBCCFUML.Text) ? string.Empty : txtTBCCFUML.Text;
            mmbafmampqc.YeastAndMouldCFUAndML    = string.IsNullOrEmpty(txtYeastMouldCFUML.Text) ? string.Empty : txtYeastMouldCFUML.Text;
            mmbafmampqc.CorrectiveActionRequired = string.IsNullOrEmpty(txtCorrectiveActionRequired.Text) ? string.Empty : txtCorrectiveActionRequired.Text;
            mmbafmampqc.Remarks = string.IsNullOrEmpty(txtRemarks.Text) ? string.Empty : txtRemarks.Text;
            mmbafmampqc.flag    = "Update";
            Result = bmbafmampqc.microbiologicalmilkproductdata(mmbafmampqc);
            if (Result > 0)
            {
                divDanger.Visible  = false;
                divwarning.Visible = false;

                divSusccess.Visible = true;
                lblSuccess.Text     = "Microbiological Analysis For Milk And Milk ProductsQC Updated  Successfully";
                pnlError.Update();
                // GetPastDetails();
            }
            else
            {
                divDanger.Visible   = false;
                divwarning.Visible  = true;
                divSusccess.Visible = false;
                lblSuccess.Text     = "Something went wrong plz contact site admin";
                pnlError.Update();
            }

            //return Result
        }
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            mmbafmampqc = new MMicrobiologicalAnalysisForMilkAndMilkProductsQC();
            bmbafmampqc = new BMicrobiologicalAnalysisForMilkAndMilkProductsQC();
            int Result = 0;

            mmbafmampqc.MicrobiologicalAnalysisForMilkAndMilkProductsQCId      = 0;
            mmbafmampqc.MicrobiologicalAnalysisForMilkAndMilkProductsQCDate    = Convert.ToDateTime(txtDate.Text.ToString());
            mmbafmampqc.MicrobiologicalAnalysisForMilkAndMilkProductsQCShiftId = Convert.ToInt32(dpShiftDetails.SelectedItem.Value);
            mmbafmampqc.TestedBy                 = string.IsNullOrEmpty(txtTestedBy.Text)?string.Empty :txtTestedBy.Text;
            mmbafmampqc.ActionTakenBy            = string.IsNullOrEmpty(txtActionTakenBy.Text) ? string.Empty : txtActionTakenBy.Text;
            mmbafmampqc.VerifiedBy               = string.IsNullOrEmpty(txtVerifiedBy.Text) ? string.Empty : txtVerifiedBy.Text;
            mmbafmampqc.SampleTakenPlace         = string.IsNullOrEmpty(txtSampleTakenPlace.Text) ? string.Empty : txtSampleTakenPlace.Text;
            mmbafmampqc.SampleTestingTime        = string.IsNullOrEmpty(txtSampleTestingTime.Text)?string.Empty :txtSampleTestingTime.Text;
            mmbafmampqc.ColiForm                 = string.IsNullOrEmpty(txtColiForm.Text) ? string.Empty : txtColiForm.Text;
            mmbafmampqc.TBCCFUAndML              = string.IsNullOrEmpty(txtTBCCFUML.Text) ? string.Empty : txtTBCCFUML.Text;
            mmbafmampqc.YeastAndMouldCFUAndML    = string.IsNullOrEmpty(txtYeastMouldCFUML.Text) ? string.Empty : txtYeastMouldCFUML.Text;
            mmbafmampqc.CorrectiveActionRequired = string.IsNullOrEmpty(txtCorrectiveActionRequired.Text) ? string.Empty : txtCorrectiveActionRequired.Text;
            mmbafmampqc.Remarks = string.IsNullOrEmpty(txtRemarks.Text) ? string.Empty : txtRemarks.Text;
            mmbafmampqc.flag    = "Insert";
            Result = bmbafmampqc.microbiologicalmilkproductdata(mmbafmampqc);
            if (Result > 0)
            {
                divDanger.Visible  = false;
                divwarning.Visible = false;

                divSusccess.Visible = true;
                lblSuccess.Text     = "Microbiological Analysis For Milk And Milk ProductsQC Added  Successfully";
                pnlError.Update();
                ScriptManager.RegisterStartupScript(this, this.GetType(), "sel3", "$('#bx1').removeClass('collapsed-box');", true);
            }
            else
            {
                divDanger.Visible   = false;
                divwarning.Visible  = true;
                divSusccess.Visible = false;
                lblSuccess.Text     = "Something went wrong plz contact site admin";
                pnlError.Update();
            }

            //return Result;
        }