public int closingstockdata(MClosingStockForMilkInSiloAndAllProducts receive)
        {
            int result = 0;

            try
            {
                DBParameterCollection paramcollection = new DBParameterCollection();
                paramcollection.Add(new DBParameter("@RMRId", receive.RMRId));
                paramcollection.Add(new DBParameter("@ClosingStockForMilkInSiloAndAllProductsId", receive.ClosingStockForMilkInSiloAndAllProductsId));
                paramcollection.Add(new DBParameter("@ClosingStockForMilkInSiloAndAllProductsDate", receive.ClosingStockForMilkInSiloAndAllProductsDate));
                paramcollection.Add(new DBParameter("@ClosingStockForMilkInSiloAndAllProductsShiftId", receive.ClosingStockForMilkInSiloAndAllProductsShiftId));
                paramcollection.Add(new DBParameter("@SiloNo", receive.SiloNo));
                paramcollection.Add(new DBParameter("@MilkType", receive.MilkType));
                paramcollection.Add(new DBParameter("@Quantity", receive.Quantity));
                paramcollection.Add(new DBParameter("@FAT", receive.FAT));
                paramcollection.Add(new DBParameter("@SNF", receive.SNF));
                paramcollection.Add(new DBParameter("@CLR", receive.CLR));
                paramcollection.Add(new DBParameter("@Temperature", receive.Temperature));
                paramcollection.Add(new DBParameter("@Acidity", receive.Acidity));
                paramcollection.Add(new DBParameter("@MBRT", receive.MBRT));
                paramcollection.Add(new DBParameter("@HomoEfficiency", receive.HomoEfficiency));
                paramcollection.Add(new DBParameter("@Remarks", receive.Remarks));
                paramcollection.Add(new DBParameter("@ClosingStockForMilkInSiloAndAllProductsStatus", receive.ClosingStockForMilkInSiloAndAllProductsStatus));
                paramcollection.Add(new DBParameter("@flag", receive.flag));
                result = _DBHelper.ExecuteNonQuery("prod_spClosingStockForMilkInSiloAndAllProductsDetails ", paramcollection, CommandType.StoredProcedure);
            }
            catch (Exception EX)
            {
                String MSG = EX.ToString();
            }
            return(result);
        }
        public int closingstockdata(MClosingStockForMilkInSiloAndAllProducts receive)
        {
            dacsfmaap = new DAClosingStockForMilkInSiloAndAllProducts();
            int Result = 0;

            try
            {
                Result = dacsfmaap.closingstockdata(receive);
            }
            catch (Exception)
            {
                throw;
            }
            return(Result);
        }
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            {
                mcsfmaap = new MClosingStockForMilkInSiloAndAllProducts();
                bcsfmaap = new BClosingStockForMilkInSiloAndAllProducts();
                int Result = 0;
                mcsfmaap.ClosingStockForMilkInSiloAndAllProductsId = 0;
                mcsfmaap.RMRId = string.IsNullOrEmpty(hId.Value) ? 0 : Convert.ToInt32(hId.Value);
                mcsfmaap.ClosingStockForMilkInSiloAndAllProductsDate    = Convert.ToDateTime(txtDate.Text.ToString());
                mcsfmaap.ClosingStockForMilkInSiloAndAllProductsShiftId = Convert.ToInt32(dpShiftDetails.SelectedItem.Value);
                mcsfmaap.SiloNo         = string.IsNullOrEmpty(txtSiloNo.Text) ? 0 : Convert.ToInt32(txtSiloNo.Text);
                mcsfmaap.MilkType       = txtMilkType.Text;
                mcsfmaap.Quantity       = string.IsNullOrEmpty(txtQuantity.Text) ? 0 : Convert.ToDouble(txtQuantity.Text);
                mcsfmaap.FAT            = string.IsNullOrEmpty(txtFAT.Text) ? 0 : Convert.ToDouble(txtFAT.Text);
                mcsfmaap.SNF            = string.IsNullOrEmpty(txtSNF.Text) ? 0 : Convert.ToDouble(txtSNF.Text);
                mcsfmaap.CLR            = string.IsNullOrEmpty(txtCLR.Text) ? 0 : Convert.ToDouble(txtCLR.Text);
                mcsfmaap.Temperature    = string.IsNullOrEmpty(txtTemperature.Text) ? 0 : Convert.ToDouble(txtTemperature.Text);
                mcsfmaap.Acidity        = string.IsNullOrEmpty(txtAcidity.Text) ? 0 : Convert.ToDouble(txtAcidity.Text);
                mcsfmaap.MBRT           = string.IsNullOrEmpty(txtMBRT.Text) ? 0 : Convert.ToDouble(txtMBRT.Text);
                mcsfmaap.HomoEfficiency = string.IsNullOrEmpty(txtHomoEfficiency.Text) ? 0 : Convert.ToDouble(txtHomoEfficiency.Text);
                mcsfmaap.Remarks        = txtRemarks.Text;
                mcsfmaap.ClosingStockForMilkInSiloAndAllProductsStatus = Convert.ToInt32(dpStatusDetails.SelectedItem.Value);
                mcsfmaap.flag = "Insert";
                Result        = bcsfmaap.closingstockdata(mcsfmaap);
                if (Result > 0)
                {
                    divDanger.Visible  = false;
                    divwarning.Visible = false;

                    divSusccess.Visible = true;
                    lblSuccess.Text     = "Closing Stock For Milk In Silo And All Products Data Add  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;
            }
        }