private void SAVEButton_Click(object sender, EventArgs e) { Driver aDriver = new Driver(); aDriver.DriverNo = driverNoTextBox.Text; aDriver.Name = driverNameTextBox.Text; aDriver.ContactNo = contactNoTextBox.Text; DriverBL driverBLOBj = new DriverBL(); bool result = driverBLOBj.SaveNewDriverBL(aDriver); if (result) { MessageBox.Show("Successfully added new Driver information.", "Done", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); this.PopulateGridView(); IntitialButtonMood(); CleanTextBar(); } else { DialogResult dialog = MessageBox.Show("Please fill all the text.", "ERROR", MessageBoxButtons.OKCancel, MessageBoxIcon.Error); if (dialog == DialogResult.Cancel) { this.Close(); } } }
private void PopulateGridView() { DataTable dt = new DataTable(); DriverBL driverBLOBj = new DriverBL(); dt = driverBLOBj.GetExistingdDriverBL(); driverDataGridView.DataSource = dt; }
public IHttpActionResult Put(string id, [FromBody] DriverDTO driver) { try { DriverBL.UpdateDriver(id, driver); return(Ok()); } catch (Exception) { return(BadRequest()); } }
public IHttpActionResult Post([FromBody] DriverDTO driver) { try { DriverBL.Add(driver); return(Ok()); } catch (Exception) { return(BadRequest()); } }
private void deleteButton_Click(object sender, EventArgs e) { Driver aDriver = new Driver(); aDriver.DriverNo = driverNoTextBox.Text; aDriver.Name = driverNameTextBox.Text; aDriver.ContactNo = contactNoTextBox.Text; DriverBL driverBLOBj = new DriverBL(); bool result = driverBLOBj.DeleteADriverBL(aDriver); if (result) { MessageBox.Show("Successfully Deleted.", "Done", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); this.PopulateGridView(); IntitialButtonMood(); CleanTextBar(); } else { MessageBox.Show("Something went wrong!", "Aleart", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public Program() { bl = new DriverBL(); management = new DriverManagement(bl); }