Exemple #1
0
 public static VoucherDetail GetVoucherDetail(Guid ID)
 {
     using (VouchersDBEntities ctx = new VouchersDBEntities())
     {
         return(ctx.VoucherDetails.FirstOrDefault(v => v.ID == ID));
     }
 }
Exemple #2
0
 public static List <Account> GetAllAcccounts()
 {
     using (VouchersDBEntities ctx = new VouchersDBEntities())
     {
         return(ctx.Accounts.OrderBy(v => v.Name).ToList());
     }
 }
Exemple #3
0
        //Voucher Details

        public static List <VoucherDetail> GetVoucherDetails(Guid ID)
        {
            using (VouchersDBEntities ctx = new VouchersDBEntities())
            {
                return(ctx.VoucherDetails.Where(v => v.VoucherID == ID).ToList());
            }
        }
Exemple #4
0
        //Vouchers

        public static List <Voucher> GetVouchers()
        {
            using (VouchersDBEntities ctx = new VouchersDBEntities())
            {
                return(ctx.Vouchers.OrderByDescending(v => v.Date).ToList());
            }
        }
Exemple #5
0
        //Accounts

        public static List <Account> GetAccountsByType(int Type)
        {
            using (VouchersDBEntities ctx = new VouchersDBEntities())
            {
                var isIncome = Convert.ToBoolean(Type);
                return(ctx.Accounts.Where(v => v.Type == isIncome).OrderByDescending(v => v.Type).ToList());
            }
        }
Exemple #6
0
 public static void AddDetail(VoucherDetail Item)
 {
     using (VouchersDBEntities ctx = new VouchersDBEntities())
     {
         ctx.VoucherDetails.Add(Item);
         ctx.SaveChanges();
     }
 }
Exemple #7
0
 public static void RemoveDetail(VoucherDetail Item)
 {
     using (VouchersDBEntities ctx = new VouchersDBEntities())
     {
         var d = ctx.VoucherDetails.FirstOrDefault(vd => vd.ID == Item.ID);
         ctx.VoucherDetails.Remove(d);
         ctx.SaveChanges();
     }
 }