public ActionResult Edit(AccountDetail accountDetail) { if (ModelState.IsValid) { db.Entry(accountDetail).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CustomerID = new SelectList(db.Customers, "CustomerID", "FirstName", accountDetail.CustomerID); return(View(accountDetail)); }
public ActionResult Edit([Bind(Include = "AccountID,AccountType,CreationDate,Balance,CustomerID,TermDepositID")] AccountDetail accountDetail) { if (ModelState.IsValid) { db.Entry(accountDetail).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CustomerID = new SelectList(db.Customers, "CustomerID", "FirstName", accountDetail.CustomerID); return(View(accountDetail)); }
public ActionResult Edit(RoomAssign roomAssign) { if (AdminSessionControl()) { if (ModelState.IsValid) { var check = _roomAssign.CountRoomAssign(roomAssign); if (check) { ViewBag.DepartmentId = new SelectList(db.Departments, "Id", "DepartmentCode", roomAssign.DepartmentId); ViewBag.Room = new SelectList(db.Rooms, "Id", "RoomNo", roomAssign.RoomId); ViewBag.Day = new SelectList(db.Day, "Id", "DayName", roomAssign.Day); ViewBag.Message = "This Room is Assign for this time "; return(View(roomAssign)); } else { db.Entry(roomAssign).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } } else { ViewBag.DepartmentId = new SelectList(db.Departments, "Id", "DepartmentCode", roomAssign.DepartmentId); ViewBag.Room = new SelectList(db.Rooms, "Id", "RoomNo", roomAssign.RoomId); ViewBag.Day = new SelectList(db.Day, "Id", "DayName", roomAssign.Day); return(View(roomAssign)); } } else { return(AdminLoginFaild()); } }
public async Task <IActionResult> PutKpi([FromRoute] int id, [FromBody] Kpi kpi) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != kpi.Kpiid) { return(BadRequest()); } _context.Entry(kpi).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!KpiExists(id)) { return(NotFound()); } else { throw; } } return(Content("Successfully updated KPI")); }
public async Task <IActionResult> PutAccount([FromRoute] int id, [FromBody] Account account) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != account.AccountId) { return(BadRequest()); } _context.Entry(account).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AccountExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public ActionResult Edit([Bind(Include = "TermDepositID,Deposit,TermCreation")] TermDeposit termDeposit) { if (ModelState.IsValid) { db.Entry(termDeposit).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(termDeposit)); }
public ActionResult Edit([Bind(Include = "Id,Content,StudentId,DepartmentId,BatchId,DateTime,FilePath")] StudentGroupContent studentGroupContent) { if (ModelState.IsValid) { db.Entry(studentGroupContent).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(studentGroupContent)); }
public ActionResult Edit([Bind(Include = "CustomerID,FirstName,LastName,UserID")] Customer customer) { if (ModelState.IsValid) { db.Entry(customer).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(customer)); }
public ActionResult Edit([Bind(Include = "AccountID,AccountClientID,AccountBalance,AccountType,AccountCreationDate")] BankAccountModel bankaccountmodel) { if (ModelState.IsValid) { db.Entry(bankaccountmodel).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(bankaccountmodel)); }
public ActionResult Edit([Bind(Include = "LoanId,LoanAmount,CustomerID")] Loan loan) { if (ModelState.IsValid) { db.Entry(loan).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CustomerID = new SelectList(db.Customers, "CustomerID", "FirstName", loan.CustomerID); return(View(loan)); }
public ActionResult Edit(Admin admin) { if (AdminSessionControl()) { if (ModelState.IsValid) { db.Entry(admin).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(admin)); } else { return(AdminLoginFaild()); } }
public ActionResult Edit([Bind(Include = "Id,RoomNo,Description")] Room room) { if (AdminSessionControl()) { if (ModelState.IsValid) { db.Entry(room).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(room)); } else { return(AdminLoginFaild()); } }
public ActionResult Edit([Bind(Include = "Id,DepartmentCode,DepartmentName")] Department department) { if (AdminSessionControl()) { if (ModelState.IsValid) { db.Entry(department).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(department)); } else { return(AdminLoginFaild()); } }
public ActionResult Edit([Bind(Include = "Id,BatchNo,DepartmentId")] Batch batch) { if (AdminSessionControl()) { if (ModelState.IsValid) { db.Entry(batch).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.DepartmentId = new SelectList(db.Departments, "Id", "DepartmentCode", batch.DepartmentId); return(View(batch)); } else { return(AdminLoginFaild()); } }
public ActionResult Edit([Bind(Include = "Id,BatchId,CourseId,TeacherId,Credit,DepartmentId")] CourseAssign courseAssign) { if (AdminSessionControl()) { if (ModelState.IsValid) { db.Entry(courseAssign).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.DepartmentId = new SelectList(db.Departments, "Id", "DepartmentCode", courseAssign.DepartmentId); return(View(courseAssign)); } else { return(AdminLoginFaild()); } }
public ActionResult Edit(Student student) { if (AdminSessionControl()) { if (ModelState.IsValid) { db.Entry(student).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.DepartmentId = new SelectList(db.Departments, "Id", "DepartmentCode", student.DepartmentId); return(View(student)); } else { return(AdminLoginFaild()); } }
public ActionResult Edit([Bind(Include = "Id,CourseCode,CourseName,Credit,Description,Semester,DepartmentId")] Course course) { if (AdminSessionControl()) { if (ModelState.IsValid) { db.Entry(course).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.DepartmentId = new SelectList(db.Departments, "Id", "DepartmentCode", course.DepartmentId); return(View(course)); } else { return(AdminLoginFaild()); } }
public ActionResult EditByFaculty(ShareContent ShareContent) { if (TeacherSessionControl()) { if (ModelState.IsValid) { db.Entry(ShareContent).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Faculty")); } ViewBag.DepartmentID = new SelectList(db.Departments, "Id", "DepartmentCode", ShareContent.DepartmentID); return(View(ShareContent)); } else { return(TeacherLoginFaild()); } }
public ActionResult Edit(Teacher teacher) { if (AdminSessionControl()) { if (ModelState.IsValid) { teacher.TeacherName = teacher.suffix + " " + teacher.TeacherFName + " " + teacher.TeacherLName; db.Entry(teacher).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(teacher)); } else { return(AdminLoginFaild()); } }
public async Task Update(Account account) { // _loger.Log("Update", LogLevel.Information); context.Entry(account).State = EntityState.Modified; }