Exemple #1
0
        public static bool DeleteByGroupSysid(RightLkUserGroup rightLkUserGroup, SqlConnection conn, SqlTransaction trans)
        {
            const string sql = @"
DELETE FROM T_RIGHT_LK_USER_GROUP
WHERE GROUP_SYSID=@GroupSysid

";

            return(Dapper.Save(rightLkUserGroup, sql, conn, trans));
        }
        public static bool Insert(RightLkUserGroup rightLkUserGroup, SqlConnection conn, SqlTransaction trans)
        {
            const string sql = @"
            INSERT INTO T_RIGHT_LK_USER_GROUP(GROUP_SYSID,USER_SYSID)
            VALUES(@GroupSysid,@UserSysid)

            ";

            return Dapper.Save(rightLkUserGroup, sql, conn, trans);
        }
Exemple #3
0
        public static bool Insert(RightLkUserGroup rightLkUserGroup, SqlConnection conn, SqlTransaction trans)
        {
            const string sql = @"
INSERT INTO T_RIGHT_LK_USER_GROUP(GROUP_SYSID,USER_SYSID)
VALUES(@GroupSysid,@UserSysid)

";

            return(Dapper.Save(rightLkUserGroup, sql, conn, trans));
        }
        public static bool DeleteByUserSysid(RightLkUserGroup rightLkUserGroup, SqlConnection conn, SqlTransaction trans)
        {
            const string sql = @"
            DELETE FROM T_RIGHT_LK_USER_GROUP
            WHERE USER_SYSID=@UserSysid

            ";

            return Dapper.Save(rightLkUserGroup, sql, conn, trans);
        }
        //构造新增的数据
        /// <summary>
        /// 构造新增的数据
        /// </summary>
        private List<RightLkUserGroup> BuildInsertEntity()
        {
            var lstRightLkUserGroup = new List<RightLkUserGroup>();
            var groupSysid = UI.GetValue(ddlUserGroup);
            for (var i = 0; i < SelectedUsers.Count; i++)
            {
                var rightUser = SelectedUsers[i];
                var findInDb = _selectedUsersInDb.FindAll(p => p.Sysid == rightUser.Sysid);
                if (findInDb.Count > 0)
                    continue;

                var rightLkUserGroup = new RightLkUserGroup
                                           {
                                               GroupSysid = groupSysid,
                                               UserSysid = rightUser.Sysid
                                           };
                lstRightLkUserGroup.Add(rightLkUserGroup);
            }
            return lstRightLkUserGroup;
        }