示例#1
0
 public ActionResult Edit([Bind(Include = "CaseID,NYPTICaseNumber,CountyCaseNumber,InitialContactDate,CountyID,EmployeeID,ContactID,ChargeID,CaseTypeID,CaseStageID,ThreatTypeID," +
                                          "ThreatBeganDate,FactsOfCase,ThreatChargeID,ApprovalStatusID,StatusReasonID,Plan,ClosingLetterReceivedDate,CaseDisposition,WitnessThreatsInDispo,DateFinalTallyReturned,CaseNotes," +
                                          "Dispersal,Active,CreatedDate,StatusReasonOther,NumAdultsMale,NumAdultsFemale,NumChildren,SpecialNeedsYN,FundsPurposeNotes,Link1,Link2,Link3")] Case @case)
 {
     if (ModelState.IsValid)
     {
         @case = AddUpdateCaseTypes(@case, true);
         @case = AddUpdateCaseStage(@case, true);
         @case = AddUpdateCharge(@case, true);
         @case = AddUpdateThreatType(@case, true);
         db.Entry(@case).State = EntityState.Modified;
         db.SaveChanges();
         TempData["UserMessage"] = "Your changes were saved";
         return(RedirectToAction("Edit", "Cases", new { id = @case.CaseID }));
     }
     ViewBag.ApprovalStatusID = new SelectList(db.ApprovalStatus, "ApprovalStatusID", "DisplayName", @case.ApprovalStatusID);
     ViewBag.CaseStageID      = new MultiSelectList(db.CaseStage, "CaseStageID", "DisplayName", @case.CaseStage != null ? @case.CaseStage.Select(c => c.CaseStageID).ToList() : @case.CaseStageID);
     ViewBag.CaseTypeID       = new MultiSelectList(db.CaseType, "CaseTypeID", "DisplayName", @case.CaseType != null ? @case.CaseType.Select(c => c.CaseTypeID).ToList() : @case.CaseTypeID);
     ViewBag.ChargeID         = new MultiSelectList(db.Charge, "ChargeID", "DisplayName", @case.Charge != null ? @case.Charge.Select(c => c.ChargeID).ToList() : @case.ChargeID);
     ViewBag.CountyID         = new SelectList(db.County, "CountyID", "CountyName", @case.CountyID);
     ViewBag.ContactID        = new SelectList(db.Contact, "ContactID", "FullName", @case.ContactID);
     ViewBag.EmployeeID       = new SelectList(db.Employee, "EmployeeID", "Email", @case.EmployeeID);
     ViewBag.ThreatChargeID   = new SelectList(db.ThreatCharge, "ThreatChargeID", "DisplayName", @case.ThreatChargeID);
     ViewBag.ThreatTypeID     = new MultiSelectList(db.ThreatType, "ThreatTypeID", "DisplayName", @case.ThreatType != null ? @case.ThreatType.Select(c => c.ThreatTypeID).ToList() : @case.ThreatTypeID);
     ViewBag.StatusReasonID   = new SelectList(db.StatusReason, "StatusReasonID", "DisplayName", @case.StatusReasonID);
     return(View(@case));
 }
示例#2
0
 public ActionResult Edit([Bind(Include = "EmployeeID,FirstName,LastName,Email,Active")] Employee employee)
 {
     if (ModelState.IsValid)
     {
         db.Entry(employee).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(employee));
 }
 public ActionResult Edit([Bind(Include = "GrantTypeID,DisplayName")] GrantType grantType)
 {
     if (ModelState.IsValid)
     {
         db.Entry(grantType).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(grantType));
 }
示例#4
0
 public ActionResult Edit([Bind(Include = "ContactID,FirstName,LastName,Title,CountyID,Email,PhoneNumberOffice,PhoneNumberMobile,FaxNumber,Active")] Contact contact)
 {
     if (ModelState.IsValid)
     {
         db.Entry(contact).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CountyID = new SelectList(db.County, "CountyID", "CountyName", contact.CountyID);
     return(View(contact));
 }
示例#5
0
 public ActionResult Edit([Bind(Include = "DispersalID,CaseID,DispersalRequestDate,CheckNumber,AmountRequested,DispersalApprovalStatusID,DisperalApprovalStatusReason,AmountApproved,DateSent,DateCleared,AmountReturned,DateReturned,GrantTypeID,DispersalNotes,Active")] Dispersal dispersal)
 {
     if (ModelState.IsValid)
     {
         db.Entry(dispersal).State = EntityState.Modified;
         db.SaveChanges();
         TempData["UserMessage"] = "Your changes were saved";
         return(RedirectToAction("Edit", "Cases", new { id = dispersal.CaseID }));
     }
     ViewBag.GrantTypeID      = new SelectList(db.GrantType, "GrantTypeID", "DisplayName", dispersal.GrantTypeID);
     ViewBag.ApprovalStatusID = new SelectList(db.ApprovalStatus, "ApprovalStatusID", "DisplayName", dispersal.DispersalApprovalStatusID);
     return(View(dispersal));
 }