Exemplo n.º 1
0
        public ActionResult Details(int id)
        {
            var crmLead = _crmLeadRepository.Get(id, "AssignedToUser.Person");

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

            // Check whether i have access to this Lead details
            var hasAccess = crmLead.AssignedToUserId == WebUser.Id || DoIHaveCRMManageAccess();

            if (!hasAccess)
            {
                return(RedirectToAction("NotAuthorized", "Error", new { area = "" }));
            }

            ViewBag.HasCRMManageAccess = DoIHaveCRMManageAccess();

            var technologies    = _crmLeadTechnologyMapRepository.GetAllBy(r => r.LeadId == crmLead.Id, "Technology").Select(t => t.Technology).ToList();
            var crmLeadStatuses = _crmLeadStatusRepository.GetAll();

            ViewBag.LeadStatusId = new SelectList(crmLeadStatuses, "Id", "Name", crmLead.LeadStatusId);

            var vm = new CRMLeadDetailsViewModel(crmLead)
            {
                Technologies = technologies
            };

            return(View(vm));
        }
Exemplo n.º 2
0
        public JsonResult Index()
        {
            var apiResult = TryExecute(() => _crmLeadStatusRepository.GetAll(), "Lead Statuses Fetched sucessfully");

            return(Json(apiResult, JsonRequestBehavior.AllowGet));
        }