private void btnRoute_Click(object sender, EventArgs e) { this.pnlRed.Height = this.btnRoute.Height; this.pnlRed.Top = this.btnRoute.Top; controlRoute route = new controlRoute(); MainControl.showControl(route, frmAdminDashboard.ActiveForm); }
private void btnSave_Click(object sender, EventArgs e) { //MessageBox.Show("fdsf"); //First we have to insert data into route table and then into the schedule table this.RouteFill(); Entity.Schedule schedule = new Entity.Schedule(); try { schedule.ScheduleId = ScheduleRepo.GetId(); } catch (Exception exception) { Console.WriteLine(exception); } schedule.DeptTime = this.dtpDeparture.Text; schedule.ArrivalTime = this.dtpArrival.Text; schedule.RouteId = this.Route.RouteId; //In Schedule table route_id is a foreign key. try { RouteRepo.Insert(this.Route); //inserting into the route table ScheduleRepo.Insert(schedule); //inserting into schedule table MessageBox.Show("Created Successfully"); //After inserting data the route home page will be redirected controlRoute route = new controlRoute(); MainControl.showControl(route, frmAdminDashboard.ActiveForm); } catch (Exception exception) { MessageBox.Show("Please Select A Bus No", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
private void btnBack_Click(object sender, EventArgs e) { controlRoute route = new controlRoute(); MainControl.showControl(route, frmAdminDashboard.ActiveForm); }