public void SaveSoldItems(List <SoldItems> soldproducts) { using (BmsDbContext context = new BmsDbContext()) { context.SoldItem.AddRange(soldproducts); context.SaveChanges(); } }
public void SaveLedger(DATA.Domains.Ledger ledger) { using (BmsDbContext context = new BmsDbContext()) { context.ledger.Add(ledger); context.SaveChanges(); } }
public void SavePurchaseItems(List <DATA.Domains.PurchaseItem> products) { using (BmsDbContext context = new BmsDbContext()) { context.PurchaseItem.AddRange(products); context.SaveChanges(); } }
public void Delete(int id) { using (BmsDbContext context = new BmsDbContext()) { var deleteproduct = context.Product.Where(x => x.Id == id).FirstOrDefault(); deleteproduct.IsDeleted = true; context.SaveChanges(); } }
public int Add(Trademark trademark) { using (BmsDbContext context = new BmsDbContext()) { var TradeMarkToAdd = context.Trademark.Add(trademark); context.SaveChanges(); return(TradeMarkToAdd.Id); } }
public void update(DATA.Domains.User user) { using (BmsDbContext context = new BmsDbContext()) { var usertouptade = context.User.Where(x => x.Id == user.Id).FirstOrDefault(); usertouptade.Password = user.Password; context.SaveChanges(); } }
public void Delete(int id) { using (BmsDbContext context = new BmsDbContext()) { var delete = context.AccountHolder.Where(x => x.Id == id).FirstOrDefault(); delete.IsDeleted = true; context.SaveChanges(); } }
public void Add(DATA.Domains.AccountHolder accountHolder) { using (BmsDbContext context = new BmsDbContext()) { accountHolder.TradeMarkID = context.Trademark.FirstOrDefault().Id; context.AccountHolder.Add(accountHolder); context.SaveChanges(); } }
public int Add(DATA.Domains.Product product) { using (BmsDbContext context = new BmsDbContext()) { var productToAdd = context.Product.Add(product); context.SaveChanges(); return(productToAdd.Id); } }
public void SaveCategory(DATA.Domains.Category category) { using (BmsDbContext context = new BmsDbContext()) { var validate = context.Category.Where(name => name.Name == category.Name).FirstOrDefault(); if (validate == null) { context.Category.Add(category); context.SaveChanges(); } } }
public Sale GenerateSale() { using (BmsDbContext context = new BmsDbContext()) { var sale = context.Sale.Add(new Sale { CreatedOn = DateTime.UtcNow.ToLocalTime() }); context.SaveChanges(); return(sale); } }
public Purchase GeneratePurchase() { using (BmsDbContext context = new BmsDbContext()) { var purchaase = context.Purchase.Add(new Purchase { CreatedOn = DateTime.UtcNow.ToLocalTime() }); context.SaveChanges(); return(purchaase); } }
public int Delete(int id) { using (BmsDbContext context = new BmsDbContext()) { var tradeMarkToDelete = context.Trademark.Where(x => x.Id == id).FirstOrDefault(); tradeMarkToDelete.IsDeleted = true; context.SaveChanges(); return(tradeMarkToDelete.Id); } }
public void Update(DATA.Domains.Trademark trademark) { using (BmsDbContext context = new BmsDbContext()) { var tradeMarktoaupdate = context.Trademark.Where(x => x.Id == trademark.Id).FirstOrDefault(); tradeMarktoaupdate.BussinessName = trademark.BussinessName; tradeMarktoaupdate.OwnerName = trademark.OwnerName; tradeMarktoaupdate.Contact = trademark.Contact; tradeMarktoaupdate.Address = trademark.Address; tradeMarktoaupdate.Detail = trademark.Detail; context.SaveChanges(); } }
public void Update(DATA.Domains.AccountHolder accountHolder) { using (BmsDbContext context = new BmsDbContext()) { var accountholderToUpdate = context.AccountHolder.Where(x => x.Id == accountHolder.Id).FirstOrDefault(); accountholderToUpdate.FirstName = accountHolder.FirstName; accountholderToUpdate.LastName = accountHolder.LastName; accountholderToUpdate.Contact = accountHolder.Contact; accountholderToUpdate.Address = accountHolder.Address; accountholderToUpdate.Detail = accountHolder.Detail; accountholderToUpdate.BankAccountNumber = accountHolder.BankAccountNumber; accountholderToUpdate.AccountHolderTypeID = accountHolder.AccountHolderTypeID; context.SaveChanges(); } }
public void Update(DATA.Domains.Product product) { using (BmsDbContext context = new BmsDbContext()) { var productToupdate = context.Product.Where(x => x.Id == product.Id).FirstOrDefault(); productToupdate.Name = product.Name; productToupdate.Availability = product.Availability; productToupdate.BarCode = product.BarCode; productToupdate.Brand = product.Brand; productToupdate.Detail = product.Detail; productToupdate.Color = product.Color; productToupdate.Size = product.Size; productToupdate.Cost = product.Cost; productToupdate.Price = product.Price; productToupdate.ImeNumber = product.ImeNumber; productToupdate.IsActive = product.IsActive; productToupdate.IsDeleted = product.IsDeleted; context.SaveChanges(); } }