public void bindUpdateDepositIncomeForm(DataRowView sellRow, BankDepositIncome_Report form) { BankDepositIncome_Update objForm = new BankDepositIncome_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 (BankDepositIncome_Update.updateBankDepositIncomeTextChangedFlag == false) { if (selRow[0].ToString() != "") { MainTabPageUpdateDepositIncome.Name = "tabPageUpdateDepositIncome"; MainTabPageUpdateDepositIncome.Text = "تعديل ايراد"; MainTabPageUpdateDepositIncome.ImageOptions.Image = null; panelUpdateDepositIncome.Name = "panelUpdateDepositIncome"; panelUpdateDepositIncome.Dock = DockStyle.Fill; panelUpdateDepositIncome.Controls.Clear(); BankDepositIncome_Update form = new BankDepositIncome_Update(selRow); form.Size = new Size(1059, 638); form.TopLevel = false; form.FormBorderStyle = FormBorderStyle.None; form.Dock = DockStyle.Fill; panelUpdateDepositIncome.Controls.Add(form); MainTabPageUpdateDepositIncome.Controls.Add(panelUpdateDepositIncome); MainTabControlBank.TabPages.Add(MainTabPageUpdateDepositIncome); form.Show(); MainTabControlBank.SelectedTabPage = MainTabPageUpdateDepositIncome; } else { MessageBox.Show("يجب ان تختار عنصر"); } } else { if (MessageBox.Show("هناك تعديلات لم تحفظ بعد..هل انت متاكد انك تريد التجاهل؟", "تحذير", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) != DialogResult.Yes) { MainTabControlBank.SelectedTabPage = MainTabPageUpdateDepositIncome; return; } else { if (selRow[0].ToString() != "") { panelUpdateDepositIncome.Controls.Clear(); MainTabPageUpdateDepositIncome.ImageOptions.Image = null; BankDepositIncome_Update form = new BankDepositIncome_Update(selRow); form.Size = new Size(1059, 638); form.TopLevel = false; form.FormBorderStyle = FormBorderStyle.None; form.Dock = DockStyle.Fill; panelUpdateDepositIncome.Controls.Add(form); form.Show(); MainTabControlBank.SelectedTabPage = MainTabPageUpdateDepositIncome; } else { MessageBox.Show("يجب ان تختار عنصر"); } } } } else { MessageBox.Show("هذا العنصر تم حذفة من قبل"); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }