コード例 #1
0
        public async Task <IHttpActionResult> Create([FromBody, CustomizeValidator(RuleSet = "Create")] ReportNew reportNew)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            try
            {
                var reportDto = _mapper.Map <ReportDto>(reportNew);
                reportDto = await _reportService.CreateAsync(reportDto);

                if (reportDto == null)
                {
                    return(BadRequest());
                }
                reportNew = _mapper.Map <ReportNew>(reportDto);

                return(Ok(reportNew));
            }
            catch (InvalidOperationException ioe)
            {
                return(InternalServerError(ioe));
            }
        }
コード例 #2
0
        /// <summary>
        /// Gets a example of model view report.
        /// </summary>
        /// <returns></returns>
        public virtual object GetExamples()
        {
            var value = new ReportNew()
            {
                Name        = "Number of requests per day",
                Description = "The dynamics of the number of requests per day",
            };

            return(value);
        }
コード例 #3
0
 private void btnBack_Click(object sender, EventArgs e)
 {
     try
     {
         var back = new ReportNew();
         back.Show();
         this.Hide();
     }
     catch (Exception)
     {
     }
 }
コード例 #4
0
 private void radReport_CheckedChanged(object sender, EventArgs e)
 {
     try
     {
         var Report = new ReportNew();
         Report.Show();
         this.Hide();
     }
     catch (Exception)
     {
     }
 }