Example #1
0
        public virtual ActionResult EditModel(RoleEditModel model)
        {
            if (!ModelState.IsValid)
            {
                return(PartialView(model));
            }

            try
            {
                var isNew = model.Id <= 0;
                model = _roleService.Save(model);

                if (isNew)
                {
                    ModelState.Clear();
                    model = new RoleEditModel();
                }

                model.FeedbackMessage = FeedbackMessageModel.CreateSuccessMessage("Saved Successfully.");
            }
            catch (Exception ex)
            {
                if (ex.Message == "Duplicate Name")
                {
                    model.FeedbackMessage = FeedbackMessageModel.CreateFailureMessage("A role with same name already exists.");
                }
                else
                {
                    _logger.Error(string.Format("Some error while add/edit role - {0}", model.Name), ex);
                    model.FeedbackMessage = FeedbackMessageModel.CreateFailureMessage("Some Error Occured.");
                }
            }

            return(PartialView(model));
        }
        public ActionResult EditHospitalPartnerCustomer(HospitalPartnerCustomerEditModel model)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    var currentSession = _sessionContext.UserSession.CurrentOrganizationRole;
                    var customer       = Mapper.Map <HospitalPartnerCustomerEditModel, HospitalPartnerCustomer>(model);

                    customer.CareCoordinatorOrgRoleUserId = currentSession.OrganizationRoleUserId;
                    customer.DataRecorderMetaData         = new DataRecorderMetaData(currentSession.OrganizationRoleUserId, DateTime.Now, DateTime.Now);

                    _hospitalPartnerCustomerRepository.Save(customer);

                    var eventCustomer = _eventCustomerRepository.Get(model.EventId, model.CustomerId);

                    SavePcp(model.CustomerId, model.PrimaryCarePhysicianName, currentSession.OrganizationRoleUserId, eventCustomer.Id);

                    model.FeedbackMessage =
                        FeedbackMessageModel.CreateSuccessMessage("The Information updated uccessfully");

                    return(View(model));
                }
                return(View(model));
            }
            catch (Exception ex)
            {
                model.FeedbackMessage =
                    FeedbackMessageModel.CreateFailureMessage("System Failure. Message: " + ex.Message);
                return(View(model));
            }
        }
Example #3
0
        public ActionResult Create(CallQueueEditModel model)
        {
            try
            {
                if (!ModelState.IsValid)
                {
                    return(View(model));
                }
                model = _callQueueService.SaveCallQueue(model, _sessionContext.UserSession.CurrentOrganizationRole.OrganizationRoleUserId);
                var callQueue  = _callQueueRepository.GetById(model.Id);
                var queueCount = _outboundCallQueueService.GetCallQueueCustomers(callQueue).Count;

                ModelState.Clear();
                var newModel = new CallQueueEditModel
                {
                    FeedbackMessage = queueCount > 0
                     ? FeedbackMessageModel.CreateSuccessMessage(string.Format("Call Queue created sucessfully. You can create more call queue or close this page. Based on the Queue created, currently there are {0} records satisfying the criteria(s).", queueCount))
                     : FeedbackMessageModel.CreateWarningMessage(string.Format("Call Queue created sucessfully. You can create more call queue or close this page. Based on the Queue created, currently there are {0} records satisfying the criteria(s).", queueCount))
                };
                return(View(newModel));
            }
            catch (Exception ex)
            {
                model.FeedbackMessage = FeedbackMessageModel.CreateFailureMessage("System Error:" + ex.Message);
                return(View(model));
            }
        }
Example #4
0
        public ActionResult Create(CheckListTemplateEditModel model)
        {
            try
            {
                var newModel     = _checkListTemplateService.GetbyId(model.Id);
                var questionsIds = model.Questions != null && model.Questions.Any() ? model.Questions.Select(x => x.Id) : null;

                newModel.Questions.ForEach(x => { x.IsSelected = questionsIds != null && questionsIds.Contains(x.Id) ? true : false; });
                model.Questions = newModel.Questions;

                if (ModelState.IsValid)
                {
                    _checkListTemplateService.SaveTemplate(model, _sessionContext.UserSession.CurrentOrganizationRole.OrganizationRoleUserId);

                    model.FeedbackMessage = FeedbackMessageModel.CreateSuccessMessage("Template is created successfully. You can create more templates or close this page.");
                    return(View(model));
                }
                return(View(model));
            }
            catch (Exception ex)
            {
                model.FeedbackMessage = FeedbackMessageModel.CreateFailureMessage("System Error:" + ex);
                return(View(model));
            }
        }
