private void BarbtnOpen_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { CTechCore.Tools.frmSearch frm = new CTechCore.Tools.frmSearch(); DevExpress.XtraSplashScreen.SplashScreenManager.ShowForm(typeof(CTechCore.WaitForms.frmWaitBasic)); DataTable dt = new DataTable(); MyApp.CTech.ExecSQL($"select AutoIndex, OrderNum, Account, Name, OrderDate, ulIDPOrdConfirmed State from vw_XR_PurchaseOrdersForGRV ", ref dt); frm.cntrlSearch1.DataSource = dt; DevExpress.XtraSplashScreen.SplashScreenManager.CloseForm(); frm.cntrlSearch1.gridView1.Columns.ToList().ForEach(c => c.MinWidth = 150); if (frm.ShowDialog() == DialogResult.OK) { if (frm.cntrlSearch1.EditValue is DataRow) { purchaseOrderToGRVBindingSource.DataSource = new PurchaseOrderToGRV(((DataRow)frm.cntrlSearch1.EditValue).Field <Int64>("AutoIndex")); } else if (frm.cntrlSearch1.EditValue is PurchaseOrderToGRV) { purchaseOrderToGRVBindingSource.DataSource = (PurchaseOrderToGRV)frm.cntrlSearch1.EditValue; } PurchaseOrderToGRV grv = (PurchaseOrderToGRV)purchaseOrderToGRVBindingSource.DataSource; gcPOHeader.DataSource = grv.HeaderInfo; gcPODetails.DataSource = grv.DetailInfo; //lkpStokGroup.Enabled = false; } }
private void BarbtnOpen_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { CTechCore.Tools.frmSearch frm = new CTechCore.Tools.frmSearch(); ///LOAD DATASOURCE & SET EVENTS FOR Customers frm.cntrlSearch1.btnNew.Click += (o, args) => frm.cntrlSearch1.EditValue = new SalesOrder(); DevExpress.XtraSplashScreen.SplashScreenManager.ShowForm(typeof(CTechCore.WaitForms.frmWaitBasic)); DataTable dt = new DataTable(); MyApp.Evo.ExecSQL($"SELECT AutoIDX, SONumber, CustomerName, ExtOrdNum, OrderDate from tblSOHeader WHERE OrderStatus in ({(int)CTechCore.Enums.Document.State.New}, {(int)CTechCore.Enums.Document.State.Saved})", ref dt); #if DEBUG MyApp.Evo.ExecSQL($"SELECT AutoIDX, SONumber, CustomerName, ExtOrdNum, OrderDate FROM tblSOHeader ", ref dt); #endif frm.cntrlSearch1.DataSource = dt; DevExpress.XtraSplashScreen.SplashScreenManager.CloseForm(); if (frm.ShowDialog() == DialogResult.OK) { if (frm.cntrlSearch1.EditValue is DataRow) { SalesOrderBindingSource.DataSource = new SalesOrder(((DataRow)frm.cntrlSearch1.EditValue).Field <int>("AutoIDX")); } else if (frm.cntrlSearch1.EditValue is SalesOrder) { SalesOrderBindingSource.DataSource = (SalesOrder)frm.cntrlSearch1.EditValue; } //lkpStokGroup.Enabled = false; } }
private void BarbtnOpen_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { CTechCore.Tools.frmSearch frm = new CTechCore.Tools.frmSearch(); ///LOAD DATASOURCE & SET EVENTS FOR Customers frm.cntrlSearch1.btnNew.Click += (o, args) => { frm.cntrlSearch1.EditValue = new SalesOrder(); }; DevExpress.XtraSplashScreen.SplashScreenManager.ShowForm(typeof(CTechCore.WaitForms.frmWaitBasic)); DataTable dt = new DataTable(); MyApp.CTech.ExecSQL($"select * from vw_XR_OrdersForView", ref dt); frm.cntrlSearch1.DataSource = dt; DevExpress.XtraSplashScreen.SplashScreenManager.CloseForm(); frm.cntrlSearch1.gridView1.Columns.ToList().ForEach(c => c.MinWidth = 150); if (frm.ShowDialog() == DialogResult.OK) { if (frm.cntrlSearch1.EditValue is DataRow) { salesOrderBindingSource.DataSource = new SalesOrder(((DataRow)frm.cntrlSearch1.EditValue).Field <Int64>("AutoIndex")); } else if (frm.cntrlSearch1.EditValue is SalesOrder) { salesOrderBindingSource.DataSource = (SalesOrder)frm.cntrlSearch1.EditValue; } //lkpStokGroup.Enabled = false; } }
private void btnAddModules_Click(object sender, EventArgs e) { try { CTechCore.Tools.frmSearch frm = new CTechCore.Tools.frmSearch(); DataView dv = HertexData.Modules.GetModules; dv.RowFilter = $"Active = 1"; frm.cntrlSearch1.DataSource = dv; frm.cntrlSearch1.ViewMultiSelectMode = DevExpress.XtraGrid.Views.Grid.GridMultiSelectMode.CheckBoxRowSelect; frm.cntrlSearch1.ViewSelectionMultiSelect = true; //frm.cntrlSearch1.Columns.ToList().ForEach(c => c.Visible = new List<string>() { "Varieties" }.Contains(c.FieldName)); User user = (User)userBindingSource.DataSource; foreach (var module in user.Modules) { int irow = frm.cntrlSearch1.gridView1.LocateByValue("AutoIDX", module.Key.ID); frm.cntrlSearch1.gridView1.SelectRow(irow); } if (frm.ShowDialog() == DialogResult.OK) { user.Modules.Clear(); foreach (int i in frm.cntrlSearch1.gridView1.GetSelectedRows()) { DataRow r = ((DataRowView)frm.cntrlSearch1.gridView1.GetRow((int)i)).Row; user.Modules.Add(new KeyValuePair <Module, Permissions>(new Modules(r.Field <string>("Module")), new Permissions())); } } } catch (Exception ex) { MessageBox.Show($"Error: {e.ToString()}"); } }