Exemple #1
0
 public Driver_Record(Drivers drivers)
 {
     try
     {
         InitializeComponent();
         dbconnection = new MySqlConnection(connection.connectionString);
         this.drivers = drivers;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
 public Driver_Record(Drivers drivers, XtraTabControl xtraTabControlCarsContent)
 {
     try
     {
         InitializeComponent();
         dbconnection = new MySqlConnection(connection.connectionString);
         this.drivers = drivers;
         this.xtraTabControlCarsContent = xtraTabControlCarsContent;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Exemple #3
0
 public Driver_Update(DataGridViewRow row1, Drivers drivers)
 {
     try
     {
         InitializeComponent();
         dbconnection = new MySqlConnection(connection.connectionString);
         SetData(row1);
         this.row1    = row1;
         this.drivers = drivers;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
 public Driver_Update(DataRowView DriverRow, Drivers drivers, XtraTabControl xtraTabControlCarsContent)
 {
     try
     {
         InitializeComponent();
         dbconnection = new MySqlConnection(connection.connectionString);
         SetData(DriverRow);
         this.DriverRow = DriverRow;
         this.drivers   = drivers;
         this.xtraTabControlCarsContent = xtraTabControlCarsContent;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
        public void bindUpdateDriverForm(DataRowView DriverRow, Drivers drivers)
        {
            Driver_Update objForm = new Driver_Update(DriverRow, drivers, xtraTabControlCarsContent);

            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();
        }
        //drivers
        public void bindRecordDriverForm(Drivers drivers)
        {
            Driver_Record objForm = new Driver_Record(drivers, xtraTabControlCarsContent);

            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();
        }
 private void BtnRecordDriver_Click(object sender, EventArgs e)
 {
     try
     {
         tableLayoutPanelContent.Controls.Clear();
         resetButtonsStoreDetailsPanelStyle();
         Button btn = (Button)sender;
         btn.ForeColor = Color.Black;
         btn.BackColor = Color.White;
         Drivers objForm = new Drivers();
         objForm.TopLevel = false;
         tableLayoutPanelContent.Controls.Add(objForm);
         objForm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
         objForm.Dock            = DockStyle.Fill;
         objForm.Show();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
        //Drivers
        private void navBarItem2_LinkClicked(object sender, NavBarLinkEventArgs e)
        {
            try
            {
                restForeColorOfNavBarItem();
                NavBarItem navBarItem = (NavBarItem)sender;
                navBarItem.Appearance.ForeColor = Color.Blue;
                if (!xtraTabControlCarsContent.Visible)
                {
                    xtraTabControlCarsContent.Visible = true;
                }

                XtraTabPage xtraTabPage = getTabPage("السائقين");
                if (xtraTabPage == null)
                {
                    xtraTabControlCarsContent.TabPages.Add("السائقين");
                    xtraTabPage = getTabPage("السائقين");
                }

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

                Drivers objForm = new Drivers(this);

                objForm.TopLevel = false;
                xtraTabPage.Controls.Add(objForm);
                objForm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
                objForm.Dock            = DockStyle.Fill;

                objForm.Show();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }