Example #1
0
        public async Task PostPolicyInfoAsync(PolicyInfo model)
        {
            var        response = string.Empty;
            HttpClient client   = new HttpClient();
            Uri        uri      = new Uri("http://localhost:5000/api/newbusiness");

            client.DefaultRequestHeaders.Accept.Clear();
            client.DefaultRequestHeaders.Accept.Add(
                new MediaTypeWithQualityHeaderValue("application/json"));

            var         json    = JsonConvert.SerializeObject(model);
            HttpContent content = new StringContent(json, Encoding.UTF8, "application/json");

            HttpRequestMessage request = new HttpRequestMessage
            {
                Method     = HttpMethod.Post,
                RequestUri = uri,
                Content    = content
            };

            HttpResponseMessage result = await client.SendAsync(request);

            if (result.IsSuccessStatusCode)
            {
                response = result.StatusCode.ToString();
            }
        }
Example #2
0
        public void Post([FromBody] PolicyInfoDto model)
        {
            var policyInfo = new PolicyInfo();

            policyInfo.PolicyNumber             = model.PolicyNumber;
            policyInfo.FullName                 = model.FullName;
            policyInfo.IdNumber                 = model.IdNumber;
            policyInfo.Nationality              = model.Nationality;
            policyInfo.DateOfBirth              = model.DateOfBirth;
            policyInfo.Gender                   = model.Gender;
            policyInfo.MaritalStatus            = model.MaritalStatus;
            policyInfo.Address                  = model.Address;
            policyInfo.Mobile                   = model.Mobile;
            policyInfo.HomeNumber               = model.HomeNumber;
            policyInfo.PlanName                 = model.PlanName;
            policyInfo.SumInsured               = model.SumInsured;
            policyInfo.TotalPremiumPayable      = model.TotalPremiumPayable;
            policyInfo.PaymentMode              = model.PaymentMode;
            policyInfo.PaymentMethod            = model.PaymentMethod;
            policyInfo.InsuredSignedDate        = model.InsuredSignedDate;
            policyInfo.RepresentativeSignedDate = model.RepresentativeSignedDate;
            policyInfo.RepresentativeName       = model.RepresentativeName;
            policyInfo.RepresentativeCode       = model.RepresentativeCode;
            context.PolicyInfo.InsertOne(policyInfo);
        }
 public void GetByNumber_Test_Moscow()
 {
     using (var client = new PolicyStatusService.PolicyStatusServiceClient())
     {
         PolicyInfo policyInfo = client.GetStatusByNumber(1, "770000", "8018570419");
     }
 }
 public void GetByNumber_Test()
 {
     using (var client = new DMZPolicyStatusService.PolicyStatusServiceClient())
     {
         client.ClientCredentials.UserName.UserName = "******";
         client.ClientCredentials.UserName.Password = "******";
         PolicyInfo status = client.GetStatusByNumber(1, "770000", "3026270680");
     }
 }
Example #5
0
        public PolicyInfo GetPolicy(long id)
        {
            List <SqlParameter> parameters = new List <SqlParameter>();

            parameters.AddInputParameter("@PolicyId", SqlDbType.BigInt, id);
            PolicyInfo item = Execute_Get(PolicyMaterializer.Instance, "Policy_Get", parameters);

            return(item);
        }
Example #6
0
 public ActionResult Create(PolicyInfo model)
 {
     try
     {
         // TODO: Add insert logic here
         context.PolicyInfo.InsertOne(model);
         return(RedirectToAction(nameof(Index)));
     }
     catch
     {
         return(View());
     }
 }
 public PolicyInfoClientVisitSaveModel(PolicyInfo policyInfo, EntityType type) : this()
 {
     Id                  = policyInfo.Id;
     EntityType          = type;
     PolicyTypeId        = policyInfo.PolicyType != null ? policyInfo.PolicyType.Id : 0;
     Series              = policyInfo.Series;
     Number              = policyInfo.Number;
     UnifiedPolicyNumber = policyInfo.UnifiedPolicyNumber;
     StartDate           = policyInfo.StartDate;
     EndDate             = policyInfo.EndDate;
     OGRN                = policyInfo.OGRN;
     OKATO               = policyInfo.OKATO;
     SmoId               = policyInfo.SmoId;
     SmoName             = policyInfo.SmoName;
 }
Example #8
0
		/// <summary>
		/// Creates the policy of given type.
		/// </summary>
		/// <param name="policyType">Type of policy to create.</param>
		/// <returns>An instance of the requested policy type.</returns>
		/// <remarks>This could be either new instance, created especially for
		/// this request, or instance shared by other nodes. This behavior is
		/// solely determined by GetPolicy method of given policy type.</remarks>
		public INodePolicy CreatePolicy( Type policyType )
		{
			PolicyInfo pi = (PolicyInfo)_cache[policyType];
			if( pi == null ) 
			{
				lock( _cache.SyncRoot ) 
				{
					pi = (PolicyInfo)_cache[policyType];
					if( pi == null )
					{
						pi = new PolicyInfo( policyType );
						_cache.Add( policyType, pi );
					}
				}
			}
			return pi.GetNodePolicy();
		}
Example #9
0
        /// <summary>
        /// Creates the policy of given type.
        /// </summary>
        /// <param name="policyType">Type of policy to create.</param>
        /// <returns>An instance of the requested policy type.</returns>
        /// <remarks>This could be either new instance, created especially for
        /// this request, or instance shared by other nodes. This behavior is
        /// solely determined by GetPolicy method of given policy type.</remarks>
        public INodePolicy CreatePolicy(Type policyType)
        {
            PolicyInfo pi = (PolicyInfo)_cache[policyType];

            if (pi == null)
            {
                lock (_cache.SyncRoot)
                {
                    pi = (PolicyInfo)_cache[policyType];
                    if (pi == null)
                    {
                        pi = new PolicyInfo(policyType);
                        _cache.Add(policyType, pi);
                    }
                }
            }
            return(pi.GetNodePolicy());
        }
Example #10
0
 public CurrentForumState()
 {
     currentPolicyInfo = new PolicyInfo();
 }
Example #11
0
        public ActionResult Index()
        {
            Address address = null;

            string searchDataHtml = string.Empty;

            if (!string.IsNullOrEmpty(Request.QueryString["addressSearch"]))
            {
                var addressSearched = Address.FormatAddress(Request.QueryString["address"], Request.QueryString["city"],
                                                            Request.QueryString["state"], Request.QueryString["zipCode"]);
                address = Address.Search(Request.QueryString["address"], Request.QueryString["city"],
                                         Request.QueryString["state"], Request.QueryString["zipCode"], true).First();

                searchDataHtml += SearchDataEntry("Address Searched", addressSearched);
            }
            if (!string.IsNullOrEmpty(Request.QueryString["geocodeSearch"]))
            {
                double latitude  = double.Parse(Request.QueryString["latitude"]);
                double longitude = double.Parse(Request.QueryString["longitude"]);

                address = Geocoder.ReverseGeocode(latitude, longitude);
            }
            if (!string.IsNullOrEmpty(Request.QueryString["policySearch"]))
            {
                if (!string.IsNullOrEmpty(Request.QueryString["policyNumber"]))
                {
                    searchDataHtml += SearchDataEntry("Policy Number", Request.QueryString["policyNumber"]);
                }
                if (!string.IsNullOrEmpty(Request.QueryString["policyHolderName"]))
                {
                    searchDataHtml += SearchDataEntry("Policy Holder Name", Request.QueryString["policyHolderName"]);
                }

                string policyNumber     = Request.QueryString["policyNumber"];
                string policyHolderName = Request.QueryString["policyHolderName"];

                PolicyInfo info = _insurancePolicyProvider.GetPolicyThatMatchesNameOrNumber(policyNumber, policyHolderName);
                address = info.PolicyHomeAddress;

                address.GeocodeAddress();
            }

            if (address == null)
            {
                // TODO: change to some asp.net mvc validation system
                throw new ArgumentException("Invalid Search");
            }

            if (!string.IsNullOrEmpty(Request.QueryString["incidentTypes"]))
            {
                searchDataHtml += SearchDataEntry("Incident Type", Request.QueryString["incidentTypes"]);
            }

            if (!string.IsNullOrEmpty(Request.QueryString["radius"]))
            {
                searchDataHtml += SearchDataEntry("Radius", Request.QueryString["radius"]);
            }

            searchDataHtml += SearchDataEntry("Address Found", address.FullAddress);

            searchDataHtml += SearchDataEntry("Latitude", address.Geocode.Latitude.ToString());
            searchDataHtml += SearchDataEntry("Longitude", address.Geocode.Longitude.ToString());


            DateTime startDate = DateTime.Parse(Request.QueryString["startDate"]);
            DateTime endDate   = DateTime.Parse(Request.QueryString["endDate"]);


            searchDataHtml += SearchDataEntry("Start Date", startDate.ToShortDateString());
            searchDataHtml += SearchDataEntry("End Date", endDate.ToShortDateString());

            string closestAirportCode = AirportList.FindClosestAirport(address.Geocode).AirportCode;
            string state = address.State.Abbreviation;

            ViewData["homeAddress"]    = address.FullAddress;
            ViewData["latitude"]       = address.Geocode.Latitude;
            ViewData["longitude"]      = address.Geocode.Longitude;
            ViewData["airportCode"]    = closestAirportCode;
            ViewData["state"]          = state;
            ViewData["county"]         = address.County.Name;
            ViewData["startDate"]      = startDate;
            ViewData["endDate"]        = endDate;
            ViewData["incidentFilter"] = Request.QueryString["incidentTypes"];
            ViewData["searchDataHtml"] = searchDataHtml;
            return(View());
        }
