コード例 #1
0
 public ActionResult Edit([Bind(Include = "PhoneNumber,LastName,FirstName")] TempEmployee tempEmployee)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tempEmployee).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(tempEmployee));
 }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "SubcontractorID,CompanyName,subcontractorPhone,subcontractor_TypeID")] Subcontractor subcontractor)
 {
     if (ModelState.IsValid)
     {
         db.Entry(subcontractor).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(subcontractor));
 }
コード例 #3
0
 public ActionResult Edit([Bind(Include = "username,password")] Admin admin)
 {
     if (ModelState.IsValid)
     {
         db.Entry(admin).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(admin));
 }
コード例 #4
0
 public ActionResult Edit([Bind(Include = "ProjectID,Description,StartDate,EndDate,LocationID")] Project project)
 {
     if (ModelState.IsValid)
     {
         db.Entry(project).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.LocationID = new SelectList(db.Locations, "LocationID", "Description", project.LocationID);
     return(View(project));
 }
コード例 #5
0
 public ActionResult Edit([Bind(Include = "LogID,Clock_In,Clock_Out,HoursWorked,PhoneNumber,LastName,ProjectID,Job_TypeID,SubcontractorID")] TimeLog timeLog)
 {
     if (ModelState.IsValid)
     {
         db.Entry(timeLog).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Job_TypeID      = new SelectList(db.Job_Type, "Job_TypeID", "Description", timeLog.Job_TypeID);
     ViewBag.ProjectID       = new SelectList(db.Projects, "ProjectID", "Description", timeLog.ProjectID);
     ViewBag.SubcontractorID = new SelectList(db.Subcontractors, "SubcontractorID", "CompanyName", timeLog.SubcontractorID);
     return(View(timeLog));
 }