Ejemplo n.º 1
0
 public int GetPaymentSequence(string year)
 {
     try
     {
         int max_sequence = 0;
         using (BudgetContext db = new BudgetContext())
         {
             var budget = db.Budgets.Where(b => b.Year == year.Trim()).FirstOrDefault();
             if (budget == null)
             {
                 throw new Exception("Invalid Year");
             }
             var last_payment = db.Payments
                                .Where(p => p.Year == year)
                                .OrderByDescending(p => p.Sequence)
                                .FirstOrDefault();
             if (last_payment != null)
             {
                 max_sequence = last_payment.Sequence;
             }
             return(max_sequence + 1);
         }
     }
     catch (Exception)
     {
         throw new Exception("ERROR: Can not get Payment Sequence.");
     }
 }
Ejemplo n.º 2
0
 public StatementRepository(BudgetContext context)
 {
     this.context = context;
 }
Ejemplo n.º 3
0
 public StatementRepository()
 {
     context = new BudgetContext();
 }
Ejemplo n.º 4
0
 public BudgetRepository(BudgetContext context)
 {
     this._db = context;
     InitInstance();
 }
Ejemplo n.º 5
0
        //private CostCenter _workingCostCenter;

        #region Constructor
        public BudgetRepository()
        {
            _db = new BudgetContext();
            InitInstance();
        }
Ejemplo n.º 6
0
        public EmployeeRepository(BudgetContext context)
        {
            this.context = context;

            InitInstance();
        }
Ejemplo n.º 7
0
        public EmployeeRepository()
        {
            this.context = new BudgetContext();

            InitInstance();
        }
Ejemplo n.º 8
0
 public CostCenterRepository(BudgetContext context)
 {
     this._db = context;
 }
Ejemplo n.º 9
0
 public UserRepository()
 {
     context = new BudgetContext();
 }
Ejemplo n.º 10
0
 public CostCenterRepository()
 {
     _db = new BudgetContext();
 }
Ejemplo n.º 11
0
 public TransactionRepository(BudgetContext context)
 {
     this._db = context;
 }
Ejemplo n.º 12
0
 public TransactionRepository()
 {
     _db = new BudgetContext();
 }
Ejemplo n.º 13
0
 public AccountRepository(BudgetContext context)
 {
     this.context = context;
 }
Ejemplo n.º 14
0
 public AccountRepository()
 {
     context = new BudgetContext();
 }