Exemplo n.º 1
0
        // GET: Pages/ContactInfo

        public ActionResult Details(int?id, int?ad)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            var coContacts = db.GetContactInfoByContactID(id, base.siteusercompanyid).FirstOrDefault();

            if (coContacts == null)
            {
                return(HttpNotFound());
            }

            ViewBag.Country        = db.SiteCountries;
            ViewBag.Activities     = db.GetActivitiesByContactID(id);
            ViewBag.ContactCustoms = db.GetContactCustomFieldsBySiteCoID(base.siteusercompanyid).FirstOrDefault();
            if (coContacts.IsVendor != true)
            {
                ViewBag.Projects = db.GetProjectsByContactID(id);
            }
            if (coContacts.IsVendor == true)
            {
                ViewBag.POR = db.GetPORByContactID(id);
            }
            ViewBag.Relationships = db.GetContactRelationshipsByContactID(id);
            //ViewBag.ContactTypes = db.GetContactTypesBySiteCoID(id);
            //ViewBag.ContactSubTypes = db.GetContactSubTypesBySiteCoID(id, ad);

            return(View("details", coContacts));
        }