Exemple #1
0
        public bool Login(ref UserInfoEntity userInfoEntity_0, ref string string_2)
        {
            DataTable table = this.method_1();

            if ((table != null) && (table.Rows.Count > 0))
            {
                if (table.Rows[0]["IsStop"].ToString().Equals("1", StringComparison.OrdinalIgnoreCase))
                {
                    string_2 = "该用户已停用,请检查!";
                    return(false);
                }
                if (table.Rows[0]["UserModule"].ToString().Equals("0", StringComparison.OrdinalIgnoreCase))
                {
                    string_2 = "该用户没有访问该系统权限,请检查!";
                    return(false);
                }
                DataTable table2 = this.method_2();
                if ((table2 != null) && (table2.Rows.Count > 0))
                {
                    int num = this.loginOnlieUserInfo.CreateLoginUserWorkId(this.Ip, this.PreWorkId);
                    userInfoEntity_0 = this.method_0(table, table2, num);
                    return(true);
                }
                string_2 = "读取用户权限参数为空!";
                return(false);
            }
            string_2 = "用户名或密码错误,请检查!";
            return(false);
        }
Exemple #2
0
 public RemotingServer(UserInfoEntity userInfo, string UserId, int ModuleId)
 {
     this._RemotingState = new RemotingState();
     this.myAlarm = new Alarm();
     this.myCar = new Car();
     this.m_LogHelper = new LogHelper();
     this._DataCSList = new RemotingDataCS();
     this._DataBSList = new RemotingDataBS();
     this._OnlineUserInfo = new OnlineUserInfo(userInfo.WorkId, UserId, userInfo.GroupId, ModuleId, userInfo.AllowSelMutil, userInfo.AllowEmptyPw, userInfo.SudoOverDue, userInfo.RoadTransportID, userInfo.AreaCode);
     this.myDownData = new DownData(userInfo.WorkId, userInfo.AllowEmptyPw, userInfo.SudoOverDue, userInfo.AllowSelMutil, this._OnlineUserInfo);
     this.myDownDataYD = new DownDataFJYD(userInfo.WorkId, userInfo.AllowEmptyPw, userInfo.SudoOverDue, userInfo.AllowSelMutil, this._OnlineUserInfo);
     this.myDownDataDB44 = new DownDataXCJLY(userInfo.WorkId, userInfo.AllowEmptyPw, userInfo.SudoOverDue, userInfo.AllowSelMutil, this._OnlineUserInfo);
     this.myDownDataPass = new DownDataPassThrough(userInfo.WorkId, userInfo.AllowEmptyPw, userInfo.SudoOverDue, userInfo.AllowSelMutil, this._OnlineUserInfo);
 }
Exemple #3
0
        private UserInfoEntity method_0(DataTable dataTable_0, DataTable dataTable_1, int int_0)
        {
            UserInfoEntity entity = new UserInfoEntity {
                UserName        = Convert.ToString(dataTable_0.Rows[0]["userName"]),
                AreaCode        = Convert.ToString(dataTable_0.Rows[0]["AreaCode"]),
                RoadTransportID = Convert.ToString(dataTable_0.Rows[0]["RoadTransportID"])
            };
            int num = Convert.ToInt32(dataTable_1.Rows[0]["MultiplySend"]);

            entity.AllowSelMutil = num == 0;
            int num2 = Convert.ToInt32(dataTable_1.Rows[0]["isNeedPass"]);

            entity.AllowEmptyPw = num2 != 0;
            int num3 = Convert.ToInt32(dataTable_1.Rows[0]["SudoOverDue"]);

            entity.SudoOverDue = num3 == 1;
            entity.GroupId     = Convert.ToInt32(dataTable_1.Rows[0]["groupID"]);
            entity.WorkId      = int_0;
            return(entity);
        }
Exemple #4
0
 private bool GetNewUser(string userId, string userPw, string sIp, int moduleId, int PreWorkId, bool IsChecked, ref UserInfoEntity userInfoEntity, out string errorMessage)
 {
     errorMessage = string.Empty;
     UserLoginInterface interface2 = new UserLoginInterface(userId, userPw, sIp, moduleId.ToString(), PreWorkId);
     bool flag = true;
     if (!IsChecked)
     {
         flag = interface2.CheckUserPasswordOutDays(out errorMessage);
     }
     if (!flag)
     {
         return false;
     }
     interface2.PreWorkId = PreWorkId;
     return interface2.Login(ref userInfoEntity, ref errorMessage);
 }
