public ActionResult ViewDisbursementList()
        {
            string      username = Session["username"].ToString();
            EmployeeDAO e        = new EmployeeDAO();
            int         clerk_id = e.GetEmployeeByUsername(username).Id;

            DisbursementDAO       d    = new DisbursementDAO();
            List <DisbursementVM> list = d.WebGetDisbursementsByClerk(clerk_id);

            CollectionPointDAO     c      = new CollectionPointDAO();
            List <CollectionPoint> c_list = c.GetCollectionPointsByClerk(clerk_id);

            if (list != null)
            {
                foreach (DisbursementVM row in list)
                {
                    foreach (CollectionPoint col in c_list)
                    {
                        if (col.Id == row.CollectionPointID)
                        {
                            row.CollectionPointName = col.Name;
                        }
                    }
                }
            }



            ViewData["c_list"] = c_list;
            return(View(list));
        }
Пример #2
0
        public MResponse UpdateCollectionPoint(int pointId, string deptId)
        {
            bool      success  = new CollectionPointDAO().UpdateCollectionPoint(pointId, deptId);
            MResponse response = new MResponse(success);

            return(response);
        }
Пример #3
0
        public ActionResult ChangeCollectionPoint()
        {
            string id    = User.Identity.GetUserId();
            var    staff = StaffDepartmentDAO.GetStaffByUserId(id);

            Department          dep     = staff.Department;
            DepartmentViewModel depView = StaffDepartmentDAO.ConvertDepartmentToDepartmentViewModel(dep);

            // Set CollectionPoint viewbag here!
            ViewBag.CollectionPoint = CollectionPointDAO.GetCollectionPoints();

            if (User.IsInRole("DH") || User.IsInRole("Temp DH"))
            {
                // get DR candidate list
                List <Staff> possibleList = StaffDepartmentDAO.FindPossibleDRList(staff);
                possibleList = possibleList == null ? new List <Staff>() : possibleList;
                Staff currentDR = StaffDepartmentDAO.FindDepartmentRole(staff.departmentId, "DR");

                // Set StaffList viewbag here!
                ViewBag.StaffList = new SelectList(
                    possibleList,
                    "staffId",
                    "staffName",
                    currentDR == null ? -1 : currentDR.staffId);
            }
            return(View(depView));
        }
Пример #4
0
        public MResponse GetCollectionPoints(int clerkId)
        {
            List <CollectionPoint> points = new CollectionPointDAO().GetCollectionPointsByClerk(clerkId);

            return(new MResponseList <CollectionPoint>()
            {
                ResList = points
            });
        }
 public DepartmentRepresentativeController()
 {
     _disbursementDAO        = new DisbursementDAO();
     _employeeDAO            = new EmployeeDAO();
     _disbursementItemDAO    = new DisbursementItemDAO();
     _collectionPointDAO     = new CollectionPointDAO();
     _departmentDAO          = new DepartmentDAO();
     _notificationChannelDAO = new NotificationChannelDAO();
 }
Пример #6
0
        public Dictionary <string, List <CollectionPoint> > GetAllCollectionPoints()
        {
            List <CollectionPoint> collectionPoints             = CollectionPointDAO.GetAllCollectionPoints();
            Dictionary <string, List <CollectionPoint> > cpDict = new Dictionary <string, List <CollectionPoint> >
            {
                { "collectionPoints", collectionPoints }
            };

            return(cpDict);
        }
 public DepartmentActingHeadController()
 {
     _employeeDAO            = new EmployeeDAO();
     _requisitionDAO         = new RequisitionDAO();
     _requisitionItemDAO     = new RequisitionItemDAO();
     _itemDAO                = new ItemDAO();
     _departmentDAO          = new DepartmentDAO();
     _notificationChannelDAO = new NotificationChannelDAO();
     _collectionPointDAO     = new CollectionPointDAO();
 }
Пример #8
0
        public void saveCollectionPoint(DepartmentViewModel department)
        {
            string userId = User.Identity.GetUserId();
            Staff  s1     = StaffDepartmentDAO.GetStaffByUserId(userId);

            if (s1 != null)
            {
                int cId = department.collectionPointId;
                CollectionPointDAO.UpdateCollectionPoint(s1.departmentId, cId);
            }
        }
Пример #9
0
        public MResponse GetCollectionPoints()
        {
            CollectionPointDAO dao = new CollectionPointDAO();
            MResponseList <CollectionPoint> response = new MResponseList <CollectionPoint>()
            {
                ResList = dao.GetCollectionPoints(),
                Success = true
            };

            return(response);
        }
Пример #10
0
 public HomeController()
 {
     _employeeDAO            = new EmployeeDAO();
     _collectionPointDAO     = new CollectionPointDAO();
     _notificationChannelDAO = new NotificationChannelDAO();
     _requisitionDAO         = new RequisitionDAO();
     _delegationDAO          = new DelegationDAO();
     _departmentDAO          = new DepartmentDAO();
     _disbursementDAO        = new DisbursementDAO();
     _disbursementItemDAO    = new DisbursementItemDAO();
 }
Пример #11
0
        public MResponse GetCollectionPointAndRep(string deptId)
        {
            CollectionPointDAO dao = new CollectionPointDAO();
            MCollectionAndRep  collectionAndRep = dao.GetCollecitonPointAndRep(deptId);
            MResponseObj <MCollectionAndRep> response
                = new MResponseObj <MCollectionAndRep>()
                {
                ResObj  = collectionAndRep,
                Success = collectionAndRep != null
                };

            return(response);
        }
Пример #12
0
        public ActionResult ChangeCollectionPoint(Department department, int chosenPoint, int?staffList, int?oldDR)
        {
            string     id    = User.Identity.GetUserId();
            var        staff = StaffDepartmentDAO.GetStaffByUserId(id);
            Department dep   = staff.Department;

            CollectionPointDAO.UpdateCollectionPoint(dep.departmentId, chosenPoint);

            if (User.IsInRole("DH") || User.IsInRole("Temp DH"))
            {
                if (staffList != null)
                {
                    StaffDepartmentDAO.changeDR(staff.staffId, (int)staffList);
                }
            }
            return(View("~/Views/Home/Index.cshtml"));
        }
Пример #13
0
        public MResponse GetDisbursementInfo(string deptId)
        {
            CollectionPoint    point = new CollectionPointDAO().GetCollectionPointByDeptID(deptId);
            List <ItemRequest> list  = new DisbursementDAO().GetDisburseItemsForRep(deptId);

            //bool showApproveButton = false;
            //if (list.Count() > 0)
            //{
            //    showApproveButton = DateTime.Today.DayOfWeek == DayOfWeek.Monday;
            //}

            return(new MResponseListAndObj <ItemRequest, CollectionPoint>()
            {
                ResObj = point,
                ResList = list,
                Success = true
            });
        }
        public ActionResult EditDisbursementList(string dept_id, string dept_name)
        {
            DisbursementDAO    disbursementDAO    = new DisbursementDAO();
            CollectionPointDAO collectionPointDAO = new CollectionPointDAO();
            CollectionPoint    collectionPoint    = collectionPointDAO.GetCollectionPointByDeptID(dept_id);


            List <ItemRequest> itemList = disbursementDAO.GetDisburseItemsForRep(dept_id);

            DisbursementVM disbursement = new DisbursementVM();

            disbursement.DeptName            = dept_name;
            disbursement.DeptId              = dept_id;
            disbursement.CollectionPointName = collectionPoint.Name;
            disbursement.ItemList            = itemList;

            return(View(disbursement));
        }
Пример #15
0
 //private readonly NotificationChannelDAO _notificationChannelDAO;
 //private readonly EmployeeDAO _employeeDAO;
 public StoreClerkController()
 {
     this._disbursementDAO         = new DisbursementDAO();
     this._requisitionDAO          = new RequisitionDAO();
     this._requisitionItemDAO      = new RequisitionItemDAO();
     this._stockRecordDAO          = new StockRecordDAO();
     this._disbursementItemDAO     = new DisbursementItemDAO();
     this._purchaseOrderDAO        = new PurchaseOrderDAO();
     this._itemDAO                 = new ItemDAO();
     this._statusDAO               = new StatusDAO();
     this._purchaseOrderDetailsDAO = new PurchaseOrderDetailsDAO();
     this._employeeDAO             = new EmployeeDAO();
     this._collectionpointDAO      = new CollectionPointDAO();
     this._notificationChannelDAO  = new NotificationChannelDAO();
     this._notificationDAO         = new NotificationDAO();
     this._supplierItemDAO         = new SupplierItemDAO();
     //this._notificationChannelDAO = new NotificationChannelDAO();
     //this._employeeDAO = new EmployeeDAO();
 }
Пример #16
0
 public static List <CollectionPoint> GetAllCollectionPoints()
 {
     return(CollectionPointDAO.GetAllCollectionPoints());
 }
Пример #17
0
 public static CollectionPoint GetCollectionPointByPlaceId(long placeId)
 {
     return(CollectionPointDAO.GetCollectionPointByPlaceId(placeId));
 }
Пример #18
0
        public List <CollectionPointViewModel> ListAllCollectionPoints()
        {
            var result = CollectionPointDAO.GetCollectionPoints();

            return(result);
        }