• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# DBUtility.SqlServerUtility类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中CY.Utility.DBUtility.SqlServerUtility的典型用法代码示例。如果您正苦于以下问题:C# SqlServerUtility类的具体用法?C# SqlServerUtility怎么用?C# SqlServerUtility使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SqlServerUtility类属于CY.Utility.DBUtility命名空间,在下文中一共展示了SqlServerUtility类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Select

        public Core.Business.OperateSort Select(Guid id)
        {
            SqlServerUtility sql = new SqlServerUtility();

            sql.AddParameter("@Id", SqlDbType.UniqueIdentifier, id);
            SqlDataReader reader = sql.ExecuteSPReader("usp_SelectOperateSort");

            if (reader != null && !reader.IsClosed && reader.Read())
            {
                Core.Business.OperateSort operateSort = new Core.Business.OperateSort();

                if (!reader.IsDBNull(0)) operateSort.Id = reader.GetGuid(0);
                if (!reader.IsDBNull(1)) operateSort.OperateSortName = reader.GetString(1);

                reader.Close();
                return operateSort;
            }
            else
            {
                if (reader != null && !reader.IsClosed)
                    reader.Close();

                return null;
            }
        }
开发者ID:dalinhuang,项目名称:cy-csts,代码行数:25,代码来源:OperateSortProvider.cs


示例2: Delete

        public void Delete(Core.Business.OperateSort operateSort)
        {
            SqlServerUtility sql = new SqlServerUtility();

            sql.AddParameter("@Id", SqlDbType.UniqueIdentifier, operateSort.Id);
            sql.ExecuteSP("usp_DeleteOperateSort");
        }
开发者ID:dalinhuang,项目名称:cy-csts,代码行数:7,代码来源:OperateSortProvider.cs


示例3: GetAllInstrumentPictureRepository

        public IList<Core.Business.InstrumentPictureRepository> GetAllInstrumentPictureRepository()
        {
            IList<Core.Business.InstrumentPictureRepository> instrumentPictureRepositorylist = new List<Core.Business.InstrumentPictureRepository>();
            SqlServerUtility sql = new SqlServerUtility();

            SqlDataReader reader = sql.ExecuteSPReader("usp_SelectInstrumentPictureRepositoriesAll");

            if(reader != null)
            {
                while(reader.Read())
                {
                    Core.Business.InstrumentPictureRepository instrumentPictureRepository = new Core.Business.InstrumentPictureRepository();

                    if (!reader.IsDBNull(0)) instrumentPictureRepository.Id = reader.GetGuid(0);
                    if (!reader.IsDBNull(1)) instrumentPictureRepository.PictureName = reader.GetString(1);
                    if (!reader.IsDBNull(2)) instrumentPictureRepository.InstrumentID = reader.GetGuid(2);
                    if (!reader.IsDBNull(3)) instrumentPictureRepository.PictureSortID = reader.GetGuid(3);
                    if (!reader.IsDBNull(4)) instrumentPictureRepository.PictureOrigin = reader.GetString(4);
                    if (!reader.IsDBNull(5)) instrumentPictureRepository.PictureContent = reader.GetString(5);
                    if (!reader.IsDBNull(6)) instrumentPictureRepository.Remark = reader.GetString(6);
                    if (!reader.IsDBNull(7)) instrumentPictureRepository.DranscriberID = reader.GetGuid(7);
                    if (!reader.IsDBNull(8)) instrumentPictureRepository.DranscribeDate = reader.GetDateTime(8);

                    instrumentPictureRepository.MarkOld();
                    instrumentPictureRepositorylist.Add(instrumentPictureRepository);
                }
                reader.Close();
            }
            return instrumentPictureRepositorylist;
        }
开发者ID:dalinhuang,项目名称:cy-csts,代码行数:30,代码来源:InstrumentPictureRepositoryProvider.cs


