Ejemplo n.º 1
0
        public ActionResult GetEDDIORowsFromPolicyNumber(string Input, string Region)
        {
            this.vm = new EDDViewModel();

            vm.ExceedRegion.CurrentRegion = Region;
            vm.PolicyNumber = Input;
            vm.PolicyID     = this.GetPolicyIDFromPolicyNumber();
            if (!string.IsNullOrEmpty(vm.PolicyID))
            {
                List <EDDIORow> eDDIORows = this.CreateEDDIORows();
                if (eDDIORows != null && eDDIORows.Count > 0)
                {
                    var formattedData = new { EDDRows = eDDIORows };
                    return(Json(formattedData));
                }
                else
                {
                    return(this.DataNotFound("No Data found for this Policy Number."));
                }
            }
            else
            {
                return(this.DataNotFound("No Data found for this Policy Number."));
            }
        }
Ejemplo n.º 2
0
        public ActionResult GetEDDMessageColAndTab()
        {
            this.vm   = new EDDViewModel();
            vm.EddKey = this.logDataModel.EddKey;
            this.GetLOBCode();

            if (string.Equals(vm.MasterCompanyNbr, "02"))
            {
                return(this.DataNotFound("Unable to find mapping for IB Policy."));
            }
            List <string> spliteEDDMessage = this.CreateEDDMessage().Split('|').ToList();

            this.GetPolarisIds();
            List <DataRow> polarisData = this.GetPolirisData();
            string         eddMessageWithTableColumn = string.Empty;

            spliteEDDMessage.ForEach(
                message =>
            {
                string strEDDMessageRow = string.Format("<span class='eddMessage'>{0}</span>", message);
                polarisData.ForEach(dr =>
                {
                    if (message.Contains(dr.Field <string>("POLARIS_ID")))
                    {
                        strEDDMessageRow += string.Format("<span class='eddTabCol'><span class='eddTable'>{0}</span><span class='eddColumn'>{1}</span></span>", dr.Field <string>("TABLE_NAME").Trim(), dr.Field <string>("COLUMN_NAME").Trim());
                    }
                });
                eddMessageWithTableColumn += "<span class='eddRow'><span class='eddMTC'>" + strEDDMessageRow + "</span></span>";
            });

            var formattedData = new { EDDMessage = eddMessageWithTableColumn };

            return(Json(formattedData));
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Maps the EDD rating query to data model.
 /// </summary>
 /// <param name="vm">The vm.</param>
 /// <param name="logDataModel">The log data model.</param>
 internal static void MapEDDRatingQueryToDataModel(EDDViewModel vm, LogDataModel dataModel)
 {
     dataModel.SqlQuery = vm.SqlQuery;
     dataModel.SqlQuery = HelperClass.ReplaceKey(dataModel.SqlQuery, "Region", dataModel.Region);
     dataModel.SqlQuery = HelperClass.ReplaceKey(dataModel.SqlQuery, "LOBCODE", dataModel.LOBCD);
     dataModel.SqlQuery = HelperClass.ReplaceKey(dataModel.SqlQuery, "IOCHAR", dataModel.EddKey.Split('-')[1]);
     dataModel.SqlQuery = HelperClass.ReplaceKey(dataModel.SqlQuery, "PolarisIds", dataModel.PolarisIds);
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Maps the EDD polaris I ds to data model.
        /// </summary>
        /// <param name="eDDViewModel">The e DD view model.</param>
        /// <param name="logDataModel">The log data model.</param>
        internal static void MapEDDPolarisIDsToDataModel(EDDViewModel vm, LogDataModel dataModel)
        {
            string polarisIds = string.Empty;

            if (vm.PolarisIds != null && vm.PolarisIds.Count > 0)
            {
                vm.PolarisIds.ForEach(x => polarisIds += "'" + x + "',");
                dataModel.PolarisIds = polarisIds.Substring(0, polarisIds.Length - 1);
            }
        }
Ejemplo n.º 5
0
        public ActionResult GetEDDMessage(string Input, string Region, bool IsPolicyID)
        {
            this.vm = new EDDViewModel();
            if (string.IsNullOrEmpty(Input) || !ModelState.IsValid)
            {
                return(View(vm));
            }

            vm.EddKey = Input;
            Mapper.MapEDDKeyToDataModel(vm, this.logDataModel);
            string EDDMessage    = this.CreateEDDMessage();
            var    formattedData = new { EDDMessage = EDDMessage.Replace("|", "|\n") };

            return(Json(formattedData));
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Maps the EDD initial data to data model.
        /// </summary>
        /// <param name="vm">The vm.</param>
        /// <param name="dataModel">The data model.</param>
        internal static void MapEDDInitialDataToDataModel(EDDViewModel vm, LogDataModel dataModel)
        {
            dataModel.Region   = vm.ExceedRegion.CurrentRegion;
            dataModel.SqlQuery = vm.SqlQuery;
            dataModel.SqlQuery = HelperClass.ReplaceKey(dataModel.SqlQuery, "Region", dataModel.Region);

            if (!string.IsNullOrEmpty(vm.PolicyNumber))
            {
                dataModel.PolicyNumber = vm.PolicyNumber;
                dataModel.SqlQuery     = HelperClass.ReplaceKey(dataModel.SqlQuery, "PolicyNbr", dataModel.PolicyNumber);
            }

            if (!string.IsNullOrEmpty(vm.PolicyID))
            {
                dataModel.PolicyId = vm.PolicyID;
                dataModel.SqlQuery = HelperClass.ReplaceKey(dataModel.SqlQuery, "PolicyId", dataModel.PolicyId);
            }
        }
Ejemplo n.º 7
0
        public ActionResult GetEDDIORowsFromPolicID(string Input, string Region)
        {
            this.vm = new EDDViewModel();

            vm.ExceedRegion.CurrentRegion = Region;
            vm.PolicyID = Input;

            this.logDataModel.EddKeys = this.CreateEDDIORows();

            if (this.logDataModel.EddKeys != null && this.logDataModel.EddKeys.Count > 0)
            {
                var formattedData = new { EDDRows = this.logDataModel.EddKeys };
                return(Json(formattedData));
            }
            else
            {
                return(this.DataNotFound("No Data found for this Policy ID."));
            }
        }
Ejemplo n.º 8
0
 /// <summary>
 /// Maps the EDDIO data to data model.
 /// </summary>
 /// <param name="vm">The vm.</param>
 /// <param name="dataModel">The data model.</param>
 internal static void MapEDDKeyToDataModel(EDDViewModel vm, LogDataModel dataModel)
 {
     dataModel.EddKey = vm.EddKey;
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Maps the EDDLOBCD query to data model.
 /// </summary>
 /// <param name="vm">The vm.</param>
 /// <param name="dataModel">The data model.</param>
 internal static void MapEDDLOBCDQueryToDataModel(EDDViewModel vm, LogDataModel dataModel)
 {
     dataModel.SqlQuery = vm.SqlQuery;
     dataModel.SqlQuery = HelperClass.ReplaceKey(dataModel.SqlQuery, "Region", dataModel.Region);
     dataModel.SqlQuery = HelperClass.ReplaceKey(dataModel.SqlQuery, "PolicyId", dataModel.PolicyId);
 }
Ejemplo n.º 10
0
 /// <summary>
 /// Maps the LOB code.
 /// </summary>
 /// <param name="vm">The vm.</param>
 /// <param name="logDataModel">The log data model.</param>
 internal static void MapLOBCode(EDDViewModel vm, LogDataModel dataModel)
 {
     dataModel.LOBCD = vm.LOBCD;
 }
Ejemplo n.º 11
0
 public ActionResult Index()
 {
     vm = new EDDViewModel();
     return(View(vm));
 }