public void MarkProxyFail(ServiceCode serviceCode, string proxy) { if (_proxyStore != null) { _proxyStore.MarkProxyFail(serviceCode, proxy); } }
/// <summary> /// Translates card track data into information. /// </summary> /// <param name="rawResponse">Raw response from pinpad GCR command.</param> /// <returns>Card information.</returns> /// <exception cref="System.InvalidOperationException">Thrown when womething went wrong internally.</exception> public CardEntry Read(GcrResponse rawResponse) { CardEntry mappedCard = new CardEntry(); // Save all tracks: if (rawResponse.GCR_TRK1.HasValue == true) { mappedCard.Track1 = rawResponse.GCR_TRK1.Value; } if (rawResponse.GCR_TRK2.HasValue == true) { mappedCard.Track2 = rawResponse.GCR_TRK2.Value; } // Selecting existing track: string selectedTrack = this.MapValidTrack(rawResponse); // Selecting corresponding track field separator: char fieldSeparator = this.GetFieldSeparator(selectedTrack); // Get Service code: ServiceCode sc = this.MapServiceCode(selectedTrack, fieldSeparator); // Values that don't need to be mapped: mappedCard.BrandId = rawResponse.GCR_RECIDX.Value.Value; // Mapping PAN, cardholder name, card expiration date and Service Code: mappedCard.PrimaryAccountNumber = this.MapPan(selectedTrack, fieldSeparator); mappedCard.CardholderName = this.MapCardholderName(selectedTrack, fieldSeparator); mappedCard.ExpirationDate = this.MapExpirationDate(selectedTrack, fieldSeparator); mappedCard.NeedsPassword = sc.IsPinRequired; mappedCard.Type = (sc.IsEmv == true) ? CardType.Emv : CardType.MagneticStripe; return(mappedCard); }
private void Sender(ServiceCode service, string from, string to, string subject, string message) { var messageRequest = new MessageRequestModel() { From = from, To = to, Message = message, Subject = subject, Brand = _xnotifiSettings.Value.Brand }; var gateway = GetGateway(service); gateway.Password = _generator.Decrypt(gateway.Password).Result; var application = GetCreateApplication(_xnotifiSettings.Value.Brand, _xnotifiSettings.Value.ClientId); var messager = (_xnotifiSettings.Value.Development)? "Local Dev." : _messageAdapter.Send(messageRequest, gateway); var requestLog = new RequestModel() { ApplicationId = application.ApplicationId, GatewayId = gateway.GatewayId, Service = ServiceCode.Email, Recipients = 1, Cost = 0.00m, Response = messager, DateCreated = DateTime.UtcNow }; _requestService.Create(requestLog); }
private SmsServiceInfoCondition GetSmsServiceInfoCondition(ServiceCode serviceCode) { if (cbSmsAuto.Checked && cbCountryAuto.Checked) { return(null); } var smsServiceInfoCondition = new SmsServiceInfoCondition { ServiceCode = serviceCode }; if (!cbCountryAuto.Checked) { smsServiceInfoCondition.CountryCodes = new List <CountryCode> { ((CountryItem)cmbCountry.SelectedItem).CountryCode }; } if (!cbSmsAuto.Checked) { smsServiceInfoCondition.SmsServiceCodes = new List <SmsServiceCode> { ((SmsServiceItem)cmbSmsService.SelectedItem).SmsServiceCode }; } return(smsServiceInfoCondition); }
public int GetCount(ServiceCode serviceCode) { switch (serviceCode) { case ServiceCode.MailRu: return(ma_0); case ServiceCode.Yandex: return(ya_0); case ServiceCode.Gmail: return(go_0); case ServiceCode.Other: return(Other); case ServiceCode.Facebook: return(fb_0); case ServiceCode.Vk: return(Vk); case ServiceCode.Ok: return(ok_0); default: return(0); } }
public override int GetHashCode() { unchecked { var hashCode = (Category != null ? Category.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (CateringCode != null ? CateringCode.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (ConnectionIndicator != null ? ConnectionIndicator.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (CourseIndicator != null ? CourseIndicator.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (HeadCode != null ? HeadCode.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (OperatingCharacteristics != null ? OperatingCharacteristics.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (PortionId != null ? PortionId.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (PowerType != null ? PowerType.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (int)RecordIdentity; hashCode = (hashCode * 397) ^ (int)Reservations; hashCode = (hashCode * 397) ^ (Rsid != null ? Rsid.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (int)SeatingClass; hashCode = (hashCode * 397) ^ (ServiceBranding != null ? ServiceBranding.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (ServiceCode != null ? ServiceCode.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (int)Sleepers; hashCode = (hashCode * 397) ^ Speed; hashCode = (hashCode * 397) ^ (TimingLoad != null ? TimingLoad.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Tiploc != null ? Tiploc.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (TiplocSuffix != null ? TiplocSuffix.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (TrainIdentity != null ? TrainIdentity.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (UicCode != null ? UicCode.GetHashCode() : 0); return(hashCode); } }
public string GetCost(CountryCode countryCode, ServiceCode serviceCode) { var getSmsCountry = GetByCountry(countryCode); switch (serviceCode) { case ServiceCode.MailRu: return(getSmsCountry.ma.cost); case ServiceCode.Yandex: return(getSmsCountry.ya.cost); case ServiceCode.Gmail: return(getSmsCountry.go.cost); case ServiceCode.Other: return(getSmsCountry.ot.cost); case ServiceCode.Facebook: return(getSmsCountry.fb.cost); case ServiceCode.Vk: return(getSmsCountry.vk.cost); case ServiceCode.Ok: return(getSmsCountry.ok.cost); default: return(""); } }
public static ErrorLogInfo CreateErrorLog(ServiceCode serviceCode, int n4ErrorCode, string strLoginID, string strErrorMessage, string strStackTrace) { int num; DateTime dateTime; return(ErrorLog.CreateErrorLog(serviceCode, n4ErrorCode, strLoginID, strErrorMessage, strStackTrace, out num, out dateTime)); }
public static ErrorLogInfo CreateErrorLog(ServiceCode serviceCode, int n4ErrorCode, string strLoginID, Exception ex) { int num; DateTime dateTime; return(ErrorLog.CreateErrorLog(serviceCode, n4ErrorCode, strLoginID, ex, out num, out dateTime)); }
/// <summary> /// Exception that can be caught and handled in an Http Response /// </summary> /// <param name="statusCode"></param> /// <param name="statusLine"></param> /// <param name="serviceCode"></param> /// <param name="args"></param> public HttpProxyException(HttpStatusCode statusCode, string statusLine, ServiceCode serviceCode, params object [] args) { _statusCode = statusCode; _statusLine = statusLine; _serviceCode = serviceCode; _messageArgs = args; }
// // POST: /Services/Delete/5 //[HttpPost, ActionName("Delete")] //[ValidateAntiForgeryToken] public ActionResult DeleteConfirmed(int id) { ServiceCode servicecode = db.ServiceCodes.Find(id); db.ServiceCodes.Remove(servicecode); db.SaveChanges(); return(RedirectToAction("Index")); }
public bool SameAs(XRoadService service) { return(XRoadInstance.Equals(service.XRoadInstance) && MemberClass.Equals(service.MemberClass) && MemberCode.Equals(service.MemberCode) && ServiceCode.Equals(service.ServiceCode) && string.Equals(SubsystemCode, service.SubsystemCode) && string.Equals(ServiceVersion, service.ServiceVersion)); }
// // GET: /Services/Edit/5 public ActionResult Edit(int id = 0) { ServiceCode servicecode = db.ServiceCodes.Find(id); if (servicecode == null) { return(HttpNotFound()); } return(View(servicecode)); }
public override int GetHashCode() { unchecked { var hashCode = base.GetHashCode(); hashCode = (hashCode * 397) ^ (ServiceCode != null ? ServiceCode.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (ServiceVersion != null ? ServiceVersion.GetHashCode() : 0); return(hashCode); } }
private void SaveData() { ShippingMethod.Name = NameField.Text.Trim(); ShippingMethod.ZoneId = long.Parse(lstZones.SelectedItem.Value); ShippingMethod.AdjustmentType = (ShippingMethodAdjustmentType)int.Parse(AdjustmentDropDownList.SelectedValue); ShippingMethod.Adjustment = decimal.Parse(AdjustmentTextBox.Text, NumberStyles.Currency); if (ShippingMethod.AdjustmentType == ShippingMethodAdjustmentType.Amount) { ShippingMethod.Adjustment = Money.RoundCurrency(ShippingMethod.Adjustment); } // Global Settings HccApp.CurrentStore.Settings.ShippingUpsAccountNumber = AccountNumberField.Text.Trim(); HccApp.CurrentStore.Settings.ShippingUpsForceResidential = ResidentialAddressCheckBox.Checked; HccApp.CurrentStore.Settings.ShippingUpsPickupType = int.Parse(PickupTypeRadioButtonList.SelectedValue); HccApp.CurrentStore.Settings.ShippingUpsDefaultService = int.Parse(DefaultServiceField.SelectedValue); HccApp.CurrentStore.Settings.ShippingUpsDefaultPackaging = int.Parse(DefaultPackagingField.SelectedValue); HccApp.CurrentStore.Settings.ShippingUpsSkipDimensions = SkipDimensionsCheckBox.Checked; HccApp.CurrentStore.Settings.ShippingUPSDiagnostics = chkDiagnostics.Checked; // Method Settings var Settings = new UPSServiceSettings(); Settings.Merge(ShippingMethod.Settings); var filter = new List <IServiceCode>(); if (rbFilterMode.SelectedValue == "0") { Settings.GetAllRates = false; foreach (ListItem item in ShippingTypesCheckBoxList.Items) { if (item.Selected) { var code = new ServiceCode { Code = item.Value, DisplayName = item.Text }; filter.Add(code); } } } else { Settings.GetAllRates = true; } Settings.ServiceCodeFilter = filter; Settings["highlight"] = lstHighlights.SelectedValue; ShippingMethod.Settings.Merge(Settings); HccApp.AccountServices.Stores.Update(HccApp.CurrentStore); }
internal void MapServiceCodeToFailure(ServiceCode code) { if (m_failure == null) { m_failure = Scout.Core.Data.CreateEntity <RouteStationFailure>(UnitOfWork); } m_failure.FailCode = code; m_failure.StationProcess = m_process; m_failure.Comments = m_comments; }
public ServiceHelper(ServiceCode code) { switch (code) { case (ServiceCode.BCRM_Update): ServiceCode = ServiceCode.BCRM_Update; InboundServiceName = "%UpdateCustomerAttributes%"; ServiceName = "UpdateCustomerAttributesService"; FolderName = ConfigurationManager.AppSettings["BCRMFolder"].ToString(); FileNameContains = "Update_BCRM_Records"; break; case (ServiceCode.Create_CPP): ServiceCode = ServiceCode.Create_CPP; InboundServiceName = "%CreateDistProject%"; ServiceName = "CreateNewDistProjectService"; FolderName = ConfigurationManager.AppSettings["DistProjectFolder"].ToString(); FileNameContains = "Create_CPP_Projects"; break; case (ServiceCode.Create_SNC): ServiceCode = ServiceCode.Create_SNC; InboundServiceName = "%CreateDistSNCProject%"; ServiceName = "CreateDistSNCProjectService"; FolderName = ConfigurationManager.AppSettings["DistProjectFolder"].ToString(); FileNameContains = "Create_SNC_Projects"; break; case (ServiceCode.Update_CPP): ServiceCode = ServiceCode.Update_CPP; InboundServiceName = "%UpdateDistProjectStatus%"; ServiceName = "UpdateDistProjectStatusService"; FolderName = ConfigurationManager.AppSettings["DistProjectUpdateFolder"].ToString(); FileNameContains = "Update_CPP_Records"; break; case (ServiceCode.Update_SNC): ServiceCode = ServiceCode.Update_SNC; InboundServiceName = "%UpdateDistSNCProject%"; ServiceName = "UpdateDistSNCProjectStatusService"; FolderName = ConfigurationManager.AppSettings["DistProjectUpdateFolder"].ToString(); FileNameContains = "Update_SNC_Records"; break; case (ServiceCode.ERMS_Update): default: ServiceCode = ServiceCode.ERMS_Update; InboundServiceName = "%UpdateERMSPMAssetAttrib%"; ServiceName = "UpdateAssetAttribService"; FolderName = ConfigurationManager.AppSettings["ErmsFolder"].ToString(); FileNameContains = "Update_Asset_Attrib_Service"; break; } }
public string GetProxy(ServiceCode serviceCode) { //return string.Empty; if (!list.Any()) { return(string.Empty); } var idx = _random.Next(0, list.Count - 1); return(list[idx].ProxyString); }
public double GetMaxResponseTime() { if (Attemps == 0) { return(0); } var time = new TimeSpan(ServiceCode.ToLong()); var value = time.TotalSeconds; var round = (int)(value * 100); return(round / 100.0); }
public static void Initialize(RechargeKadDBContext context) { context.Database.EnsureCreated(); if (context.ServiceCodes.Any()) { return; // DB has been seeded } var serviceCodes = new ServiceCode[] { new ServiceCode() { NetworkType = NetworkType.AIRTEL, RechargeType = RechargeType.AIRTIME, Vendor = Vendor.CREDIT_SWITCH, Code = "A01E" }, new ServiceCode() { NetworkType = NetworkType.ETISALAT, RechargeType = RechargeType.AIRTIME, Vendor = Vendor.CREDIT_SWITCH, Code = "A02E" }, new ServiceCode() { NetworkType = NetworkType.GLOBACOM, RechargeType = RechargeType.AIRTIME, Vendor = Vendor.CREDIT_SWITCH, Code = "A03E" }, new ServiceCode() { NetworkType = NetworkType.MTN, RechargeType = RechargeType.AIRTIME, Vendor = Vendor.CREDIT_SWITCH, Code = "A04E" }, new ServiceCode() { NetworkType = NetworkType.AIRTEL, RechargeType = RechargeType.DATA, Vendor = Vendor.CREDIT_SWITCH, Code = "D01D" }, new ServiceCode() { NetworkType = NetworkType.ETISALAT, RechargeType = RechargeType.DATA, Vendor = Vendor.CREDIT_SWITCH, Code = "D02D" }, new ServiceCode() { NetworkType = NetworkType.GLOBACOM, RechargeType = RechargeType.DATA, Vendor = Vendor.CREDIT_SWITCH, Code = "D03D" }, new ServiceCode() { NetworkType = NetworkType.MTN, RechargeType = RechargeType.DATA, Vendor = Vendor.CREDIT_SWITCH, Code = "D04D" }, }; foreach (ServiceCode s in serviceCodes) { context.ServiceCodes.Add(s); } context.SaveChanges(); }
private static bool CodeIsValid(ColumnView view, ValidateRowEventArgs e) { ServiceCode code = e.Row as ServiceCode; GridColumn column = view.Columns["Code"]; if (code != null && code.Code.Length > 0) { return(true); } view.SetColumnError(column, "Code is required."); return(false); }
public async Task <IEnumerable <SmsServiceInfo> > GetServiceInfoList(ServiceCode serviceCode) { if (!_smsServiceInfoListInitialized) { await InitializeSmsServiceInfoList(); } return(_smsServiceInfoList .Where(z => z.ServiceCode == serviceCode && z.NumberCount > 0 && !z.Skiped) .OrderBy(z => z.FailCount) .ThenBy(z => z.Price) .ThenByDescending(z => z.NumberCount) .ToList()); }
private void AddFailure() { ServiceCode code = failCodeView.GetFocusedRow() as ServiceCode; if (code == null) { return; } m_callback(this, new ServiceCodeEventArgs(code, commentsText.Text)); Close(); }
public JsonResult Delete(int id = 0) { ServiceCode servicecode = db.ServiceCodes.Find(id); //if (servicecode == null) //{ //servicecode = db.ServiceCodes.Find(id); db.ServiceCodes.Remove(servicecode); db.SaveChanges(); return(Json(new { success = true }, JsonRequestBehavior.AllowGet)); //} //return View(servicecode); }
public void when_the_first_failure_is_added_to_the_collection_it_is_set_to_the_fp_error_code() { RouteStationProcess process = Xpo.CreateXPObject <RouteStationProcess>(); InventoryItem item = Xpo.CreateXPObject <InventoryItem>(); process.Item = item; ServiceCode serviceCode = Xpo.CreateXPObject <ServiceCode>(); RouteStationFailure firstFailure; firstFailure = process.AddFailure(serviceCode, "test"); Assert.That(firstFailure.IsFpErrorCode); }
private void SaveData() { ShippingMethod.Name = NameField.Text.Trim(); ShippingMethod.ZoneId = long.Parse(lstZones.SelectedItem.Value); ShippingMethod.AdjustmentType = (ShippingMethodAdjustmentType)int.Parse(AdjustmentDropDownList.SelectedValue); ShippingMethod.Adjustment = decimal.Parse(AdjustmentTextBox.Text, NumberStyles.Currency); if (ShippingMethod.AdjustmentType == ShippingMethodAdjustmentType.Amount) { ShippingMethod.Adjustment = Money.RoundCurrency(ShippingMethod.Adjustment); } // Global Settings HccApp.CurrentStore.Settings.ShippingUSPostalUserId = txtUserId.Text.Trim(); HccApp.CurrentStore.Settings.ShippingUSPostalDiagnostics = chbDiagnostics.Checked; HccApp.UpdateCurrentStore(); // Method Settings var Settings = new USPostalServiceSettings(); Settings.Merge(ShippingMethod.Settings); // Service Code var filter = new List <IServiceCode>(); foreach (ListItem item in ShippingTypesCheckBoxList.Items) { if (item.Selected) { var code = new ServiceCode { Code = item.Value, DisplayName = item.Text }; filter.Add(code); } } Settings.ServiceCodeFilter = filter; Settings["highlight"] = lstHighlights.SelectedValue; // Package var packageCode = lstPackageType.SelectedItem.Value; var packageCodeInt = -1; if (int.TryParse(packageCode, out packageCodeInt)) { Settings.PackageType = (DomesticPackageType)packageCodeInt; } ShippingMethod.Settings.Merge(Settings); }
public void DefaultMagneticStripeTrackReader_MapServiceCode_ShouldReturnIsPinRequiredAsFalse_IfParametersAreValid() { // Arrange string track1 = "B4205932010016391^ /^2309121000000000000000225000000"; char expectedFieldSeparator = '^'; // Act ServiceCode mappedServiceCode = this.defaultReader.MapServiceCode( track1, expectedFieldSeparator); // Assert Assert.IsFalse(mappedServiceCode.IsPinRequired); }
/// <summary> /// test locally without saving to database /// for debugging purposes only: call this method in Main() /// </summary> /// <param name="myService">Service Code</param> private static void TestTransactionId(ServiceCode myService) { PrintHelper.Trace(string.Format(Messages.GetServiceName, myService.ToString())); ServiceHelper sh = new ServiceHelper(myService); List <FileInfo> logFiles = ReadHelper.Read_SW_Logs(inputDate, sh); foreach (FileInfo file in logFiles) { DateTime createDate = file.CreationTime; DateTime modifiedDate = file.LastWriteTime; string id = ReadHelper.GetTransactionId_StreamReader(file); PrintHelper.Trace(string.Format("the output transaction ID is {0}", id)); } }
public bool Equals(Services other) { if (Object.ReferenceEquals(other, null)) { return(false); } if (Object.ReferenceEquals(this, other)) { return(true); } return(ServiceCode.Equals(other.ServiceCode)); }
public static UserBasicInfo GetUserBasicInfo(ServiceCode serviceCode, string strNexonID) { UserBasicGetListSoapResult userBasicGetListSoapResult = new UserBasicGetInfoSoapWrapper { ServiceCode = (int)serviceCode, NexonID = strNexonID }.Execute(); if (userBasicGetListSoapResult.SoapErrorCode == 0 && userBasicGetListSoapResult.UserBasicList.Count == 1) { return(userBasicGetListSoapResult.UserBasicList[0]); } return(null); }