public CarExpensesRecord(CarExpenses carExpenses, XtraTabControl xtraTabControlCarsContent) { try { InitializeComponent(); dbconnection = new MySqlConnection(connection.connectionString); this.xtraTabControlCarsContent = xtraTabControlCarsContent; this.carExpenses = carExpenses; } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public CarExpensesUpdate(DataRowView r, CarExpenses CarExpenses, XtraTabControl xtraTabControlCarsContent) { try { InitializeComponent(); dbconnection = new MySqlConnection(connection.connectionString); row = r; this.xtraTabControlCarsContent = xtraTabControlCarsContent; this.CarExpenses = CarExpenses; } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public void bindUpdateExpensesForm(DataRowView ExpensesRow, CarExpenses carExpenses) { CarExpensesUpdate objForm = new CarExpensesUpdate(ExpensesRow, carExpenses, 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(); }
//car expenses private void navBarItem6_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; CarExpenses objForm = new CarExpenses(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); } }