示例4: GetCommentCountByMiniBlogId

        public int GetCommentCountByMiniBlogId(CY.UME.Core.Business.MiniBlog miniBlog)
        {
            int count = 0;

            if (miniBlog == null)
            {
                return count;
            }

            SqlServerUtility sql = new SqlServerUtility(connectionString);

            sql.AddParameter("@MiniBlogId", SqlDbType.BigInt, miniBlog.Id);
            SqlDataReader reader = sql.ExecuteSPReader("USP_MiniBlogComment_SelectCount_By_MiniBlogId");

            if (reader != null && !reader.IsClosed && reader.Read())
            {
                if (!reader.IsDBNull(0)) count = reader.GetInt32(0);

                reader.Close();
            }
            else
            {
                if (reader != null && !reader.IsClosed)
                    reader.Close();
            }

            return count;
        }
开发者ID:dalinhuang,项目名称:ume-v3,代码行数:28,代码来源:MiniBlogCommentProvider.cs


示例5: Select

        public Core.Business.ObjectStimulatedType Select(int id)
        {
            SqlServerUtility sql = new SqlServerUtility();

            sql.AddParameter("@Id", SqlDbType.Int, id);
            SqlDataReader reader = sql.ExecuteSPReader("usp_SelectObjectStimulatedType");

            if (reader != null && !reader.IsClosed && reader.Read())
            {
                Core.Business.ObjectStimulatedType objectStimulatedType = new Core.Business.ObjectStimulatedType();

                if (!reader.IsDBNull(0)) objectStimulatedType.Id = reader.GetInt32(0);
                if (!reader.IsDBNull(1)) objectStimulatedType.Name = reader.GetString(1);
                if (!reader.IsDBNull(2)) objectStimulatedType.Description = reader.GetString(2);

                reader.Close();
                return objectStimulatedType;
            }
            else
            {
                if (reader != null && !reader.IsClosed)
                    reader.Close();

                return null;
            }
        }
开发者ID:dalinhuang,项目名称:cy-csts,代码行数:26,代码来源:ObjectStimulatedTypeProvider.cs


示例6: Select

        public Core.Business.SysSetting Select(Guid id)
        {
            SqlServerUtility sql = new SqlServerUtility();

            sql.AddParameter("@Id", SqlDbType.UniqueIdentifier, id);
            SqlDataReader reader = sql.ExecuteSPReader("usp_SelectSysSetting");

            if (reader != null && !reader.IsClosed && reader.Read())
            {
                Core.Business.SysSetting sysSetting = new Core.Business.SysSetting();

                if (!reader.IsDBNull(0)) sysSetting.Id = reader.GetGuid(0);
                if (!reader.IsDBNull(1)) sysSetting.Name = reader.GetString(1);
                if (!reader.IsDBNull(2)) sysSetting.SysValue = reader.GetString(2);

                reader.Close();
                return sysSetting;
            }
            else
            {
                if (reader != null && !reader.IsClosed)
                    reader.Close();

                return null;
            }
        }
开发者ID:dalinhuang,项目名称:cy-csts,代码行数:26,代码来源:SysSettingProvider.cs


示例7: Delete

        public void Delete(Core.Business.SysSetting sysSetting)
        {
            SqlServerUtility sql = new SqlServerUtility();

            sql.AddParameter("@Id", SqlDbType.UniqueIdentifier, sysSetting.Id);
            sql.ExecuteSP("usp_DeleteSysSetting");
        }
开发者ID:dalinhuang,项目名称:cy-csts,代码行数:7,代码来源:SysSettingProvider.cs


示例8: Select

        public Core.Business.Subsidies Select(Guid id)
        {
            SqlServerUtility sql = new SqlServerUtility();

            sql.AddParameter("@Id", SqlDbType.UniqueIdentifier, id);
            SqlDataReader reader = sql.ExecuteSPReader("usp_SelectSubsidy");

            if (reader != null && !reader.IsClosed && reader.Read())
            {
                Core.Business.Subsidies subsidies = new Core.Business.Subsidies();

                if (!reader.IsDBNull(0)) subsidies.Id = reader.GetGuid(0);
                if (!reader.IsDBNull(1)) subsidies.Name = reader.GetString(1);
                if (!reader.IsDBNull(2)) subsidies.Des = reader.GetString(2);
                if (!reader.IsDBNull(3)) subsidies.AddPerson = reader.GetString(3);
                if (!reader.IsDBNull(4)) subsidies.AddTime = reader.GetDateTime(4);
                if (!reader.IsDBNull(5)) subsidies.Status = reader.GetInt32(5);

                reader.Close();
                return subsidies;
            }
            else
            {
                if (reader != null && !reader.IsClosed)
                    reader.Close();

                return null;
            }
        }
