public int stdpdata(MStandardizationProductsAdded receive)
        {
            int result = 0;

            try
            {
                DBParameterCollection paramcollection = new DBParameterCollection();
                paramcollection.Add(new DBParameter("@StandardizationProductsAddedId", receive.StandardizationProductsAddedId));
                paramcollection.Add(new DBParameter("@RMRId", receive.RMRId));
                paramcollection.Add(new DBParameter("@StandardizationProductsAddedDate", receive.StandardizationProductsAddedDate));
                paramcollection.Add(new DBParameter("@StandardizationProductsAddedShiftId", receive.StandardizationProductsAddedShiftId));
                paramcollection.Add(new DBParameter("@MilkType", receive.MilkType));
                paramcollection.Add(new DBParameter("@SMPQuantity", receive.SMPQuantity));
                paramcollection.Add(new DBParameter("@Creamkg", receive.Creamkg));
                paramcollection.Add(new DBParameter("@Waterliters", receive.Waterliters));
                paramcollection.Add(new DBParameter("@CondensedMilk", receive.CondensedMilk));
                paramcollection.Add(new DBParameter("@ButterOil", receive.ButterOil));
                paramcollection.Add(new DBParameter("@SkimmedMilk", receive.SkimmedMilk));
                paramcollection.Add(new DBParameter("@Others", receive.Others));
                paramcollection.Add(new DBParameter("@StdStatusId", receive.StdStatusId));
                paramcollection.Add(new DBParameter("@flag", receive.flag));
                result = _DBHelper.ExecuteNonQuery("sp_Prod_StandardizationProductsAddedDetails ", paramcollection, CommandType.StoredProcedure);
            }
            catch (Exception EX)
            {
                String MSG = EX.ToString();
            }
            return(result);
        }
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            {
                mstdpdata = new MStandardizationProductsAdded();
                bstdpdata = new BStandardizationProductsAdded();
                int Result = 0;
                mstdpdata.StandardizationProductsAddedId = 0;

                mstdpdata.RMRId = string.IsNullOrEmpty(hId.Value) ? 0 : Convert.ToInt32(hId.Value);

                mstdpdata.StandardizationProductsAddedDate    = Convert.ToDateTime(txtDate.Text.ToString());
                mstdpdata.StandardizationProductsAddedShiftId = Convert.ToInt32(dpShiftDetails.SelectedItem.Value);
                mstdpdata.MilkType      = string.IsNullOrEmpty(txtMilkType.Text) ? string.Empty : txtMilkType.Text;
                mstdpdata.SMPQuantity   = string.IsNullOrEmpty(txtSMPQuantity.Text) ? 0 : Convert.ToDouble(txtSMPQuantity.Text);
                mstdpdata.Creamkg       = string.IsNullOrEmpty(txtCreamkg.Text) ? 0 : Convert.ToDouble(txtCreamkg.Text);
                mstdpdata.Waterliters   = string.IsNullOrEmpty(txtWaterliters.Text) ? 0 : Convert.ToDouble(txtWaterliters.Text);
                mstdpdata.CondensedMilk = string.IsNullOrEmpty(txtCondensedMilk.Text) ? 0 : Convert.ToDouble(txtCondensedMilk.Text);
                mstdpdata.ButterOil     = string.IsNullOrEmpty(txtButterOil.Text) ? 0 : Convert.ToDouble(txtButterOil.Text);
                mstdpdata.SkimmedMilk   = string.IsNullOrEmpty(txtSkimmedMilk.Text) ? 0 : Convert.ToDouble(txtSkimmedMilk.Text);
                mstdpdata.Others        = string.IsNullOrEmpty(txtOthers.Text) ? string.Empty : txtOthers.Text;
                mstdpdata.StdStatusId   = Convert.ToInt32(dpStdAddDone.SelectedItem.Value);
                mstdpdata.flag          = "Insert";
                Result = bstdpdata.stdpdata(mstdpdata);
                if (Result > 0)
                {
                    divDanger.Visible   = false;
                    divwarning.Visible  = false;
                    divSusccess.Visible = true;
                    lblSuccess.Text     = "Standardization Products Added 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");
                    RMRecieve R = new RMRecieve();
                    R.RMRDate = Convert.ToDateTime(txtDate.Text);
                    GetStandardizationProductsAddedDetails(R);
                    uprouteList.Update();
                    ClearFields();
                }
                else
                {
                    divDanger.Visible   = false;
                    divwarning.Visible  = true;
                    divSusccess.Visible = false;
                    lblSuccess.Text     = "Something went wrong plz contact site admin";
                    pnlError.Update();
                }

                //return Result;
            }
        }
示例#3
0
        public int stdpdata(MStandardizationProductsAdded receive)
        {
            dastdp = new DAStandardizationProductsAdded();
            int Result = 0;

            try
            {
                Result = dastdp.stdpdata(receive);
            }
            catch (Exception)
            {
                throw;
            }
            return(Result);
        }