public List <WCFAdjustment> ListOfPendingRequestForSupervisor(string email, string password) { if (loginService.ValidateUser(email, password)) { List <WCFAdjustment> listOfWcfAdjustmwnt = new List <WCFAdjustment>(); WCFAdjustment wcfAdjustment = new WCFAdjustment(); List <Adjustment> adList = controller.ListOfPendingAdjustmentBySupervisor(); foreach (Adjustment a in adList) { StationeryCatalogue tempst = controller.GetStationeryCatalogue(a.ItemCode); string price = tempst.Price.ToString(); string stock = tempst.Stock.ToString(); listOfWcfAdjustmwnt.Add(new WCFAdjustment(a.AdjustmentCode, a.ItemCode, price, a.AdjustmentQuant.ToString(), stock, a.Reason, a.HeadRemarks, tempst.Description)); } return(listOfWcfAdjustmwnt); } else { return(null); } }
public string UpdateAdjustmentBySupervisor(WCFAdjustment wcfAdjustment, string email, string password) { if (loginService.ValidateUser(email, password)) { try { Adjustment ad = new Adjustment() { AdjustmentCode = wcfAdjustment.AdjustmentCode, Status = wcfAdjustment.Status, DateApproved = Convert.ToDateTime(wcfAdjustment.DateOfApprove), ApprovedBy = wcfAdjustment.ApprovedBy, HeadRemarks = wcfAdjustment.Remark }; controller.UpdateAdjustmentBySupervisor(ad); return("Success"); } catch (Exception e) { return(e.Message); } } else { return(null); } }