Ejemplo n.º 1
0
        public JsonResult ChangeCRMLeadStatus(CRMActivityViewModel vm)
        {
            var selectedCRMLead = _crmLeadRepository.Get(vm.CRMLeadId);

            if (selectedCRMLead != null)
            {
                selectedCRMLead.LeadStatusId    = vm.StatusId.GetValueOrDefault();
                selectedCRMLead.UpdatedByUserId = WebUser.Id;

                // Send Email Here to Tech Team

                var selectedStatus = _crmLeadStatusRepository.Get(vm.StatusId.GetValueOrDefault());
                // Add it as an Activity
                if (selectedStatus != null)
                {
                    var newActivity = new CRMLeadActivity
                    {
                        Title           = selectedStatus.Name,
                        Comment         = vm.Comment,
                        CRMLeadId       = selectedCRMLead.Id,
                        CreatedByUserId = WebUser.Id
                    };

                    _crmLeadActivityRepository.Create(newActivity);
                }

                _crmLeadRepository.Update(selectedCRMLead);
                _unitOfWork.Commit();
                return(Json(true));
            }

            return(Json(false));
        }
Ejemplo n.º 2
0
        public ActionResult Details(int id)
        {
            var crmLeadStatus = _crmLeadStatusRepository.Get(id);

            return(CheckForNullAndExecute(crmLeadStatus, () => View(crmLeadStatus)));
        }
Ejemplo n.º 3
0
        public ActionResult Get(int id)
        {
            var apiResult = TryExecute(() => _crmLeadStatusRepository.Get(id), "Lead Status fetched sucessfully");

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