public static void OpenFormByName(string name) { Form frm = null; switch (name) { case "Frm_Vendor": frm = new Frm_CustomerVendor(false); break; case "Frm_Customer": frm = new Frm_CustomerVendor(true); break; case "Frm_VendorList": frm = new Frm_CustomerVendorList(false); break; case "Frm_CustomerList": frm = new Frm_CustomerVendorList(true); break; case "Frm_PurchaseInvoice": frm = new Frm_Invoice(Class.Master.InvoiceType.Purchase); break; default: var ins = Assembly.GetExecutingAssembly().GetTypes().FirstOrDefault(x => x.Name == name); if (ins != null) { frm = Activator.CreateInstance(ins) as Form; if (Application.OpenForms[frm.Name] != null) { frm = Application.OpenForms[frm.Name]; } else { frm.Show(); } frm.BringToFront(); } break; } if (frm != null) { if (Application.OpenForms[frm.Name] != null) { frm = Application.OpenForms[frm.Name]; } else { frm.Show(); } frm.BringToFront(); } }
private void Lkp_PartType_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { if (e.Button.Kind == DevExpress.XtraEditors.Controls.ButtonPredefines.Plus) { using (var frm = new Frm_CustomerVendor(Convert.ToInt32(lkp_PartType.EditValue) == (int)PartType.Customer)) { frm.ShowDialog(); RefreshData(); } } }
private void GridView1_DoubleClick(object sender, EventArgs e) { DXMouseEventArgs ea = e as DXMouseEventArgs; GridView view = sender as GridView; GridHitInfo info = view.CalcHitInfo(ea.Location); if (info.InRow || info.InRowCell) { var frm = new Frm_CustomerVendor(Convert.ToInt32(view.GetFocusedRowCellValue("ID"))); frm.Show(); } }
public override void New() { var frm = new Frm_CustomerVendor(isCustomer); base.New(); }