Beispiel #1
0
        /// <summary>
        /// Gets the contract basic information.
        /// </summary>
        /// <param name="contractBasicInfo">The contract basic information.</param>
        /// <param name="parentId">The parent unique identifier.</param>
        /// <param name="facilityId">The facility unique identifier.</param>
        /// <param name="nodeId">The node unique identifier.</param>
        /// <returns></returns>
        /// <exception cref="System.NotImplementedException"></exception>
        private ContractBasicInfoViewModel GetContractBasicInfo(Shared.Models.Contract contractBasicInfo, long?parentId, int facilityId, long?nodeId)
        {
            ContractBasicInfoViewModel contractBasicInfoViewModel = AutoMapper.Mapper.Map <Shared.Models.Contract, ContractBasicInfoViewModel>(contractBasicInfo);

            if (contractBasicInfo.Payers != null && contractBasicInfo.Payers.Count > 0)
            {
                contractBasicInfoViewModel.ParentId           = parentId;
                contractBasicInfoViewModel.FacilityId         = facilityId;
                contractBasicInfoViewModel.NodeId             = nodeId;
                contractBasicInfoViewModel.AvailablePayerList = new List <ContractPayerViewModel>();
                contractBasicInfoViewModel.SelectedPayerList  = new List <ContractPayerViewModel>();

                foreach (var payer in contractBasicInfo.Payers)
                {
                    if (payer.IsSelected)
                    {
                        contractBasicInfoViewModel.SelectedPayerList.Add(new ContractPayerViewModel
                        {
                            Name = payer.PayerName
                        });
                    }
                    else
                    {
                        contractBasicInfoViewModel.AvailablePayerList.Add(new ContractPayerViewModel
                        {
                            Name = payer.PayerName
                        });
                    }
                }
                contractBasicInfoViewModel.AvailablePayerList = contractBasicInfoViewModel.AvailablePayerList.OrderBy(q => q.Name).ToList();
                contractBasicInfoViewModel.SelectedPayerList  = contractBasicInfoViewModel.SelectedPayerList.OrderBy(q => q.Name).ToList();
            }
            return(contractBasicInfoViewModel);
        }
Beispiel #2
0
        public JsonResult PushContractBasicInfoData(ContractBasicInfoViewModel basicInfo)
        {
            Shared.Models.Contract contract = AutoMapper.Mapper.Map <ContractBasicInfoViewModel, Shared.Models.Contract>(basicInfo);
            if (basicInfo != null)
            {
                if (basicInfo.SelectedPayerList != null && basicInfo.SelectedPayerList.Count > 0)
                {
                    contract.Payers = new List <Payer>();
                    foreach (var payer in basicInfo.SelectedPayerList)
                    {
                        contract.Payers.Add(new Payer {
                            PayerName = payer.Name
                        });
                    }
                }
                LastExpandedNodeId    = basicInfo.NodeId;
                LastHighlightedNodeId = basicInfo.NodeId;
            }
            contract.UserName = GetLoggedInUserName();
            Shared.Models.Contract contractinfo = PostApiResponse <Shared.Models.Contract>(Constants.Contract, Constants.AddEditContractBasicInfo, contract);

            bool isSuccess = false;

            if (contractinfo != null)
            {
                LastHighlightedNodeId = contractinfo.NodeId;
                LastExpandedNodeId    = contractinfo.NodeId;
                isSuccess             = contractinfo.ContractId != 0;
            }
            return(Json(new { sucess = isSuccess, addedId = contractinfo != null ? contractinfo.ContractId : 0 }));
        }
Beispiel #3
0
        /// <summary>
        /// Gets the contract basic information.
        /// </summary>
        /// <param name="contractBasicInfo">The contract basic information.</param>
        /// <param name="parentId">The parent unique identifier.</param>
        /// <param name="facilityId">The facility unique identifier.</param>
        /// <param name="nodeId">The node unique identifier.</param>
        /// <returns></returns>
        /// <exception cref="System.NotImplementedException"></exception>
        private ContractBasicInfoViewModel GetContractBasicInfo(Shared.Models.Contract contractBasicInfo, long?parentId, int facilityId, long?nodeId)  //TODO Janaki
        {
            ContractBasicInfoViewModel contractBasicInfoViewModel = Mapper.Map <Shared.Models.Contract, ContractBasicInfoViewModel>(contractBasicInfo);

            if (contractBasicInfo != null)
            {
                if (contractBasicInfo.Payers != null && contractBasicInfo.Payers.Count > 0)
                {
                    contractBasicInfoViewModel.ParentId           = parentId;
                    contractBasicInfoViewModel.FacilityId         = facilityId;
                    contractBasicInfoViewModel.NodeId             = nodeId;
                    contractBasicInfoViewModel.AvailablePayerList = new List <ContractPayerViewModel>();
                    contractBasicInfoViewModel.SelectedPayerList  = new List <ContractPayerViewModel>();
                    if (nodeId == null)
                    {
                        contractBasicInfoViewModel.ThresholdDaysToExpireAlters =
                            GlobalConfigVariables.DefaultThresholdDaysToExpireAlters;
                    }
                    foreach (var payer in contractBasicInfo.Payers.Where(payer => payer != null))
                    {
                        if (payer.IsSelected)
                        {
                            contractBasicInfoViewModel.SelectedPayerList.Add(new ContractPayerViewModel
                            {
                                Name = payer.PayerName
                            });
                        }
                        else
                        {
                            contractBasicInfoViewModel.AvailablePayerList.Add(new ContractPayerViewModel
                            {
                                Name = payer.PayerName
                            });
                        }
                    }
                    contractBasicInfoViewModel.AvailablePayerList = contractBasicInfoViewModel.AvailablePayerList.OrderBy(q => q.Name).ToList();
                    contractBasicInfoViewModel.SelectedPayerList  = contractBasicInfoViewModel.SelectedPayerList.OrderBy(q => q.Name).ToList();
                }
            }
            else //if Contract view model is null.
            {
                contractBasicInfoViewModel = new ContractBasicInfoViewModel
                {
                    ThresholdDaysToExpireAlters = GlobalConfigVariables.DefaultThresholdDaysToExpireAlters
                };
            }
            return(contractBasicInfoViewModel);
        }
Beispiel #4
0
        /// <summary>
        /// 查询记录项目的一些基本信息添补上已回款总金额
        /// </summary>
        /// <param name="pageNumber">翻页查询页码</param>
        /// <param name="pageSize">分页大小
        public List <ContractBasicInfoViewModel> QueryContractBasicInfoWithTotalActualPayment(int pageNumber, int pageSize)
        {
            //通过页码和分页大小查出当前页的合同信息列表
            var contractList = contractBasicInfoRepository.QueryContractBasicInfo(pageNumber, pageSize);

            //创建一个合同视同列表对象
            List <ContractBasicInfoViewModel> conViewModels = new List <ContractBasicInfoViewModel>();

            //将每个合同的实际回款总额计算出来
            foreach (var item in contractList)
            {
                ContractBasicInfoViewModel temp = new ContractBasicInfoViewModel();
                temp = Mapper.Map <ContractBasicInfo, ContractBasicInfoViewModel>(item, temp);
                temp.TotalActualPayment = actualPaymentRepository.queryTotolMoney(item.ContractGUID);
                conViewModels.Add(temp);
            }
            //返回结果
            return(conViewModels);
        }
Beispiel #5
0
        /// <summary>
        /// 查询记录项目的一些基本信息添补上已回款总金额
        /// <param name="key">查询关键字</param>
        /// <param name="value">查询需要匹配的值</param>
        /// <returns></returns>
        public List <ContractBasicInfoViewModel> QueryContractBasicInfo(String key, String value)
        {
            //通过关键字和值查询出符合要求的列表
            var contractList = contractBasicInfoRepository.QueryContractBasicInfo(key, value);

            //创建一个合同视图列表对象
            List <ContractBasicInfoViewModel> conViewModels = new List <ContractBasicInfoViewModel>();

            //计算出查出来的合同的实际回款总额
            foreach (var item in contractList)
            {
                ContractBasicInfoViewModel temp = new ContractBasicInfoViewModel();
                temp = Mapper.Map <ContractBasicInfo, ContractBasicInfoViewModel>(item, temp);
                temp.TotalActualPayment = actualPaymentRepository.queryTotolMoney(item.ContractGUID);
                conViewModels.Add(temp);
            }

            //返回结果
            return(conViewModels);
        }
Beispiel #6
0
 /// <summary>
 /// Checks the contract name is unique.
 /// </summary>
 /// <param name="basicInfo">The basic information.</param>
 /// <returns></returns>
 public JsonResult IsContractNameExist(ContractBasicInfoViewModel basicInfo)
 {
     Shared.Models.Contract contract = AutoMapper.Mapper.Map <ContractBasicInfoViewModel, Shared.Models.Contract>(basicInfo);
     contract.UserName = GetLoggedInUserName();
     return(Json(PostApiResponse <bool>(Constants.Contract, Constants.IsContractNameExist, contract)));
 }
Beispiel #7
0
        public ActionResult Index(long?contractId)
        {
            long?     id  = contractId;
            BaseModel obj = new BaseModel();

            Shared.Models.Contract contract = GetApiResponse <Shared.Models.Contract>("Contract", "GetContractFirstLevelDetails", id);
            long?nodeId     = contract.NodeId;
            int  facilityId = contract.FacilityId;
            long?parentId   = contract.ParentId;

            obj.UserName = contract.UserName ?? GetLoggedInUserName();

            if (parentId != null || contractId != null)
            {
                if (contractId == null)
                {
                    contractId = 0;
                }

                Shared.Models.Contract contractInfo = new Shared.Models.Contract {
                    FacilityId = facilityId, ContractId = contractId.Value, ParentId = parentId
                };

                ContractFullInfo contractFullInfo = PostApiResponse <ContractFullInfo>("Contract", "GetContractFullInfo", contractInfo);

                ContractViewModel viewModel = new ContractViewModel
                {
                    ContractId          = contractId.Value,
                    ContractBasicInfo   = new ContractBasicInfoViewModel(),
                    ContractContactIds  = new List <long>(),
                    ContractNotes       = new List <ContractNotesViewModel>(),
                    ContractUploadFiles = new List <ContractUploadFiles>(),
                    FacilityId          = facilityId,
                    NodeId      = nodeId,
                    PayerCode   = contractFullInfo.ContractBasicInfo.PayerCode,
                    CustomField = contractFullInfo.ContractBasicInfo.CustomField
                };
                if (contractFullInfo.ContractBasicInfo != null)
                {
                    ContractBasicInfoViewModel contractBasicInfoViewModel =
                        GetContractBasicInfo(contractFullInfo.ContractBasicInfo, parentId, facilityId, nodeId);
                    viewModel.ContractBasicInfo = contractBasicInfoViewModel;
                }

                if (contractFullInfo.ContractContactIds != null && contractFullInfo.ContractContactIds.Any())
                {
                    viewModel.ContractContactIds = contractFullInfo.ContractContactIds;
                }

                if (contractFullInfo.ContractDocs != null && contractFullInfo.ContractDocs.Count > 0)
                {
                    List <ContractUploadFiles> contractUploadFiles = GetContractUploadFilesesInfo(contractFullInfo);
                    viewModel.ContractUploadFiles = contractUploadFiles;
                }

                if (contractFullInfo.ContractNotes != null)
                {
                    List <ContractNotesViewModel> contractNotes = GetContractNotesInfo(contractFullInfo);
                    viewModel.ContractNotes = contractNotes;
                }
                return(View("~/Areas/Contract/Views/DenialManagementContractContainer/Index.cshtml", viewModel));
            }
            return(View("~/Areas/Contract/Views/DenialManagementContractContainer/SSIMedworthHome.cshtml"));
        }
