protected void btnAddFinishGoodsdetail_Click(object sender, EventArgs e)
        {
            try
            {
                finishMdata = new MFinishedGoodsRelease();
                finishBdata = new BFinishedGoodsRelease();
                int Result = 0;
                finishMdata.FinishgoodId           = 0;
                finishMdata.RMRId                  = string.IsNullOrEmpty(hId.Value) ? 0 : Convert.ToInt32(hId.Value);
                finishMdata.FinishedGoodsBatchCode = string.IsNullOrEmpty(txtBatchCode.Text) ? string.Empty : txtBatchCode.Text;
                finishMdata.FinishedGoodsDate      = Convert.ToDateTime(txtDate.Text).ToString("dd-MM-yyyy");
                finishMdata.FinishedGoodsShiftId   = Convert.ToInt32(dpShiftDetails.SelectedItem.Value);
                finishMdata.TypeofMilk             = string.IsNullOrEmpty(txtMilkType.Text) ? string.Empty : txtMilkType.Text;
                finishMdata.FinishedGoodsQuantity  = string.IsNullOrEmpty(txtQuantity.Text) ? string.Empty : txtQuantity.Text;
                finishMdata.FinishedGoodsMfgDate   = Convert.ToDateTime(txtMfgDate.Text).ToString("dd-MM-yyyy");
                finishMdata.FinishedGoodsStatusId  = Convert.ToInt32(dpStatus.SelectedItem.Value);
                finishMdata.flag = "Insert";
                Result           = finishBdata.FinishedGoods(finishMdata);
                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");
                    //GetFinishedGoodReleaseDetails(dates);
                    RMRecieve R = new RMRecieve();
                    R.RMRDate = Convert.ToDateTime(txtDate.Text);

                    GetFinishedGoodReleaseDetails(R);
                    uprouteList.Update();
                    lblSuccess.Text = "Finished Goods Added Successfully";
                    pnlError.Update();
                    //ClearField();
                }
                else
                {
                    divDanger.Visible   = false;
                    divwarning.Visible  = true;
                    divSusccess.Visible = false;
                    lblSuccess.Text     = "Something went wrong plz contact site admin";
                    pnlError.Update();
                }
            }
            catch (FormatException EX)
            {
                string MSG = EX.ToString();
            }
        }
        public int FinishedGoods(MFinishedGoodsRelease receive)
        {
            dafinishgoods = new DAFinishedGoodsRelease();
            int Result = 0;

            try
            {
                Result = dafinishgoods.FinishedGoods(receive);
            }
            catch (Exception)
            {
                throw;
            }
            return(Result);
        }
Beispiel #3
0
        public int FinishedGoods(MFinishedGoodsRelease receive)
        {
            int result = 0;

            try
            {
                DBParameterCollection paramcollection = new DBParameterCollection();
                paramcollection.Add(new DBParameter("@RMRId", receive.RMRId));
                paramcollection.Add(new DBParameter("@FinishedGoodsBatchCode", receive.FinishedGoodsBatchCode));
                paramcollection.Add(new DBParameter("@FinishedGoodsDate", receive.FinishedGoodsDate));
                paramcollection.Add(new DBParameter("@FinishedGoodsShiftId", receive.FinishedGoodsShiftId));
                paramcollection.Add(new DBParameter("@TypeOfMilk", receive.TypeofMilk));
                paramcollection.Add(new DBParameter("@FinishedGoodsQuantity", receive.FinishedGoodsQuantity));
                paramcollection.Add(new DBParameter("@FinishedGoodsMfgDate", receive.FinishedGoodsMfgDate));
                paramcollection.Add(new DBParameter("@FinishedGoodsStatusId", receive.FinishedGoodsStatusId));
                paramcollection.Add(new DBParameter("@flag", receive.flag));
                result = _DBHelper.ExecuteNonQuery("sp_Prod_FinishedGoodsDetails", paramcollection, CommandType.StoredProcedure);
            }
            catch (Exception EX)
            {
                string MSG = EX.ToString();
            }
            return(result);
        }