public static DataSet GetActions()
            {
                const string sql = @"
                        SELECT *
                        FROM [dbo].[Actions];
                    ";

                using (var db = new MsSql(DbName.Official)) {
                    return(db.DataSet(CommandType.Text, sql));
                }
            }
            public static DataSet GetRoleList()
            {
                const string sql = @"
                        SELECT *
                        FROM [dbo].[Role]
                        ORDER BY [Name]
                    ";

                using (var db = new MsSql(DbName.Official)) {
                    return(db.DataSet(CommandType.Text, sql));
                }
            }
            public static DataSet GetUserRole(long userId)
            {
                string sql = Format(@"
                        SELECT *
                        FROM [dbo].[Role];

                        SELECT RoleID
                        FROM [dbo].[UserRole]
                        WHERE UserID={0};
                    ", userId);

                using (var db = new MsSql(DbName.Official)) {
                    return(db.DataSet(CommandType.Text, sql));
                }
            }
            public static DataSet GetUserAction(long userId)
            {
                string sql =
                    $@"
                        SELECT *
                        FROM [dbo].[Actions];

                        SELECT ActionID
                        FROM [dbo].[UserAction]
                        WHERE UserID={userId};
                    ";

                using (var db = new MsSql(DbName.Official)) {
                    return(db.DataSet(CommandType.Text, sql));
                }
            }
 public static DataSet Detail(long userId)
 {
     using (var db = new MsSql(DbName.Official)) {
         return(db.DataSet(
                    CommandType.StoredProcedure,
                    "[dbo].[sp_UserDetailById_Sel]",
                    new DbParameter[] {
             new SqlParameter {
                 Value = userId,
                 SqlDbType = SqlDbType.BigInt,
                 ParameterName = "@argIntUserId",
                 Direction = ParameterDirection.Input
             }
         }));
     }
 }
 public static DataSet List(FunctionParameter param)
 {
     using (var db = new MsSql(DbName.Official)) {
         return(db.DataSet(
                    CommandType.StoredProcedure,
                    "[dbo].[sp_Function_Sel]",
                    new DbParameter[] {
             new SqlParameter {
                 Value = param.Function.Owner,
                 SqlDbType = SqlDbType.Int,
                 ParameterName = "@argIntOwner",
                 Direction = ParameterDirection.Input
             }
         }));
     }
 }
Example #7
0
 public static DataSet List(VideoNewsParameter param)
 {
     using (var db = new MsSql(DbName.Official))
     {
         return(db.DataSet(
                    CommandType.StoredProcedure,
                    "[dbo].[sp_VideoNewsList_Sel]",
                    new DbParameter[] {
             new SqlParameter {
                 Value = param.KeyWord,
                 SqlDbType = SqlDbType.NVarChar,
                 ParameterName = "@argStrKeyWord",
                 Direction = ParameterDirection.Input
             },
             new SqlParameter {
                 Value = param.StartUtcDateTime,
                 SqlDbType = SqlDbType.DateTime,
                 ParameterName = "@argDteStart",
                 Direction = ParameterDirection.Input
             },
             new SqlParameter {
                 Value = param.EndUtcDateTime,
                 SqlDbType = SqlDbType.DateTime,
                 ParameterName = "@argDteEnd",
                 Direction = ParameterDirection.Input
             },
             new SqlParameter {
                 Value = param.Page,
                 SqlDbType = SqlDbType.Int,
                 ParameterName = "@argIntPage",
                 Direction = ParameterDirection.Input
             },
             new SqlParameter {
                 Value = param.PageSize,
                 SqlDbType = SqlDbType.Int,
                 ParameterName = "@argIntPageSize",
                 Direction = ParameterDirection.Input
             },
             new SqlParameter {
                 Value = param.VideoNewsType,
                 SqlDbType = SqlDbType.TinyInt,
                 ParameterName = "@argIntType",
                 Direction = ParameterDirection.Input
             }
         }));
     }
 }
 public static DataSet Detail(string account)
 {
     using (var db = new MsSql(DbName.Official)) {
         return(db.DataSet(
                    CommandType.StoredProcedure,
                    "[dbo].[sp_UserDetailByAccount_Sel]",
                    new DbParameter[] {
             new SqlParameter {
                 Value = account,
                 SqlDbType = SqlDbType.VarChar,
                 Size = 32,
                 ParameterName = "@argStrAccount",
                 Direction = ParameterDirection.Input
             }
         }));
     }
 }
            public static DataSet GetRoleDetail(RoleParameter param)
            {
                var sql = Format(@"
                        SELECT *
                        FROM [dbo].[Actions];

                        SELECT *
                        FROM [dbo].[Role]
                        WHERE ID={0};

                        SELECT ActionID
                        FROM [dbo].[RoleAction]
                        WHERE RoleID={0};
                    ", param.ID);

                using (var db = new MsSql(DbName.Official)) {
                    return(db.DataSet(CommandType.Text, sql));
                }
            }
Example #10
0
 public static DataSet List(InvestorParameter param)
 {
     using (var db = new MsSql(DbName.Official))
     {
         return(db.DataSet(
                    CommandType.StoredProcedure,
                    "[dbo].[sp_FetchInvestorList_Sel]",
                    new DbParameter[] {
             new SqlParameter {
                 Value = param.KeyWord,
                 SqlDbType = SqlDbType.NVarChar,
                 ParameterName = "@argStrKeyWord",
                 Direction = ParameterDirection.Input
             },
             new SqlParameter {
                 Value = string.IsNullOrEmpty(param.StartUtcDateTime) ? null : param.StartUtcDateTime,
                 SqlDbType = SqlDbType.DateTime,
                 ParameterName = "@argDteStart",
                 Direction = ParameterDirection.Input
             },
             new SqlParameter {
                 Value = string.IsNullOrEmpty(param.EndUtcDateTime) ? null : param.EndUtcDateTime,
                 SqlDbType = SqlDbType.DateTime,
                 ParameterName = "@argDteEnd",
                 Direction = ParameterDirection.Input
             },
             new SqlParameter {
                 Value = param.Page,
                 SqlDbType = SqlDbType.Int,
                 ParameterName = "@argIntPage",
                 Direction = ParameterDirection.Input
             },
             new SqlParameter {
                 Value = param.PageSize,
                 SqlDbType = SqlDbType.Int,
                 ParameterName = "@argIntPageSize",
                 Direction = ParameterDirection.Input
             }
         }));
     }
 }
            public static DataSet List(UserParameter param)
            {
                using (var db = new MsSql(DbName.Official)) {
                    return(db.DataSet(
                               CommandType.StoredProcedure,
                               "[dbo].[sp_User_Sel]",
                               new DbParameter[] {
                        new SqlParameter {
                            Value = param.Page,
                            SqlDbType = SqlDbType.Int,
                            ParameterName = "@argIntPage",
                            Direction = ParameterDirection.Input
                        },
                        new SqlParameter {
                            Value = param.PageSize,
                            SqlDbType = SqlDbType.Int,
                            ParameterName = "@argIntPageSize",
                            Direction = ParameterDirection.Input
                        },
                        new SqlParameter {
                            Value = param.KeyWord,
                            SqlDbType = SqlDbType.NVarChar,
                            Size = 128,
                            ParameterName = "@argStrKeyWord",
                            Direction = ParameterDirection.Input
                        },
                        new SqlParameter {
                            Value = param.User.Status,
                            SqlDbType = SqlDbType.Int,

                            ParameterName = "@argIntStatus",
                            Direction = ParameterDirection.Input
                        }
                    }));
                }
            }