Example #5
0
        public ActionResult AccountMemberVerificationForm(AccountVerificationEditModel model)
        {
            if (!ModelState.IsValid)
            {
                return(PartialView(model));
            }
            var isCustomerVerified = _customerRepository.IsCustomerVerified(model);

            if (isCustomerVerified)
            {
                var customer = _customerRepository.GetCustomer(model.CustomerId);
                model.FirstName     = customer.Name.FirstName;
                model.LastName      = customer.Name.LastName;
                model.DateOfBirth   = customer.DateOfBirth.HasValue ? customer.DateOfBirth.Value : (DateTime?)null;
                model.CustomerEmail = customer.Email.ToString();
                model.MemberId      = customer.InsuranceId;
                model.ZipCode       = customer.Address.ZipCode.Zip;
            }


            model.FeedbackMessage = isCustomerVerified
                ? FeedbackMessageModel.CreateSuccessMessage("Verification Success")
                : FeedbackMessageModel.CreateFailureMessage(string.Format("Unable to verify your information. Please call us as {0} for any queries.", _settings.PhoneTollFree));

            return(PartialView(model));
        }
Example #6
0
        public ActionResult Edit(CampaignEditModel model)
        {
            try
            {
                var orgRoleId = _sessionContext.UserSession.CurrentOrganizationRole.OrganizationRoleUserId;

                if (ModelState.IsValid)
                {
                    if (!IsAlreadyPublished(model.CampaignId))
                    {
                        _campaignService.Save(model, orgRoleId);
                        model.FeedbackMessage = FeedbackMessageModel.CreateSuccessMessage("Campaign updated successfully");
                    }

                    else
                    {
                        model.FeedbackMessage = FeedbackMessageModel.CreateFailureMessage("Campaign has been already published");
                    }


                    //return RedirectToAction("ManageCampaign");
                }
            }
            catch (Exception ex)
            {
                model.FeedbackMessage = FeedbackMessageModel.CreateFailureMessage("Some Error occured while saving your record");
                logger.Error("Message: " + ex.Message + " stack Trace: " + ex.StackTrace);
            }

            return(View(model));
        }
        public HealthPlanRevenueEditModel SaveHealthPlanRevenue(HealthPlanRevenueEditModel model, long createdBy)
        {
            var healthPlanRevenue  = _healthPlanRevenueFactory.MapHealthPlanRevenueInfo(model, createdBy);
            var helathPlanPrevious = _healthPlanRevenueRepository.GetHealthPlanRevenuesId(model.HealthPlanId);

            if (helathPlanPrevious != null && helathPlanPrevious.Any())
            {
                foreach (var revenue in helathPlanPrevious)
                {
                    if (revenue.DateFrom >= model.DateFrom.Value)
                    {
                        _healthPlanRevenueRepository.DeleteRevenue(revenue.Id);
                    }
                    else if (revenue.DateTo == null)
                    {
                        _healthPlanRevenueRepository.UpdatePreviousHealthPlanRevenue(model.DateFrom.Value, revenue.Id);
                    }
                    else if (revenue.DateTo.HasValue && revenue.DateTo.Value >= model.DateFrom.Value && revenue.DateTo.Value <= DateTime.Today)
                    {
                        _healthPlanRevenueRepository.UpdatePreviousHealthPlanRevenue(model.DateFrom.Value, revenue.Id);
                    }
                }
            }

            var healthPlanSaved        = _healthPlanRevenueRepository.Save(healthPlanRevenue);
            var healthPlanRevenueItems = _healthPlanRevenueFactory.MapHealthPlanRevenueItemInfo(model, healthPlanSaved.Id);

            foreach (var item in healthPlanRevenueItems)
            {
                _healthPlanRevenueItemRepository.Save(item);
            }

            model.FeedbackMessage = FeedbackMessageModel.CreateSuccessMessage("Health Plan Revenue Saved Successfully.");
            return(model);
        }
        public ActionResult Edit(HospitalFacilityEditModel model)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    model.OrganizationEditModel.LogoImage = FileObject(model.OrganizationEditModel.Name, "organization_logo", _mediaRepository.GetOrganizationLogoImageFolderLocation(), model.OrganizationEditModel.LogoImage != null ? model.OrganizationEditModel.LogoImage.Id : 0);
                    model.ResultLetterFile = FileObject(model.OrganizationEditModel.Name, "result_letter", _mediaRepository.GetOrganizationResultLetterFolderLocation(), model.ResultLetterFile != null ? model.ResultLetterFile.Id : 0);

                    model.OrganizationEditModel.OrganizationType = OrganizationType.HospitalFacility;
                    _organizationService.CreateHospitalFacility(model);

                    model.FeedbackMessage = FeedbackMessageModel.CreateSuccessMessage(string.Format("The hospital facility {0} was saved successfully.", model.OrganizationEditModel.Name));

                    return(View(model));
                }

                return(View(model));
            }
            catch (Exception ex)
            {
                model.FeedbackMessage = FeedbackMessageModel.CreateFailureMessage("System Failure. Message: " + ex.Message);
                return(View(model));
            }
        }