开发者ID:dalinhuang,项目名称:cy-csts,代码行数:29,代码来源:SubsidiesProvider.cs


示例9: GetAllSubsidies

        public IList<Core.Business.Subsidies> GetAllSubsidies()
        {
            IList<Core.Business.Subsidies> subsidieslist = new List<Core.Business.Subsidies>();
            SqlServerUtility sql = new SqlServerUtility();

            SqlDataReader reader = sql.ExecuteSPReader("usp_SelectSubsidiesAll");

            if(reader != null)
            {
                while(reader.Read())
                {
                    Core.Business.Subsidies subsidies = new Core.Business.Subsidies();

                    if (!reader.IsDBNull(0)) subsidies.Id = reader.GetGuid(0);
                    if (!reader.IsDBNull(1)) subsidies.Name = reader.GetString(1);
                    if (!reader.IsDBNull(2)) subsidies.Des = reader.GetString(2);
                    if (!reader.IsDBNull(3)) subsidies.AddPerson = reader.GetString(3);
                    if (!reader.IsDBNull(4)) subsidies.AddTime = reader.GetDateTime(4);
                    if (!reader.IsDBNull(5)) subsidies.Status = reader.GetInt32(5);

                    subsidies.MarkOld();
                    subsidieslist.Add(subsidies);
                }
                reader.Close();
            }
            return subsidieslist;
        }
开发者ID:dalinhuang,项目名称:cy-csts,代码行数:27,代码来源:SubsidiesProvider.cs


示例10: Delete

        public void Delete(Core.Business.Subsidies subsidies)
        {
            SqlServerUtility sql = new SqlServerUtility();

            sql.AddParameter("@Id", SqlDbType.UniqueIdentifier, subsidies.Id);
            sql.ExecuteSP("usp_DeleteSubsidy");
        }
开发者ID:dalinhuang,项目名称:cy-csts,代码行数:7,代码来源:SubsidiesProvider.cs


示例11: Delete

        public void Delete(Core.Business.ObjectStimulatedType objectStimulatedType)
        {
            SqlServerUtility sql = new SqlServerUtility();

            sql.AddParameter("@Id", SqlDbType.Int, objectStimulatedType.Id);
            sql.ExecuteSP("usp_DeleteObjectStimulatedType");
        }
开发者ID:dalinhuang,项目名称:cy-csts,代码行数:7,代码来源:ObjectStimulatedTypeProvider.cs


示例12: Delete

        public void Delete(Core.Business.FavoritesComment favoritesComment)
        {
            SqlServerUtility sql = new SqlServerUtility(connectionString);

            sql.AddParameter("@Id", SqlDbType.BigInt, favoritesComment.Id);
            sql.ExecuteSqlReader(SqlDeleteFavoritesComment);
        }
开发者ID:dalinhuang,项目名称:ume-v3,代码行数:7,代码来源:FavoritesCommentProvider.cs


示例13: Delete

        public void Delete(Core.Business.MiniBlogComment miniBlogComment)
        {
            SqlServerUtility sql = new SqlServerUtility(connectionString);

            sql.AddParameter("@Id", SqlDbType.BigInt, miniBlogComment.Id);
            sql.ExecuteSP("USP_MiniBlogComment_Delete_By_Id");
        }
开发者ID:dalinhuang,项目名称:ume-v3,代码行数:7,代码来源:MiniBlogCommentProvider.cs


示例14: GetCommentCountByFavoritesId

        public int GetCommentCountByFavoritesId(CY.UME.Core.Business.Favorites favorites)
        {
            int count = 0;

            if (favorites == null)
            {
                return count;
            }

            SqlServerUtility sql = new SqlServerUtility(connectionString);

            sql.AddParameter("@FavoritesId", SqlDbType.BigInt, favorites.Id);
            SqlDataReader reader = sql.ExecuteSqlReader(SqlGetFavoritesCommentCountByInstanceId);

            if (reader != null && !reader.IsClosed && reader.Read())
            {
                if (!reader.IsDBNull(0)) count = reader.GetInt32(0);

                reader.Close();
            }
            else
            {
                if (reader != null && !reader.IsClosed)
                    reader.Close();
            }

            return count;
        }
