示例#1
0
 protected override void UserReLoginREQ(LoginUser User)
 {
     if (User != null)
     {
         try
         {
             MLoginUser sb = User as MLoginUser;
             LoginRequest(sb.UserObj.UserName, sb.UserObj.Password);
         }
         catch (Exception ex)
         {
             JLog.Instance.Error(ex.Message, MethodBase.GetCurrentMethod().Name,
                                 MethodBase.GetCurrentMethod().Module.Name);
         }
     }
 }
        public MLoginUser GetLoginUserInfo(string userid, string password)
        {
            MLoginUser result = null;


            ISession     ss   = holder.CreateSession(typeof(MLoginUserDaoOracleImp));
            ITransaction tran = ss.BeginTransaction();

            try
            {
                //result = (IList<MFunctioncatalog>)FindAll(typeof(MFunctioncatalog));
                ScalarQuery <MLoginUser> q = new ScalarQuery <MLoginUser>(typeof(MLoginUser), @"
                                                from MLoginUser where Userid=:userid and Password=:password");
                q.SetParameter("userid", userid);
                q.SetParameter("password", password);
                result = q.Execute();
//                string query = @"
//                        select LANGID,CATALOGID,CATALOGNAME from M_FUNCTIONCATALOG
//                        where
//                            LANGID = :key";
//                result = ss.CreateSQLQuery(query)
//                            .AddEntity(typeof(MFunctioncatalog))
//                            .SetParameter("key", langid)
//                            .List<MFunctioncatalog>();
            }
            catch (Castle.ActiveRecord.Framework.ActiveRecordException ex)
            {
                tran.Rollback();
                throw new ApplicationException(ex.Message, ex);
            }
            catch (DbException ex)
            {
                tran.Rollback();
                throw new ApplicationException(ex.Message, ex);
            }
            finally
            {
                tran.Dispose();
                holder.ReleaseSession(ss);
            }

            return(result);
        }
示例#3
0
        public LoginUserInfoVo GetLoginUserList(string userid, string password)
        {
            LoginUserInfoVo result = null;

            IMLoginUserDao ml        = ComponentLocator.Instance().Resolve <IMLoginUserDao>();
            MLoginUser     loginuser = ml.GetLoginUserInfo(userid, password);

            if ((loginuser != null))
            {
                result                  = new LoginUserInfoVo();
                result.Companyid        = loginuser.Companyid;
                result.Deleteflag       = loginuser.Deleteflag;
                result.Lockflag         = loginuser.Lockflag;
                result.Mappingid        = loginuser.Mappingid;
                result.Namepinyin       = loginuser.Namepinyin;
                result.Password         = loginuser.Password;
                result.Temppasswordflag = loginuser.Temppasswordflag;
                result.Userid           = loginuser.Userid;
                result.Username         = loginuser.Username;
                result.Usertype         = loginuser.Usertype;
            }

            return(result);
        }