Example #9
0
        public ActionResult ResultConfigModel(ResultConfigEditModel model)
        {
            try
            {
                model.RecordableTests = _testRepository.GetRecordableTests();

                if (!ModelState.IsValid)
                {
                    return(PartialView(model));
                }

                _corporateAccountService.SaveAccountResultConfig(model);

                model.FeedbackMessage = FeedbackMessageModel.CreateSuccessMessage("Updated Successfully");
            }
            catch (Exception exception)
            {
                _logger.Error(string.Format("Error While Updating {0} \n message: {1} \n stack Trace: {2} ",
                                            model.AccountId, exception.Message, exception.StackTrace));

                model.FeedbackMessage = FeedbackMessageModel.CreateFailureMessage("Some Error Occured");
            }

            return(PartialView(model));
        }
Example #10
0
        public ActionResult Create(EmailTemplateEditModel model)
        {
            if (!ModelState.IsValid)
            {
                var templateMacros = _emailTemplateService.GetMacrosForNotificationTypeId(model.NotificationTypeId);

                model.TemplateMacros = templateMacros.Select(tm => tm.IdentifierName).OrderBy(t => t);
                return(View(model));
            }

            try
            {
                if (model.Id > 0)
                {
                    model = _emailTemplateService.Save(model, _sessionContext.UserSession.CurrentOrganizationRole.OrganizationRoleUserId);
                }
                else
                {
                    model = _emailTemplateService.SaveNewTemplate(model, _sessionContext.UserSession.CurrentOrganizationRole.OrganizationRoleUserId);
                }

                model.FeedbackMessage = FeedbackMessageModel.CreateSuccessMessage("Template Created successfully!");
                ModelState.Clear();
            }
            catch (Exception ex)
            {
                var templateMacros = _emailTemplateService.GetMacrosForNotificationTypeId(model.NotificationTypeId);
                model.TemplateMacros = templateMacros.Select(tm => tm.IdentifierName).OrderBy(t => t);

                model.FeedbackMessage = FeedbackMessageModel.CreateFailureMessage(string.Concat("System Failure! Message: ", ex.Message));
            }

            return(View(model));
        }
        public ActionResult Create(StaffEventRoleEditModel staffEventRoleEditModel)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    var staffEventRole = Mapper.Map <StaffEventRoleEditModel, StaffEventRole>(staffEventRoleEditModel);

                    if (staffEventRole.Id == 0)
                    {
                        staffEventRole.DataRecorderMetaData = new DataRecorderMetaData()
                        {
                            DataRecorderCreator = Mapper.Map <OrganizationRoleUserModel, OrganizationRoleUser>(
                                _sessionContext.UserSession.CurrentOrganizationRole),
                            DateCreated = DateTime.Now
                        };
                    }
                    _staffEventRoleRepository.Save(staffEventRole);

                    var newModel = new StaffEventRoleEditModel(_testRepository);
                    newModel.FeedbackMessage = FeedbackMessageModel.CreateSuccessMessage("Staff Event Role created succesfully.");
                    return(View(newModel));
                }
                staffEventRoleEditModel.Tests = _testRepository.GetAll();
                return(View(staffEventRoleEditModel));
            }
            catch (Exception exception)
            {
                staffEventRoleEditModel.Tests           = _testRepository.GetAll();
                staffEventRoleEditModel.FeedbackMessage = FeedbackMessageModel.CreateFailureMessage("System Error:" + exception);
                return(View(staffEventRoleEditModel));
            }
        }
