// this method adds a new brand in brand table in db
 public async Task AddBrand(Brand brand)
 {
     try
     {
         sde.Brands.Add(brand);
         await sde.SaveChangesAsync();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #2
0
 public async Task AddPacking(Packing pack)
 {
     try
     {
         sde.Packings.Add(pack);
         await sde.SaveChangesAsync();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #3
0
 public async Task AddCategory(Category cat)
 {
     try
     {
         sde.Categories.Add(cat);
         await sde.SaveChangesAsync();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #4
0
 public async Task AddSubCategory(SubCategory subcat)
 {
     try
     {
         sde.SubCategories.Add(subcat);
         await sde.SaveChangesAsync();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 // AddProduct method to add new product to database.
 public async Task AddProduct(Product product)
 {
     try
     {
         sde.Products.Add(product);
         await sde.SaveChangesAsync();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 // this method adds a new stock in the database.
 public async Task AddStock(Stock stock)
 {
     try
     {
         sde.Stocks.Add(stock);
         await sde.SaveChangesAsync();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }