Exemple #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="name"></param>
        /// <param name="www"></param>
        /// <param name="id"></param>
        /// <param name="sid"></param>
        /// <param name="code"></param>
        internal static void Initialize(string name, string www, int id, string sid, string code)
        {
            if (!string.IsNullOrEmpty(code))
            {
                //更新好友数据
                string sql = "UPDATE user_status SET invited=invited+1 WHERE id=@id1;UPDATE inviteinfo SET invited_id=@id2 WHERE id=@id1 AND code=@code;"; //id1 邀请 id2
                DBH.ExecuteText(QA.DBCS_MAIN, sql, new SqlParameter("@id1", sid), new SqlParameter("@id2", id), new SqlParameter("@code", code));
            }

            //写入用户信息
            EB <UserStatusEntity> .Create(QA.DBCS_MAIN, new UserStatusEntity()
            {
                id = id,
            });
        }
Exemple #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 internal static UserEntity Get(int id)
 {
     return(EB <UserEntity> .Get("SELECT * FROM user_account WHERE id=@id", new SqlParameter("@id", id)));
 }
Exemple #3
0
 /// <summary>
 ///  创建账户实体对象
 /// </summary>
 /// <param name="entity"></param>
 /// <returns></returns>
 public static int Create(UserEntity entity)
 {
     return(EB <UserEntity> .Create(QA.DBCS_MAIN, entity));
 }
Exemple #4
0
 /// <summary>
 ///  根据用户名和密码获取对应的账户实体对象.
 /// </summary>
 /// <param name="name">用户名</param>
 /// <param name="passwd">密码</param>
 /// <returns>如果无匹配的对象则返回null.</returns>
 public static UserEntity LoginByEmail(string email, string passwd)
 {
     return(EB <UserEntity> .Get("SELECT * FROM user_account WHERE email=@email AND passwd=@passwd AND  status=0", new SqlParameter("@email", email), new SqlParameter("@passwd", passwd)));
 }
Exemple #5
0
 internal static IList <UserEntity> GetFriends(int count, int uid)
 {
     return(EB <UserEntity> .List(QA.DBCS_MAIN, CommandType.Text, "SELECT TOP " + count + " user_account.* FROM user_account INNER JOIN friend ON friend.uid2=user_account.id WHERE friend.uid1=@uid", new SqlParameter("@uid", uid)));
 }
Exemple #6
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 internal static IList <UserEntity> GetInvited(int id)
 {
     return(EB <UserEntity> .List(QA.DBCS_MAIN, CommandType.Text, "SELECT TOP 20 id,www,name,avatar FROM user_account WHERE id in(SELECT invited_id FROM inviteinfo WHERE id=@id and used=1) ORDER BY id ASC", new SqlParameter("@id", id)));
 }
Exemple #7
0
 internal static IList <EventEntity> ListUserPublicEvent(int uid, int count)
 {
     return(EB <EventEntity> .List(QA.DBCS_MAIN, CommandType.Text, "SELECT TOP " + count + " * FROM event WHERE uid=@uid AND type=0", new SqlParameter("@uid", uid)));
 }
Exemple #8
0
 internal static AttachmentEntity Get(int type, int uid, int referid)
 {
     return(EB <AttachmentEntity> .Get("SELECT TOP 1 * FROM attachment WHERE type=@type AND uid=@uid AND refer_id=@refer_id", new SqlParameter("@type", type), new SqlParameter("@uid", uid), new SqlParameter("@referid", referid)));
 }
Exemple #9
0
 /// <summary>
 ///  获取用户的状态数据实体
 /// </summary>
 /// <param name="uid">用户标识</param>
 /// <returns>返回对应的用户状态实体</returns>
 internal static UserStatusEntity GetStatus(int uid)
 {
     return(EB <UserStatusEntity> .Get("SELECT * FROM user_status WHERE uid=@uid", new SqlParameter("@uid", uid)));
 }
Exemple #10
0
 /// <summary>
 ///  根据用户名和密码获取对应的账户实体对象.
 /// </summary>
 /// <param name="name">用户名</param>
 /// <param name="passwd">密码</param>
 /// <returns>如果无匹配的对象则返回null.</returns>
 public static UserEntity LoginByName(string name, string passwd)
 {
     return(EB <UserEntity> .Get("SELECT * FROM user_account WHERE name=@name AND passwd=@passwd AND status=0", new SqlParameter("@name", name), new SqlParameter("@passwd", passwd)));
 }
Exemple #11
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="code"></param>
 /// <returns></returns>
 internal static UserStatusEntity FromCode(string code)
 {
     return(EB <UserStatusEntity> .Get("SELECT * FROM user_status INNER JOIN inviteinfo ON user_status.uid = inviteinfo.id WHERE inviteinfo.code=@code and used=0", new SqlParameter("@code", code)));
 }
Exemple #12
0
 internal static int Create(RoleEntity entity)
 {
     return(EB <RoleEntity> .Create(QA.DBCS_MAIN, entity));
 }
Exemple #13
0
 public static IList <RoleEntity> GetRoleList()
 {
     return(EB <RoleEntity> .List(QA.DBCS_MAIN, CommandType.Text, "SELECT * FROM role"));
 }
Exemple #14
0
 internal static IList <AppEntity> GetAppList(int roleid)
 {
     return(EB <AppEntity> .List(QA.DBCS_MAIN, CommandType.Text, "SELECT app.* FROM role_app INNER JOIN app ON appid=app.id WHERE roleid=@roleid AND allowaccess=1 AND app.enabled=1 ORDER BY displayorder ASC",
                                 new SqlParameter("@roleid", roleid)));
 }
Exemple #15
0
 internal static IList <DistrictEntity> ListDistrict(int levelcode, int pid)
 {
     return(EB <DistrictEntity> .List(QA.DBCS_STATIC, CommandType.Text, "SELECT * FROM district WHERE pid=@pid AND levelcode=@levelcode", new SqlParameter("@pid", pid), new SqlParameter("@levelcode", levelcode)));
 }
Exemple #16
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="key"></param>
 /// <returns></returns>
 internal static UserEntity FromUrlKey(string key)
 {
     return(EB <UserEntity> .Get("SELECT * FROM user_account WHERE www=@www", new SqlParameter("@www", key)));
 }
Exemple #17
0
 internal static int Update(UserEntity entity)
 {
     return(EB <UserEntity> .Update(QA.DBCS_MAIN, entity));
 }
Exemple #18
0
 /// <summary>
 ///  获取最近加入组织的用户信息
 /// </summary>
 /// <param name="count">获取的最大数量</param>
 /// <returns>返回实体列表</returns>
 internal static IList <UserStatusEntity> GetRecent(int count)
 {
     return(EB <UserStatusEntity> .List(QA.DBCS_MAIN, CommandType.Text, "SELECT TOP " + count + " * FROM user_status ORDER BY created DESC"));
 }
Exemple #19
0
 public static int CreateAttachment(AttachmentEntity attach)
 {
     return(EB <AttachmentEntity> .Create(QA.DBCS_MAIN, attach));
 }
Exemple #20
0
 internal static IList <EventEntity> ListEvent(int uid, int count, int eid)
 {
     return(EB <EventEntity> .List(QA.DBCS_MAIN, CommandType.Text, "SELECT TOP " + count + " event.* FROM event_index INNER JOIN event ON event_index.eid=event.id WHERE event_index.uid=@uid AND event_index.eid>@eid",
                                   new SqlParameter("@uid", uid),
                                   new SqlParameter("@eid", eid)));
 }