private bool Update() { OfferPrice offerPrice = new OfferPrice(this.guid); DBOfferPrice.AddHistory( Guid.NewGuid(), offerPrice.Guid, offerPrice.OfferGuid, offerPrice.CurrencyGuid, offerPrice.Price, offerPrice.Created, offerPrice.CreatedBy, offerPrice.CreatedFromIP, offerPrice.LastModifed, offerPrice.LastModifiedBy, offerPrice.ModifiedFromIP, DateTime.UtcNow); return(DBOfferPrice.Update( this.guid, this.currencyGuid, this.price, this.lastModifed, this.lastModifiedBy, this.modifiedFromIP)); }
public static bool Delete(Guid guid) { OfferPrice offerPrice = new OfferPrice(guid); DBOfferPrice.AddHistory( Guid.NewGuid(), offerPrice.Guid, offerPrice.OfferGuid, offerPrice.CurrencyGuid, offerPrice.Price, offerPrice.Created, offerPrice.CreatedBy, offerPrice.CreatedFromIP, offerPrice.LastModifed, offerPrice.LastModifiedBy, offerPrice.ModifiedFromIP, DateTime.UtcNow); return(DBOfferPrice.Delete(guid)); }
private bool Create() { Guid newID = Guid.NewGuid(); this.guid = newID; int rowsAffected = DBOfferPrice.Add( this.guid, this.offerGuid, this.currencyGuid, this.price, this.created, this.createdBy, this.createdFromIP, this.lastModifed, this.lastModifiedBy, this.modifiedFromIP); return(rowsAffected > 0); }
private void GetOfferPrice(Guid guid) { IDataReader reader = DBOfferPrice.Get(guid); if (reader.Read()) { this.guid = new Guid(reader["Guid"].ToString()); this.offerGuid = new Guid(reader["OfferGuid"].ToString()); this.currencyGuid = new Guid(reader["CurrencyGuid"].ToString()); this.price = Convert.ToDecimal(reader["Price"]); this.created = Convert.ToDateTime(reader["Created"]); this.createdBy = new Guid(reader["CreatedBy"].ToString()); this.createdFromIP = reader["CreatedFromIP"].ToString(); this.lastModifed = Convert.ToDateTime(reader["LastModifed"]); this.lastModifiedBy = new Guid(reader["LastModifiedBy"].ToString()); this.modifiedFromIP = reader["ModifiedFromIP"].ToString(); } reader.Close(); }
public static DataTable GetByOffer(Guid offerGuid) { DataTable dataTable = new DataTable(); dataTable.Columns.Add("Guid", typeof(Guid)); dataTable.Columns.Add("OfferGuid", typeof(Guid)); dataTable.Columns.Add("CurrencyGuid", typeof(Guid)); dataTable.Columns.Add("Price", typeof(decimal)); dataTable.Columns.Add("Currency", typeof(string)); dataTable.Columns.Add("CurrencyCode", typeof(string)); dataTable.Columns.Add("SymbolLeft", typeof(string)); dataTable.Columns.Add("SymbolRight", typeof(string)); IDataReader reader = DBOfferPrice.GetByOffer(offerGuid); while (reader.Read()) { DataRow row = dataTable.NewRow(); row["Guid"] = reader["Guid"]; row["OfferGuid"] = reader["OfferGuid"]; row["CurrencyGuid"] = reader["CurrencyGuid"]; row["Price"] = reader["Price"]; row["Currency"] = reader["Currency"]; row["CurrencyCode"] = reader["CurrencyCode"]; row["SymbolLeft"] = reader["SymbolLeft"]; row["SymbolRight"] = reader["SymbolRight"]; dataTable.Rows.Add(row); } reader.Close(); return(dataTable); }