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
        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");
                }
            }
        }