public async Task <bool> AddCategory(CategoryModel obj)
        {
            try
            {
                Category cat = new Category();
                if (obj != null)
                {
                    cat.Cid      = obj.Cid;
                    cat.Cname    = obj.Cname;
                    cat.Cdetails = obj.Cdetails;
                }
                _context.Add(cat);
                var res = await _context.SaveChangesAsync();

                if (res > 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
예제 #2
0
        public async Task <bool> AddCategory(Category obj)
        {
            try
            {
                _context.Add(obj);
                await _context.SaveChangesAsync();

                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
 public void BuyerRegister(Buyer obj)
 {
     _context.Add(obj);
     _context.SaveChanges();
 }
예제 #4
0
 public void AddItem(Items items)
 {
     _context.Add(items);
     _context.SaveChanges();
 }
 public void AddToCart(Cart cart)
 {
     _context.Add(cart);
     _context.SaveChanges();
 }
예제 #6
0
 /*public void BuyItem(Purchase purchase)
  * {
  *  conn.Add(purchase);
  *  conn.SaveChanges();
  * }*/
 public void BuyItem(Purchase item)
 {
     conn.Add(item);
     conn.SaveChanges();
 }
 public void AddItem(Items iobj)
 {
     _context.Add(iobj);
     _context.SaveChanges();
 }
 public void AddItems(Items obj)
 {
     _context.Add(obj);
     _context.SaveChanges();
 }