Ejemplo n.º 1
0
 protected void btnAddReport_Click(object sender, EventArgs e)
 {
     if (Page.IsValid)
     {
         ReportBLL       bll    = new ReportBLL(connectionString);
         ReportViewModel report = new ReportViewModel();
         report.CarID             = Convert.ToInt32(ddlRide.SelectedValue);
         report.DateOfIncident    = Convert.ToDateTime(tbIncidentDate.Text);
         report.ReportName        = tbReportName.Text;
         report.ReportDescription = tbDescription.Text;
         report.DateOfReport      = DateTime.Now;
         bll.AddReport(report);
         Response.Redirect("~/Reports.aspx");
     }
 }
Ejemplo n.º 2
0
 protected void ReportAddButton_Click(object sender, EventArgs e)
 {
     if (Page.IsValid)
     {
         string          connectionString = ConfigurationManager.ConnectionStrings["RideXpressConnectionString"].ToString();
         ReportBLL       bll    = new ReportBLL(connectionString);
         ReportViewModel report = new ReportViewModel();
         report.ReportName        = ReportName.Text;
         report.CarID             = Convert.ToInt32(CarID.Text);
         report.DateOfIncident    = Convert.ToDateTime(DateOfIncident.Text);
         report.ReportDescription = ReportDescription.Text;
         bll.AddReport(report);
         Response.Redirect("~/Reports.aspx");
     }
 }
        protected void ReportAddButton_Click(object sender, EventArgs e)
        {
            string Ride = RideDropDownList.Text;

            if (Page.IsValid)
            {
                ReportBLL       bll    = new ReportBLL(connectionString);
                ReportViewModel report = new ReportViewModel();
                report.CarID             = Convert.ToInt32(GetCarId(Ride));
                report.DateOfIncident    = DateOfIncident.Text;
                report.ReportName        = ReportName.Text;
                report.ReportDescription = ReportDescription.Text;
                report.DateOfReport      = DateTime.Now.ToString();
                bll.AddReport(report);
                Response.Redirect("~/Reports.aspx");
            }
        }