public async Task <IActionResult> Create([Bind("Id,Name,Address")] Manufacturer manufacturer) { if (ModelState.IsValid) { _context.Add(manufacturer); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(manufacturer)); }
public async Task <IActionResult> Create([Bind("TipID,TipMedicament")] Tip tip) { if (ModelState.IsValid) { _context.Add(tip); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(tip)); }
public async Task <IActionResult> Create([Bind("Id,Firstname,Lastname,Certificate")] 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,StartTime,EndTime")] Order order) { if (ModelState.IsValid) { _context.Add(order); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(order)); }
public async Task <IActionResult> Create([Bind("Id,Dosage,Price,Name,Type,Description")] Drug drug) { if (ModelState.IsValid) { _context.Add(drug); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(drug)); }
public async Task <IActionResult> Create([Bind("Id,Name,Address,DoctorForeignKey")] Organization organization) { if (ModelState.IsValid) { _context.Add(organization); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["DoctorForeignKey"] = new SelectList(_context.Doctor, "Id", "Id", organization.DoctorForeignKey); return(View(organization)); }
public async Task <IActionResult> Create([Bind("Id,Firstname,Lastname,DoctorId")] Patient patient) { if (ModelState.IsValid) { _context.Add(patient); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["DoctorId"] = new SelectList(_context.Doctor, "Id", "Id", patient.DoctorId); return(View(patient)); }
public async Task <IActionResult> Create([Bind("ProdusID,NumeMedicament,CategorieID,FurnizorID,Doza,Pret,DataExpirare")] Produs produs) { if (ModelState.IsValid) { _context.Add(produs); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["CategorieID"] = new SelectList(_context.Categorii, "CategorieID", "CategorieID", produs.CategorieID); ViewData["FurnizorID"] = new SelectList(_context.Furnizori, "FurnizorID", "FurnizorID", produs.FurnizorID); return(View(produs)); }
public async Task <IActionResult> Create([Bind("Name,Cnpj,Address,PostCode,Phone,Email")] Supplier supplier) { if (ModelState.IsValid) { _context.Add(supplier); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(supplier)); }
public async Task <IActionResult> Create( [Bind("Id,Name,Description,Price,Batch,Type,SupplierId")] Product product) { if (ModelState.IsValid) { _context.Add(product); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["SupplierId"] = new SelectList(_context.Suppliers, "Id", "Name", product.SupplierId); return(View(product)); }
public async Task <IActionResult> Create([Bind("NumeCategorie")] Categorie categorie) { try { if (ModelState.IsValid) { _context.Add(categorie); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } } catch (DbUpdateException /* ex*/) { ModelState.AddModelError("", "Unable to save changes. " + "Try again, and if the problem persists "); } return(View(categorie)); }
public void Create(Pharmacy pharmacy) { context.Add(pharmacy); }
public void Store(object entity) { _context.Add(entity); }