public async Task GetReport()
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;
            var error = false;

            try
            {
                //SSRCreditAnalysisReport res =new  SSRCreditAnalysisReport ();
                //res= await Service.ReportService.GetCreditAnalysisReport();

                //await Task.Delay(1000);
                LstSSRPerformance = await Service.ReportService.Get_SSRPerformanceReport(dtFrom.ToString("MM-dd-yyyy"), dtTo.ToString("MM-dd-yyyy"));

                GetDetails(LstSSRPerformance.FirstOrDefault());

                if (OnReportChanged != null)
                {
                    OnReportChanged.Invoke(LstSSRPerformance);
                }
                TestChartList = new List <SSRPerformance>();
                foreach (var item in LstSSRPerformance)
                {
                    TestChartList.Add(new SSRPerformance
                    {
                        EmployeeName = item.EmployeeName.ToString(),
                        Sales        = Convert.ToInt32(item.SaleInRs.Substring(0, 3)),
                        Outs         = Convert.ToInt32(item.Outstandings.Substring(0, 3)),
                        Receipt      = Convert.ToInt32(item.Receipts.Substring(0, 3)),
                    });
                }
            }
            catch
            {
                error = true;
            }
            if (error)
            {
                var page   = new ContentPage();
                var result = page.DisplayAlert("Error", "Unable to load report.", "OK");
            }
            IsBusy = false;
        }
Ejemplo n.º 2
0
        //public void GetDetailsOnLoad()
        //{
        //    EmployeeCode = LstSSRPerformance[0].EmployeeCode.ToString();
        //    EmployeeName = LstSSRPerformance[0].EmployeeName.ToString();
        //    Outstandings = LstSSRPerformance[0].Outstandings.ToString();
        //    Receipts = LstSSRPerformance[0].Receipts.ToString();
        //    SaleInLtr = LstSSRPerformance[0].SaleInLtr.ToString();
        //    SaleInRs = LstSSRPerformance[0].SaleInRs.ToString();
        //}

        public async Task GetReport()
        {
            try
            {
                LstSSRPerformance = await Service.ReportService.Get_SSRPerformanceReport(dtFrom.ToString("MM-dd-yyyy"), dtTo.ToString("MM-dd-yyyy"));

                GetDetails(LstSSRPerformance.FirstOrDefault());
                if (OnReportChanged != null)
                {
                    OnReportChanged.Invoke(LstSSRPerformance);
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }