Exemplo n.º 1
0
        public ActionResult AddPhoneCall(int ContactId, int PlaintiffId)
        {
            PhoneCall phoneCall = new PhoneCall();

            Contact contact = db.Contacts.Find(ContactId);
            Plaintiff plaintiff = db.Plaintiffs.Find(PlaintiffId);

            phoneCall.Contact = contact;
            phoneCall.Plaintiff = plaintiff;

            //Add to Database
            //db.PhoneCalls.Add(phoneCallFinal);
            return null;
        }
Exemplo n.º 2
0
        public ActionResult Create(PhoneCall phonecall)
        {
            if (ModelState.IsValid)
            {

                db.PhoneCalls.Add(phonecall);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            //ViewBag.PlaintiffId = new SelectList(db.Plaintiffs, "Id", "FullName", phonecall.PlaintiffId);
            //ViewBag.ContactId = new SelectList(db.Contacts, "Id", "FullName", phonecall.ContactId);
            return View(phonecall);
        }
Exemplo n.º 3
0
 public ActionResult Edit(PhoneCall phonecall)
 {
     if (ModelState.IsValid)
     {
         db.Entry(phonecall).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     ViewBag.ContactId = new SelectList(db.Contacts, "Id", "FirstName", phonecall.ContactId);
     return View(phonecall);
 }