示例#1
0
 private void btnUpdate_Click(object sender, EventArgs e)
 {
     try
     {
         if (sparePartUpdate == null)
         {
             if (row != null)
             {
                 sparePartUpdate = new SparePartUpdate(row, this);
                 sparePartUpdate.Show();
                 sparePartUpdate.Focus();
             }
             else
             {
                 MessageBox.Show("Select row");
             }
         }
         else
         {
             sparePartUpdate.Show();
             sparePartUpdate.Focus();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
示例#2
0
        public void bindUpdateSparePartForm(DataRowView SparePartRow, SparePart sparepart)
        {
            SparePartUpdate objForm = new SparePartUpdate(SparePartRow, sparepart, 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();
        }