private void barButtonItem21_ItemClick(object sender, ItemClickEventArgs e) { Control item = new InvoiceRequest(InvoiceWorkflowState.Request, null); documentManager1.View.AddDocument(item).Caption = "إذن شراء"; int index = tabbedView1.Documents.Count - 1; DevExpress.XtraBars.Docking2010.Views.Tabbed.Document doc = tabbedView1.Documents[index] as DevExpress.XtraBars.Docking2010.Views.Tabbed.Document; tabbedView1.Controller.Select(doc); }
private void Action_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { int inex = gridView1.GetFocusedDataSourceRowIndex(); Invoice inv = (Invoice)gridView1.GetFocusedRow();//.GetFocusedDataSourceRowIndex(); Form toOpen = new Form(); if (ControlFlag == InvoiceWorkflowState.Request) { //panelControl1.Show(); } else if (ControlFlag == InvoiceWorkflowState.Approvement) { req = new InvoiceRequest(InvoiceWorkflowState.Approvement, inv.InvoiceId); toOpen.Text = "مراجعة طلب شراء"; //DevExpress.XtraEditors.XtraDialog.Show(req, "مراجعة طلب شراء", MessageBoxButtons.OKCancel); } else if (ControlFlag == InvoiceWorkflowState.Payment) { req = new InvoiceRequest(InvoiceWorkflowState.Payment, inv.InvoiceId); // DevExpress.XtraEditors.XtraDialog.Show(req, "إضافة البيانات المالية لفاتورة", MessageBoxButtons.YesNoCancel); toOpen.Text = "إضافة البيانات المالية لفاتورة"; } else if (ControlFlag == InvoiceWorkflowState.Completed) { req = new InvoiceRequest(InvoiceWorkflowState.Completed, inv.InvoiceId); //DevExpress.XtraEditors.XtraDialog.Show(req, "تأكيد إكتمال عملية شراء", MessageBoxButtons.YesNoCancel); toOpen.Text = "تأكيد إكتمال عملية شراء"; } else if (ControlFlag == InvoiceWorkflowState.Return) { PirachseReturn prn = new PirachseReturn(); DialogResult ret = DevExpress.XtraEditors.XtraDialog.Show(prn, "إرجاع فاتورة", MessageBoxButtons.YesNoCancel); if (ret.Equals(DialogResult.Yes)) { //return proceder } else if (ret.Equals(DialogResult.No)) { req = new InvoiceRequest(InvoiceWorkflowState.Return, inv.InvoiceId); //DevExpress.XtraEditors.XtraDialog.Show(req, "إرجاع فاتورة", MessageBoxButtons.OK); toOpen.Text = "إرجاع فاتورة"; } else { } } //gridControl1.Hide(); //Purchase.AccountingSystem dbContext = new Purchase.AccountingSystem(); //dbContext.InvoiceDetails.Where(a => a.InvoiceId == inv.InvoiceId).Load(); //gridControl2.DataSource = dbContext.InvoiceDetails.Local.ToBindingList(); toOpen.Controls.Add(req); toOpen.WindowState = FormWindowState.Maximized; toOpen.ShowDialog(); }