Example #12
0
        public ActionResult BasicInfoModel(CorporateAccountBasicInfoEditModel model)
        {
            if (!ModelState.IsValid)
            {
                return(PartialView(model));
            }

            try
            {
                model = _corporateAccountService.SaveAccountInfo(model);
                model.FeedbackMessage = FeedbackMessageModel.CreateSuccessMessage("Saved Successfully");
            }
            catch (Exception exception)
            {
                _logger.Error(
                    string.Format(
                        "While {0} organization Error Occured Organization Id {1}, \n message: {2} \n stack Trace {3}",
                        (model.IsNew ? "Created" : "Updated"), model.OrganizationEditModel.Id, exception.Message,
                        exception.StackTrace));

                model.FeedbackMessage = FeedbackMessageModel.CreateFailureMessage("Some error Occured while saving");
            }

            return(PartialView(model));
        }
Example #13
0
        public ActionResult Create(ContentEditModel model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            try
            {
                model = _contentService.SaveModel(model, _sessionContext.UserSession.CurrentOrganizationRole.OrganizationRoleUserId);
                model = new ContentEditModel
                {
                    FeedbackMessage = FeedbackMessageModel.CreateSuccessMessage("Content Saved successfully! Create another.")
                };

                ModelState.Clear();

                return(View(model));
            }
            catch (Exception ex)
            {
                model.FeedbackMessage =
                    FeedbackMessageModel.CreateFailureMessage(string.Format("System Failure! Message: {0}", ex.Message));
                _logger.Info(string.Format("Create New Content {0}!  Message: {1} \nStackTrace: {2}", model.Title, ex.Message, ex.StackTrace));
                return(View(model));
            }
        }
 public ActionResult CustomerActivityTypeUpload(string message)
 {
     return(View(new CustomerActivityTypeUploadViewModel()
     {
         FeedbackMessage = !string.IsNullOrWhiteSpace(message) ? FeedbackMessageModel.CreateSuccessMessage(message) : null
     }));
 }
 public ActionResult CreateCustomTag(CustomTagEditViewModel model)
 {
     if (ModelState.IsValid)
     {
         try
         {
             var orgId = _sessionContext.UserSession.CurrentOrganizationRole.OrganizationRoleUserId;
             if (model.TagId > 0)
             {
                 _customTagService.UpdateCustomeTag(model);
             }
             else
             {
                 _customTagService.SaveCustomeTag(model, orgId);
             }
             model.FeedbackMessage = FeedbackMessageModel.CreateSuccessMessage("CustomTag has been saved successfully!");
         }
         catch (Exception ex)
         {
             model.FeedbackMessage = FeedbackMessageModel.CreateFailureMessage(string.Format("System Failure! Message: {0}", ex.Message));
             _logger.Info(string.Format("New CustomTag {0}!  Message: {1} \nStackTrace: {2}", model.CustomTag, ex.Message, ex.StackTrace));
         }
     }
     return(View(model));
 }
