public async Task <IActionResult> Create([Bind("Id,Name")] ProductType productType)
        {
            if (ModelState.IsValid)
            {
                _context.Add(productType);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(productType));
        }
Esempio n. 2
0
        public async Task <IActionResult> Create([Bind("Id,Name,OfficeName")] Employee employee)
        {
            if (ModelState.IsValid)
            {
                _context.Add(employee);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(employee));
        }
        public async Task <IActionResult> Create([Bind("Id,Name,Dec")] Doctor doctor)
        {
            if (ModelState.IsValid)
            {
                _context.Add(doctor);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(doctor));
        }
        public async Task <IActionResult> Create([Bind("Id,Name,RightEyeParam_1,RightEyeParam_2,RightEyeParam_3,LeftEyeParam_1,LeftEyeParam_2,LeftEyeParam_3,DesesaseId")] Patient patient)
        {
            if (ModelState.IsValid)
            {
                _context.Add(patient);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["DesesaseId"] = new SelectList(_context.Desesase, "Id", "Id", patient.DesesaseId);
            return(View(patient));
        }
Esempio n. 5
0
        public async Task <IActionResult> Create([Bind("Id,Name,CurrentStoreValue,ProductCategoryId,ProductTypeId")] Product product)
        {
            if (ModelState.IsValid)
            {
                _context.Add(product);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ProductCategoryId"] = new SelectList(_context.ProductCategorys, "Id", "Name", product.ProductCategoryId);
            ViewData["ProductTypeId"]     = new SelectList(_context.ProductTypes, "Id", "Name", product.ProductTypeId);
            return(View(product));
        }