public async Task <IActionResult> Create([Bind("ID,EmpName,Dept,Title")] Employee employee) { if (ModelState.IsValid) { _context.Add(employee); await _context.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(employee)); }
public async Task <IActionResult> Create([Bind("ID,ContractName,SignDate,Amount")] Contract contract) { if (ModelState.IsValid) { _context.Add(contract); await _context.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(contract)); }
public async Task <IActionResult> Create([Bind("ID,ProductName,ProductCatalog,ProductModel,ProductParameter,ProductDesc")] Product product) { if (ModelState.IsValid) { _context.Add(product); await _context.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewBag.ProductCatalog = new SelectList(System.Enum.GetValues(typeof(ProductCatalog)), product.ProductCatalog); return(View(product)); }
public async Task <IActionResult> Create([Bind("ID,ProjectName,ProjectType,Province,Region,StartDate,DeliveryDate,Status")] Project project) { if (ModelState.IsValid) { _context.Add(project); await _context.SaveChangesAsync(); return(RedirectToAction("Index")); } EnumDropDownList(null, project.Region, project.Province, null, project.ProjectType, project.Status, null, null, null, null); return(View(project)); }
public async Task <IActionResult> Create([Bind("ID,PartyID,ContactName,Title,Tel,Email")] Contact contact) { if (ModelState.IsValid) { _context.Add(contact); await _context.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewData["PartyID"] = new SelectList(_context.Parties, "ID", "PartyName", contact.PartyID); return(View(contact)); }
public async Task <IActionResult> Create([Bind("ID,PartyName,PartyType")] Party party) { if (ModelState.IsValid) { _context.Add(party); await _context.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewBag.PartyType = new SelectList(System.Enum.GetValues(typeof(PartyType)), party.PartyType); return(View(party)); }