Esempio n. 1
0
        public int?criteriaAmount()
        {
            LUSSISEntities           e             = new LUSSISEntities();
            List <RequisitionDetail> reqdetaillist = new List <RequisitionDetail>();
            List <RequisitionDetail> temp          = new List <RequisitionDetail>();
            List <string>            cata          = new List <string>();

            List <Catalogue> cataBy = new List <Catalogue>();

            cata = e.Catalogues.Where(x => x.CategoryID == CategoryID).Select(x => x.ItemCode).ToList();
            int?amount = 0;

            foreach (Requisition req in dlist)
            {
                temp = e.RequisitionDetails.Where(x => x.RequisitionID == req.RequisitionID).ToList();
                reqdetaillist.AddRange(temp);
            }

            foreach (string code in cata)
            {
                foreach (RequisitionDetail reqd in reqdetaillist)
                {
                    if (reqd.ItemCode == code)
                    {
                        amount += reqd.ItemQty;
                    }
                }
            }
            return(amount);
        }
Esempio n. 2
0
        public List <Requisition> getReqByDepid()
        {
            LUSSISEntities     e     = new LUSSISEntities();
            List <int>         empid = new List <int>();
            List <Requisition> temp  = new List <Requisition>();

            empid = e.Employees.Where(x => x.DepartmentID == DepartmentID).Select(x => x.EmployeeID).ToList();
            foreach (var item in empid)
            {
                temp = e.Requisitions.Where(x => x.EmployeeID == item).ToList();
                reql.AddRange(temp);
            }
            return(reql);
        }