public static string loadApprovedRequests()
        {
            User user = (User)HttpContext.Current.Session["user"];
            if (user == null)
            {
                return null;
            }
            int empId = user.id;

            //--------------------------------------------------------------

            JavaScriptSerializer js = new JavaScriptSerializer();
            RequisitionController requisitionController = new RequisitionController();
            // hard coded user id = 6
               // List<Requisition> requisition_entities =requisitionController.actionGetPendingRequisitionsByUserID(6);
            List<Requisition> requisition_entities = requisitionController.actionGetApprovedRequisitionsByUserID(empId);
            List<RequisitionModel> model = new List<RequisitionModel>();
            StationeryController stationeryController = new StationeryController();
            List<StationaryRequests> stationeryRequests = new List<StationaryRequests>();
            foreach (Requisition r in requisition_entities)
            {
                StationaryRequests stationaryRequests = new StationaryRequests();
                stationaryRequests.Quantity = r.quantity;
                stationaryRequests.StrationeryName = stationeryController.actionGetStationeryByID(r.stationery).stationery_name;
                stationaryRequests.RequestedDate = r.datetime_requested.ToString("MMMM dd, yyyy");
                stationeryRequests.Add(stationaryRequests);
            }

            return js.Serialize(stationeryRequests);
        }
 public string loadAllApprovedRequisitions(String accessToken)
 {
     OAuthController oAuth = new OAuthController();
     User user = oAuth.actionGetUserByToken(accessToken);
     RequisitionController requisitionController = new RequisitionController();
     List<Requisition> requisition_entities = requisitionController.actionGetApprovedRequisitionsByUserID(user.id);
     List<RequisitionModel> model = new List<RequisitionModel>();
     StationeryController stationeryController = new StationeryController();
     List<StationaryRequests> stationeryRequests = new List<StationaryRequests>();
     foreach (Requisition r in requisition_entities)
     {
         StationaryRequests stationaryRequests = new StationaryRequests();
         stationaryRequests.Quantity = r.quantity;
         stationaryRequests.StationaryName = stationeryController.actionGetStationeryByID(r.stationery).stationery_name;
         stationaryRequests.RequestedDate = r.datetime_requested.ToString();
         stationeryRequests.Add(stationaryRequests);
     }
     return JsonConvert.SerializeObject(stationeryRequests);
 }