Пример #1
0
 private void btnAddressAdd_Click(object sender, EventArgs e)
 {
     try
     {
         ObjECustomer = new ECustomer();
         int Ivalue = 0;
         if (int.TryParse(Convert.ToString(cmbCustomer.EditValue), out Ivalue))
         {
             ObjECustomer.AddressID           = -1;
             ObjECustomer.Customer_CustomerID = Ivalue;
             frmCustomerMaster frm = new frmCustomerMaster("Address", ObjECustomer);
             frm.ShowDialog();
             if (frm.DialogResult == DialogResult.OK)
             {
                 BindAddressData();
                 Setfocus(gvAddress, "AddressID", ObjECustomer.AddressID);
                 if (Utility._IsGermany == true)
                 {
                     frmOTTOPro.UpdateStatus("Vorgang abgeschlossen: Speichern der Kunden-Adressdaten");
                 }
                 else
                 {
                     frmOTTOPro.UpdateStatus("Customer address saved successfully");
                 }
             }
         }
     }
     catch (Exception ex) { Utility.ShowError(ex); }
 }
Пример #2
0
        private void gvAddress_DoubleClick(object sender, EventArgs e)
        {
            try
            {
                GridView    view = (GridView)sender;
                Point       pt   = view.GridControl.PointToClient(Control.MousePosition);
                GridHitInfo info = view.CalcHitInfo(pt);

                if (info.InRow || info.InRowCell)
                {
                    ObjECustomer = new ECustomer();
                    int Ivalue = 0;
                    if (int.TryParse(Convert.ToString(cmbCustomer.EditValue), out Ivalue))
                    {
                        ObjECustomer.Customer_CustomerID = Ivalue;
                        GetAddressDetails();
                        frmCustomerMaster frm = new frmCustomerMaster("Address", ObjECustomer);
                        frm.ObjEcustomer = ObjECustomer;
                        frm.ShowDialog();
                        if (frm.DialogResult == DialogResult.OK)
                        {
                            BindAddressData();
                            Setfocus(gvAddress, "AddressID", ObjECustomer.AddressID);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Utility.ShowError(ex);
            }
        }