public static List <PreparedRecord> Prepare(global::Statistics.Statistics statistics)
        {
            var states = Configurator.Config();

            return
                (statistics.Records.Select(
                     item =>
                     new PreparedRecord(item.TimeOfOperation.ToString(CultureInfo.InvariantCulture),
                                        item.RequestedSum.ToString(CultureInfo.InvariantCulture), states[item.ResultOfOperation],
                                        PrepareMoney(item.Money))).ToList());
        }
示例#2
0
        public StatisticsForm(global::Statistics.Statistics statistics)
        {
            var t = CultureInfo.CurrentCulture;

            InitializeComponent();
            t = CultureInfo.CurrentCulture;
            metroGrid1.DataSource = StatisticsPreparer.Prepare(statistics);
            metroGrid2.DataSource = statistics.Cassettes;


            labelTime.Text      += statistics.StartTime;
            labelTotalSum.Text  += statistics.TotalSum;
            labelRemainder.Text += statistics.Remainder;
        }
示例#3
0
        public AtmGui()
        {
            Log.Info("start");
            InitializeComponent();

            DisenableButtonSelection();

            XmlConfigurator.Configure();
            _errors = Configurator.Config();
            Atm     = CashMachine.Deserialize(ConfigurationManager.AppSettings["SerializationAtm"]) ??
                      new CashMachine(new GreedyAlgorithm());
            Stat = global::Statistics.Statistics.Deserialize(ConfigurationManager.AppSettings["SerializationStatistics"]) ??
                   new global::Statistics.Statistics();
            AtmEvent.InsertCassettesEvent += Stat.InsertCassettes;
            AtmEvent.WithdrawMoneyEvent   += Stat.WithdrawMoney;
            AtmEvent.RemoveCassettesEvent += Stat.RemoveCassettes;

            _operation = Operations.Withdraw;
            InitializeBanknotes();
        }