Ejemplo n.º 1
0
        private static ReportData ImportJson (ReportData data, ReportJson json)
        {
            data.TotalGrand = json.TotalGrand;
            data.TotalBillable = json.TotalBillable;
            data.Activity = MakeActivityList (json.ActivityContainer);
            data.Projects = MakeProjectList (json.Projects);
            data.TotalCost = new List<string> ();

            if (json.TotalCurrencies != null) {
                json.TotalCurrencies.Sort ((x, y) => y.Amount.CompareTo (x.Amount));
                foreach (var row in json.TotalCurrencies) {
                    data.TotalCost.Add (String.Format ("{0} {1}", row.Amount, row.Currency));
                }
            }
            return data;
        }
Ejemplo n.º 2
0
        private static ReportData ImportJson(ReportData data, ReportJson json)
        {
            data.TotalGrand    = json.TotalGrand;
            data.TotalBillable = json.TotalBillable;
            data.Activity      = MakeActivityList(json.ActivityContainer);
            data.Projects      = MakeProjectList(json.Projects);
            data.TotalCost     = new List <string> ();

            if (json.TotalCurrencies != null)
            {
                json.TotalCurrencies.Sort((x, y) => y.Amount.CompareTo(x.Amount));
                foreach (var row in json.TotalCurrencies)
                {
                    data.TotalCost.Add(String.Format("{0} {1}", row.Amount, row.Currency));
                }
            }
            return(data);
        }
Ejemplo n.º 3
0
        public IHttpActionResult Add([FromBody] ReportJson reportJson)
        {
            var result = new ResultMessage <TblReportDataDto>();

            try
            {
                var reportDataDto = new TblReportDataDto
                {
                    TestQueueId    = reportJson.TestQueueId,
                    ExecutionGroup = reportJson.ExecutionGroup,
                    Value          = JsonConvert.SerializeObject(reportJson)
                };

                result = this.reportDataService.SaveOrUpdate(reportDataDto, this.UserId);
            }
            catch (Exception ex)
            {
                this.LoggerService.LogException(ex);
                result.Messages.Add(new Message(null, ex.Message));
            }

            return(this.CreateCustomResponse(result));
        }
Ejemplo n.º 4
0
 public ReportData Import(ReportJson json)
 {
     return(ImportJson(new ReportData(), json));
 }
Ejemplo n.º 5
0
        private async void HandleGenerateJsonReportCommand(object parameter)
        {
            try
            {
                var reporter = new ReportJson();
                var msg = await reporter.GenerateJsonReport();

                MessageBox.Show(msg);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Json report");
            }
        }
Ejemplo n.º 6
0
 public ReportData Import (ReportJson json)
 {
     return ImportJson (new ReportData (), json);
 }
Ejemplo n.º 7
0
        public static ReportData Import(this ReportJson json)
        {
            var converter = ServiceContainer.Resolve <ReportJsonConverter> ();

            return(converter.Import(json));
        }