Ejemplo n.º 1
0
 public ActionResult Create(int companyId)
 {
     Contact contact = new Contact();
     contact.CompanyID = companyId;
     contact.CreatedByUserID = CurrentLoggedInUser.UserID;
     contact.CreatedDate = DateTime.Now;
     ViewBag.PossibleCountries = countryRepository.All;
     ViewBag.PossibleContactProfessionTypes = contactprofessiontypeRepository.All;
     ViewBag.PossibleContactRatingScales = ratingscaleRepository.All;
     return View(contact);
 }
Ejemplo n.º 2
0
 public ActionResult Create(Contact contact,int companyId)
 {
     if (ModelState.IsValid)
     {
         contact.CompanyID = companyId;
         contactRepository.InsertOrUpdate(contact);
         contactRepository.Save();
         return RedirectToAction("Index", new { companyId=companyId });
     }
     else
     {
         ViewBag.PossibleCountries = countryRepository.All;
         ViewBag.PossibleContactProfessionTypes = contactprofessiontypeRepository.All;
         ViewBag.PossibleContactRatingScales = ratingscaleRepository.All;
         return View(contact);
     }
 }
Ejemplo n.º 3
0
 public void InsertOrUpdate(Contact contact)
 {
     if (contact.ContactID == default(int)) {
         // New entity
         context.Contact.Add(contact);
     } else {
         // Existing entity
         context.Entry(contact).State = EntityState.Modified;
     }
 }
Ejemplo n.º 4
0
 public ViewResult Search(Contact searchContact,int companyId)
 {
     if (searchContact != null)
     {
     }
     return View("Index", contactRepository.AllIncluding(companyId,contact => contact.Company, contact => contact.Country, contact => contact.State, contact => contact.ContactProfessionType, contact => contact.ContactRatingScale, contact => contact.CreatedByUser, contact => contact.VerifiedByUser));
 }