Example #1
0
        public async Task <IActionResult> Create([Bind("Id,Name")] Department department)
        {
            if (ModelState.IsValid)
            {
                _context.Add(department);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(department));
        }
Example #2
0
        public async Task <IActionResult> Create([Bind("Id,Name,Phone,GenderId,CityId,RegionId,LastPurchase,ClassificationId,UserId")] Customer customer)
        {
            if (ModelState.IsValid)
            {
                _context.Add(customer);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(customer));
        }
Example #3
0
 /// <summary>
 /// Save seller
 /// </summary>
 /// <param name="seller">Seller to save</param>
 public async Task InsertAsync(Seller seller)
 {
     _context.Add(seller);
     await _context.SaveChangesAsync();
 }
Example #4
0
 public async Task InsertAsync(Seller obj)
 {
     //     obj.Department = _context.Department.First();
     _context.Add(obj);
     await _context.SaveChangesAsync();
 }