Beispiel #1
0
 /// <summary>
 /// Method To Clear All Record
 /// </summary>
 public void ClearAll()
 {
     try
     {
         FirstName = string.Empty;
         LastName  = string.Empty;
         UserCode  = string.Empty;
         RoleList.Clear();
         GetAllRoles(0);
         RecordStatus.Clear();
         GetRecordStatus();
     }
     catch (Exception ex)
     {
         LogHelper.LogErrorToDb(ex);
         bool displayErrorOnUI = false;
         CommonSettings.logger.LogError(this.GetType(), ex);
         if (displayErrorOnUI)
         {
             throw;
         }
     }
     finally
     {
         CommonSettings.logger.LogInfo(typeof(string), string.Format(CultureInfo.InvariantCulture, Resources.loggerMsgEnd, DateTime.Now.ToShortDateString(), DateTime.Now.ToShortTimeString(), MethodBase.GetCurrentMethod().Name));
     }
 }
Beispiel #2
0
        async Task ExecuteLoadItemsCommand()
        {
            try
            {
                RoleService role = new RoleService();
                RoleList.Clear();
                var items = await role.GetSignUpRole();

                foreach (var item in items)
                {
                    if (item.RoleName == "Isolator" || item.RoleName == "Engineer")
                    {
                        RoleList.Add(new RoleModel()
                        {
                            Id = item.Id, RoleName = item.RoleName
                        });
                    }
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
            }
            finally
            {
                // IsBusy = false;
            }
        }
 private void GetAllRoles()
 {
     RoleList.Clear();
     _roleService.GetAllRoles().ToList().ForEach(x =>
     {
         RoleList.Add(x);
     });
 }
        private async void LoadUserRoleList()
        {
            RoleList.Clear();

            IEnumerator <string> e = userManager.GetUserRoleList().GetEnumerator();

            while (await Task.Factory.StartNew(() => e.MoveNext()))
            {
                RoleList.Add(e.Current);
            }
        }
Beispiel #5
0
        public override void Dispose()
        {
            if (RoleList != null)
            {
                RoleList.Clear();
                RoleList = null;
            }

            if (CancelList != null)
            {
                CancelList.Clear();
                CancelList = null;
            }

            base.Dispose();
            GC.SuppressFinalize(this);
        }
        public async Task GetRoles()
        {
            try
            {
                List <RoleResponseModel> Roles = await dashboardRepo.GetRoles();

                RoleList.Clear();

                foreach (var r in Roles)
                {
                    RoleList.Add(r);
                }
            }
            catch (Exception e)
            {
                Toast.ProvideToast().ShowError("Can't load roles");
            }
        }