Example #1
0
 public bool RegisterUserInfo(UserInfo userinfo)
 {
     bool flag = false;
     try
     {
         return this.db.RunProcedure("SP_User_Info_Add", new SqlParameter[6]
     {
       new SqlParameter("@UserID", (object) userinfo.UserID),
       new SqlParameter("@UserEmail", (object) userinfo.UserEmail),
       new SqlParameter("@UserPhone", userinfo.UserPhone == null ? (object) string.Empty : (object) userinfo.UserPhone),
       new SqlParameter("@UserOther1", userinfo.UserOther1 == null ? (object) string.Empty : (object) userinfo.UserOther1),
       new SqlParameter("@UserOther2", userinfo.UserOther2 == null ? (object) string.Empty : (object) userinfo.UserOther2),
       new SqlParameter("@UserOther3", userinfo.UserOther3 == null ? (object) string.Empty : (object) userinfo.UserOther3)
     });
     }
     catch (Exception ex)
     {
         if (BaseBussiness.log.IsErrorEnabled)
             BaseBussiness.log.Error((object)"Init", ex);
     }
     return flag;
 }
Example #2
0
 public UserInfo GetUserInfo(int UserId)
 {
     SqlDataReader ResultDataReader = (SqlDataReader)null;
     UserInfo userInfo = new UserInfo()
     {
         UserID = UserId
     };
     try
     {
         SqlParameter[] SqlParameters = new SqlParameter[1]
     {
       new SqlParameter("@UserID", (object) UserId)
     };
         this.db.GetReader(ref ResultDataReader, "SP_Get_User_Info", SqlParameters);
         while (ResultDataReader.Read())
         {
             userInfo.UserID = int.Parse(ResultDataReader["UserID"].ToString());
             userInfo.UserEmail = ResultDataReader["UserEmail"] == null ? "" : ResultDataReader["UserEmail"].ToString();
             userInfo.UserPhone = ResultDataReader["UserPhone"] == null ? "" : ResultDataReader["UserPhone"].ToString();
             userInfo.UserOther1 = ResultDataReader["UserOther1"] == null ? "" : ResultDataReader["UserOther1"].ToString();
             userInfo.UserOther2 = ResultDataReader["UserOther2"] == null ? "" : ResultDataReader["UserOther2"].ToString();
             userInfo.UserOther3 = ResultDataReader["UserOther3"] == null ? "" : ResultDataReader["UserOther3"].ToString();
         }
     }
     catch (Exception ex)
     {
         if (BaseBussiness.log.IsErrorEnabled)
             BaseBussiness.log.Error((object)"Init", ex);
     }
     finally
     {
         if (ResultDataReader != null && !ResultDataReader.IsClosed)
             ResultDataReader.Close();
     }
     return userInfo;
 }