public async Task <IActionResult> Create([Bind("MedicineId,MedicineName,Category,UnitPrice,AvailableQuantity,StoredDate")] MedicinesStored medicinesStored) { if (ModelState.IsValid) { _context.Add(medicinesStored); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(medicinesStored)); }
public async Task <IActionResult> Create([Bind("UserId,UserName,Pwd,Age,RegisteredDate")] Users users) { if (ModelState.IsValid) { _context.Add(users); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(users)); }
public async Task <IActionResult> Create([Bind("ManagerId,ManagerName,Pwd")] Manager manager) { if (ModelState.IsValid) { _context.Add(manager); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(manager)); }
public async Task <IActionResult> Create([Bind("PharmacistId,PharmacistName,HiredBy,HiredDate,Pwd")] Pharmacist pharmacist) { if (ModelState.IsValid) { _context.Add(pharmacist); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["HiredBy"] = new SelectList(_context.Manager, "ManagerId", "ManagerName", pharmacist.HiredBy); return(View(pharmacist)); }
public async Task <IActionResult> Create([Bind("ComplaintId,ComplaintBy,ComplaintOn,ComplaintDate,CompaintText")] UserCompliants userCompliants) { if (ModelState.IsValid) { _context.Add(userCompliants); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["ComplaintBy"] = new SelectList(_context.Users, "UserId", "Pwd", userCompliants.ComplaintBy); ViewData["ComplaintOn"] = new SelectList(_context.MedicinesStored, "MedicineId", "Category", userCompliants.ComplaintOn); return(View(userCompliants)); }
public async Task <IActionResult> Create([Bind("SoldId,SoldBy,SoldMedicine,SoldDate,SoldTo")] MedicinesSold medicinesSold) { if (ModelState.IsValid) { _context.Add(medicinesSold); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["SoldBy"] = new SelectList(_context.Pharmacist, "PharmacistId", "PharmacistName", medicinesSold.SoldBy); ViewData["SoldMedicine"] = new SelectList(_context.MedicinesStored, "MedicineId", "Category", medicinesSold.SoldMedicine); ViewData["SoldTo"] = new SelectList(_context.Users, "UserId", "Pwd", medicinesSold.SoldTo); return(View(medicinesSold)); }