Exemplo n.º 1
0
 private void notifyIcon1_Click(object sender, EventArgs e)
 {
     try
     {
         CarLicenseUpdate f = new CarLicenseUpdate(notifyIcon1.Text);
         f.Show();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Exemplo n.º 2
0
        void item_Click(object sender, EventArgs e)
        {
            try
            {
                dbconnection.Open();
                ToolStripMenuItem clickedItem = (ToolStripMenuItem)sender;
                string            str         = clickedItem.Text;
                string            carNumber   = str.Split(',')[0];

                string       query = "select Car_ID from cars where Car_Number=" + carNumber;
                MySqlCommand com   = new MySqlCommand(query, dbconnection);
                string       id    = com.ExecuteScalar().ToString();

                //// open carsManager Tap
                if (flag == false)
                {
                    xtraTabControlMainContainer.TabPages.Insert(1, StoreTP);
                    flag = true;
                }
                xtraTabControlMainContainer.SelectedTabPage = xtraTabControlMainContainer.TabPages[1];

                //// open carsContent Tap
                if (!xtraTabControlCarsContent.Visible)
                {
                    xtraTabControlCarsContent.Visible = true;
                }

                ////

                CarLicenseUpdate objForm = new CarLicenseUpdate(id, carNumber, xtraTabControlCarsContent, this);
                objForm.TopLevel = false;
                XtraTabPage xtraTabPage = getTabPage("تعديل رخصة العربية");
                if (xtraTabPage == null)
                {
                    xtraTabControlCarsContent.TabPages.Add("تعديل رخصة العربية");
                    xtraTabPage = getTabPage("تعديل رخصة العربية");
                }

                xtraTabPage.Controls.Clear();
                xtraTabPage.Controls.Add(objForm);
                xtraTabControlCarsContent.SelectedTabPage = xtraTabPage;

                objForm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
                objForm.Dock            = DockStyle.Fill;
                objForm.Show();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            dbconnection.Close();
        }
Exemplo n.º 3
0
        public void bindCarLicenseForm(DataRowView carRow, Cars cars)
        {
            try
            {
                dbconnection.Open();
                String       query = "select Car_License_ID from car_license where Car_ID=" + carRow[0].ToString();
                MySqlCommand com   = new MySqlCommand(query, dbconnection);
                if (com.ExecuteScalar() == null)
                {
                    CarLicenseRecord objForm = new CarLicenseRecord(carRow, cars, xtraTabControlCarsContent, this);

                    objForm.TopLevel = false;
                    XtraTabPage xtraTabPage = getTabPage("تسجيل رخصة العربية");
                    if (xtraTabPage == null)
                    {
                        xtraTabControlCarsContent.TabPages.Add("تسجيل رخصة العربية");
                        xtraTabPage = getTabPage("تسجيل رخصة العربية");
                    }
                    xtraTabPage.Controls.Clear();
                    xtraTabPage.Controls.Add(objForm);
                    xtraTabControlCarsContent.SelectedTabPage = xtraTabPage;

                    objForm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
                    objForm.Dock            = DockStyle.Fill;
                    objForm.Show();
                }
                else
                {
                    CarLicenseUpdate objForm = new CarLicenseUpdate(carRow, cars, xtraTabControlCarsContent, this);

                    objForm.TopLevel = false;
                    XtraTabPage xtraTabPage = getTabPage("تعديل رخصة العربية");
                    if (xtraTabPage == null)
                    {
                        xtraTabControlCarsContent.TabPages.Add("تعديل رخصة العربية");
                        xtraTabPage = getTabPage("تعديل رخصة العربية");
                    }
                    xtraTabPage.Controls.Clear();
                    xtraTabPage.Controls.Add(objForm);
                    xtraTabControlCarsContent.SelectedTabPage = xtraTabPage;

                    objForm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
                    objForm.Dock            = DockStyle.Fill;
                    objForm.Show();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            dbconnection.Close();
        }
Exemplo n.º 4
0
 private void btnCarLicense_Click(object sender, EventArgs e)
 {
     try
     {
         if (row1 != null)
         {
             dbconnection.Open();
             String       query = "select Car_License_ID from car_license where Car_ID=" + row1.Cells["car_id"].Value;
             MySqlCommand com   = new MySqlCommand(query, dbconnection);
             if (com.ExecuteScalar() == null)
             {
                 if (carLicenseRecord == null)
                 {
                     carLicenseRecord = new CarLicenseRecord(row1, this);
                     carLicenseRecord.Show();
                     carLicenseRecord.Focus();
                 }
                 else
                 {
                     carLicenseRecord.Show();
                     carLicenseRecord.Focus();
                 }
             }
             else
             {
                 if (carLicenseUpdate == null)
                 {
                     carLicenseUpdate = new CarLicenseUpdate(row1, this);
                     carLicenseUpdate.Show();
                     carLicenseUpdate.Focus();
                 }
                 else
                 {
                     carLicenseUpdate.Show();
                     carLicenseUpdate.Focus();
                 }
             }
         }
         else
         {
             MessageBox.Show("Select row");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
     dbconnection.Close();
 }