//For Check Collection Point Page
        //1.. get All Collection list();
        public List <CollectionPointBO> getCollectionList()
        {
            List <CollectionPointBO> collectionlist = new List <CollectionPointBO>();
            var clst = da.getCollectionList();

            foreach (CollectionPoint c in clst)
            {
                CollectionPointBO b = new CollectionPointBO();
                b.CollectionPointID = c.CollectionPointID;
                b.Name = c.Name;
                collectionlist.Add(b);
            }
            return(collectionlist);
        }
        public List <CollectionPointBO> getCollectionPointDeptList(int collectionPointID)
        {
            List <CollectionPointBO> lst = new List <CollectionPointBO>();
            var qry = (from c in context.CollectionPoints
                       join d in context.Departments on c.CollectionPointID equals d.CollectionPointID
                       join emp in context.Employees on d.DepartmentID equals emp.DepartmentID
                       join u in context.Users on emp.EmployeeID equals u.EmployeeID
                       join dis in context.Disbursements on d.DepartmentID equals dis.DepartmentID
                       join disItem in context.Disbursement_Item on dis.DisbursementID equals disItem.DisbursementID
                       where (c.CollectionPointID == collectionPointID) && (u.DelegatedRole == "Employee Rep" || u.DelegatedRole == "Employee RepHead") && disItem.Status == "Pending"
                       group new { c, d, emp, u } by disItem.DisbursementID into g
                       select new
            {
                g.FirstOrDefault().c.CollectionPointID,
                g.FirstOrDefault().c.Name,
                g.FirstOrDefault().c.Time,
                g.FirstOrDefault().d.DepartmentID,
                g.FirstOrDefault().d.DepartmentName,
                g.FirstOrDefault().emp.FirstName,
                g.FirstOrDefault().emp.LastName,
                g.FirstOrDefault().emp.Phone,
                total = g.Count()
            }).ToList();

            foreach (var q in qry)
            {
                CollectionPointBO cpBO = new CollectionPointBO();
                cpBO.CollectionPointID = q.CollectionPointID;
                cpBO.Name           = q.Name;
                cpBO.Time           = q.Time;
                cpBO.DepartmentID   = q.DepartmentID;
                cpBO.DepartmentName = q.DepartmentName;
                cpBO.EmpFirstName   = q.FirstName;
                cpBO.EmpLastName    = q.LastName;
                cpBO.Phone          = q.Phone;
                cpBO.TotalItem      = q.total;
                cpBO.EmployeeName   = q.FirstName + "" + q.LastName;
                lst.Add(cpBO);
            }

            return(lst);
        }
        public List <CollectionPointBO> getCollectionPointList()
        {
            List <CollectionPoint>   collectionPointsEF = new List <CollectionPoint>();
            List <CollectionPointBO> collectionPointsBO = new List <CollectionPointBO>();

            collectionPointsEF = context.CollectionPoints.ToList();

            foreach (CollectionPoint cp in collectionPointsEF)
            {
                CollectionPointBO collectionPointBO = new CollectionPointBO();
                collectionPointBO.CollectionPointID = cp.CollectionPointID;
                collectionPointBO.Name       = cp.Name;
                collectionPointBO.Time       = cp.Time;
                collectionPointBO.EmployeeID = cp.EmployeeID;
                EmployeeDA employeeDA = new EmployeeDA();
                collectionPointBO.EmployeeName = employeeDA.getEmployeeByID((int)cp.EmployeeID).FirstName + " " + employeeDA.getEmployeeByID((int)cp.EmployeeID).LastName;
                collectionPointsBO.Add(collectionPointBO);
            }
            return(collectionPointsBO);
        }