// DataSet DS;

        public int milkqc(MAfterPackedMilkTestQCDetails receive)
        {
            damilkqc = new DAAfterPackedMilkTestQCDetails();
            int Result = 0;

            try
            {
                Result = damilkqc.milkqc(receive);
            }
            catch (Exception)
            {
                throw;
            }
            return(Result);
        }
        //
        public int milkqc(MAfterPackedMilkTestQCDetails receive)
        {
            int result = 0;

            try
            {
                DBParameterCollection paramcollection = new DBParameterCollection();
                paramcollection.Add(new DBParameter("@RMRId", receive.RMRId));
                paramcollection.Add(new DBParameter("@AfterPackedMilkTestQCId", receive.AfterPackedMilkTestQCId));
                paramcollection.Add(new DBParameter("@AfterPackedMilkTestQCDate", receive.AfterPackedMilkTestQCDate));
                paramcollection.Add(new DBParameter("@ShiftId", receive.ShiftId));
                paramcollection.Add(new DBParameter("@Source", receive.Source));
                paramcollection.Add(new DBParameter("@Weight", receive.Weight));
                paramcollection.Add(new DBParameter("@Quantity", receive.Quantity));
                paramcollection.Add(new DBParameter("@Temperature", receive.Temperature));
                paramcollection.Add(new DBParameter("@FAT", receive.FAT));
                paramcollection.Add(new DBParameter("@CLR", receive.CLR));
                paramcollection.Add(new DBParameter("@SNF", receive.SNF));
                paramcollection.Add(new DBParameter("@QualityStartTime", receive.QualityStartTime));
                paramcollection.Add(new DBParameter("@Hour1", receive.Hour1));
                paramcollection.Add(new DBParameter("@Hours2", receive.Hours2));
                paramcollection.Add(new DBParameter("@Hours3", receive.Hours3));
                paramcollection.Add(new DBParameter("@Hours4", receive.Hours4));
                paramcollection.Add(new DBParameter("@Hours5", receive.Hours5));
                paramcollection.Add(new DBParameter("@Hours6", receive.Hours6));
                paramcollection.Add(new DBParameter("@Hours7", receive.Hours7));
                paramcollection.Add(new DBParameter("@Hours8", receive.Hours8));
                paramcollection.Add(new DBParameter("@TotalHours", receive.TotalHours));
                paramcollection.Add(new DBParameter("@MilkPouchQcStatusId", receive.MilkPouchQcStatusId));
                paramcollection.Add(new DBParameter("@flag", receive.flag));
                result = _DBHelper.ExecuteNonQuery("sp_Prod_AfterPackedPouchMilkTestQCDetails", paramcollection, CommandType.StoredProcedure);
            }
            catch (Exception EX)
            {
                String MSG = EX.ToString();
            }
            return(result);
        }
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            {
                mqc = new MAfterPackedMilkTestQCDetails();
                bqc = new BAfterPackedMilkTestQCDetails();
                int Result = 0;
                mqc.AfterPackedMilkTestQCId = 0;
                mqc.RMRId = string.IsNullOrEmpty(hId.Value) ? 0 : Convert.ToInt32(hId.Value);
                mqc.AfterPackedMilkTestQCDate = Convert.ToDateTime(txtDate.Text.ToString());
                mqc.ShiftId             = Convert.ToInt32(dpShiftDetails.SelectedItem.Value);
                mqc.Source              = txtSource.Text;
                mqc.Weight              = string.IsNullOrEmpty(txtWeight.Text) ? 0 : Convert.ToDouble(txtWeight.Text);
                mqc.Quantity            = string.IsNullOrEmpty(txtQuantity.Text) ? 0 : Convert.ToDouble(txtQuantity.Text);
                mqc.Temperature         = string.IsNullOrEmpty(txtTemperature.Text) ? 0 : Convert.ToDouble(txtTemperature.Text);
                mqc.FAT                 = string.IsNullOrEmpty(txtFAT.Text) ? 0 : Convert.ToDouble(txtFAT.Text);
                mqc.CLR                 = string.IsNullOrEmpty(txtCLR.Text) ? 0 : Convert.ToDouble(txtCLR.Text);
                mqc.SNF                 = string.IsNullOrEmpty(txtSNF.Text) ? 0 : Convert.ToDouble(txtSNF.Text);
                mqc.QualityStartTime    = txtQualityStartTime.Text;
                mqc.Hour1               = string.IsNullOrEmpty(txt1hr.Text) ? string.Empty : txt1hr.Text;
                mqc.Hours2              = string.IsNullOrEmpty(txt2hr.Text) ? string.Empty : txt2hr.Text;
                mqc.Hours3              = string.IsNullOrEmpty(txt3hr.Text) ? string.Empty : txt3hr.Text;
                mqc.Hours4              = string.IsNullOrEmpty(txt4hr.Text) ? string.Empty : txt4hr.Text;
                mqc.Hours5              = string.IsNullOrEmpty(txt5hr.Text) ? string.Empty : txt5hr.Text;
                mqc.Hours6              = string.IsNullOrEmpty(txt6hr.Text) ? string.Empty : txt6hr.Text;
                mqc.Hours7              = string.IsNullOrEmpty(txt7hr.Text) ? string.Empty : txt7hr.Text;
                mqc.Hours8              = string.IsNullOrEmpty(txt8hr.Text) ? string.Empty : txt8hr.Text;
                mqc.TotalHours          = string.IsNullOrEmpty(txtTotalHours.Text) ? string.Empty : txtTotalHours.Text;
                mqc.MilkPouchQcStatusId = Convert.ToInt32(dpPouchMilkTestStatus.SelectedItem.Value);
                //mqc.QualityStartTime = Convert.ToString("hh:mm:ss tt");
                //mqc.Hour1 = Convert.ToString("hh:mm:ss tt");
                //mqc.Hours2 = Convert.ToString("hh:mm:ss tt");
                //mqc.Hours3 = Convert.ToString("hh:mm:ss tt");
                //mqc.Hours4 = Convert.ToString("hh:mm:ss tt");
                //mqc.Hours5 = Convert.ToString("hh:mm:ss tt");
                //mqc.Hours6 = Convert.ToString("hh:mm:ss tt");
                //mqc.Hours7 = Convert.ToString("hh:mm:ss tt");
                //mqc.Hours8 = Convert.ToString("hh:mm:ss tt");
                //mqc.TotalHours = Convert.ToString("hh:mm:ss tt");
                mqc.flag = "Insert";
                Result   = bqc.milkqc(mqc);
                if (Result > 0)
                {
                    divDanger.Visible   = false;
                    divwarning.Visible  = false;
                    divSusccess.Visible = true;

                    ScriptManager.RegisterStartupScript(this, this.GetType(), "sel3", "$('#bx1').addClass('collapsed-box');", true);

                    //string dates;
                    //dates = string.IsNullOrEmpty(txtSearchDate.Text) ? string.Empty : Convert.ToDateTime(txtSearchDate.Text).ToString("dd-MM-yyyy");
                    RMRecieve R = new RMRecieve();
                    R.RMRDate = Convert.ToDateTime(txtSearchDate.Text);
                    uprouteList.Update();
                    lblSuccess.Text = "AfterPackedMilkTestQC Data Add  Successfully";
                    pnlError.Update();
                }
                else
                {
                    divDanger.Visible   = false;
                    divwarning.Visible  = true;
                    divSusccess.Visible = false;
                    lblSuccess.Text     = "Something went wrong plz contact site admin";
                    pnlError.Update();
                }

                //return Result;
            }
        }