public async Task <IActionResult> Create([Bind("CategoryId,Category1")] Category category)
        {
            if (ModelState.IsValid)
            {
                _context.Add(category);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(category));
        }
Пример #2
0
        public async Task <IActionResult> Create([Bind("LoginId,LoginPassword")] Login login)
        {
            if (ModelState.IsValid)
            {
                _context.Add(login);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(login));
        }
Пример #3
0
        public async Task <IActionResult> Create([Bind("UserId,UserPassword,Name,Email,Age,Address,UserPin,UserLocation,DateOfBirth,ContactNumber")] NewUser newUser)
        {
            if (ModelState.IsValid)
            {
                _context.Add(newUser);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(newUser));
        }
Пример #4
0
        public async Task <IActionResult> Create([Bind("AdminId,AdminPassword,Name,Email,Age,Address,DateOfBirth,ContactNumber")] Admin admin)
        {
            if (ModelState.IsValid)
            {
                _context.Add(admin);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(admin));
        }
Пример #5
0
        public async Task <IActionResult> Create([Bind("MerchantId,MerchantPassword,Name,Email,Age,Address,MerchantPin,MerchantLocation,DateOfBirth,ContactNumber")] Merchant merchant)
        {
            if (ModelState.IsValid)
            {
                _context.Add(merchant);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(merchant));
        }
Пример #6
0
        public async Task <IActionResult> Create([Bind("Id,Name,CompanyType,CategoryType,AddedFeatures")] FuturisticApproach futuristicApproach)
        {
            if (ModelState.IsValid)
            {
                _context.Add(futuristicApproach);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CategoryType"] = new SelectList(_context.Categories, "Category1", "Category1", futuristicApproach.CategoryType);
            ViewData["CompanyType"]  = new SelectList(_context.Companies, "Name", "Name", futuristicApproach.CompanyType);
            return(View(futuristicApproach));
        }
        public async Task <IActionResult> Create([Bind("Id,Name,CompanyType,CategoryType,Description")] CustomDesign customDesign)
        {
            if (ModelState.IsValid)
            {
                _context.Add(customDesign);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CategoryType"] = new SelectList(_context.Categories, "Category1", "Category1", customDesign.CategoryType);
            ViewData["CompanyType"]  = new SelectList(_context.Companies, "Name", "Name", customDesign.CompanyType);
            return(View(customDesign));
        }
Пример #8
0
        public async Task <IActionResult> Create([Bind("ProductId,Name,Company,Category,Price,DateOfManufacturing,Colour,Description,EngineType,MileageKmpl,CentralLocking,BrakesType,RearSuspension")] ProductUser productUser)
        {
            if (ModelState.IsValid)
            {
                _context.Add(productUser);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["Category"] = new SelectList(_context.Categories, "Category1", "Category1", productUser.Category);
            ViewData["Company"]  = new SelectList(_context.Companies, "Name", "Name", productUser.Company);
            return(View(productUser));
        }
Пример #9
0
        public async Task <IActionResult> Create([Bind("ServiceCenterId,Name,CompanyType,Location,CategoryType,ContactNumber,Timings,CertifiedBy")] ServiceCenter serviceCenter)
        {
            if (ModelState.IsValid)
            {
                _context.Add(serviceCenter);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CategoryType"] = new SelectList(_context.Categories, "Category1", "Category1", serviceCenter.CategoryType);
            ViewData["CompanyType"]  = new SelectList(_context.Companies, "Name", "Name", serviceCenter.CompanyType);
            return(View(serviceCenter));
        }