本文整理汇总了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;
}
}
示例2: Delete
public void Delete(Core.Business.OperateSort operateSort)
{
SqlServerUtility sql = new SqlServerUtility();
sql.AddParameter("@Id", SqlDbType.UniqueIdentifier, operateSort.Id);
sql.ExecuteSP("usp_DeleteOperateSort");
}
示例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;
}
示例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;
}
示例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;
}
}
示例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;
}
}
示例7: Delete
public void Delete(Core.Business.SysSetting sysSetting)
{
SqlServerUtility sql = new SqlServerUtility();
sql.AddParameter("@Id", SqlDbType.UniqueIdentifier, sysSetting.Id);
sql.ExecuteSP("usp_DeleteSysSetting");
}
示例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;
}
}
示例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;
}
示例10: Delete
public void Delete(Core.Business.Subsidies subsidies)
{
SqlServerUtility sql = new SqlServerUtility();
sql.AddParameter("@Id", SqlDbType.UniqueIdentifier, subsidies.Id);
sql.ExecuteSP("usp_DeleteSubsidy");
}
示例11: Delete
public void Delete(Core.Business.ObjectStimulatedType objectStimulatedType)
{
SqlServerUtility sql = new SqlServerUtility();
sql.AddParameter("@Id", SqlDbType.Int, objectStimulatedType.Id);
sql.ExecuteSP("usp_DeleteObjectStimulatedType");
}
示例12: Delete
public void Delete(Core.Business.FavoritesComment favoritesComment)
{
SqlServerUtility sql = new SqlServerUtility(connectionString);
sql.AddParameter("@Id", SqlDbType.BigInt, favoritesComment.Id);
sql.ExecuteSqlReader(SqlDeleteFavoritesComment);
}
示例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");
}
示例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;
}
示例15: Delete
public void Delete(Core.Business.Messages messages)
{
SqlServerUtility sql = new SqlServerUtility(connectionString);
sql.AddParameter("@Id", SqlDbType.BigInt, messages.Id);
sql.ExecuteSql(SqlDeleteMessages);
}