protected void btnAdd_Click(object sender, EventArgs e)
        {
            mmaoamcspt = new MMicrobiologicalAnalysisOfAerobicMicrobialCountSettlePlateTest();
            bmaoamcspt = new BMicrobiologicalAnalysisOfAerobicMicrobialCountSettlePlateTest();
            int Result = 0;

            mmaoamcspt.MicrobiologicalAnalysisofAerobicMicrobialCountSettlePlateTestId      = 0;
            mmaoamcspt.MicrobiologicalAnalysisofAerobicMicrobialCountSettlePlateTestDate    = Convert.ToDateTime(txtDate.Text.ToString());
            mmaoamcspt.MicrobiologicalAnalysisofAerobicMicrobialCountSettlePlateTestShiftId = Convert.ToInt32(dpShiftDetails.SelectedItem.Value);
            mmaoamcspt.AreaOfExposure     = string.IsNullOrEmpty(txtAreaOfExposure.Text) ? string.Empty : txtAreaOfExposure.Text;
            mmaoamcspt.StartingTime       = string.IsNullOrEmpty(txtStartingTime.Text) ? string.Empty : txtStartingTime.Text;
            mmaoamcspt.EndTime            = string.IsNullOrEmpty(txtEndTime.Text) ? string.Empty : txtEndTime.Text;
            mmaoamcspt.TBCCount           = string.IsNullOrEmpty(txtTBCCount.Text) ? string.Empty : txtTBCCount.Text;
            mmaoamcspt.yeastAndMouldCount = string.IsNullOrEmpty(txtyeastAndMouldCount.Text) ? string.Empty : txtyeastAndMouldCount.Text;
            mmaoamcspt.Merits             = string.IsNullOrEmpty(txtMerits.Text) ? string.Empty : txtMerits.Text;
            mmaoamcspt.Demerits           = string.IsNullOrEmpty(txtDemerits.Text) ? string.Empty : txtDemerits.Text;
            mmaoamcspt.CheckedBy          = string.IsNullOrEmpty(txtCheckedBy.Text) ? string.Empty : txtCheckedBy.Text;
            mmaoamcspt.VerifiedBy         = string.IsNullOrEmpty(txtVerifiedBy.Text) ? string.Empty : txtVerifiedBy.Text;
            mmaoamcspt.ApprovedBy         = string.IsNullOrEmpty(txtApprovedBy.Text) ? string.Empty : txtApprovedBy.Text;
            mmaoamcspt.flag = "insert";
            Result          = bmaoamcspt.MicrobiologicalCountSettlePlateTest(mmaoamcspt);
            if (Result > 0)
            {
                divDanger.Visible  = false;
                divwarning.Visible = false;

                divSusccess.Visible = true;
                lblSuccess.Text     = "Microbiological Analysis Of Aerobic Microbial Count Settle Plate Test Data Added  Successfully";
                ScriptManager.RegisterStartupScript(this, this.GetType(), "sel3", "$('#bx2').removeClass('collapsed-box');", true);
                pnlError.Update();
            }
            else
            {
                divDanger.Visible   = false;
                divwarning.Visible  = true;
                divSusccess.Visible = false;
                lblSuccess.Text     = "Something went wrong plz contact site admin";
                pnlError.Update();
            }
        }
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            mmaoamcspt = new MMicrobiologicalAnalysisOfAerobicMicrobialCountSettlePlateTest();
            bmaoamcspt = new BMicrobiologicalAnalysisOfAerobicMicrobialCountSettlePlateTest();
            int Result = 0;

            mmaoamcspt.MicrobiologicalAnalysisofAerobicMicrobialCountSettlePlateTestId      = string.IsNullOrEmpty(hId.Value) ? 0 : Convert.ToInt32(hId.Value);
            mmaoamcspt.MicrobiologicalAnalysisofAerobicMicrobialCountSettlePlateTestDate    = Convert.ToDateTime(txtDate.Text.ToString());
            mmaoamcspt.MicrobiologicalAnalysisofAerobicMicrobialCountSettlePlateTestShiftId = Convert.ToInt32(dpShiftDetails.SelectedItem.Value);
            mmaoamcspt.AreaOfExposure     = string.IsNullOrEmpty(txtAreaOfExposure.Text) ? string.Empty : txtAreaOfExposure.Text;
            mmaoamcspt.StartingTime       = string.IsNullOrEmpty(txtStartingTime.Text) ? string.Empty : txtStartingTime.Text;
            mmaoamcspt.EndTime            = string.IsNullOrEmpty(txtEndTime.Text) ? string.Empty : txtEndTime.Text;
            mmaoamcspt.TBCCount           = string.IsNullOrEmpty(txtTBCCount.Text) ? string.Empty : txtTBCCount.Text;
            mmaoamcspt.yeastAndMouldCount = string.IsNullOrEmpty(txtyeastAndMouldCount.Text) ? string.Empty : txtyeastAndMouldCount.Text;
            mmaoamcspt.Merits             = string.IsNullOrEmpty(txtMerits.Text) ? string.Empty : txtMerits.Text;
            mmaoamcspt.Demerits           = string.IsNullOrEmpty(txtDemerits.Text) ? string.Empty : txtDemerits.Text;
            mmaoamcspt.CheckedBy          = string.IsNullOrEmpty(txtCheckedBy.Text) ? string.Empty : txtCheckedBy.Text;
            mmaoamcspt.VerifiedBy         = string.IsNullOrEmpty(txtVerifiedBy.Text) ? string.Empty : txtVerifiedBy.Text;
            mmaoamcspt.ApprovedBy         = string.IsNullOrEmpty(txtApprovedBy.Text) ? string.Empty : txtApprovedBy.Text;
            mmaoamcspt.flag = "Update";
            Result          = bmaoamcspt.MicrobiologicalCountSettlePlateTest(mmaoamcspt);
            if (Result > 0)
            {
                divDanger.Visible  = false;
                divwarning.Visible = false;

                divSusccess.Visible = true;
                lblSuccess.Text     = "Microbiological Analysis Of Aerobic Microbial Count Settle Plate Test Data Updated  Successfully";
                pnlError.Update();
            }
            else
            {
                divDanger.Visible   = false;
                divwarning.Visible  = true;
                divSusccess.Visible = false;
                lblSuccess.Text     = "Something went wrong plz contact site admin";
                pnlError.Update();
            }
        }