private void listas_ButtonClick(object sender, ButtonPressedEventArgs e)
        {
            var edit = sender as ButtonEdit;

            if (edit != null)
            {
                var name = edit.Name;
                if (name == "")
                {
                    name = ((DevExpress.XtraEditors.Repository.RepositoryItemLookUpEdit)edit.Tag).Name;
                }
                int a = edit.Properties.Buttons.IndexOf(e.Button);
                if (a == 1)
                {
                    switch (name)
                    {
                    case "chVendedores":
                        EntidadesGlobales.RecargaVendedores(true);
                        chVendedores.Properties.DataSource = EntidadesGlobales.Vendedores;
                        break;
                    }
                }
                else if (a == 2)
                {
                    if (name != "leFamilia" && name != "leGenerico")
                    {
                        edit.EditValue = null;
                    }
                    if (edit is CheckedComboBoxEdit)
                    {
                        (edit as CheckedComboBoxEdit).SetEditValue(null);
                    }
                }
            }
        }
示例#2
0
        private void chDelegaciones_ButtonClick(object sender, ButtonPressedEventArgs e)
        {
            var edit = sender as ButtonEdit;

            if (edit != null)
            {
                int a = edit.Properties.Buttons.IndexOf(e.Button);
                if (a == 1)
                {
                    EntidadesGlobales.RecargaDelegaciones(true);
                    chDelegaciones.Properties.DataSource = EntidadesGlobales.Delegaciones.FindAll(o => o.IdEmpresa == Parametros.IdEmpresa);
                }
                else if (a == 2)
                {
                    (edit as CheckedComboBoxEdit).SetEditValue(null);
                }
            }
        }