Example #16
0
        private void Save(SourceCodeEditModel model)
        {
            try
            {
                var  sourceCode = Mapper.Map <SourceCodeEditModel, SourceCode>(model);
                bool forEdit    = false;
                if (model.Id > 0)
                {
                    forEdit = true;
                    var sourceCodeInDb = _sourceCodeRepository.GetSourceCodeById(model.Id);
                    sourceCode.DataRecorderMetaData = sourceCodeInDb.DataRecorderMetaData;
                    sourceCode.DataRecorderMetaData.DataRecorderModifier = new OrganizationRoleUser(_sessionContext.UserSession.CurrentOrganizationRole.OrganizationRoleUserId);
                    sourceCode.DataRecorderMetaData.DateModified         = DateTime.Now;
                }
                else
                {
                    sourceCode.DataRecorderMetaData = new DataRecorderMetaData(_sessionContext.UserSession.CurrentOrganizationRole.OrganizationRoleUserId, DateTime.Now, null)
                    {
                        DataRecorderModifier = null
                    };
                }

                _sourceCodeRepository.SaveSourceCode(sourceCode);
                model.FeedbackMessage =
                    FeedbackMessageModel.CreateSuccessMessage("Source Code " + (forEdit ? "edited" : "created") +
                                                              " successfully!");
            }
            catch (Exception ex)
            {
                model.FeedbackMessage =
                    FeedbackMessageModel.CreateFailureMessage("System Failure! Message: " + ex.Message);
            }
        }
Example #17
0
        public ActionResult Create(MedicalVendorEditModel model)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    model.OrganizationEditModel.LogoImage = FileObject(model.OrganizationEditModel.Name, "organization_logo", _mediaRepository.GetOrganizationLogoImageFolderLocation());
                    model.ResultLetterCoBrandingFile      = FileObject(model.OrganizationEditModel.Name, "result_letter", _mediaRepository.GetOrganizationResultLetterFolderLocation());

                    model.DoctorLetterFile = FileObject(model.OrganizationEditModel.Name, "doctor_letter", _mediaRepository.GetOrganizationDoctorLetterFolderLocation());

                    model.OrganizationEditModel.OrganizationType = OrganizationType.MedicalVendor;
                    _organizationService.CreateMedicalVendor(model);

                    var newModel = new MedicalVendorEditModel();
                    SetPackageAndTerritory(newModel);

                    newModel.FeedbackMessage =
                        FeedbackMessageModel.CreateSuccessMessage(string.Format("The medical vendor {0} was saved successfully. You can add more medical vendors from here.", model.OrganizationEditModel.Name));

                    return(View(newModel));
                }
                SetPackageAndTerritory(model);
                return(View(model));
            }
            catch (Exception ex)
            {
                SetPackageAndTerritory(model);
                model.FeedbackMessage = FeedbackMessageModel.CreateFailureMessage("System Failure. Message: " + ex.Message);
                return(View(model));
            }
        }
Example #18
0
        public ActionResult Create(PackageEditModel model)
        {
            try
            {
                var tests = _testRepository.GetAll();
                model.AllTests      = Mapper.Map <IEnumerable <Test>, IEnumerable <TestViewModel> >(tests);
                model.AllRoles      = _userService.GetRoleswithRegistrationEnabled();
                model.SelectedTests = GetDefaultSelectedTests(tests.Where(x => x.IsDefaultSelectionForPackage), model.SelectedTests);
                if (ModelState.IsValid)
                {
                    model.ForOrderDisplayFile = FileObject(model.Name.Replace(" ", "_").Replace("+", "_"), "package_image", _mediaRepository.GetPackageImageFolderLocation());
                    SavePackage(model);
                    model.FeedbackMessage = FeedbackMessageModel.CreateSuccessMessage("Package is created successfully. You can create more packages or close this page.");

                    return(View(model));
                }

                return(View(model));
            }
            catch (Exception ex)
            {
                model.FeedbackMessage = FeedbackMessageModel.CreateFailureMessage("System Error:" + ex);
                return(View(model));
            }
        }
