public ActionResult Edit([Bind(Include = "Id,Name,Salary,Position,TotalSalary")] Employee employee)
 {
     if (ModelState.IsValid)
     {
         db.Entry(employee).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(employee));
 }
示例#2
0
 public ActionResult Edit([Bind(Include = "Id,Electricity,Water,Lunch,Month,TotalBills")] Bill bill)
 {
     if (ModelState.IsValid)
     {
         db.Entry(bill).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(bill));
 }
 public ActionResult Edit([Bind(Include = "Id,RentSpace,Equipments,Month,TotalAdditional")] Additional additional)
 {
     if (ModelState.IsValid)
     {
         db.Entry(additional).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(additional));
 }
示例#4
0
 public ActionResult Edit([Bind(Include = "Id,SponsoredAmount,SellingAmount,EmpId,ClarkId,BillId,AdditionalId,Profit")] Management management)
 {
     if (ModelState.IsValid)
     {
         db.Entry(management).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.AdditionalId = new SelectList(db.Additionals, "Id", "Month", management.AdditionalId);
     ViewBag.BillId       = new SelectList(db.Bills, "Id", "Month", management.BillId);
     ViewBag.ClarkId      = new SelectList(db.Clarks, "Id", "Name", management.ClarkId);
     ViewBag.EmpId        = new SelectList(db.Employees, "Id", "Name", management.EmpId);
     return(View(management));
 }