/// <summary> /// Deletes a TOCTemplates record /// </summary> public static int Delete(TOCTemplatesDO DO) { SqlParameter _TOCTemplatesID = new SqlParameter("TOCTemplatesID", SqlDbType.Int); _TOCTemplatesID.Value = DO.TOCTemplatesID; SqlParameter[] _params = new SqlParameter[] { _TOCTemplatesID }; return DataCommon.ExecuteScalar("[dbo].[TOCTemplates_Delete]", _params, "dbo"); }
/// <summary> /// Creates a new TOCTemplates record /// </summary> public static int Create(TOCTemplatesDO DO) { SqlParameter _TOCID = new SqlParameter("TOCID", SqlDbType.Int); SqlParameter _Template = new SqlParameter("Template", SqlDbType.VarChar); _TOCID.Value = DO.TOCID; _Template.Value = DO.Template; SqlParameter[] _params = new SqlParameter[] { _TOCID, _Template }; return DataCommon.ExecuteScalar("[dbo].[TOCTemplates_Insert]", _params, "dbo"); }
/// <summary> /// Gets all TOCTemplates records /// </summary> public static TOCTemplatesDO[] GetAll() { SafeReader sr = DataCommon.ExecuteSafeReader("[dbo].[TOCTemplates_GetAll]", new SqlParameter[] { }, "dbo"); List<TOCTemplatesDO> objs = new List<TOCTemplatesDO>(); while(sr.Read()){ TOCTemplatesDO obj = new TOCTemplatesDO(); obj.TOCTemplatesID = sr.GetInt32(sr.GetOrdinal("TOCTemplatesID")); obj.TOCID = sr.GetInt32(sr.GetOrdinal("TOCID")); obj.Template = sr.GetString(sr.GetOrdinal("Template")); objs.Add(obj); } return objs.ToArray(); }
/// <summary> /// Selects TOCTemplates records by PK /// </summary> public static TOCTemplatesDO[] GetByPK(Int32 TOCTemplatesID) { SqlParameter _TOCTemplatesID = new SqlParameter("TOCTemplatesID", SqlDbType.Int); _TOCTemplatesID.Value = TOCTemplatesID; SqlParameter[] _params = new SqlParameter[] { _TOCTemplatesID }; SafeReader sr = DataCommon.ExecuteSafeReader("[dbo].[TOCTemplates_GetByPK]", _params, "dbo"); List<TOCTemplatesDO> objs = new List<TOCTemplatesDO>(); while(sr.Read()) { TOCTemplatesDO obj = new TOCTemplatesDO(); obj.TOCTemplatesID = sr.GetInt32(sr.GetOrdinal("TOCTemplatesID")); obj.TOCID = sr.GetInt32(sr.GetOrdinal("TOCID")); obj.Template = sr.GetString(sr.GetOrdinal("Template")); objs.Add(obj); } return objs.ToArray(); }