Beispiel #8
0
        /// <summary>
        /// Indexes the specified contract identifier.
        /// </summary>
        /// <param name="contractId">The contract identifier.</param>
        /// <param name="parentId">The parent identifier.</param>
        /// <param name="facilityId">The facility identifier.</param>
        /// <param name="nodeId">The node identifier.</param>
        /// <param name="isParentNode">The is parent node.</param>
        /// <param name="modelParentId">The model parent identifier.</param>
        /// <param name="currentDateTime">The current date time.</param>
        /// <returns></returns>
        public ActionResult Index(long?contractId, long?parentId, int?facilityId, long?nodeId, bool?isParentNode, long?modelParentId, string currentDateTime)
        {
            // Sample code to get the facility list and the permissions
            //TODO: From UI nodeID is coming in ContractID parameter which is wrong, Need to do changes if required later.
            if (nodeId.HasValue)
            {
                LastExpandedNodeId    = nodeId;
                LastHighlightedNodeId = nodeId;
                if (parentId.HasValue && facilityId.HasValue)//TODO Janaki
                {
                    if (LastRequestedNode == null)
                    {
                        LastRequestedNode = new ContractHierarchy();
                    }
                    LastRequestedNode.NodeId     = nodeId.Value;
                    LastRequestedNode.ParentId   = parentId.Value;
                    LastRequestedNode.FacilityId = facilityId.Value;
                }
            }

            if (facilityId != null && (parentId != null || contractId != null))
            {
                if (contractId == null)
                {
                    contractId = 0;
                }

                Shared.Models.Contract contractInfo = new Shared.Models.Contract
                {
                    FacilityId      = facilityId.Value,
                    ContractId      = contractId.Value,
                    UserName        = GetLoggedInUserName(),
                    CurrentDateTime = currentDateTime
                };
                ContractFullInfo contractFullInfo = PostApiResponse <ContractFullInfo>(Constants.Contract, Constants.GetContractFullInfo,
                                                                                       contractInfo);
                ContractViewModel viewModel = new ContractViewModel
                {
                    ContractId          = contractId.Value,
                    ContractBasicInfo   = new ContractBasicInfoViewModel(),
                    ContractContactIds  = new List <long>(),
                    ContractNotes       = new List <ContractNotesViewModel>(),
                    ContractUploadFiles = new List <ContractUploadFiles>(),
                    FacilityId          = facilityId.Value,
                    NodeId        = nodeId,
                    PayerCode     = contractFullInfo.ContractBasicInfo != null ? contractFullInfo.ContractBasicInfo.PayerCode : string.Empty,
                    CustomField   = contractFullInfo.ContractBasicInfo != null ? contractFullInfo.ContractBasicInfo.CustomField : null,
                    IsParentNode  = isParentNode,
                    ModelParentId = modelParentId
                };
                ContractBasicInfoViewModel contractBasicInfoViewModel =
                    GetContractBasicInfo(contractFullInfo.ContractBasicInfo, parentId, facilityId.Value, contractFullInfo.ContractBasicInfo != null ? contractFullInfo.ContractBasicInfo.NodeId : null);
                viewModel.ContractBasicInfo = contractBasicInfoViewModel;

                if (contractFullInfo.ContractContactIds != null && contractFullInfo.ContractContactIds.Any())
                {
                    viewModel.ContractContactIds = contractFullInfo.ContractContactIds;
                }

                if (contractFullInfo.ContractDocs != null && contractFullInfo.ContractDocs.Count > 0)
                {
                    List <ContractUploadFiles> contractUploadFiles = GetContractUploadFilesesInfo(contractFullInfo);
                    viewModel.ContractUploadFiles = contractUploadFiles;
                }

                if (contractFullInfo.ContractNotes != null)
                {
                    List <ContractNotesViewModel> contractNotes = GetContractNotesInfo(contractFullInfo);
                    viewModel.ContractNotes = contractNotes;
                }
                ViewBag.CurrentFacilityId = GetCurrentFacilityId();
                return(View("Index", viewModel));
            }
            ViewBag.CurrentFacilityId   = GetCurrentFacilityId();
            ViewBag.CurrentFacilityName = GetCurrentFacilityName();
            ViewBag.UserName            = GetLoggedInUserName();

            UserInfo userinfo = GetUserInfo();

            if (userinfo.SingleFacility != null && !userinfo.IsFromSecurityPage)
            {
                userinfo.SingleFacility = 0;
            }
            else if (userinfo.AssignedFacilities.Count == 1)
            {
                userinfo.SingleFacility = 1;
                // ReSharper disable once SimplifyConditionalTernaryExpression
                userinfo.IsFromSecurityPage = (userinfo.IsFromSecurityPage) ? false : userinfo.IsFromSecurityPage;
            }
            ViewBag.SingleFacility         = userinfo.SingleFacility;
            ViewBag.UserId                 = userinfo.UserId;
            ViewBag.UserTypeId             = userinfo.UserTypeId;
            ViewBag.LastLoginDate          = userinfo.LastLoginDate;
            ViewBag.PasswordExpirationDays = userinfo.PasswordExpirationDays;
            ViewBag.LandingPageId          = userinfo.LandingPageId;
            ViewBag.IsAutoRefresh          = GetAutoRefresh();

            return(View("~/Areas/Contract/Views/ContractContainer/SSIMedworthHome.cshtml"));
        }