private void buttonComFailed_Click(object sender, EventArgs e) { if (richTextBoxComComment.Text == "") { MessageBox.Show("Please type any comment", "Error"); } else { try { DBL.Res res = new DBL.Res(); res.Cab = labelComCab.Text; res.Comment = richTextBoxComComment.Text; res.statusResFailed(res); DBL.Driver cab = new DBL.Driver(); cab.Taxi = labelComCab.Text; cab.Status = "available"; cab.statusDriver(cab); MessageBox.Show("Success", "Success"); manage.refreshResTableFromOut(); this.Dispose(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error"); } } }
private void buttonResSave_Click(object sender, EventArgs e) { if (comboBoxResCab.Text == "") { MessageBox.Show("Please fill the required information", "Error"); } else { try { DBL.Res res = new DBL.Res(); res.Client = comboBoxResClient.Text; res.Tourfrom = comboBoxResFrom.Text; res.Tourto = comboBoxResTo.Text; res.Cab = comboBoxResCab.Text; res.Tourkm = labelResKm.Text; res.Touramount = labelResAmount.Text; res.Date = DateTime.Now.ToString("yyyy-M-dd"); res.Status = "hire"; res.Comment = ""; res.addRes(res); DBL.Driver cab = new DBL.Driver(); cab.Taxi = comboBoxResCab.Text; cab.Status = "hire"; cab.statusDriver(cab); MessageBox.Show("Inserted Well", "Success"); curResTable(); allCabTable(); buttonResRefresh.PerformClick(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error"); } } }
private void buttonComFind_Click(object sender, EventArgs e) { DBL.Res res = new DBL.Res(); res.Cab = textBoxComCab.Text; SqlDataReader rdr = res.getResCom(res); if (rdr.Read()) { labelComCab.Text = rdr["taxi"].ToString(); labelComClient.Text = rdr["client"].ToString(); labelComFrom.Text = rdr["tourfrom"].ToString(); labelComTo.Text = rdr["tourto"].ToString(); labelComAmount.Text = rdr["amount"].ToString(); labelComKM.Text = rdr["km"].ToString(); labelComDate.Text = rdr["date"].ToString(); panelCom.Show(); } else { MessageBox.Show("Not Found", "Error", MessageBoxButtons.OK, MessageBoxIcon.Stop); panelCom.Hide(); } }