开发者ID:dalinhuang,项目名称:ume-v3,代码行数:28,代码来源:FavoritesCommentProvider.cs


示例15: Delete

        public void Delete(Core.Business.Messages messages)
        {
            SqlServerUtility sql = new SqlServerUtility(connectionString);

            sql.AddParameter("@Id", SqlDbType.BigInt, messages.Id);
            sql.ExecuteSql(SqlDeleteMessages);
        }
开发者ID:dalinhuang,项目名称:ume-v3,代码行数:7,代码来源:MessagesProvider.cs


示例16: Delete

        public void Delete(Core.Business.InstrumentPictureRepository instrumentPictureRepository)
        {
            SqlServerUtility sql = new SqlServerUtility();

            sql.AddParameter("@Id", SqlDbType.UniqueIdentifier, instrumentPictureRepository.Id);
            sql.ExecuteSP("usp_DeleteInstrumentPictureRepository");
        }
开发者ID:dalinhuang,项目名称:cy-csts,代码行数:7,代码来源:InstrumentPictureRepositoryProvider.cs


示例17: GetAllMessages

        public IList<Core.Business.Messages> GetAllMessages()
        {
            IList<Core.Business.Messages> messageslist = new List<Core.Business.Messages>();
            SqlServerUtility sql = new SqlServerUtility(connectionString);

            SqlDataReader reader = sql.ExecuteSqlReader(SqlGetAllMessages);

            if (reader != null)
            {
                while (reader.Read())
                {
                    Core.Business.Messages messages = new Core.Business.Messages();

                    if (!reader.IsDBNull(0)) messages.Id = reader.GetInt64(0);
                    if (!reader.IsDBNull(1)) messages.Content = reader.GetString(1);
                    if (!reader.IsDBNull(2)) messages.Type = reader.GetInt32(2);
                    if (!reader.IsDBNull(3)) messages.DateCreated = reader.GetDateTime(3);
                    if (!reader.IsDBNull(4)) messages.SendDate = reader.GetDateTime(4);
                    if (!reader.IsDBNull(5)) messages.IsRead = reader.GetInt32(5);
                    if (!reader.IsDBNull(6)) messages.AuthorId = reader.GetInt64(6);
                    if (!reader.IsDBNull(7)) messages.AccountId = reader.GetInt64(7);
                    if (!reader.IsDBNull(8)) messages.Title = reader.GetString(8);
                    if (!reader.IsDBNull(9)) messages.Attachments = reader.GetString(9);
                    if (!reader.IsDBNull(10)) messages.AuthorName = reader.GetString(10);
                    if (!reader.IsDBNull(11)) messages.AccountName = reader.GetString(11);

                    messages.MarkOld();
                    messageslist.Add(messages);
                }
                reader.Close();
            }
            return messageslist;
        }
开发者ID:dalinhuang,项目名称:ume-v3,代码行数:33,代码来源:MessagesProvider.cs


示例18: getCount

        public int getCount(string strWhere)
        {
            SqlServerUtility sql = new SqlServerUtility();

            if (strWhere.Trim().Equals(""))
            {
                strWhere = "1=1";
            }
            string sqlstr = "select count(*) from InstrumentPictureRepository where " + strWhere + "";
            SqlDataReader reader = sql.ExecuteSqlReader(sqlstr);

            int count = 0;
            if (reader != null && !reader.IsClosed && reader.Read())
            {
                if (!reader.IsDBNull(0)) count = reader.GetInt32(0);

                reader.Close();
                return count;
            }
            else
            {
                if (reader != null && !reader.IsClosed)
                    reader.Close();
                return count;
            }
        }
开发者ID:dalinhuang,项目名称:cy-csts,代码行数:26,代码来源:InstrumentPictureRepositoryProvider.cs



注:本文中的CY.Utility.DBUtility.SqlServerUtility类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Common.CacheKey类代码示例发布时间:2022-05-24
下一篇:
C# CWrapped.Wrapped类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap