public async Task <IActionResult> Create([Bind("AdId,StId,StdId,FTId,FeeYear,PaidAmount,Totalfees,Pendingamt")] Admission1 admission1) { if (string.IsNullOrEmpty(HttpContext.Session.GetString("Session1"))) { return(RedirectToAction("UserLogin", "Login")); } if (ModelState.IsValid) { //if(ViewBag.StId1 != null && admission1.StId==null) //{ // admission1.StdId= //} _context.Add(admission1); await _context.SaveChangesAsync(); var routeValues = new RouteValueDictionary { { "ID", admission1.AdId } }; return(RedirectToAction("AdmissionPay", "Admission", routeValues)); // return RedirectToAction(nameof(Index)); } ViewData["FTId"] = new SelectList(_context.FeeType, "FTId", "Feetype1"); ViewData["StId"] = new SelectList(_context.Student, "StId", "StName", admission1.StId); ViewData["StdId"] = new SelectList(_context.Std, "StdId", "Stname", admission1.StdId); return(View(admission1)); }
public async Task <IActionResult> Create([Bind("FTId,Feetype1,FeeYear,TotalFees")] FeeType feeType) { if (string.IsNullOrEmpty(HttpContext.Session.GetString("Session1"))) { return(RedirectToAction("UserLogin", "Login")); } if (ModelState.IsValid) { _context.Add(feeType); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(feeType)); }
public async Task <IActionResult> Create([Bind("StdId,Stname")] Std std) { if (string.IsNullOrEmpty(HttpContext.Session.GetString("Session1"))) { return(RedirectToAction("UserLogin", "Login")); } if (ModelState.IsValid) { _context.Add(std); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(std)); }
public async Task <IActionResult> Create([Bind("AdTId,Term,TermAmount,TermDate,AdYear,FTId")] AdTypeFee adTypeFee) { if (string.IsNullOrEmpty(HttpContext.Session.GetString("Session1"))) { return(RedirectToAction("UserLogin", "Login")); } if (ModelState.IsValid) { _context.Add(adTypeFee); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(adTypeFee)); }
public async Task <IActionResult> Create([Bind("AdId,AdTId,PayDate,Paystatus")] Admissiopay admissiopay) { if (string.IsNullOrEmpty(HttpContext.Session.GetString("Session1"))) { return(RedirectToAction("UserLogin", "Login")); } if (ModelState.IsValid) { _context.Add(admissiopay); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["AdId"] = new SelectList(_context.Admission1, "AdId", "AdId", admissiopay.AdId); ViewData["AdTId"] = new SelectList(_context.AdTypeFee, "AdTId", "AdTId", admissiopay.AdTId); return(View(admissiopay)); }
public void Create(T entity) { context.Add(entity); context.SaveChanges(); }