当前位置: 首页>>代码示例>>C#>>正文


C# DBUtility.SqlServerUtility类代码示例

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


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


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