Beispiel #1
0
 public static OurGoal Detail()
 {
     using (var db = new MsSql(DbName.Official)) {
         var data = new OurGoal();
         data.Fill(
             db.First(
                 CommandType.Text,
                 "SELECT Top 1 [OurGoalId],[LeftImg],[RightImg] FROM [dbo].[OurGoal] WITH(READUNCOMMITTED);",
                 new DbParameter[] { }));
         return(data);
     }
 }
 public static Partner Detail()
 {
     using (var db = new MsSql(DbName.Official))
     {
         var data = new Partner();
         data.Fill(
             db.First(
                 CommandType.Text,
                 "SELECT Top 1 [PartnerId],[ImgPath] FROM [dbo].[Partner] WITH(READUNCOMMITTED);",
                 new DbParameter[] { }));
         return(data);
     }
 }
 public static StringDictionary Detail(LiteratureParameter param)
 {
     using (var db = new MsSql(DbName.Official)) {
         return(db.First(
                    CommandType.Text,
                    "SELECT [LiteratureId],[TypesOfCancer],[literatureTitel],[publishDate],[HyperLink],[CreateTime] FROM [dbo].[Literature] WITH(READUNCOMMITTED) WHERE [LiteratureId] = @LiteratureId;",
                    new DbParameter[] {
             new SqlParameter {
                 Value = param.Entity.LiteratureId,
                 SqlDbType = SqlDbType.Int,
                 ParameterName = "@LiteratureId",
                 Direction = ParameterDirection.Input
             }
         }));
     }
 }
 public static StringDictionary Detail(AnnouncementParameter param)
 {
     using (var db = new MsSql(DbName.Official)) {
         return(db.First(
                    CommandType.Text,
                    "SELECT [AnnouncementId],[Sort], [Type],[ImgPath], [Link],[IsTop],[Title],  [TextBody], [StartDate],[EndDate],[CreateTime],[UpdateTime],[Status]FROM [dbo].[Announcement] WITH(READUNCOMMITTED)WHERE [AnnouncementId] = @AnnouncementId;",
                    new DbParameter[] {
             new SqlParameter {
                 Value = param.Announcement.AnnouncementId,
                 SqlDbType = SqlDbType.Int,
                 ParameterName = "@AnnouncementId",
                 Direction = ParameterDirection.Input
             }
         }));
     }
 }
 public static StringDictionary Detail(FunctionParameter param)
 {
     using (var db = new MsSql(DbName.Official)) {
         return(db.First(
                    CommandType.StoredProcedure,
                    "[dbo].[sp_FunctionDetail_Sel]",
                    new DbParameter[] {
             new SqlParameter {
                 Value = param.Function.FunctionId,
                 SqlDbType = SqlDbType.Int,
                 ParameterName = "@argIntFunctionId",
                 Direction = ParameterDirection.Input
             }
         }));
     }
 }
Beispiel #6
0
 public static StringDictionary Detail(InvestorParameter param)
 {
     using (var db = new MsSql(DbName.Official))
     {
         return(db.First(
                    CommandType.Text,
                    "SELECT [InvestorId],[TypesOfCatagory],[Titel],[publishDate],[HyperLink],[CreateTime], [DocPath] FROM [dbo].[Investor] WITH(READUNCOMMITTED) WHERE [InvestorId] = @InvestorId;",
                    new DbParameter[] {
             new SqlParameter {
                 Value = param.Entity.InvestorId,
                 SqlDbType = SqlDbType.Int,
                 ParameterName = "@InvestorId",
                 Direction = ParameterDirection.Input
             }
         }));
     }
 }
            public static bool Check(FunctionParameter param)
            {
                if (IsNullOrEmpty(param.Function.Target))
                {
                    return(true);
                }
                string sql =
                    $@"
                        SELECT COUNT(*) AS Count
                        FROM [dbo].[Function]
                        WHERE [FunctionId]!={param
                        .Function.FunctionId} AND [Target]='{param.Function.Target}'
                    ";

                using (var db = new MsSql(DbName.Official)) {
                    var sd = db.First(CommandType.Text, sql);
                    return(Convert.ToInt32(sd["Count"]) == 0);
                }
            }
 public static UserComment Detail(UserCommentParameter param)
 {
     using (var db = new MsSql(DbName.Official)) {
         var data = new UserComment();
         data.Fill(
             db.First(
                 CommandType.Text,
                 "SELECT [UserCommentId],[Name],[Title],[Comment],[ImgPath],[CreateTime] FROM [dbo].[UserComment] WITH(READUNCOMMITTED) WHERE [UserCommentId] = @UserCommentId;",
                 new DbParameter[] {
             new SqlParameter {
                 Value         = param.Entity.UserCommentId,
                 SqlDbType     = SqlDbType.Int,
                 ParameterName = "@UserCommentId",
                 Direction     = ParameterDirection.Input
             }
         }));
         return(data);
     }
 }
Beispiel #9
0
 public static IndexBanner Detail(IndexBannerParameter param)
 {
     using (var db = new MsSql(DbName.Official)) {
         var data = new IndexBanner();
         data.Fill(
             db.First(
                 CommandType.Text,
                 "SELECT [IndexBannerId],[ImgPath],[FirstString],[FirstStringColor],[SecondString],[SecondStringColor],[ThreeString],[ThreeStringColor],[Align],[Link],[CreateTime] FROM [dbo].[IndexBanner] WITH(READUNCOMMITTED) WHERE [IndexBannerId] = @IndexBannerId;",
                 new DbParameter[] {
             new SqlParameter {
                 Value         = param.Entity.IndexBannerId,
                 SqlDbType     = SqlDbType.Int,
                 ParameterName = "@IndexBannerId",
                 Direction     = ParameterDirection.Input
             }
         }));
         return(data);
     }
 }