Example #12
0
 public void Post([FromBody] PolicyInfo value)
 {
 }
Example #13
0
        private void InsertPolicy(string hotelId, string hotelCode, IList <OTA_HotelDescriptiveInfoRS.HotelDescriptiveContentsLocalType.HotelDescriptiveContentLocalType.PoliciesLocalType.PolicyLocalType> policy)
        {
            if (Check(policy))
            {
                using (var context = new TravelDBContext())
                {
                    EfRepository <Policy>     policyContext     = new EfRepository <Policy>(context);
                    EfRepository <PolicyInfo> policyinfoContext = new EfRepository <PolicyInfo>(context);

                    var policyCheck = (from p in policyContext.Table where p.HotelID == hotelId select p).ToList();
                    if (policyCheck.Count > 0)
                    {
                        LoggerHelper(hotelCode, "Policy Deleted");
                        policyContext.Delete(policyCheck);
                    }

                    var policyinfoCheck = (from p in policyinfoContext.Table where p.HotelId == hotelId select p).ToList();
                    if (policyinfoCheck.Count > 0)
                    {
                        LoggerHelper(hotelCode, "policyinfo Deleted");
                        policyinfoContext.Delete(policyinfoCheck);
                    }



                    var policyinfoCodes = policy[0].PolicyInfoCodes;

                    if (Check(policyinfoCodes))
                    {
                        var PolicyInfoCode = policyinfoCodes[0].PolicyInfoCode;
                        foreach (var item in PolicyInfoCode[0].Description)
                        {
                            Console.WriteLine(item.Name + "," + item.Text);

                            Policy p = new Policy();
                            p.HotelID        = hotelId;
                            p.Key            = item.Name;
                            p.Value          = item.Text;
                            p.LastMofifyTime = DateTime.Now;

                            policyContext.Insert(p);
                        }
                    }

                    var policyinfo = policy[0].PolicyInfo;
                    if (policyinfo != null)
                    {
                        var CheckinTime  = policyinfo[0].CheckInTime;
                        var checkOutTime = policyinfo[0].CheckOutTime;

                        PolicyInfo pi = new PolicyInfo();
                        pi.HotelId        = hotelId;
                        pi.CheckIn        = CheckinTime;
                        pi.CheckOut       = checkOutTime;
                        pi.LastModifyTime = DateTime.Now;

                        policyinfoContext.Insert(pi);
                    }
                }
            }
        }