public ActionResult DeleteConfirmed(int id)
        {
            Troubleshooter troubleshooter = db.Troubleshooters.Find(id);

            db.Troubleshooters.Remove(troubleshooter);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Beispiel #2
0
 public ActionResult Assign([Bind(Include = "Impactid, TicketId,FaultId,TroubleshooterId,TicketRaisedDate,TicketClosingDate")] ImpactInfo impactInfo)
 {
     if (ModelState.IsValid)
     {
         Troubleshooter troubleshooter = db.Troubleshooters.Find(impactInfo.TroubleshooterId);
         impactInfo.TeamId = troubleshooter.TroubleshooterTeam;
         db.ImpactInfoes.Add(impactInfo);
         db.SaveChanges();
         return(RedirectToAction("Index", "ImpactInfoes"));
     }
     return(View(impactInfo));
 }
 public ActionResult Edit([Bind(Include = "TroubleshooterId,TroubleshooterName,TroubleshooterDesignation,TroubleshooterTeam,TroubleshooterPhoneNo,TroubleshooterExpertise,YearOfExperience,ManagerofTroubleshooter,NumberofSolves")] Troubleshooter troubleshooter)
 {
     if (ModelState.IsValid)
     {
         db.Entry(troubleshooter).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.TroubleshooterDesignation = new SelectList(db.Designations, "DesignationId", "Designation1", troubleshooter.TroubleshooterDesignation);
     ViewBag.TroubleshooterExpertise   = new SelectList(db.FaultTypes, "FaultTypeId", "FaultType1", troubleshooter.TroubleshooterExpertise);
     ViewBag.TroubleshooterTeam        = new SelectList(db.Teams, "TeamId", "TeamName", troubleshooter.TroubleshooterTeam);
     ViewBag.ManagerofTroubleshooter   = new SelectList(db.TroubleshooterManagers, "TroubleshooterManagerId", "ManagerName", troubleshooter.ManagerofTroubleshooter);
     return(View(troubleshooter));
 }
        // GET: Troubleshooters/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Troubleshooter troubleshooter = db.Troubleshooters.Find(id);

            if (troubleshooter == null)
            {
                return(HttpNotFound());
            }
            return(View(troubleshooter));
        }
        // GET: Troubleshooters/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Troubleshooter troubleshooter = db.Troubleshooters.Find(id);

            if (troubleshooter == null)
            {
                return(HttpNotFound());
            }
            ViewBag.TroubleshooterDesignation = new SelectList(db.Designations, "DesignationId", "Designation1", troubleshooter.TroubleshooterDesignation);
            ViewBag.TroubleshooterExpertise   = new SelectList(db.FaultTypes, "FaultTypeId", "FaultType1", troubleshooter.TroubleshooterExpertise);
            ViewBag.TroubleshooterTeam        = new SelectList(db.Teams, "TeamId", "TeamName", troubleshooter.TroubleshooterTeam);
            ViewBag.ManagerofTroubleshooter   = new SelectList(db.TroubleshooterManagers, "TroubleshooterManagerId", "ManagerName", troubleshooter.ManagerofTroubleshooter);
            return(View(troubleshooter));
        }