Exemplo n.º 1
0
 private void btnCarSparePart_Click(object sender, EventArgs e)
 {
     try
     {
         if (carSpareParts == null)
         {
             if (row1 != null)
             {
                 carSpareParts = new CarSpareParts(row1, this);
                 carSpareParts.Show();
                 carSpareParts.Focus();
             }
             else
             {
                 MessageBox.Show("Select row");
             }
         }
         else
         {
             carSpareParts.Show();
             carSpareParts.Focus();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Exemplo n.º 2
0
        public void bindSparePartForm(DataRowView carRow, Cars cars)
        {
            CarSpareParts objForm = new CarSpareParts(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();
        }