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)); }
public MResponse UpdateCollectionPoint(int pointId, string deptId) { bool success = new CollectionPointDAO().UpdateCollectionPoint(pointId, deptId); MResponse response = new MResponse(success); return(response); }
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)); }
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(); }
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(); }
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); } }
public MResponse GetCollectionPoints() { CollectionPointDAO dao = new CollectionPointDAO(); MResponseList <CollectionPoint> response = new MResponseList <CollectionPoint>() { ResList = dao.GetCollectionPoints(), Success = true }; return(response); }
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(); }
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); }
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")); }
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)); }
//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(); }
public static List <CollectionPoint> GetAllCollectionPoints() { return(CollectionPointDAO.GetAllCollectionPoints()); }
public static CollectionPoint GetCollectionPointByPlaceId(long placeId) { return(CollectionPointDAO.GetCollectionPointByPlaceId(placeId)); }
public List <CollectionPointViewModel> ListAllCollectionPoints() { var result = CollectionPointDAO.GetCollectionPoints(); return(result); }