public SparePartUpdate(DataRowView row1, SparePart sparePart, XtraTabControl xtraTabControlCarsContent)
 {
     try
     {
         InitializeComponent();
         dbconnection   = new MySqlConnection(connection.connectionString);
         this.sparePart = sparePart;
         this.row1      = row1;
         this.xtraTabControlCarsContent = xtraTabControlCarsContent;
     }
     catch (Exception e)
     {
         MessageBox.Show(e.ToString());
     }
     dbconnection.Close();
 }
Exemple #2
0
        public void bindUpdateSparePartForm(DataRowView SparePartRow, SparePart sparepart)
        {
            SparePartUpdate objForm = new SparePartUpdate(SparePartRow, sparepart, xtraTabControlCarsContent);

            objForm.TopLevel = false;
            XtraTabPage xtraTabPage = getTabPage(xtraTabControlCarsContent, "تعديل قطع الغيار");

            if (xtraTabPage == null)
            {
                xtraTabControlCarsContent.TabPages.Add("تعديل قطع الغيار");
                xtraTabPage = getTabPage(xtraTabControlCarsContent, "تعديل قطع الغيار");
            }
            xtraTabPage.Controls.Clear();
            xtraTabPage.Controls.Add(objForm);
            xtraTabControlCarsContent.SelectedTabPage = xtraTabPage;

            objForm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
            objForm.Dock            = DockStyle.Fill;
            objForm.Show();
        }
Exemple #3
0
        //Spare Part
        private void navBarItem3_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(xtraTabControlCarsContent, "قطع الغيار");
                if (xtraTabPage == null)
                {
                    xtraTabControlCarsContent.TabPages.Add("قطع الغيار");
                    xtraTabPage = getTabPage(xtraTabControlCarsContent, "قطع الغيار");
                }

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

                SparePart objForm = new SparePart(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);
            }
        }