/// <summary> /// Creates a new ReviewChecklist record /// </summary> public static int Create(ReviewChecklistDO DO) { SqlParameter _ChecklistTypeID = new SqlParameter("ChecklistTypeID", SqlDbType.VarChar); SqlParameter _PermitKey = new SqlParameter("PermitKey", SqlDbType.Int); SqlParameter _Section = new SqlParameter("Section", SqlDbType.VarChar); SqlParameter _SubSection = new SqlParameter("SubSection", SqlDbType.VarChar); SqlParameter _Description = new SqlParameter("Description", SqlDbType.VarChar); SqlParameter _User = new SqlParameter("User", SqlDbType.VarChar); _ChecklistTypeID.Value = DO.ChecklistTypeID; _PermitKey.Value = DO.PermitKey; _Section.Value = DO.Section; _SubSection.Value = DO.SubSection; _Description.Value = DO.Description; _User.Value = DO.User; SqlParameter[] _params = new SqlParameter[] { _ChecklistTypeID, _PermitKey, _Section, _SubSection, _Description, _User }; return DataCommon.ExecuteScalar("[dbo].[ReviewChecklist_Insert]", _params, "dbo"); }
/// <summary> /// Deletes a ReviewChecklist record /// </summary> public static int Delete(ReviewChecklistDO DO) { SqlParameter _ReviewChecklistID = new SqlParameter("ReviewChecklistID", SqlDbType.Int); _ReviewChecklistID.Value = DO.ReviewChecklistID; SqlParameter[] _params = new SqlParameter[] { _ReviewChecklistID }; return DataCommon.ExecuteScalar("[dbo].[ReviewChecklist_Delete]", _params, "dbo"); }
/// <summary> /// Gets all ReviewChecklist records /// </summary> public static ReviewChecklistDO[] GetAll() { SafeReader sr = DataCommon.ExecuteSafeReader("[dbo].[ReviewChecklist_GetAll]", new SqlParameter[] { }, "dbo"); List<ReviewChecklistDO> objs = new List<ReviewChecklistDO>(); while(sr.Read()){ ReviewChecklistDO obj = new ReviewChecklistDO(); obj.ReviewChecklistID = sr.GetInt32(sr.GetOrdinal("ReviewChecklistID")); obj.ChecklistTypeID = sr.GetString(sr.GetOrdinal("ChecklistTypeID")); obj.PermitKey = sr.GetInt32(sr.GetOrdinal("PermitKey")); obj.Section = sr.GetString(sr.GetOrdinal("Section")); obj.SubSection = sr.GetString(sr.GetOrdinal("SubSection")); obj.User = sr.GetString(sr.GetOrdinal("User")); if (sr.IsDBNull(sr.GetOrdinal("Description"))) { obj.Description = null; } else { obj.Description = sr.GetString(sr.GetOrdinal("Description")); } objs.Add(obj); } return objs.ToArray(); }