Exemplo n.º 1
0
        public void bindUpdateDepositCashForm(DataRowView sellRow, BankDepositCash_Report form)
        {
            BankDepositCash_Update objForm = new BankDepositCash_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 (BankDepositCash_Update.updateBankDepositCashTextChangedFlag == false)
                    {
                        if (selRow[0].ToString() != "")
                        {
                            MainTabPageUpdateDepositCash.Name = "tabPageUpdateDepositCash";
                            MainTabPageUpdateDepositCash.Text = "تعديل ايداع-كاش";
                            MainTabPageUpdateDepositCash.ImageOptions.Image = null;
                            panelUpdateDepositCash.Name = "panelUpdateDepositCash";
                            panelUpdateDepositCash.Dock = DockStyle.Fill;

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