private void btnDelete_Click(object sender, EventArgs e) { DialogResult dialogResult = MessageBox.Show("Please Click Yes To Continue To DELETE", "Delete", MessageBoxButtons.YesNo); if (dialogResult == DialogResult.Yes) { string id = "'" + lblId.Text + "'"; string IsSave; string spName = "sp_Delete_Driver"; SqlDataReader reader; reader = monitoring.ExecuteReader(spName, id); DataTable result = new DataTable(); result.Load(reader); IsSave = result.Rows[0]["Result"].ToString(); if (IsSave == "0") { MessageBox.Show("Failed To Delete.."); } else { this.Hide(); MessageBox.Show("Successfully Deleted.."); DriverListForm driver = new DriverListForm(); driver.ShowDialog(); this.Close(); } } }
private void btnSave_Click(object sender, EventArgs e) { DialogResult dialogResult = MessageBox.Show("Please Click Yes To Continue To SAVE", "Save", MessageBoxButtons.YesNo); if (dialogResult == DialogResult.Yes) { string id = "'" + lblId.Text + "'"; string DriverName = "'" + txtName.Text + "'"; string Status = "'" + cmbStatus.SelectedItem.ToString() + "'"; string IsSave; string spName = "sp_Update_Driver"; SqlDataReader reader; reader = monitoring.ExecuteReader(spName, id, DriverName, Status); DataTable result = new DataTable(); result.Load(reader); IsSave = result.Rows[0]["Result"].ToString(); if (IsSave == "0") { MessageBox.Show("Failed To Save.."); } else { this.Hide(); MessageBox.Show("Successfully Saved.."); DriverListForm driver = new DriverListForm(); driver.param(ID); driver.ShowDialog(); this.Close(); } } }
private void lnkClose_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { this.Hide(); DriverListForm driver = new DriverListForm(); driver.param(ID); driver.ShowDialog(); this.Close(); }