public void bindUpdatePullExpenseForm(DataRowView sellRow, BankPullExpense_Report form) { BankPullExpense_Update objForm = new BankPullExpense_Update(sellRow, form, MainTabControlBank); objForm.TopLevel = false; XtraTabPage xtraTabPage = getTabPage(MainTabControlBank, "تعديل مرتد-مصروف"); if (xtraTabPage == null) { MainTabControlBank.TabPages.Add("تعديل مرتد-مصروف"); xtraTabPage = getTabPage(MainTabControlBank, "تعديل مرتد-مصروف"); } xtraTabPage.Controls.Clear(); xtraTabPage.Controls.Add(objForm); MainTabControlBank.SelectedTabPage = xtraTabPage; objForm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; objForm.Dock = DockStyle.Fill; objForm.Show(); }
private void btnUpdate_Click(object sender, EventArgs e) { try { DataRowView selRow = (DataRowView)(((GridView)gridControl1.MainView).GetRow(((GridView)gridControl1.MainView).GetSelectedRows()[0])); if (selRow["Error"].ToString() == "0") { if (BankPullExpense_Update.updateBankPullExpenseTextChangedFlag == false) { if (selRow[0].ToString() != "") { MainTabPageUpdatePullExpense.Name = "tabPageUpdatePullExpense"; MainTabPageUpdatePullExpense.Text = "تعديل مصروف"; MainTabPageUpdatePullExpense.ImageOptions.Image = null; panelUpdatePullExpense.Name = "PanelUpdatePullExpense"; panelUpdatePullExpense.Dock = DockStyle.Fill; panelUpdatePullExpense.Controls.Clear(); BankPullExpense_Update form = new BankPullExpense_Update(selRow); form.Size = new Size(1059, 638); form.TopLevel = false; form.FormBorderStyle = FormBorderStyle.None; form.Dock = DockStyle.Fill; panelUpdatePullExpense.Controls.Add(form); MainTabPageUpdatePullExpense.Controls.Add(panelUpdatePullExpense); MainTabControlBank.TabPages.Add(MainTabPageUpdatePullExpense); form.Show(); MainTabControlBank.SelectedTabPage = MainTabPageUpdatePullExpense; } else { MessageBox.Show("يجب ان تختار عنصر"); } } else { if (MessageBox.Show("هناك تعديلات لم تحفظ بعد..هل انت متاكد انك تريد التجاهل؟", "تحذير", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) != DialogResult.Yes) { MainTabControlBank.SelectedTabPage = MainTabPageUpdatePullExpense; return; } else { if (selRow[0].ToString() != "") { panelUpdatePullExpense.Controls.Clear(); MainTabPageUpdatePullExpense.ImageOptions.Image = null; BankPullExpense_Update form = new BankPullExpense_Update(selRow); form.Size = new Size(1059, 638); form.TopLevel = false; form.FormBorderStyle = FormBorderStyle.None; form.Dock = DockStyle.Fill; panelUpdatePullExpense.Controls.Add(form); form.Show(); MainTabControlBank.SelectedTabPage = MainTabPageUpdatePullExpense; } else { MessageBox.Show("يجب ان تختار عنصر"); } } } } else { MessageBox.Show("هذا العنصر تم حذفة من قبل"); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }