예제 #1
0
        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);
        }
예제 #2
0
        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");
        }
예제 #3
0
 public static List <AdjVoucher> GetAdjByAdjId(long adjId)
 {
     return(AdjVoucherDAO.GetAdjByAdjId(adjId));
 }
예제 #4
0
 public static void AuthoriseBy(long adjId, long empId)
 {
     AdjVoucherDAO.AuthoriseBy(adjId, empId);
 }
예제 #5
0
 public static void UpdateStatus(long adjId, int status)
 {
     AdjVoucherDAO.UpdateStatus(adjId, status);
 }
예제 #6
0
 public static void UpdateReason(AdjVoucher adjVoucher)
 {
     AdjVoucherDAO.UpdateReason(adjVoucher);
 }
예제 #7
0
 public static long?GetLastId()
 {
     return(AdjVoucherDAO.GetLastId());
 }
예제 #8
0
 public static void CreateAdjVoucher(long adjId, long itemId, int qty)
 {
     AdjVoucherDAO.CreateAdjVoucher(adjId, itemId, qty);
 }