Exemplo n.º 1
0
        public static MA_USER GetByUserCode(SessionInfo sessioninfo, string usercode)
        {
            try
            {
                UserBusiness _userBusiness = new UserBusiness();
                //Get data from database
                MA_USER user = _userBusiness.GetByUserCode(sessioninfo, usercode);

                //Return result to jTable
                return user;
            }
            catch (Exception ex)
            {
                throw new UIPException(ex);
            }
        }
Exemplo n.º 2
0
 public void GetByUserCodeTest()
 {
     UserBusiness target = new UserBusiness(); // TODO: Initialize to an appropriate value
     SessionInfo sessioninfo = null; // TODO: Initialize to an appropriate value
     string usercode = string.Empty; // TODO: Initialize to an appropriate value
     MA_USER expected = null; // TODO: Initialize to an appropriate value
     MA_USER actual;
     actual = target.GetByUserCode(sessioninfo, usercode);
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
Exemplo n.º 3
0
        public static MA_USER ValidateUser(SessionInfo sessioninfo, string strUsername, string strPassword, int intADLogin)
        {
            UserBusiness _userBusiness = new UserBusiness();

            try
            {
                bool validUser = true;
                if (intADLogin == 1)
                    validUser = LDAPHelper.ValidateUser(strUsername, strPassword);

                if (validUser)
                {
                    MA_USER user = _userBusiness.GetByUserCode(sessioninfo, strUsername);

                    return user;
                }
                else
                {
                    return null;
                }

            }
            catch (Exception ex)
            {
                throw new UIPException(ex);
            }

            //if (strUsername == "Admin")
            //{
            //    return new { Result = "OK", Message = "" };
            //}
            //else
            //{
            //    return new { Result = "ERROR", Message = "User has no right to approve limit." };
            //}
        }