public static bool SaveDisbursement(List<int> quant, List<int> dep, int itemID, List<int> quantreq)
        {
            DepartmentService sdepser = new DepartmentService();
            //int count;
            int totcount;
            totcount = dep.Count();
            bool ans = true;
            int userid= Convert.ToInt32(HttpContext.Current.Session["userid"].ToString());

            Disbursement_M disb=new Disbursement_M();
            for (int i = 0; i < totcount; i++)
            {
                disb.ItemID = itemID;
                disb.DepID = dep[i];
                disb.RequiredQuant = quantreq[i];
                disb.QuantinHand = quant[i];
                sdepser.savedisb(disb,userid);

            }

            return ans;
        }
Ejemplo n.º 2
0
        public bool CreateDisbursement(DisbursementM[] disbursement)
        {
            DepartmentService departmentService = new DepartmentService();
            try
            {
                for (int i = 0; i < disbursement.Count(); i++)
                {
                    DisbursementM d = disbursement[i];
                    Disbursement_M m = new Disbursement_M();
                    m.DepID = Convert.ToInt32( d.DepID);
                    m.ItemID = Convert.ToInt32(d.ItemID);
                    m.QuantinHand = Convert.ToInt32(d.QuantityInHand);
                    m.RequiredQuant =Convert.ToInt32( d.RequiredQuant);
                    departmentService.savedisb(m,Convert.ToInt32(d.UpdatedUserID));

                }
                return true;
            }
            catch (Exception ex)
            {
                return false;
            }
        }