public void AccountDataEntry() { using (AccountingEntity context = new AccountingEntity()) { int i = 4; context.Accounts.Add(new Account { Code = 110000 + i, Name = "BANK ACCOUNT", Type = 3 }); i = i + 2; context.Accounts.Add(new Account { Code = 110000 + i, Name = "ADVERTISEMENT AND PUBLICITY EXP", Type = 1 }); i = i + 2; context.Accounts.Add(new Account { Code = 110000 + i, Name = "GENERAL EXPENSES", Type = 1 }); i = i + 2; context.Accounts.Add(new Account { Code = 110000 + i, Name = "REPAIR & MAINTENANCE EXPENSES ACCOUNT", Type = 1 }); i = i + 2; context.Accounts.Add(new Account { Code = 110000 + i, Name = "MISCELLANEOUS EXPENSES", Type = 1 }); i = i + 2; context.Accounts.Add(new Account { Code = 110000 + i, Name = "SALARY ACCOUNT", Type = 2 }); i = i + 2; context.Accounts.Add(new Account { Code = 110000 + i, Name = "WAGES ACCOUNT", Type = 1 }); i = i + 2; context.Accounts.Add(new Account { Code = 110000 + i, Name = "INCOME TAX ACCOUNT", Type = 4 }); i = i + 2; context.Accounts.Add(new Account { Code = 110000 + i, Name = "RENT ACCOUNT", Type = 1 }); i = i + 2; context.Accounts.Add(new Account { Code = 110000 + i, Name = "PURCHASE ACCOUNT", Type = 1 }); i = i + 2; context.Accounts.Add(new Account { Code = 110000 + i, Name = "LOANS TO STAFF", Type = 4 }); i = i + 2; context.Accounts.Add(new Account { Code = 110000 + i, Name = "FURNITURE ACCOUNT", Type = 3 }); context.SaveChanges(); } }
public void UpdateIntoVoucher(int VoucherNo, int paidBy, int transactionType, int amount, string narration, DateTime date, string employeeID) { using (AccountingEntity context = new AccountingEntity()) { Voucher voucher = context.Vouchers.FirstOrDefault(r => r.VNo == VoucherNo); voucher.Debit = transactionType; voucher.Credit = paidBy; voucher.Amount = amount; voucher.Narration = narration; voucher.VDate = DateTime.Now; voucher.AuthenticationBy = employeeID; context.SaveChanges(); } }
public void InsertIntoVoucher(int paidBy, int transactionType, int amount, string narration, DateTime date, string employeeID) { using (AccountingEntity context = new AccountingEntity()) { Voucher voucher = new Voucher { Debit = paidBy, Credit = transactionType, Amount = amount, Narration = narration, VDate = date, AuthenticationBy = employeeID, PreparedBy = "A001" }; context.Vouchers.Add(voucher); // MessageBox.Show(voucher.AuthenticationBy.ToString()); context.SaveChanges(); } }