public void LoadData()
        {
            try
            {
                var AlphaList = Alpharepo.GetAlphasAsync().Result.ToList();
                ObservableCollection <Alpha> POData = new ObservableCollection <Alpha>();
                foreach (var item in AlphaList)
                {
                    POData.Add(item);
                }
                Alphas = POData;

                var BetaList = Betarepo.GetBetasAsync().Result.ToList();
                ObservableCollection <Beta> BetaData = new ObservableCollection <Beta>();
                foreach (var item in BetaList)
                {
                    BetaData.Add(item);
                }
                Betas = BetaData;

                var GammaList = Gammarepo.GetGammasAsync().Result.ToList();
                ObservableCollection <Gamma> GammaData = new ObservableCollection <Gamma>();
                foreach (var item in GammaList)
                {
                    GammaData.Add(item);
                }
                Gammas = GammaData;

                var DeltaList = DeltaRepo.GetDeltasAsync().Result.ToList();
                ObservableCollection <Delta> DeltaData = new ObservableCollection <Delta>();
                foreach (var item in DeltaList)
                {
                    DeltaData.Add(item);
                }
                Deltas = DeltaData;

                var ThetaList = ThetaRepo.GetThetasAsync().Result.ToList();
                ObservableCollection <Theta> ThetaData = new ObservableCollection <Theta>();
                foreach (var item in ThetaList)
                {
                    ThetaData.Add(item);
                }
                Thetas = ThetaData;

                SelectedBeta  = Betas.First(x => x.Id.Equals(1));
                SelectedGamma = Gammas.First(x => x.Id.Equals(1));
                SelectedAlpha = Alphas.First(x => x.Id.Equals(1));
                SelectedDelta = Deltas.First(x => x.Id.Equals(1));
                SelectedTheta = Thetas.First(x => x.Id.Equals(1));
                SaveText      = null;
            }
            catch (Exception e)
            {
                _logger.Error("Some error have AddRecordViewModel Load data , stacktarce =" + e.StackTrace);
                _logger.Error("AddRecordViewModel error message is " + e.Message + " inner error is " + e.InnerException.Message);
            }
        }
        private void ResetUI()
        {
            SelectedBeta  = Betas.First(x => x.Id.Equals(1));
            SelectedGamma = Gammas.First(x => x.Id.Equals(1));
            SelectedAlpha = Alphas.First(x => x.Id.Equals(1));
            SelectedDelta = Deltas.First(x => x.Id.Equals(1));
            SelectedTheta = Thetas.First(x => x.Id.Equals(1));
            Zeus          = null;
            Hera          = null;
            BeginDate     = null;
            EndDate       = null;

            TargetDate = null;
            Artemis    = null;
            Ares       = null;
            Athena     = null;
            Apollo     = null;
            Poseidon   = null;
            Remarks    = null;
        }
Esempio n. 3
0
        public List <List <string> > GetPDFDAta()
        {
            List <List <string> > ListOfRecord = new List <List <string> >();


            foreach (var item in ReportRecords)
            {
                List <string> SingleRecord = new List <string>();
                if (PdfFilterZeus)
                {
                    SingleRecord.Add(item.Zeus);
                }

                if (PdfFilterStatus)
                {
                    SingleRecord.Add(Statuses.First(x => x.Id.Equals(item.StatusID)).Name.ToString());
                }

                if (PdfFilterEndDate)
                {
                    SingleRecord.Add(item.EndDate);
                }

                if (PdfFilterGamma)
                {
                    SingleRecord.Add(Gammas.First(x => x.Id.Equals(item.GammaID)).Name.ToString());
                }

                if (PdfFilterBeta)
                {
                    SingleRecord.Add(Betas.First(x => x.Id.Equals(item.BetaID)).Name.ToString());
                }

                if (PdfFilterAlpha)
                {
                    SingleRecord.Add(Alphas.First(x => x.Id.Equals(item.AlphaID)).Name.ToString());
                }

                if (PdfFilterHera)
                {
                    SingleRecord.Add(item.Hera);
                }

                if (PdfFilterDelta)
                {
                    SingleRecord.Add(Deltas.First(x => x.Id.Equals(item.DeltaID)).Name.ToString());
                }

                if (PdfFilterBeginDate)
                {
                    SingleRecord.Add(item.BeginDate);
                }

                if (PdfFilterPoseidon)
                {
                    SingleRecord.Add(item.Poseidon);
                }

                if (PdfFilterAres)
                {
                    SingleRecord.Add(item.Ares);
                }

                if (PdfFilterAthena)
                {
                    SingleRecord.Add(item.Athena);
                }

                if (PdfFilterTheta)
                {
                    SingleRecord.Add(Thetas.First(x => x.Id.Equals(item.ThetaID)).Name.ToString());
                }

                if (PdfFilterArtemis)
                {
                    SingleRecord.Add(item.Artemis);
                }

                if (PdfFilterTargetDate)
                {
                    SingleRecord.Add(item.TargetDate);
                }

                if (PdfFilterApollo)
                {
                    SingleRecord.Add(item.Apollo);
                }
                ListOfRecord.Add(SingleRecord);
            }

            return(ListOfRecord);
        }