private void AssignClaimantDetails(ClaimHeader claimHeader, ClaimDetail claimDetail, BusinessData dataClass) { var claimants = claimDetail.ClaimDetailToClaimInvolvementLinks.Where(lnk => lnk.ClaimInvolvement.ClaimInvolvementType == (short)StaticValues.LinkableComponentType.NameInvolvement).SelectMany(link => link.ClaimInvolvement.ClaimNameInvolvements.Where(a=> a.NameUsageTypeCode == "UCL" || a.NameUsageTypeCode == "DRV")); if (claimants.Count() > 0) { ClaimNameInvolvement claimant = claimants.FirstOrDefault(); if (claimant.NameID.HasValue) { dataClass.CustomProperties["ClaimantNameID"] = claimant.NameID.GetValueOrDefault(); } CodeRow code = claimant.CustomCode01Field.AllowedValues().Where(c => c.Code == claimant.CustomCode01).FirstOrDefault(); if (code != null) { dataClass.CustomProperties["ClaimantCustomCode01Desc"] = code.Description; } else { dataClass.CustomProperties["ClaimantCustomCode01Desc"] = string.Empty; } } else { dataClass.CustomProperties["ClaimantCustomCode01Desc"] = string.Empty; } }
public ResponseStatus Process(BusinessData businessData) { if (businessData == null) { return(ResponseStatus.NullData); } if (businessData.IsC) { Console.WriteLine($"{nameof(HandlerC)} is processing ..."); return(ResponseStatus.Processed); } else { if (nextHandler != null) { Console.WriteLine($"{nameof(HandlerC)} is passing to the next handler."); return(nextHandler.Process(businessData)); } else { Console.WriteLine($"{nameof(HandlerC)} is terminating."); return(ResponseStatus.Unhandled); } } }
private IRow GetRow(ISheet sheet, int i, Business business, BusinessData data, ClientStep1 step1) { var row = sheet.CreateRow(i); var user = context.Users.Single(u => u.Id == business.CreatorId); row.CreateCell(0).SetCellValue(user.FirstName + " " + user.LastName); row.CreateCell(1).SetCellValue(data.AddDate.ToString("dd-MM-yyyy")); row.CreateCell(2).SetCellValue(data.RecipientName); row.CreateCell(3).SetCellValue(data.Street); row.CreateCell(4).SetCellValue(data.BuildingNumber); row.CreateCell(5).SetCellValue(data.PostCode); row.CreateCell(6).SetCellValue(data.City); row.CreateCell(7).SetCellValue(context.Provinces.Single(p => p.Id == data.ProvinceId).Name); row.CreateCell(8).SetCellValue(context.Districts.Single(d => d.Id == data.DistrictId).Name); row.CreateCell(9).SetCellValue(data.NIP); row.CreateCell(10).SetCellValue(data.StartYear); row.CreateCell(3).SetCellValue(context.CooperationTypes.Single(c => c.Id == data.CooperationTypeId).Name); row.CreateCell(11).SetCellValue(data.Owner); row.CreateCell(12).SetCellValue(data.OwnerPhoneNumber); row.CreateCell(13).SetCellValue(data.PhoneNumber); row.CreateCell(14).SetCellValue(data.PhoneNumber2); row.CreateCell(15).SetCellValue(data.PhoneNumber3); row.CreateCell(16).SetCellValue(data.Emial); row.CreateCell(17).SetCellValue(data.Website); row.CreateCell(18).SetCellValue(data.ContactPerson); row.CreateCell(19).SetCellValue(data.ContactPersonEmail); row.CreateCell(20).SetCellValue(data.ContactPersonPhoneNumber); row.CreateCell(21).SetCellValue(data.ContactPersonPosition); return(row); }
public BusinessData TestAllFunctions(string s1, ref string s2, out string s3, Version v1, ref Version v2, out Version v3, int i1, ref int i2, out int i3, CommonData commonData, out CommonData commonData2, ICommonService serice1, ref ICommonService serice2, out ICommonService serice3) { s2 = "[" + s1 + s2 + "]"; s3 = "<" + s1 + ">"; i2 = i1 + i2; i3 = i1 + 100; v2 = new Version(v1.Major + v2.Major, v1.Minor + v2.Minor); v3 = new Version(v1.Major + 1, v1.Minor + 1, v1.Build + 1, v1.Revision + 1); var testData = new TestData { Message = "[" + commonData.TestData.Message + "]", Number = commonData.TestData.Number + 100 }; commonData2 = new CommonData { Code = commonData.Code + 100, Country = "[" + commonData.Country + "]", TestData = testData }; var result = new BusinessData { EntityId = 1500, EntityName = "Fake" }; serice3 = DoCreateOutCommonService("[" + serice1.Name + "]", i1 + serice1.Age, serice1); serice2 = DoCreateRefCommonService(s1, i1, serice1); return(result); }
private void AssignClaimantRegistrationNumber(ClaimHeader claimHeader, ClaimDetail claimDetail, BusinessData dataClass) { string registrationNumber = string.Empty; var insuredObjects = claimDetail.ClaimDetailToClaimInvolvementLinks.Where(lnk => lnk.ClaimInvolvement.ClaimInvolvementType == (short)StaticValues.LinkableComponentType.InsuredObject).SelectMany(link => link.ClaimInvolvement.InternalClaimInsuredObjects); int number = insuredObjects.Count(io => io.InternalIOType == (short)StaticValues.InternalIOType.Vehicle); if (number == 0) { var nameInvolvements = claimHeader.ClaimInvolvements.SelectMany<ClaimInvolvement, ClaimNameInvolvement>(ci => ci.ClaimNameInvolvements); registrationNumber = this.GetRegistationNumber(claimHeader, this.GetNameInvolmentDataID(claimDetail, (short)StaticValues.NameInvolvementType_ClaimNameInvolvement.AdditionalClaimant)); if (string.IsNullOrEmpty(registrationNumber)) { registrationNumber = this.GetRegistationNumber(claimHeader, this.GetNameInvolmentDataID(claimDetail, (short)StaticValues.NameInvolvementType_ClaimNameInvolvement.Driver)); } } else if (number > 1) { registrationNumber = ClaimConstants.CONST_VARIOUS; } else { var claimIOVehicle = insuredObjects.First(io => io.InternalIOType == (short)StaticValues.InternalIOType.Vehicle).ClaimIOVehicles.FirstOrDefault(); registrationNumber = claimIOVehicle.RegistrationNumber; } dataClass.CustomProperties["RegistrationNumber"] = registrationNumber; }
public ColecaoRequisicoes GetRequisicoes(BusinessData.Entities.Calendario cal, ColecaoDias dias, ColecaoCategoriaDeRecursos categorias, ColecaoTurmas turmas) { ColecaoRequisicoes colAux = new ColecaoRequisicoes(); BusinessData.BusinessLogic.RequisicoesBO controleRequisicoes = new BusinessData.BusinessLogic.RequisicoesBO(); ICollection<BusinessData.Entities.Requisicao> requisicoes = controleRequisicoes.GetRequisicoesPorCalendario(cal); Requisicao aux; Dia dia; Horarios.HorariosPUCRS horario; Guid id; TurmaDistribuicao turma; CategoriaRecurso categoria; foreach (BusinessData.Entities.Requisicao req in requisicoes) { dia = dias.Find(req.Aula.Data); horario = Horarios.Parse(req.Aula.Hora); id = req.IdRequisicao; categoria = categorias.Find(req.CategoriaRecurso); turma = turmas.Find(req.Aula.TurmaId); aux = new Requisicao(dia, horario, turma, categoria, req.Prioridade,req.EstaAtendida); colAux.Add(aux); } return colAux; }
float getSoldChance(ItemForSale item, BusinessData data, ref string message) { if (!data.workersAssigned.Contains(HireeType.Sales) && playerAtStall != data.name) { message = ("You should assign a sales assistant to your " + data.name + " so it can operate while you are busy."); return(0); } float soldChance = 0.6f; foreach (HireeType hireeData in data.workersAssigned) { if (hireeData == HireeType.Promoter) { soldChance *= 1.7f; } if (hireeData == HireeType.Sales) { soldChance *= 1.2f; } } soldChance *= item.item.baseValue / item.cost; return(soldChance); }
public static BusinessData GetBusinessData() { var businessData = new BusinessData() { BusinessLegalName = "LegalName", DoingBusinessAs = "PPA", EmployerIdentificationNumber = new Random((int)DateTime.Now.Ticks).Next(100000000, 999999999).ToString(), BusinessDescription = "Accounting Services", WebsiteURL = "https://www.propay.com", MerchantCategoryCode = "5399", MonthlyBankCardVolume = "50000", AverageTicket = "100", HighestTicket = "300", BusinessAddress = new Address() { StreetAddress1 = "123 Main St.", City = "Downtown", State = "NJ", PostalCode = "12345", Country = "USA" } }; return(businessData); }
public static async Task Main(string[] args) { var builder = WebAssemblyHostBuilder.CreateDefault(args); builder.RootComponents.Add <App>("app"); Facture facture1 = new Facture("LESTON", "00001", "12/06/1800", "11/11/1111", 104850000, 45632); Facture facture2 = new Facture("MADEZO", "00002", "12/06/1800", "11/11/1111", 154650, 42132); Facture facture3 = new Facture("BAZATS", "00003", "12/06/1800", "11/11/1111", 93, 6562); Facture facture4 = new Facture("BENETIER", "69420", "12/06/1800", "11/11/1111", 69420, 2789); BusinessData Factures = new BusinessData(); Factures.addFacture(facture1); Factures.addFacture(facture2); Factures.addFacture(facture3); Factures.addFacture(facture4); builder.Services.AddSingleton <IBusinessData>(sp => new BusinessData()); builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); await builder.Build().RunAsync(); }
public ActionResult GetData() { List <BusinessData> data = new List <BusinessData>(); List <DateTime> allDates = new List <DateTime>(); Business currentBusiness = GetLoggedInBusiness(); var messageList = _context.Messages.Where(c => c.CurrentBar == currentBusiness.Name).ToList(); if (messageList.Count == 0) { return(Json(data)); } var startDate = messageList[0].CurrentDay; DateTime now = DateTime.Now; for (DateTime date = startDate; date < now; date = date.AddDays(1)) //counts dates from the start date until date.now { allDates.Add(date); } for (int i = 0; i < allDates.Count; i++) { BusinessData businessData = new BusinessData(); List <Message> dateList = _context.Messages.Where(c => c.CurrentDay == allDates[i]).ToList(); businessData.date = allDates[i]; businessData.count = dateList.Count; data.Add(businessData); } return(Json(data)); }
protected void btnDel_Click(object sender, System.EventArgs e) { System.Collections.Generic.List <string> list = new System.Collections.Generic.List <string>(); if (this.hfldIdsChecked.Value.Contains('[')) { list = JsonHelper.GetListFromJson(this.hfldIdsChecked.Value); } else { list.Add(this.hfldIdsChecked.Value); } try { foreach (string current in list) { System.Collections.Generic.List <string> reportIdByApplyId = this.reportSer.GetReportIdByApplyId(current); foreach (string current2 in reportIdByApplyId) { BusinessData.Delete("148", current2); } BusinessData.Delete("147", current); } base.RegisterScript("top.ui.show('删除成功!');"); this.BindGV(); } catch { base.RegisterScript("top.ui.show('删除失败!');"); } }
/// <summary> /// Fetches a business data snapshot from blob storage. /// </summary> /// <param name="cancellationToken">the CancellationToken.</param> /// <returns>the most recent snapshot.</returns> public async Task <FSharpResult <BusinessData <TBusinessData>, BusinessDataUpdateError> > FetchBusinessDataSnapshot(CancellationToken cancellationToken) { try { FSharpOption <(Watermark, string)> someWatermarkAndName = await this.GetLatestSnapshotID(cancellationToken); if (FSharpOption <(Watermark, string)> .get_IsNone(someWatermarkAndName)) { var emptyBusinessData = new BusinessData <TBusinessData>( data: this.createEmptyBusinessData(), watermark: Watermark.NewWatermark(-1)); return(FSharpResult <BusinessData <TBusinessData>, BusinessDataUpdateError> .NewOk(emptyBusinessData)); } var(watermark, blobName) = someWatermarkAndName.Value; await Console.Out.WriteLineAsync($"Loading snapshot watermark {watermark.Item} from {blobName}"); var blobClient = this.snapshotContainerClient.GetBlobClient(blobName: blobName); var result = await blobClient.DownloadAsync(cancellationToken : cancellationToken); var val = await result.Value.Content.ReadJSON <BusinessData <TBusinessData> >(); return(FSharpResult <BusinessData <TBusinessData>, BusinessDataUpdateError> .NewOk(val)); } catch (Exception ex) { return(FSharpResult <BusinessData <TBusinessData>, BusinessDataUpdateError> .NewError( BusinessDataUpdateError.NewSnapshotDownloadError(ex))); } }
public void SetUserData(BusinessData playerData, string token) { if (mainData == null) { mainData = new MainData(); } mainData.SetUserInformation(playerData, token); }
public async Task StartUpdateProcess(CancellationToken cancellationToken = default) { IObservable <BusinessData <TBusinessData> > businessDataObservable = await this.CreateObservable(cancellationToken); businessDataObservable.Subscribe( onNext: bd => this.BusinessData = bd, cancellationToken); }
public void Update(BusinessData data) { name = data.Name.IsDefault ? name : data.Name; businessType = data.BusinessType.IsDefault ? businessType : data.BusinessType; taxIdentificationNumber = data.TaxIdentificationNumber.IsDefault ? taxIdentificationNumber : data.TaxIdentificationNumber; state = data.State.IsDefault ? state : data.State; Store(); }
public static async void Buy(int bId) { CurrentData = await GetAllData(bId); if (User.Data.age < 21 && Main.ServerName != "SunFlower") { Notification.SendWithTime(Lang.GetTextToPlayer("_lang_26")); return; } if (!User.Data.biz_lic && Main.ServerName != "SunFlower") { Notification.SendWithTime("~r~У Вас нет лицензии на бизнес"); return; } if (User.Data.money_bank < CurrentData.price) { Notification.SendWithTime(Lang.GetTextToPlayer("_lang_2")); return; } if (CurrentData.user_id != 0) { Notification.SendWithTime(Lang.GetTextToPlayer("_lang_30")); return; } if (User.Data.business_id != 0) { Notification.SendWithTime(Lang.GetTextToPlayer("_lang_31")); return; } Sync.Data.Set(User.GetServerId(), "business_id", CurrentData.id); await Delay(200); if (await Sync.Data.Get(User.GetServerId(), "business_id") == 0) { Notification.SendWithTime(Lang.GetTextToPlayer("_lang_32")); return; } User.RemoveBankMoney(CurrentData.price); Coffer.AddMoney(CurrentData.price + CurrentData.bank); Sync.Data.Set(-20000 + bId, "bank", 0); User.Data.business_id = CurrentData.id; Notification.SendWithTime(Lang.GetTextToPlayer("_lang_33")); Main.SaveLog("BuySellBizz", $"[BUY] {User.Data.id} {User.Data.rp_name} | {CurrentData.price} | {User.Data.business_id}"); Sync.Data.Set(-20000 + bId, "user_id", User.Data.id); Sync.Data.Set(-20000 + bId, "user_name", User.Data.rp_name); User.SaveAccount(); Save(CurrentData.id); }
public void SetUserInformation(BusinessData _playerData, string _token) { token = _token; playerData = _playerData; bussinessReward = playerData.businessCoupons; BuildBussinessStrongholdAttrubte(); BuildStrongholdDawingList(); GetImg(); }
public static Business Create(BusinessData data) { Business business = new Business(); business.Update(data); business.Store(); return(business); }
public Calendario(BusinessData.Entities.Calendario cal, ColecaoDias dias, ColecaoRequisicoes requisicoes, ColecaoTurmas turmas, ColecaoCategoriaDeRecursos categorias, List<BusinessData.Entities.CategoriaDisciplina> categoriasDeDisciplina) { this.cal = cal; this.dias = dias; this.requisicoes = requisicoes; this.turmas = turmas; this.categorias = categorias; this.categoriasDeDisciplina = categoriasDeDisciplina; }
public static async void Sell(int bId) { if (Screen.LoadingPrompt.IsActive) { Notification.SendWithTime(Lang.GetTextToPlayer("_lang_34")); return; } Client.Sync.Data.ShowSyncMessage = false; Screen.LoadingPrompt.Show(Lang.GetTextToPlayer("_lang_36")); CurrentData = await GetAllData(bId); if (CurrentData.id == 0) { Notification.SendWithTime(Lang.GetTextToPlayer("_lang_35")); return; } if (User.Data.business_id == 0) { Notification.SendWithTime(Lang.GetTextToPlayer("_lang_37")); return; } Sync.Data.Set(User.GetServerId(), "business_id", 0); await Delay(200); if (await Sync.Data.Get(User.GetServerId(), "business_id") != 0) { Notification.SendWithTime(Lang.GetTextToPlayer("_lang_32")); return; } var nalog = CurrentData.price * (100 - Coffer.GetNalog()) / 100; Main.SaveLog("BuySellBizz", $"[SELL] {User.Data.id} {User.Data.rp_name} | {nalog} | {User.Data.business_id}"); User.AddBankMoney(nalog); Coffer.RemoveMoney(nalog); User.Data.business_id = 0; Notification.SendWithTime(Lang.GetTextToPlayer("_lang_38", nalog)); Sync.Data.Set(-20000 + bId, "user_id", 0); Sync.Data.Set(-20000 + bId, "user_name", ""); User.SaveAccount(); Save(CurrentData.id); Screen.LoadingPrompt.Hide(); Client.Sync.Data.ShowSyncMessage = true; }
public async Task <SearchResponse <FashionBusinessData, FashionItem> > Get(int size, string type = "Hat", int timeout = 15000) { var searchRequest = new FashionSearchRequest(size: size, fashionType: type); /* curl --silent "http://localhost:5000/fashionsearch?size=54&type=Throusers&timeout=15000" | jq * curl --silent "http://localhost:5000/fashionsearch?size=16&type=Hat&timeout=5000" | jq * curl --silent "http://localhost:5000/fashionsearch?size=15&type=Hat&timeout=5000" | jq **/ // snap a copy of the business data early in the process BusinessData <FashionBusinessData> businessData = this.getBusinessData(); var responseMustBeReadyBy = DateTimeOffset.Now.Add(TimeSpan.FromMilliseconds(timeout));
public static async void Enter(int id) { CurrentData = await GetAllData(id); if (CurrentData.id == 0) { Notification.SendWithTime("~r~Business error #1"); return; } LoadInterior(CurrentData.interior); User.Teleport(BusinessOfficePos); User.SetVirtualWorld(CurrentData.id); }
private void UpdateCustomProperties(IBusinessComponent component, BusinessData dataClass) { ArgumentCheck.ArgumentNullCheck(component, "component"); ArgumentCheck.ArgumentNullCheck(dataClass, "dataClass"); ClaimDetail claimDetail = component as ClaimDetail; ClaimHeader claimHeader = claimDetail.ClaimHeader as ClaimHeader; if (claimHeader.GetProduct().Product.Code == ClaimConstants.PRODUCT_MOTORCLAIM) { //// Registration number is only available in MOTOR Claim product. this.AssignClaimantRegistrationNumber(claimHeader, claimDetail, dataClass); } this.AssignClaimantDetails(claimHeader, claimDetail, dataClass); }
public void AssertBusinessData(BusinessData business, ExpectedBusiness expectedBusiness) { Assert.That(business, Is.Not.Null); Assert.That(business.id, Is.EqualTo(expectedBusiness.Id)); Assert.That(business.name, Is.EqualTo(expectedBusiness.Name)); Assert.That(business.domain, Is.EqualTo(expectedBusiness.Domain)); Assert.That(business.sport, Is.EqualTo(expectedBusiness.Sport)); AssertDateTime(business.authorisedUntil, expectedBusiness.AuthorisedUntil); Assert.That(business.payment.currency, Is.EqualTo(expectedBusiness.Payment.currency)); Assert.That(business.payment.isOnlinePaymentEnabled, Is.EqualTo(false)); Assert.That(business.payment.forceOnlinePayment, Is.EqualTo(false)); Assert.That(business.payment.paymentProvider, Is.EqualTo(null)); Assert.That(business.payment.merchantAccountIdentifier, Is.EqualTo(null)); }
/// <summary> /// Returns BusinessData class of the owner /// </summary> /// <param name="ownerId">Owner id</param> /// <returns>Business data class</returns> public BusinessData GetBusinessInformation(int ownerId) { BusinessData business = new BusinessData(); var query = from a in dc.Businesses where a.CustomerId == ownerId select new { BusinessId = a.BusinessId, BusinessName = a.BusinessName, BusinessAddress = a.Address }; foreach (var item in query) { business.address = item.BusinessAddress; business.businessId = item.BusinessId; business.businessName = item.BusinessName; } return(business); }
//This is the click method that identifies which business is being clicked on private async void OnTapped(object s, ItemTappedEventArgs e) { var getList = e.Item; Debug.WriteLine("Checking the selected item!!!! " + getList.ToString()); for (int i = 0; i < FaveViewModel.FaveList.Count; i++) { if (getList.ToString() == FaveViewModel.FaveList[i].BusinessName.ToString()) { faveData = FaveViewModel.FaveList[i]; await Navigation.PushAsync(new DetailsPage("fave")); } } }
public ColecaoTurmas GetTurmas(BusinessData.Entities.Calendario cal,List<BusinessData.Entities.CategoriaDisciplina> categoriasDeDisciplina) { BusinessData.BusinessLogic.TurmaBO controleTurmas = new BusinessData.BusinessLogic.TurmaBO(); BusinessData.BusinessLogic.AulaBO controleAulas = new BusinessData.BusinessLogic.AulaBO(); ColecaoTurmas colecao = new ColecaoTurmas(); List<BusinessData.Entities.Turma> listaTurmas = controleTurmas.GetTurmas(cal,categoriasDeDisciplina); TurmaDistribuicao turmaAux; foreach (BusinessData.Entities.Turma turma in listaTurmas) { turmaAux = new TurmaDistribuicao(turma, controleAulas.GetAulas(turma.Id)); colecao.Add(turmaAux); } return colecao; }
/// <summary> /// Retorna todos os dias letivos de um calendario especificado /// </summary> /// <param name="cal"></param> /// <returns></returns> public ColecaoDias GetColecaoDias(BusinessData.Entities.Calendario cal) { ColecaoDias colecao = new ColecaoDias(); Dia aux; for (DateTime data = cal.InicioG1; data <= cal.FimG2; data = data.AddDays(1.0)) { if (data.DayOfWeek == DayOfWeek.Sunday) { continue; } aux = new Dia(data); colecao.Add(aux); } return colecao; }
float getStolenChance(BusinessData data) { float stolenChance = 0.1f; foreach (HireeType hireeData in data.workersAssigned) { if (hireeData == HireeType.Guard) { stolenChance *= 0.3f; } if (hireeData == HireeType.Sales) { stolenChance *= 0.8f; } } return(stolenChance); }
private void HydrateBusinessData(ElementTree xml, Element xmlTrans, BusinessData businessData) { xml.SubElement(xmlTrans, "BusinessLegalName", businessData.BusinessLegalName); xml.SubElement(xmlTrans, "DoingBusinessAs", businessData.DoingBusinessAs); xml.SubElement(xmlTrans, "EIN", businessData.EmployerIdentificationNumber); xml.SubElement(xmlTrans, "MCCCode", businessData.MerchantCategoryCode); xml.SubElement(xmlTrans, "WebsiteURL", businessData.WebsiteURL); xml.SubElement(xmlTrans, "BusinessDesc", businessData.BusinessDescription); xml.SubElement(xmlTrans, "MonthlyBankCardVolume", businessData.MonthlyBankCardVolume); xml.SubElement(xmlTrans, "AverageTicket", businessData.AverageTicket); xml.SubElement(xmlTrans, "HighestTicket", businessData.HighestTicket); xml.SubElement(xmlTrans, "BusinessAddress", businessData.BusinessAddress.StreetAddress1); xml.SubElement(xmlTrans, "BusinessAddress2", businessData.BusinessAddress.StreetAddress2); xml.SubElement(xmlTrans, "BusinessCity", businessData.BusinessAddress.City); xml.SubElement(xmlTrans, "BusinessCountry", businessData.BusinessAddress.Country); xml.SubElement(xmlTrans, "BusinessState", businessData.BusinessAddress.State); xml.SubElement(xmlTrans, "BusinessZip", businessData.BusinessAddress.PostalCode); }
public IEnumerable <BusinessData> ListAll() { try { using (var context = new DepContext()) { return(context.BusinessData.ToList()); } } catch (Exception e) { List <BusinessData> list = new List <BusinessData>(); BusinessData bd = new BusinessData(); bd.FacebookUrl = e.Message; list.Add(bd); return(list); } }
static void Main(string[] args) { var businessData = new BusinessData(isA: false, isB: true, isC: true); var builder = new ChainBuilder(); var chain = builder.Build(); if (chain != null) { var response = chain.Process(businessData); DisplayResult(response); } else { Console.WriteLine("Chain has not been created."); } Console.ReadKey(); }
private static void UpdateClaimHeaderDataForReopenTransaction(IBusinessComponent component, BusinessData dataClass) { ClaimHeader claimHeader = component as ClaimHeader; ClaimHeaderData headerData = dataClass as ClaimHeaderData; if (claimHeader != null && headerData != null && claimHeader.Context != null && claimHeader.Context.TransactionType == ClaimsProcessConstants.REOPENCLAIM) { if (claimHeader.HistoricalClaimTransactionHeaders.Any(a => a.ClaimTransactionSource == (short?)StaticValues.ClaimTransactionSource.Payment)) { headerData.HasPayment = true; } if (claimHeader.HistoricalClaimTransactionHeaders.Any(a => a.ClaimTransactionSource == (short?)StaticValues.ClaimTransactionSource.Reserve)) { headerData.HasReserve = true; } } }
public static BusinessData CreateBusinessDataFromBranchDataViewModel(BranchDataViewModel data) { var model = new BusinessData() { RecipientName = data.Name, ProvinceId = data.ProvinceId, DistrictId = data.DistrictId, PostCode = data.PostCode, PhoneNumber = data.PhoneNumber, City = data.City, Street = data.Street, BuildingNumber = data.BuildingNumber, Emial = data.Email, IsBranch = true }; return(model); }
public void rentStall() { BusinessManager b = BusinessManager.instance; BusinessData d = b.getData(BusinessType.Stall); if (!d.rented) { if (attemptBuy(d.rentCost)) { b.setOwned(BusinessType.Stall, 1); rentStallButton.interactable = false; } } else { b.setOwned(BusinessType.Stall, 0); rentStallButton.GetComponentInChildren <Text>().text = "Rent £200/day"; } }
public IEnumerable <BusinessData> UpdateBusiness(Int32 Id, [FromBody] BusinessStatusRequest bus) { try { using (var context = new DepContext()) { BusinessData bd = context.BusinessData.Where(bus => bus.Id == Id).FirstOrDefault(); bd.Status = bus.Status; context.SaveChanges(); return(context.BusinessData.Where(bus => bus.Id == Id).ToList()); } } catch (Exception e) { Serilog.Log.Information("UpdateBusinessStatusError: " + e.Message); throw new Exception(); } }
public static void GetPosition(ref BusinessData data) { try { var url = "https://maps.googleapis.com/maps/api/geocode/json?address=" + data.BuildingNumber + "," + data.Street.Replace(' ', '+') + "," + data.City.Replace(' ', '+') + "," + data.PostCode; var json = (new WebClient()).DownloadString(url); var obj = JObject.Parse(json); if (obj["status"].Value <string>() != "OK") { return; } data.Lat = "" + obj["results"][0]["geometry"]["location"]["lat"]; data.Lng = "" + obj["results"][0]["geometry"]["location"]["lng"]; } catch (Exception) { data.Lat = null; data.Lng = null; } }
public static async Task Main(string[] args) { var builder = WebAssemblyHostBuilder.CreateDefault(args); builder.RootComponents.Add <App>("app"); Facture facture1 = new Facture("BAZATS", "00001", new DateTime(2020, 06, 04), new DateTime(2020, 07, 19), 104850000, 45632); Facture facture2 = new Facture("DURAND", "00002", new DateTime(2019, 03, 30), new DateTime(2019, 05, 15), 154650, 42132); BusinessData Factures = new BusinessData(); Factures.addFacture(facture1); Factures.addFacture(facture2); builder.Services.AddSingleton <IBusinessData>(sp => new BusinessData()); builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); await builder.Build().RunAsync(); }
public Recurso(BusinessData.Entities.Recurso rec) { this.rec = rec; alocacoes = new List<BusinessData.Entities.Alocacao>(); }
public override bool TryGetCustomField(BusinessData data, string fieldName, out Field field) { if (this.claimModel.HeaderData.CustomProperties == null) { this.claimModel.HeaderData.CustomProperties = new Dictionary<string, object>(); } switch (fieldName) { case "CustomProperties[AXA_CustomCode01UI]": { CodeLookupService.GetCodeList( this.claimModel.ClaimHeaderFields.CustomCode01.LookupDefinitionKey, this.claimModel.ClaimHeaderFields.CustomCode01.LookupParameters, (ObservableCollection<CodeRow> collection) => { if (this.claimModel != null) { var codeRow = collection.FirstOrDefault(c => c.Code == this.claimModel.HeaderData.CustomCode01); this.claimModel.HeaderData.CustomProperties["AXA_CustomCode01UI"] = string.Empty; if (codeRow != null) { this.claimModel.HeaderData.CustomProperties["AXA_CustomCode01UI"] = codeRow.Description; } } }); field = (Field)this.claimModel.ClaimHeaderFields.CustomCode01.Clone(); field.Readonly = true; field.PropertyName = "AXA_CustomCode01UI"; } break; case "CustomProperties[AXA_CustomReference04UI]": { this.claimModel.HeaderData.CustomProperties["AXA_CustomReference04UI"] = string.Empty; if (!string.IsNullOrEmpty(((ClaimHeaderData)this.claimModel.HeaderDto.Data).CustomReference04)) { this.claimModel.IsBusy = true; this.searchService.GetSearchParameters("ReassignUserSearch", (SearchParameters parameters) => { this.searchService.InvokeSearch(this.appModel.UserProfile.Culture, this.appModel.UserProfile.LanguageId, parameters.SearchName, this.BuildUserSearchCriteria(parameters), searchData => { if (searchData.SearchResultRowList.Count > 0) { var row = searchData.SearchResultRowList[0]; row.Columns.ForEach((column) => { if (column.ColumnName == "UserDescription") { this.claimModel.HeaderData.CustomProperties["AXA_CustomReference04UI"] = column.Value.ToString(); } }); } else { this.claimModel.HeaderData.CustomProperties["AXA_CustomReference04UI"] = ((ClaimHeaderData)this.claimModel.HeaderDto.Data).CustomReference04; } this.claimModel.HeaderData.InvokePropertyChanged("CustomProperties"); this.claimModel.IsBusy = false; }, this.HandleAsyncError); }); } field = (Field)this.claimModel.ClaimHeaderFields.CustomReference04.Clone(); field.PropertyName = "AXA_CustomReference04UI"; } break; case "CustomProperties[ClaimHandlerNameUI]": { var claimNameInvolvements = this.claimModel.HeaderDto.ClaimInvolvements.Where(c => c.IsFull && c.ClaimInvolvementData != null && c.ClaimInvolvementData.ClaimInvolvementType == (short)StaticValues.LinkableComponentType.NameInvolvement).SelectMany(b => b.ClaimNameInvolvements).ToList(); if (claimNameInvolvements != null) { var mainClaimHandler = claimNameInvolvements.FirstOrDefault(c => c.ClaimNameInvolvementData.NameInvolvementType == (short)StaticValues.NameInvolvementType_ClaimNameInvolvement.MainClaimHandler && c.ClaimNameInvolvementData.NameInvolvementMaintenanceStatus == (short)StaticValues.ClaimNameInvolvementMaintenanceStatus.Latest); if (mainClaimHandler != null) { field = new Field(); field.TypeInfo = new DataTypeInfo(DataTypeEnum.String); field.Readonly = true; field.Visible = true; field.PropertyName = "ClaimHandlerNameUI"; this.claimModel.HeaderData.CustomProperties["ClaimHandlerNameUI"] = mainClaimHandler.ClaimNameInvolvementData.ListName; } else { this.claimModel.HeaderData.CustomProperties["ClaimHandlerNameUI"] = String.Empty; } } } break; case "CustomProperties[AXA_ClaimHeaderAnalysisCode05UI]": { CodeLookupService.GetCodeList( this.claimModel.ClaimHeaderFields.ClaimHeaderAnalysisCode05.LookupDefinitionKey, this.claimModel.ClaimHeaderFields.ClaimHeaderAnalysisCode05.LookupParameters, (ObservableCollection<CodeRow> collection) => { if (this.claimModel != null) { var codeRow = collection.FirstOrDefault(c => c.Code == this.claimModel.HeaderData.ClaimHeaderAnalysisCode05); this.claimModel.HeaderData.CustomProperties["AXA_ClaimHeaderAnalysisCode05UI"] = string.Empty; if (codeRow != null) { this.claimModel.HeaderData.CustomProperties["AXA_ClaimHeaderAnalysisCode05UI"] = codeRow.Description; } } }); field = (Field)this.claimModel.ClaimHeaderFields.ClaimHeaderAnalysisCode05.Clone(); field.Readonly = true; field.PropertyName = "AXA_ClaimHeaderAnalysisCode05UI"; } break; case "CustomProperties[AXA_ClaimHeaderAnalysisCode06UI]": { CodeLookupService.GetCodeList( this.claimModel.ClaimHeaderFields.ClaimHeaderAnalysisCode06.LookupDefinitionKey, this.claimModel.ClaimHeaderFields.ClaimHeaderAnalysisCode06.LookupParameters, (ObservableCollection<CodeRow> collection) => { if (this.claimModel != null) { var codeRow = collection.FirstOrDefault(c => c.Code == this.claimModel.HeaderData.ClaimHeaderAnalysisCode06); this.claimModel.HeaderData.CustomProperties["AXA_ClaimHeaderAnalysisCode06UI"] = string.Empty; if (codeRow != null) { this.claimModel.HeaderData.CustomProperties["AXA_ClaimHeaderAnalysisCode06UI"] = codeRow.Description; } } }); field = (Field)this.claimModel.ClaimHeaderFields.ClaimHeaderAnalysisCode06.Clone(); field.Readonly = true; field.PropertyName = "AXA_ClaimHeaderAnalysisCode06UI"; } break; case "CustomProperties[AXA_ClaimHeaderAnalysisCode09UI]": { CodeLookupService.GetCodeList( this.claimModel.ClaimHeaderFields.ClaimHeaderAnalysisCode09.LookupDefinitionKey, this.claimModel.ClaimHeaderFields.ClaimHeaderAnalysisCode09.LookupParameters, (ObservableCollection<CodeRow> collection) => { if (this.claimModel != null) { var codeRow = collection.FirstOrDefault(c => c.Code == this.claimModel.HeaderData.ClaimHeaderAnalysisCode09); this.claimModel.SelectedIOVersionDetailData.CustomProperties["AXA_ClaimHeaderAnalysisCode09UI"] = string.Empty; if (codeRow != null) { this.claimModel.SelectedIOVersionDetailData.CustomProperties["AXA_ClaimHeaderAnalysisCode09UI"] = codeRow.Description; } } }); field = (Field)this.claimModel.ClaimHeaderFields.ClaimHeaderAnalysisCode09.Clone(); field.Readonly = true; field.PropertyName = "AXA_ClaimHeaderAnalysisCode09UI"; } break; } return base.TryGetCustomField(data, fieldName, out field); }
public AlocacaoTmp(BusinessData.Entities.Recurso r, DateTime d, string h, Aula a, Evento e) : base(r,d,h,a,e) { }
public override void UpdateBusinessData(IBusinessComponent component, BusinessData dataClass) { base.UpdateBusinessData(component, dataClass); this.UpdatePolicyReasonCodes(component, dataClass); UpdateClaimHeaderDataForReopenTransaction(component, dataClass); UpdateCustomProperties(component, dataClass); }
private static void UpdateCustomProperties(IBusinessComponent component, BusinessData dataClass) { ClaimHeader claimHeader = component as ClaimHeader; ClaimHeaderData headerData = dataClass as ClaimHeaderData; CodeRow code = claimHeader.CustomCode01Field.AllowedValues().Where(c => c.Code == claimHeader.CustomCode01).FirstOrDefault(); if (code != null) { headerData.CustomProperties["AXA_CustomCode01UI"] = code.Description; } code = claimHeader.ClaimHeaderAnalysisCode05Field.AllowedValues().Where(c => c.Code == claimHeader.ClaimHeaderAnalysisCode05).FirstOrDefault(); if (code != null) { headerData.CustomProperties["AXA_ClaimHeaderAnalysisCode05UI"] = code.Description; } code = claimHeader.ClaimHeaderAnalysisCode06Field.AllowedValues().Where(c => c.Code == claimHeader.ClaimHeaderAnalysisCode06).FirstOrDefault(); if (code != null) { headerData.CustomProperties["AXA_ClaimHeaderAnalysisCode06UI"] = code.Description; } string[] predicates = { ConfigurationManager.AppSettings[AXAClaimsDecisionTablePluginPredicate] }; ClaimsDecisionTablePluginPredicate cdtPredicate = ObjectFactory.Resolve<ClaimsDecisionTablePluginPredicate>(); bool isMotorProduct = cdtPredicate.CanExecute((IBusinessComponent)claimHeader, ProcessInvocationPoint.Blank, ClaimSummaryTotalsFieldsMotorProductCheck, predicates); short? processingMethod = claimHeader.GetProduct().ProductClaimDefinition.ClaimHeaderAutomaticDeductibleProcessingMethod; headerData.CustomProperties["TotalClaimLossField"] = new Field() { TypeInfo = new DecimalTypeInfo(), Readonly = true, Visible = true, Title = "Total", DefaultValue = 0, Precision = 15, Scale = 2 }; headerData.CustomProperties["ExcessField"] = new Field() { TypeInfo = new DecimalTypeInfo(), Readonly = true, Visible = isMotorProduct, Title = "Excess", DefaultValue = 0, Precision = 15, Scale = 2 }; headerData.CustomProperties["OutstandingEstimateField"] = new Field() { TypeInfo = new DecimalTypeInfo(), Readonly = true, Visible = true, Title = "O/S Estimate", DefaultValue = 0, Precision = 15, Scale = 2 }; headerData.CustomProperties["OutstandingRecoveryEstimateField"] = new Field() { TypeInfo = new DecimalTypeInfo(), Readonly = true, Visible = true, Title = "O/S Recovery Estimate", DefaultValue = 0, Precision = 15, Scale = 2 }; headerData.CustomProperties["OutstandingULREstimateField"] = new Field() { TypeInfo = new DecimalTypeInfo(), Readonly = true, Visible = isMotorProduct, Title = "O/S ULR Estimate", DefaultValue = 0, Precision = 15, Scale = 2 }; headerData.CustomProperties["PaymentsInProgressField"] = new Field() { TypeInfo = new DecimalTypeInfo(), Readonly = true, Visible = true, Title = "Payments in Progress", DefaultValue = 0, Precision = 15, Scale = 2 }; headerData.CustomProperties["RecoveryInProgressField"] = new Field() { TypeInfo = new DecimalTypeInfo(), Readonly = true, Visible = true, Title = "Recoveries in Progress", DefaultValue = 0, Precision = 15, Scale = 2 }; headerData.CustomProperties["ULRField"] = new Field() { TypeInfo = new DecimalTypeInfo(), Readonly = true, Visible = isMotorProduct, Title = "ULR in Progress", DefaultValue = 0, Precision = 15, Scale = 2 }; headerData.CustomProperties["TotalPaymentsPaidField"] = new Field() { TypeInfo = new DecimalTypeInfo(), Readonly = true, Visible = true, Title = "Total Payments", DefaultValue = 0, Precision = 15, Scale = 2 }; headerData.CustomProperties["RecoveriesCompletedField"] = new Field() { TypeInfo = new DecimalTypeInfo(), Readonly = true, Visible = true, Title = "Recoveries Completed", DefaultValue = 0, Precision = 15, Scale = 2 }; headerData.CustomProperties["ULRCompletedField"] = new Field() { TypeInfo = new DecimalTypeInfo(), Readonly = true, Visible = isMotorProduct, Title = "ULR Completed", DefaultValue = 0, Precision = 15, Scale = 2 }; headerData.CustomProperties["AXAManagedShareField"] = new Field { TypeInfo = new DecimalTypeInfo(), Precision = 10, Scale = 7, Visible = processingMethod.GetValueOrDefault() == (short)StaticValues.ClaimHeaderAutomaticDeductibleProcessingMethod.NotActive, Readonly = true }; headerData.CustomProperties["AXAShareField"] = new Field { TypeInfo = new DecimalTypeInfo(), Precision = 10, Scale = 7, Visible = processingMethod.GetValueOrDefault() == (short)StaticValues.ClaimHeaderAutomaticDeductibleProcessingMethod.NotActive, Readonly = true }; using (var claimsEntities = ClaimsEntitiesFactory.GetClaimsEntities()) { var latestCTH = claimHeader.HistoricalClaimTransactionHeaders.OrderByDescending(h => h.ClaimTransactionHeaderID).FirstOrDefault(); if (latestCTH != null && latestCTH.ClaimTransactionGroups.Any()) { var latestCTG= latestCTH.ClaimTransactionGroups.OrderByDescending(c => c.ClaimTransactionGroupID).FirstOrDefault(); if (latestCTG != null) { headerData.CustomProperties["CoinsuranceOfWholePercent"] = latestCTG.CoinsuranceOfWholePercent; headerData.CustomProperties["ShareOfWholePercent"] = latestCTG.ShareOfWholePercent; } } else { headerData.CustomProperties["CoinsuranceOfWholePercent"] = null; headerData.CustomProperties["ShareOfWholePercent"] = null; } } }
private void UpdatePolicyReasonCodes(Xiap.Framework.IBusinessComponent component, BusinessData dataClass) { ClaimHeader claimHeader = component as ClaimHeader; ClaimHeaderData headerData = dataClass as ClaimHeaderData; if (claimHeader.Context.GetAttachedData<DeductibleReasonCode>(false) != null) { DeductibleReasonCode deductibleReasonCode = claimHeader.Context.GetAttachedData<DeductibleReasonCode>(true).FirstOrDefault(); if (deductibleReasonCode.PolicyReasonCodes != null && deductibleReasonCode.PolicyReasonCodes.Count > 0) { headerData.CodeRowList = deductibleReasonCode.PolicyReasonCodes; } } }