示例#1
0
        public void bindUpdatePullAglForm(DataRowView sellRow, BankPullAgl_Report form)
        {
            BankPullAgl_Update objForm = new BankPullAgl_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 (BankPullAgl_Update.UpdateBankPullAglTextChangedFlag == false)
                    {
                        if (selRow[0].ToString() != "")
                        {
                            MainTabPageUpdatePullAgl.Name = "tabPageUpdatePullAgl";
                            MainTabPageUpdatePullAgl.Text = "تعديل سحب-آجل";
                            MainTabPageUpdatePullAgl.ImageOptions.Image = null;
                            panelUpdatePullAgl.Name = "PanelUpdatePullAgl";
                            panelUpdatePullAgl.Dock = DockStyle.Fill;

                            panelUpdatePullAgl.Controls.Clear();
                            BankPullAgl_Update form = new BankPullAgl_Update(selRow);
                            form.Size            = new Size(1059, 638);
                            form.TopLevel        = false;
                            form.FormBorderStyle = FormBorderStyle.None;
                            form.Dock            = DockStyle.Fill;
                            panelUpdatePullAgl.Controls.Add(form);
                            MainTabPageUpdatePullAgl.Controls.Add(panelUpdatePullAgl);
                            MainTabControlBank.TabPages.Add(MainTabPageUpdatePullAgl);
                            form.Show();
                            MainTabControlBank.SelectedTabPage = MainTabPageUpdatePullAgl;
                        }
                        else
                        {
                            MessageBox.Show("يجب ان تختار عنصر");
                        }
                    }
                    else
                    {
                        if (MessageBox.Show("هناك تعديلات لم تحفظ بعد..هل انت متاكد انك تريد التجاهل؟", "تحذير", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) != DialogResult.Yes)
                        {
                            MainTabControlBank.SelectedTabPage = MainTabPageUpdatePullAgl;
                            return;
                        }
                        else
                        {
                            if (selRow[0].ToString() != "")
                            {
                                panelUpdatePullAgl.Controls.Clear();
                                MainTabPageUpdatePullAgl.ImageOptions.Image = null;
                                BankPullAgl_Update form = new BankPullAgl_Update(selRow);
                                form.Size            = new Size(1059, 638);
                                form.TopLevel        = false;
                                form.FormBorderStyle = FormBorderStyle.None;
                                form.Dock            = DockStyle.Fill;
                                panelUpdatePullAgl.Controls.Add(form);
                                form.Show();
                                MainTabControlBank.SelectedTabPage = MainTabPageUpdatePullAgl;
                            }
                            else
                            {
                                MessageBox.Show("يجب ان تختار عنصر");
                            }
                        }
                    }
                }
                else
                {
                    MessageBox.Show("هذا العنصر تم حذفة من قبل");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }