public ActionResult Edit([Bind(Include = "ToolToRepairId,Type,Manufacturer,Issue,Result,TechnicianId,RepairCaseIdd")] ToolTorepair toolTorepair)
 {
     if (ModelState.IsValid)
     {
         db.Entry(toolTorepair).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.RepairCaseIdd = new SelectList(db.RepairCases, "RepairCaseId", "RepairCaseId", toolTorepair.RepairCaseIdd);
     ViewBag.TechnicianId  = new SelectList(db.Technicians, "TechnicianId", "FirstName", toolTorepair.TechnicianId);
     return(View(toolTorepair));
 }
 public ActionResult Edit([Bind(Include = "RepairCaseId,Note,TechNote,ReceptionDate,CompletionDate,PickUpDate,LatestPickUpDate,Agreement,TechnicianIdd,CustomerIdd")] RepairCase repairCase)
 {
     if (ModelState.IsValid)
     {
         if ((repairCase.TechnicianIdd != null) && (repairCase.Situation == advancement.Registered))
         {
             repairCase.Situation = advancement.InProgress;
         }
         if (repairCase.CompletionDate != null)
         {
             repairCase.Situation = advancement.Finished;
         }
         repairCase.Agreement        = "Agree";
         vtc.Entry(repairCase).State = EntityState.Modified;
         vtc.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(repairCase));
 }