123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194 |
- using Dfs.WayneChina.SinochemEps;
- using System;
- using System.Collections.Generic;
- using System.Configuration;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace SinochemInternetPlusApp
- {
- public static class ConfigurationValues
- {
- private static readonly string needConfirmExpiration =
- SinochemEpsApp.AppSettings["NeedConfirmEpsTrxExpirationInMinutes"];
- public static double NeedConfirmEpsTrxExpirationInMinutes
- {
- get
- {
- try
- {
- return double.Parse(needConfirmExpiration);
- }
- catch (Exception ex)
- {
- return 24 * 60;
- }
- }
- }
- private static readonly string doneEpsTrxCountPerDisplay =
- SinochemEpsApp.AppSettings["AlreadyDoneEpsTrxCountPerDisplay"];
- public static int AlreadyDoneEpsTrxCountPerDisplay
- {
- get
- {
- try
- {
- return int.Parse(doneEpsTrxCountPerDisplay);
- }
- catch (Exception ex)
- {
- return 50;
- }
- }
- }
- private static readonly string fuelingPoints =
- SinochemEpsApp.AppSettings["ListOfFuelingPoints"];
- public static IEnumerable<int> ListOfFuelingPoints
- {
- get
- {
- try
- {
- return fuelingPoints.Split(',')
- .Where(str => !string.IsNullOrEmpty(str))
- .Select(str => int.Parse(str));
- }
- catch (Exception ex)
- {
- return new int[] { 1, 2 };
- }
- }
- }
- private static readonly string fpAssociatedNozzles =
- SinochemEpsApp.AppSettings["AssociatedNozzlesForFuelingPoints"];
- public static Dictionary<int, IEnumerable<int>> FuelingPointNozzlesDict
- {
- get
- {
- try
- {
- var list = fpAssociatedNozzles.Replace(" ", "").Split(';');
- Dictionary<int, IEnumerable<int>> dict = new Dictionary<int, IEnumerable<int>>();
- foreach (var item in list)
- {
- var subItems = item.Split('=');
- dict.Add(Convert.ToInt32(subItems[0]), subItems[1].Split(',').Select(Int32.Parse));
- }
- return dict;
- }
- catch (Exception)
- {
- return null;
- }
- }
- }
- private static readonly string multiFusions =
- SinochemEpsApp.AppSettings["SupportMultiFusions"];
- public static bool SupportMultiFusions
- {
- get
- {
- try
- {
- return bool.Parse(multiFusions);
- }
- catch (Exception ex)
- {
- return false;
- }
- }
- }
- private static readonly string resendPosNotifyExpire =
- SinochemEpsApp.AppSettings["ResendPosNotifyExpirationInMinutes"];
- public static int ResendPosNotifyExpirationInMinutes
- {
- get
- {
- try
- {
- return int.Parse(resendPosNotifyExpire);
- }
- catch (Exception ex)
- {
- return 24 * 60;
- }
- }
- }
-
- private static readonly string epsTrxHistoryArchive =
- SinochemEpsApp.AppSettings["EpsTrxHistoryArchiveInDays"];
- public static int EpsTrxHistoryArchiveInDays
- {
- get
- {
- try
- {
- return int.Parse(epsTrxHistoryArchive);
- }
- catch (Exception ex)
- {
- return 90;
- }
- }
- }
- private static readonly string icPaymentResultDisplayTO =
- SinochemEpsApp.AppSettings["ICCardPaymentResultDisplayTimeoutInSeconds"];
- public static int ICCardPaymentResultDisplayTimeoutInSeconds
- {
- get
- {
- try
- {
- return int.Parse(icPaymentResultDisplayTO);
- }
- catch (Exception ex)
- {
- return 10;
- }
- }
- }
- private static readonly string receiptEnabled =
- SinochemEpsApp.AppSettings["PrintReceiptEnabled"];
- public static bool PrintReceiptEnabled
- {
- get
- {
- try
- {
- return bool.Parse(receiptEnabled);
- }
- catch (Exception ex)
- {
- return true;
- }
- }
- }
- private static readonly string qrCodeEnabled =
- SinochemEpsApp.AppSettings["PrintQrCodeOnReceiptEnabled"];
- public static bool PrintQrCodeOnReceiptEnabled
- {
- get
- {
- try
- {
- return bool.Parse(qrCodeEnabled);
- }
- catch (Exception ex)
- {
- return true;
- }
- }
- }
- }
- }
|