Example #19
0
        public ActionResult ChangeUserName(UserNameEditModel model)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    var userLoginRepository = IoC.Resolve <IUserLoginRepository>();
                    var userNameUpdated     = userLoginRepository.UpdateUserName(model.UserId, model.UserName);

                    if (userNameUpdated)
                    {
                        var notifier = IoC.Resolve <INotifier>();
                        var emailNotificationModelsFactory = IoC.Resolve <IEmailNotificationModelsFactory>();
                        var currentSession = IoC.Resolve <ISessionContext>().UserSession;

                        var customerRepository = IoC.Resolve <ICustomerRepository>();
                        var customer           = customerRepository.GetCustomerByUserId(model.UserId);

                        var welcomeEmailViewModel = emailNotificationModelsFactory.GetWelcomeWithUserNameNotificationModel(model.UserName, customer.Name.FullName, customer.DateCreated);
                        notifier.NotifySubscribersViaEmail(NotificationTypeAlias.CustomerWelcomeEmailWithUsername, EmailTemplateAlias.CustomerWelcomeEmailWithUsername, welcomeEmailViewModel, model.UserId, currentSession.CurrentOrganizationRole.OrganizationRoleUserId, Request.Url.AbsolutePath);

                        model.FeedbackMessage = FeedbackMessageModel.CreateSuccessMessage("User Name updated uccessfully");

                        return(View(model));
                    }
                }
                return(View(model));
            }
            catch (Exception ex)
            {
                model.FeedbackMessage =
                    FeedbackMessageModel.CreateFailureMessage("System Failure. Message: " + ex.Message);
                return(View(model));
            }
        }
Example #20
0
 public ActionResult AssignPhysicianToCustomer(PhysicianCustomerAssignmentEditModel model)
 {
     if (ModelState.IsValid)
     {
         try
         {
             var physicianCustomerAssignment =
                 Mapper.Map <PhysicianCustomerAssignmentEditModel, PhysicianCustomerAssignment>(model);
             physicianCustomerAssignment.DataRecorderMetaData = new DataRecorderMetaData
             {
                 DataRecorderCreator = Mapper.Map <OrganizationRoleUserModel, OrganizationRoleUser>(
                     _sessionContext.UserSession.CurrentOrganizationRole),
                 DateCreated = DateTime.Now
             };
             _physicianCustomerAssignmentRepository.Save(physicianCustomerAssignment);
             model.FeedbackMessage    = FeedbackMessageModel.CreateSuccessMessage("Physicians assigned successfully");
             model.AssignedPhysicians = _physicianAssignmentService.GetPhysiciansAssignedToCustomer(model.EventCustomerId);
         }
         catch (Exception exception)
         {
             model.FeedbackMessage = FeedbackMessageModel.CreateFailureMessage("System Error:" + exception.Message);
             return(View(model));
         }
     }
     return(View(model));
 }
        public ActionResult Edit(StaffEventRoleEditModel staffEventRoleEditModel)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    var staffEventRole = Mapper.Map <StaffEventRoleEditModel, StaffEventRole>(staffEventRoleEditModel);

                    var inDbStaffEventRole = _staffEventRoleRepository.GetById(staffEventRole.Id);
                    staffEventRole.DataRecorderMetaData = inDbStaffEventRole.DataRecorderMetaData;

                    staffEventRole.DataRecorderMetaData.DataRecorderModifier = Mapper.Map <OrganizationRoleUserModel, OrganizationRoleUser>(
                        _sessionContext.UserSession.CurrentOrganizationRole);
                    staffEventRole.DataRecorderMetaData.DateModified = DateTime.Now;

                    staffEventRole                          = _staffEventRoleRepository.Save(staffEventRole);
                    staffEventRoleEditModel                 = Mapper.Map <StaffEventRole, StaffEventRoleEditModel>(staffEventRole);
                    staffEventRoleEditModel.Tests           = _testRepository.GetAll();
                    staffEventRoleEditModel.FeedbackMessage =
                        FeedbackMessageModel.CreateSuccessMessage("Staff Event Role edited succesfully.");
                }
                staffEventRoleEditModel.Tests = _testRepository.GetAll();
                return(View(staffEventRoleEditModel));
            }
            catch (Exception exception)
            {
                staffEventRoleEditModel.Tests           = _testRepository.GetAll();
                staffEventRoleEditModel.FeedbackMessage = FeedbackMessageModel.CreateFailureMessage("System Error:" + exception);
                return(View(staffEventRoleEditModel));
            }
        }
