private void Login(string pStrUser, string pStrPassword) { FormLoading(); try { if (CheckVersion()) { if (ActiveSecurity() && !TestMode()) { SetUserSession(mObjUserFactory.GetUserService().Login(pStrUser, pStrPassword)); AuthorizeAccess(); } else { StaticSessionUtility.mObjSeccion = new SessionDTO() { Id = 0, UserName = "******" }; AuthorizeAccess(); } } } catch (Exception lObjException) { FormDefult(); ShowMessage(lObjException.Message); } finally { FormDefult(); } }
private void LoadDatagrid() { FormLoading(); try { this.Dispatcher.Invoke(() => { dgUser.ItemsSource = null; }); List <User> lObjUser = mObjUserFactory.GetUserService().GetList().Where(x => x.Active == true && x.Removed == false).ToList(); mLcvListData = new ListCollectionView(lObjUser); this.Dispatcher.Invoke(() => { dgUser.ItemsSource = mLcvListData; }); } catch (Exception lObjException) { FormDefult(); ShowMessage("Error", lObjException.Message); } finally { FormDefult(); } }
private void LoadDataGridUser() { dgUserType.ItemsSource = null; List <User> lObjuserTypes = mObjUserTypeFactory.GetUserService().GetList().Where(x => x.Active == true && x.Removed == false).ToList(); mLcvListData = new ListCollectionView(lObjuserTypes); dgUser.ItemsSource = mLcvListData; dgUser.Visibility = Visibility.Visible; dgUserType.Visibility = Visibility.Collapsed; }
private bool GetActiveSession() { SessionDTO lObjCurrentSession = (SessionDTO)StaticSessionUtility.GetCurrentSession(); if (lObjCurrentSession != null) { UserDTO pObjUserDto = mObjUserFactory.GetUserService().GetUserDTO(lObjCurrentSession.Id); if (pObjUserDto.UserType.Equals("Administrador")) { return(true); } else { return(false); } } else { return(false); } }