/// <summary> /// Deletes a MineSiteAcreage record /// </summary> public static int Delete(MineSiteAcreageDO DO) { SqlParameter _PermitKey = new SqlParameter("PermitKey", SqlDbType.Int); SqlParameter _MineSiteCategoryID = new SqlParameter("MineSiteCategoryID", SqlDbType.VarChar); SqlParameter _MineSiteTopicID = new SqlParameter("MineSiteTopicID", SqlDbType.VarChar); _PermitKey.Value = DO.PermitKey; _MineSiteCategoryID.Value = DO.MineSiteCategoryID; _MineSiteTopicID.Value = DO.MineSiteTopicID; SqlParameter[] _params = new SqlParameter[] { _PermitKey, _MineSiteCategoryID, _MineSiteTopicID }; return DataCommon.ExecuteScalar("[dbo].[MineSiteAcreage_Delete]", _params, "dbo"); }
/// <summary> /// Creates a new MineSiteAcreage record /// </summary> public static void Create(MineSiteAcreageDO DO) { SqlParameter _PermitKey = new SqlParameter("PermitKey", SqlDbType.Int); SqlParameter _MineSiteCategoryID = new SqlParameter("MineSiteCategoryID", SqlDbType.VarChar); SqlParameter _MineSiteTopicID = new SqlParameter("MineSiteTopicID", SqlDbType.VarChar); SqlParameter _ProposedAmount = new SqlParameter("ProposedAmount", SqlDbType.Int); _PermitKey.Value = DO.PermitKey; _MineSiteCategoryID.Value = DO.MineSiteCategoryID; _MineSiteTopicID.Value = DO.MineSiteTopicID; _ProposedAmount.Value = DO.ProposedAmount; SqlParameter[] _params = new SqlParameter[] { _PermitKey, _MineSiteCategoryID, _MineSiteTopicID, _ProposedAmount }; DataCommon.ExecuteNonQuery("[dbo].[MineSiteAcreage_Insert]", _params, "dbo"); }
/// <summary> /// Gets all MineSiteAcreage records /// </summary> public static MineSiteAcreageDO[] GetAll() { SafeReader sr = DataCommon.ExecuteSafeReader("[dbo].[MineSiteAcreage_GetAll]", new SqlParameter[] { }, "dbo"); List<MineSiteAcreageDO> objs = new List<MineSiteAcreageDO>(); while(sr.Read()){ MineSiteAcreageDO obj = new MineSiteAcreageDO(); obj.PermitKey = sr.GetInt32(sr.GetOrdinal("PermitKey")); obj.MineSiteCategoryID = sr.GetString(sr.GetOrdinal("MineSiteCategoryID")); obj.MineSiteTopicID = sr.GetString(sr.GetOrdinal("MineSiteTopicID")); obj.ProposedAmount = sr.GetInt32(sr.GetOrdinal("ProposedAmount")); objs.Add(obj); } return objs.ToArray(); }
/// <summary> /// Selects MineSiteAcreage records by PK /// </summary> public static MineSiteAcreageDO[] GetByPK(Int32 PermitKey, String MineSiteCategoryID, String MineSiteTopicID) { SqlParameter _PermitKey = new SqlParameter("PermitKey", SqlDbType.Int); SqlParameter _MineSiteCategoryID = new SqlParameter("MineSiteCategoryID", SqlDbType.VarChar); SqlParameter _MineSiteTopicID = new SqlParameter("MineSiteTopicID", SqlDbType.VarChar); _PermitKey.Value = PermitKey; _MineSiteCategoryID.Value = MineSiteCategoryID; _MineSiteTopicID.Value = MineSiteTopicID; SqlParameter[] _params = new SqlParameter[] { _PermitKey, _MineSiteCategoryID, _MineSiteTopicID }; SafeReader sr = DataCommon.ExecuteSafeReader("[dbo].[MineSiteAcreage_GetByPK]", _params, "dbo"); List<MineSiteAcreageDO> objs = new List<MineSiteAcreageDO>(); while(sr.Read()) { MineSiteAcreageDO obj = new MineSiteAcreageDO(); obj.PermitKey = sr.GetInt32(sr.GetOrdinal("PermitKey")); obj.MineSiteCategoryID = sr.GetString(sr.GetOrdinal("MineSiteCategoryID")); obj.MineSiteTopicID = sr.GetString(sr.GetOrdinal("MineSiteTopicID")); obj.ProposedAmount = sr.GetInt32(sr.GetOrdinal("ProposedAmount")); objs.Add(obj); } return objs.ToArray(); }