Beispiel #1
0
        /// <summary>
        /// Carga el combobox de permision
        /// </summary>
        /// <history>
        /// [emoguel] created 11/06/2016
        /// </history>
        private async void LoadPermission()
        {
            try
            {
                List <Permission> lstPermission = await BRPermissions.GetPermissions(1);

                lstPermission.Insert(0, new Permission {
                    pmID = "ALL", pmN = "ALL"
                });
                cmbPermission.ItemsSource   = lstPermission;
                cmbPermission.SelectedValue = permission;
            }
            catch (Exception ex)
            {
                UIHelper.ShowMessage(ex);
            }
        }
Beispiel #2
0
        /// <summary>
        /// Llena el grid de permissions
        /// </summary>
        /// <param name="permision">Objeto a seleccionar</param>
        /// <history>
        /// [emoguel] created 07/06/2016
        /// [emoguel] Modified 11/06/2016 se volvió async
        /// </history>
        private async void LoadPermissions(Permission permision = null)
        {
            try
            {
                status.Visibility = Visibility.Visible;
                int nIndex = 0;
                List <Permission> lstPermissions = await BRPermissions.GetPermissions(_nStatus, _permissionFilter);

                dgrPermissions.ItemsSource = lstPermissions;

                if (lstPermissions.Count > 0 && permision != null)
                {
                    permision = lstPermissions.Where(pm => pm.pmID == permision.pmID).FirstOrDefault();
                    nIndex    = lstPermissions.IndexOf(permision);
                }
                GridHelper.SelectRow(dgrPermissions, nIndex);
                StatusBarReg.Content = lstPermissions.Count + " Permissions.";
                status.Visibility    = Visibility.Collapsed;
            }
            catch (Exception ex)
            {
                UIHelper.ShowMessage(ex);
            }
        }