Exemple #1
0
        public JsonResult ChangeSalesStage(CRMActivityViewModel vm)
        {
            var selectedCRMPotential = _crmPotentialRepository.Get(vm.CRMPotentialId);

            if (selectedCRMPotential != null)
            {
                selectedCRMPotential.SalesStageId    = vm.StatusId.GetValueOrDefault();
                selectedCRMPotential.UpdatedByUserId = WebUser.Id;

                // Send Email Here to Tech Team

                var selectedStatus = _crmSalesStageRepository.Get(vm.StatusId.GetValueOrDefault());
                // Add it as an Activity
                if (selectedStatus != null)
                {
                    var newActivity = new CRMPotentialActivity
                    {
                        Title           = selectedStatus.Name,
                        Comment         = vm.Comment,
                        CRMPotentialId  = selectedCRMPotential.Id,
                        CreatedByUserId = WebUser.Id
                    };

                    _crmPotentialActivityRepository.Create(newActivity);
                }

                _crmPotentialRepository.Update(selectedCRMPotential);
                _unitOfWork.Commit();

                return(Json(true));
            }

            return(Json(false));
        }
Exemple #2
0
        public ActionResult Details(int id)
        {
            var crmSalesStage = _crmSalesSalesStageRepository.Get(id);

            return(CheckForNullAndExecute(crmSalesStage, () => View(crmSalesStage)));
        }
        public ActionResult Get(int id)
        {
            var apiResult = TryExecute(() => _crmSalesStageRepository.Get(id), "Sales Stage fetched sucessfully");

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