Пример #1
0
        public ActionResult CollectedDepOrder()
        {
            Dictionary <int, Dictionary <int, int> > plannedlist = new Dictionary <int, Dictionary <int, int> >();

            List <Department> ldep = DepartmentData.GetAllDep();

            //load the collected dep order

            foreach (int depId in ldep.Select(x => x.Id))
            {
                List <DepOrder> listdp = DepOrderData.GetCollectedDepOrderByDepId(depId);

                Dictionary <int, int> dp = new Dictionary <int, int>();
                foreach (int itemId in listdp.Select(x => x.item.Id))
                {
                    dp.Add(itemId, listdp.Where(x => x.item.Id == itemId).FirstOrDefault().collectedquant);
                }
                if (!plannedlist.ContainsKey(depId))
                {
                    plannedlist.Add(depId, dp);
                }
                else
                {
                    plannedlist[depId] = dp;
                }
            }
            Session["plannedlist"] = plannedlist;


            ViewBag.Rlist = plannedlist;
            Session.Remove("collist");
            Session.Remove("plannedlist");

            return(View());
        }
Пример #2
0
        public Dictionary <int, int> loadsigninglist()
        {
            Dictionary <int, int> list = new Dictionary <int, int>();
            Employee        u          = EmployeeData.FindByUserName((string)Session["username"]);
            List <DepOrder> ldo        = new List <DepOrder>();

            ldo = DepOrderData.GetCollectedDepOrderByDepId(u.department.Id);
            if (ldo.Any())
            {
                foreach (int itemId in ldo.Select(x => x.item.Id).ToList())
                {
                    list.Add(itemId, ldo.Where(x => x.item.Id == itemId).FirstOrDefault().collectedquant);
                }
            }
            return(list);
        }