Example #22
0
        public ActionResult Edit(PodEditModel podEditModel)
        {
            try
            {
                podEditModel.Territories = _territoryRepository.GetAllTerritoriesIdNamePair(TerritoryType.Pod);
                podEditModel.Tests       = _testRepository.GetAll();
                if (ModelState.IsValid)
                {
                    var pod     = Mapper.Map <PodEditModel, Pod>(podEditModel);
                    var podInDb = _podRepository.GetById(pod.Id);
                    pod.DataRecorderMetaData = podInDb.DataRecorderMetaData;

                    pod.DataRecorderMetaData.DataRecorderModifier =
                        Mapper.Map <OrganizationRoleUserModel, OrganizationRoleUser>(_sessionContext.UserSession.CurrentOrganizationRole);
                    pod.DataRecorderMetaData.DateModified = DateTime.Now;

                    using (var scope = new TransactionScope())
                    {
                        pod = _podRepository.Save(pod);

                        var podTeam = new List <PodStaff>();
                        podEditModel.DefaultStaffAssigned.ToList().ForEach(dsa =>
                        {
                            var teamMember   = Mapper.Map <PodStaffEditModel, PodStaff>(dsa);
                            teamMember.PodId = pod.Id;
                            teamMember.DataRecorderMetaData = new DataRecorderMetaData()
                            {
                                DataRecorderCreator = Mapper.Map <OrganizationRoleUserModel, OrganizationRoleUser>(_sessionContext.UserSession.CurrentOrganizationRole),
                                DateCreated         = DateTime.Now
                            };
                            podTeam.Add(teamMember);
                        });

                        ((IPodRepository)_podRepository).SavePodTerritories(podEditModel.AssignedTerritories,
                                                                            pod.Id);

                        // Need to check the DefaultPodTeam Issue.
                        podTeam = _podStaffAssignmentRepository.SaveMultiple(podTeam, pod.Id).ToList();

                        _podService.SavePodRooms(podEditModel.Rooms, pod.Id);
                        scope.Complete();
                    }

                    var newModel = _podService.GetPodEditModel(podEditModel.Id);

                    newModel.FeedbackMessage =
                        FeedbackMessageModel.CreateSuccessMessage(
                            "The POD was edited successfully. You can edit it for more changes or close this page.");

                    return(View(newModel));
                }
                return(View(podEditModel));
            }
            catch (Exception exception)
            {
                podEditModel.FeedbackMessage = FeedbackMessageModel.CreateFailureMessage("System Error:" + exception);
                return(View(podEditModel));
            }
        }
        public JsonResult RegenerateHealthPlanCriteria(long criteriaId)
        {
            _healthPlanCallQueueCriteriaRepository.RegenerateHealthPlanCriteria(criteriaId, _sessionContext.UserSession.CurrentOrganizationRole.OrganizationRoleUserId);

            var feedback = FeedbackMessageModel.CreateSuccessMessage("Health Plan Criteria Regenerated.");

            return(Json(feedback, JsonRequestBehavior.AllowGet));
        }
Example #24
0
        public ActionResult Edit(PayPeriodEditModel model)
        {
            if (ModelState.IsValid)
            {
                _payPeriodService.Save(model, _sessionContext.UserSession.CurrentOrganizationRole.OrganizationRoleUserId);
                model.FeedbackMessage = FeedbackMessageModel.CreateSuccessMessage("Pay Period Saved Successfully.");
            }

            return(View(model));
        }
