Ejemplo n.º 1
0
        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();
            }
        }
Ejemplo n.º 2
0
 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();
     }
 }
Ejemplo n.º 3
0
        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;
        }
Ejemplo n.º 4
0
        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);
            }
        }