public static List <AdjVoucher> GetAdjByStatus(int status) { List <AdjVoucher> adjVouchers = new List <AdjVoucher>(); adjVouchers = AdjVoucherDAO.GetAdjByStatus(status); if (adjVouchers != null) { foreach (AdjVoucher adj in adjVouchers) { adj.ItemCode = CatalogueService.GetCatalogueById(adj.ItemId).ItemCode; } } return(adjVouchers); }
public string SubmitStockAdjustment(List <AdjVoucher> adjVouchers) { int managerId = 3; int supervisorId = 2; double totalPrice = 0; foreach (AdjVoucher voucher in adjVouchers) { totalPrice += voucher.TotalPrice; } int id = (totalPrice > -250) ? supervisorId : managerId; for (var i = 0; i < adjVouchers.Count; i++) { //int id = (adjVouchers[i].TotalPrice < 250.0) ? supervisorId : managerId; adjVouchers[i].AuthorisedBy = id; } AdjVoucherDAO.GenerateDisbursement(adjVouchers); AdjVoucherDAO.UpdateStock(adjVouchers); return("Success"); }
public static List <AdjVoucher> GetAdjByAdjId(long adjId) { return(AdjVoucherDAO.GetAdjByAdjId(adjId)); }
public static void AuthoriseBy(long adjId, long empId) { AdjVoucherDAO.AuthoriseBy(adjId, empId); }
public static void UpdateStatus(long adjId, int status) { AdjVoucherDAO.UpdateStatus(adjId, status); }
public static void UpdateReason(AdjVoucher adjVoucher) { AdjVoucherDAO.UpdateReason(adjVoucher); }
public static long?GetLastId() { return(AdjVoucherDAO.GetLastId()); }
public static void CreateAdjVoucher(long adjId, long itemId, int qty) { AdjVoucherDAO.CreateAdjVoucher(adjId, itemId, qty); }