Example #25
0
        public ActionResult Create(string message)
        {
            var userCreateModel = new UserEditModel();

            SetTestsAndPodsForPhysicianProfile(userCreateModel);
            if (message != null)
            {
                userCreateModel.FeedbackMessage = FeedbackMessageModel.CreateSuccessMessage(message);
            }
            return(View(userCreateModel));
        }
        public ActionResult Edit(long criteriaId, bool isSuccessfull = false)
        {
            var model = _healthPlanCallQueueCriteriaService.GetCriteriaEditModel(criteriaId);

            if (isSuccessfull)
            {
                model.FeedbackMessage = FeedbackMessageModel.CreateSuccessMessage("Criteria updated and queue will be regenerated");
            }

            return(View(model));
        }
        public ActionResult HealthPlanRevenueConfigModel(HealthPlanRevenueEditModel model)
        {
            if (ModelState.IsValid)
            {
                _healthPlanRevenueService.SaveHealthPlanRevenue(model, _sessionContext.UserSession.CurrentOrganizationRole.OrganizationRoleUserId);
                model.FeedbackMessage = FeedbackMessageModel.CreateSuccessMessage("Health Plan Revenue Saved Successfully.");
            }

            model.PackageMasterList = _healthPlanRevenueService.GetHealthPlansPackages(model.HealthPlanId);
            model.TestMasterList    = _healthPlanRevenueService.GetHealthPlansTests(model.HealthPlanId);
            return(PartialView("HealthPlanRevenueConfigModel", model));
        }
        public ActionResult EligibilityUpload(string message)
        {
            var model = new CustomerEligibilityUploadEditModel
            {
                SampleCsvMediaUrl = _mediaRepository.GetSamplesLocation().Url
            };

            if (message != null)
            {
                model.FeedbackMessage = FeedbackMessageModel.CreateSuccessMessage(message);
            }
            return(View(model));
        }
Example #29
0
        public ActionResult ScheduleUpload(string message)
        {
            var model = new StaffEventScheduleUploadViewModel
            {
                SampleCsvMediaUrl = _mediaRepository.GetSamplesLocation().Url + "StaffEventScheduleUploadSample.csv",
                SampleRoleUrl     = _mediaRepository.GetSamplesLocation().Url + "StaffEventScheduleRoleSample.csv"
            };

            if (message != null)
            {
                model.FeedbackMessage = FeedbackMessageModel.CreateSuccessMessage(message);
            }
            return(View(model));
        }
Example #30
0
        public ActionResult RegistrationConfigModel(RegistrationConfigEditModel model)
        {
            if (ModelState.IsValid)
            {
                var validClinicalTemplate = false;
                if (!model.AskClinicalQuestions && model.OldClinicalQuestionTemplateId == 0)
                {
                    validClinicalTemplate = true;
                }
                else if (model.AskClinicalQuestions && model.OldClinicalQuestionTemplateId == 0 && model.ClinicalQuestionTemplateId > 0)
                {
                    validClinicalTemplate = true;
                }
                else if (model.AskClinicalQuestions && model.OldClinicalQuestionTemplateId > 0 && model.ClinicalQuestionTemplateId > 0 && model.OldClinicalQuestionTemplateId == model.ClinicalQuestionTemplateId)
                {
                    validClinicalTemplate = true;
                }
                else if (model.AskClinicalQuestions && model.OldClinicalQuestionTemplateId > 0 && model.ClinicalQuestionTemplateId > 0 && model.OldClinicalQuestionTemplateId != model.ClinicalQuestionTemplateId)
                {
                    validClinicalTemplate = _corporateAccountService.CheckCanChangeClinicalTemplate(model.AccountId);
                }
                else if (!model.AskClinicalQuestions && model.OldClinicalQuestionTemplateId > 0)
                {
                    validClinicalTemplate = _corporateAccountService.CheckCanChangeClinicalTemplate(model.AccountId);
                }

                if (validClinicalTemplate)
                {
                    var orgRoleId = _sessionContext.UserSession.CurrentOrganizationRole.OrganizationRoleUserId;

                    _corporateAccountService.SaveAccountRegistrationInfo(model, orgRoleId);

                    model = _corporateAccountService.GetRegistrationConfig(model.AccountId);

                    model.FeedbackMessage = FeedbackMessageModel.CreateSuccessMessage("Updated Successfully");
                }
                else
                {
                    model.FeedbackMessage = FeedbackMessageModel.CreateFailureMessage("Clinical template can not be changed/removed.");
                    _corporateAccountService.BindDefaultRegistrationData(model);
                }
            }
            else
            {
                _corporateAccountService.BindDefaultRegistrationData(model);
            }

            return(PartialView(model));
        }