Exemple #1
0
        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");
                }
            }
        }
Exemple #2
0
        public bool foundCab(String taxi)
        {
            DBL.Driver driver = new DBL.Driver();
            driver.Taxi = taxi;
            SqlDataReader rdr = driver.getDriver(driver);

            if (rdr.Read())
            {
                /*
                 * string col = rdr["id"].ToString();
                 * MessageBox.Show(col, "Success");
                 */
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemple #3
0
        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");
                }
            }
        }
Exemple #4
0
 private void buttonCabDelete_Click(object sender, EventArgs e)
 {
     if (textBoxCabSearch.Text == "")
     {
         MessageBox.Show("Please fill the required information", "Error");
     }
     else
     {
         try
         {
             DBL.Driver driver = new DBL.Driver();
             driver.Taxi = textBoxCabSearch.Text;
             driver.deleteDriver(driver);
             MessageBox.Show("Deleted Well", "Success");
             allCabTable();
             textBoxCabSearch.Text = "";
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message, "Error");
         }
     }
 }
Exemple #5
0
        private void buttonCabSave_Click(object sender, EventArgs e)
        {
            if (textBoxCabName.Text == "")
            {
                MessageBox.Show("Please fill the required information", "Error");
            }
            else
            {
                try
                {
                    DBL.Driver driver = new DBL.Driver();
                    driver.Name     = textBoxCabName.Text;
                    driver.Username = textBoxCabUsername.Text;
                    driver.Password = textBoxCabPassword.Text;
                    driver.Mobile   = textBoxCabMobile.Text;
                    driver.Branch   = textBoxCabBranch.Text;
                    driver.Status   = textBoxCabStatus.Text;
                    driver.Taxi     = textBoxCabNo.Text;
                    driver.addDriver(driver);
                    MessageBox.Show("Inserted Well", "Success");
                    allCabTable();

                    textBoxCabName.Text     = "";
                    textBoxCabUsername.Text = "";
                    textBoxCabPassword.Text = "";
                    textBoxCabMobile.Text   = "";
                    textBoxCabBranch.Text   = "";
                    textBoxCabStatus.Text   = "";
                    textBoxCabNo.Text       = "";
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, "Error");
                }
            }
        }