Example #1
0
        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();
                }
            }
        }
Example #2
0
        private void PopulateGridView()
        {
            DataTable dt          = new DataTable();
            DriverBL  driverBLOBj = new DriverBL();

            dt = driverBLOBj.GetExistingdDriverBL();
            driverDataGridView.DataSource = dt;
        }
Example #3
0
 public IHttpActionResult Put(string id, [FromBody] DriverDTO driver)
 {
     try
     {
         DriverBL.UpdateDriver(id, driver);
         return(Ok());
     }
     catch (Exception)
     {
         return(BadRequest());
     }
 }
Example #4
0
 public IHttpActionResult Post([FromBody] DriverDTO driver)
 {
     try
     {
         DriverBL.Add(driver);
         return(Ok());
     }
     catch (Exception)
     {
         return(BadRequest());
     }
 }
Example #5
0
        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);
            }
        }
Example #6
0
 public Program()
 {
     bl         = new DriverBL();
     management = new DriverManagement(bl);
 }