Exemplo n.º 1
0
        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();
            }
        }
Exemplo n.º 2
0
 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();
         }
     }
 }
Exemplo n.º 3
0
        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();
            }
        }
Exemplo n.º 4
0
        public override void New()
        {
            var frm = new Frm_CustomerVendor(isCustomer);

            base.New();
        }