public async Task <IActionResult> Create([Bind("SaloonID,SaloonName,SaloonAddress,Contact_Number")] Saloon saloon)
        {
            if (ModelState.IsValid)
            {
                _context.Add(saloon);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(saloon));
        }
        public async Task <IActionResult> Create([Bind("CustomerID,CustomerName,ContactNumber,Expenses,BeauticianID")] Customer customer)
        {
            if (ModelState.IsValid)
            {
                _context.Add(customer);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["BeauticianID"] = new SelectList(_context.Beautician, "BeauticianID", "BeauticianName", customer.BeauticianID);
            return(View(customer));
        }
Example #3
0
        public async Task <IActionResult> Create([Bind("ProductID,ProductName,ExpiryDate,SaloonID")] Product product)
        {
            if (ModelState.IsValid)
            {
                _context.Add(product);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["SaloonID"] = new SelectList(_context.Saloon, "SaloonID", "SaloonName", product.SaloonID);
            return(View(product));
        }
        public async Task <IActionResult> Create([Bind("BeauticianID,BeauticianName,ContactNumber,JoiningDate,Salary,SaloonID")] Beautician beautician)
        {
            if (ModelState.IsValid)
            {
                _context.Add(beautician);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["SaloonID"] = new SelectList(_context.Saloon, "SaloonID", "SaloonName", beautician.SaloonID);
            return(View(beautician));
        }