Exemple #5
0
 private Response ExecLogin(string ecCode, string userId, string userPw, string clientIp, int moduleId, int workId, out IRemotingServer remotingServerObject, bool isOldInterfaceFlag)
 {
     remotingServerObject = null;
     Response response = new Response();
     string format = "{0}|{1}|{2}";
     try
     {
         new LogHelper().WriteLog(new LogMsg("RemotingLogin", "ExecLogin", userId + "," + userPw + "," + clientIp));
         string errorMessage = string.Empty;
         if (!this.CheckOnline(ref errorMessage))
         {
             ErrorMsg msg = new ErrorMsg("RemotingLogin", "ExecLogin", errorMessage);
             new LogHelper().WriteError(msg);
             response.ErrorMsg = errorMessage;
             return response;
         }
         if (!this.ADCCheck(workId, ecCode, userId, userPw, ref errorMessage))
         {
             ErrorMsg msg2 = new ErrorMsg("RemotingLogin", "ExecLogin", errorMessage);
             new LogHelper().WriteError(msg2);
             response.ErrorMsg = errorMessage;
             return response;
         }
         if (((workId == -1) || !this.GetExistRemotingServerObject(workId, out remotingServerObject)) || !this.IsDbExistUser(workId))
         {
             new LogHelper().WriteLog(new LogMsg("RemotingLogin", "ExecLogin", "开始新的重登," + workId.ToString()));
             moduleId = this.ChangeModuleIdFromConfiger(moduleId);
             UserInfoEntity userInfoEntity = new UserInfoEntity();
             if (!this.GetNewUser(userId, userPw, clientIp, moduleId, OnlineUserManager.MaxWorkId + 1, isOldInterfaceFlag, ref userInfoEntity, out errorMessage))
             {
                 ErrorMsg msg3 = new ErrorMsg("RemotingLogin", "ExecLogin", errorMessage);
                 new LogHelper().WriteError(msg3);
                 response.ErrorMsg = errorMessage;
                 return response;
             }
             response.ErrorMsg = errorMessage;
             remotingServerObject = this.CreateRemotingServer(userInfoEntity, userId, moduleId);
             response.ResultCode = 0L;
             response.SvcContext = string.Format(format, userInfoEntity.WorkId, userInfoEntity.UserName, SecurityHelper.Key);
             CarDataInfoBuffer.UpdateLoginUserCarInfo(userId);
             new LogHelper().WriteLog(new LogMsg("RemotingLogin", "ExecLogin", "结束新的重登," + userInfoEntity.WorkId.ToString()));
             return response;
         }
         new LogHelper().WriteLog(new LogMsg("RemotingLogin", "ExecLogin", "开始原有还存在对象登入," + workId.ToString()));
         response.ResultCode = 0L;
         string userName = this.GetUserName(userId);
         response.SvcContext = string.Format(format, workId.ToString(), userName, SecurityHelper.Key);
         new LogHelper().WriteLog(new LogMsg("RemotingLogin", "ExecLogin", "结束原有还存在对象登入," + workId.ToString()));
     }
     catch (Exception exception)
     {
         ErrorMsg msg4 = new ErrorMsg("RemotingLogin", "ExecLogin", exception.Message + exception.StackTrace);
         new LogHelper().WriteError(msg4);
         response.ErrorMsg = exception.Message;
     }
     return response;
 }
Exemple #6
0
 private RemotingServer CreateRemotingServer(UserInfoEntity userInfoEntity, string userId, int moduleId)
 {
     OnlineUserManager manager = new OnlineUserManager();
     RemotingServer remotingObj = new RemotingServer(userInfoEntity, userId, moduleId);
     manager.Add(userInfoEntity.WorkId, remotingObj);
     return remotingObj;
 }
 public bool Login(ref UserInfoEntity userInfoEntity_0, ref string string_2)
 {
     DataTable table = this.method_1();
     if ((table != null) && (table.Rows.Count > 0))
     {
         if (table.Rows[0]["IsStop"].ToString().Equals("1", StringComparison.OrdinalIgnoreCase))
         {
             string_2 = "该用户已停用,请检查!";
             return false;
         }
         if (table.Rows[0]["UserModule"].ToString().Equals("0", StringComparison.OrdinalIgnoreCase))
         {
             string_2 = "该用户没有访问该系统权限,请检查!";
             return false;
         }
         DataTable table2 = this.method_2();
         if ((table2 != null) && (table2.Rows.Count > 0))
         {
             int num = this.loginOnlieUserInfo.CreateLoginUserWorkId(this.Ip, this.PreWorkId);
             userInfoEntity_0 = this.method_0(table, table2, num);
             return true;
         }
         string_2 = "读取用户权限参数为空!";
         return false;
     }
     string_2 = "用户名或密码错误,请检查!";
     return false;
 }
 private UserInfoEntity method_0(DataTable dataTable_0, DataTable dataTable_1, int int_0)
 {
     UserInfoEntity entity = new UserInfoEntity {
         UserName = Convert.ToString(dataTable_0.Rows[0]["userName"]),
         AreaCode = Convert.ToString(dataTable_0.Rows[0]["AreaCode"]),
         RoadTransportID = Convert.ToString(dataTable_0.Rows[0]["RoadTransportID"])
     };
     int num = Convert.ToInt32(dataTable_1.Rows[0]["MultiplySend"]);
     entity.AllowSelMutil = num == 0;
     int num2 = Convert.ToInt32(dataTable_1.Rows[0]["isNeedPass"]);
     entity.AllowEmptyPw = num2 != 0;
     int num3 = Convert.ToInt32(dataTable_1.Rows[0]["SudoOverDue"]);
     entity.SudoOverDue = num3 == 1;
     entity.GroupId = Convert.ToInt32(dataTable_1.Rows[0]["groupID"]);
     entity.WorkId = int_0;
     return entity;
 }