public static DataTable GetListForPageOfProducts( Guid storeGuid, int pageNumber, int pageSize) { return(DBOffer.GetListForPageOfProducts(storeGuid, pageNumber, pageSize)); }
public static bool Delete( Guid guid, Guid deletedBy, string deletedFromIP) { Offer offer = new Offer(guid); DBOffer.AddOfferHistory( Guid.NewGuid(), offer.Guid, offer.StoreGuid, offer.IsVisible, offer.IsSpecial, offer.Created, offer.CreatedBy, offer.CreatedFromIP, offer.IsDeleted, offer.DeletedTime, offer.DeletedBy, offer.DeletedFromIP, offer.LastModified, offer.LastModifiedBy, offer.LastModifiedFromIP, DateTime.UtcNow, offer.TaxClassGuid, offer.Url); return(DBOffer.Delete( guid, DateTime.UtcNow, deletedBy, deletedFromIP)); }
private void GetOffer(Guid guid) { using (IDataReader reader = DBOffer.GetOne(guid)) { if (reader.Read()) { this.guid = new Guid(reader["Guid"].ToString()); this.storeGuid = new Guid(reader["StoreGuid"].ToString()); this.isVisible = Convert.ToBoolean(reader["IsVisible"]); this.isSpecial = Convert.ToBoolean(reader["IsSpecial"]); this.created = Convert.ToDateTime(reader["Created"]); this.createdBy = new Guid(reader["CreatedBy"].ToString()); this.url = reader["Url"].ToString(); this.createdFromIP = reader["CreatedFromIP"].ToString(); this.isDeleted = Convert.ToBoolean(reader["IsDeleted"]); if (reader["DeletedTime"] != DBNull.Value) { this.deletedTime = Convert.ToDateTime(reader["DeletedTime"]); } if (reader["DeletedBy"] != DBNull.Value) { this.deletedBy = new Guid(reader["DeletedBy"].ToString()); } this.deletedFromIP = reader["DeletedFromIP"].ToString(); this.lastModified = Convert.ToDateTime(reader["LastModified"]); this.lastModifiedBy = new Guid(reader["LastModifiedBy"].ToString()); this.lastModifiedFromIP = reader["LastModifiedFromIP"].ToString(); this.name = reader["Name"].ToString(); this.description = reader["Description"].ToString(); this.teaser = reader["Abstract"].ToString(); if (reader["TaxClassGuid"] != DBNull.Value) { this.taxClassGuid = new Guid(reader["TaxClassGuid"].ToString()); } this.isDonation = Convert.ToBoolean(reader["IsDonation"]); if (reader["Price"] != DBNull.Value) { this.price = Convert.ToDecimal(reader["Price"].ToString()); } this.showDetailLink = Convert.ToBoolean(reader["ShowDetailLink"]); this.productListName = reader["ProductListName"].ToString(); this.userCanSetPrice = Convert.ToBoolean(reader["UserCanSetPrice"]); this.maxPerOrder = Convert.ToInt32(reader["MaxPerOrder"]); this.sortRank1 = Convert.ToInt32(reader["SortRank1"]); this.sortRank2 = Convert.ToInt32(reader["SortRank2"]); this.metaDescription = reader["MetaDescription"].ToString(); this.metaKeywords = reader["MetaKeywords"].ToString(); this.compiledMeta = reader["CompiledMeta"].ToString(); } } }
private bool Update() { Offer offer = new Offer(this.guid); DBOffer.AddOfferHistory( Guid.NewGuid(), offer.Guid, offer.StoreGuid, offer.IsVisible, offer.IsSpecial, offer.Created, offer.CreatedBy, offer.CreatedFromIP, offer.IsDeleted, offer.DeletedTime, offer.DeletedBy, offer.DeletedFromIP, offer.LastModified, offer.LastModifiedBy, offer.LastModifiedFromIP, DateTime.UtcNow, offer.TaxClassGuid, offer.Url); bool result = DBOffer.Update( this.guid, this.isVisible, this.isSpecial, this.taxClassGuid, this.url, this.lastModified, this.lastModifiedBy, this.lastModifiedFromIP, this.isDonation, this.name, this.description, this.teaser, this.price, this.productListName, this.showDetailLink, this.userCanSetPrice, this.maxPerOrder, this.sortRank1, this.sortRank2, this.metaDescription, this.metaKeywords, this.compiledMeta); if (result) { ContentChangedEventArgs e = new ContentChangedEventArgs(); OnContentChanged(e); } return(result); }
/// <summary> /// Gets a page of data from the ws_Offer table. /// </summary> /// <param name="pageNumber">The page number.</param> /// <param name="pageSize">Size of the page.</param> /// <param name="totalPages">total pages</param> public static IDataReader GetPageForProductList( Guid storeGuid, int pageNumber, int pageSize, out int totalPages) { return(DBOffer.GetPageForProductList( storeGuid, pageNumber, pageSize, out totalPages)); }
public static DataTable GetPublicPage( Guid storeGuid, int pageNumber, int pageSize, out int totalPages) { return(DBOffer.GetPublicPage( storeGuid, pageNumber, pageSize, out totalPages)); }
//public static DataTable GetPage( // Guid storeGuid, // Guid languageGuid, // int pageNumber, // int pageSize) //{ // DataTable dataTable = new DataTable(); // dataTable.Columns.Add("Guid",typeof(Guid)); // dataTable.Columns.Add("StoreGuid",typeof(Guid)); // dataTable.Columns.Add("Name", typeof(string)); // dataTable.Columns.Add("IsVisible",typeof(bool)); // dataTable.Columns.Add("IsSpecial",typeof(bool)); // dataTable.Columns.Add("Created",typeof(DateTime)); // dataTable.Columns.Add("CreatedBy",typeof(Guid)); // dataTable.Columns.Add("CreatedFromIP",typeof(string)); // dataTable.Columns.Add("LastModified",typeof(DateTime)); // dataTable.Columns.Add("LastModifiedBy",typeof(Guid)); // dataTable.Columns.Add("LastModifiedFromIP",typeof(string)); // dataTable.Columns.Add("TotalPages", typeof(int)); // IDataReader reader = DBOffer.GetPage( // storeGuid, // languageGuid, // pageNumber, // pageSize); // while (reader.Read()) // { // DataRow row = dataTable.NewRow(); // row["Guid"] = reader["Guid"]; // row["StoreGuid"] = reader["StoreGuid"]; // row["Name"] = reader["Name"]; // row["IsVisible"] = reader["IsVisible"]; // row["IsSpecial"] = reader["IsSpecial"]; // row["Created"] = reader["Created"]; // row["CreatedBy"] = reader["CreatedBy"]; // row["CreatedFromIP"] = reader["CreatedFromIP"]; // row["LastModified"] = reader["LastModified"]; // row["LastModifiedBy"] = reader["LastModifiedBy"]; // row["LastModifiedFromIP"] = reader["LastModifiedFromIP"]; // row["TotalPages"] = Convert.ToInt32(reader["TotalPages"]); // dataTable.Rows.Add(row); // } // reader.Close(); // return dataTable; //} public static DataTable GetBySitePage(int siteId, int pageId) { DataTable dataTable = new DataTable(); dataTable.Columns.Add("ModuleID", typeof(int)); dataTable.Columns.Add("ModuleTitle", typeof(string)); dataTable.Columns.Add("Guid", typeof(Guid)); dataTable.Columns.Add("Url", typeof(string)); dataTable.Columns.Add("Name", typeof(string)); dataTable.Columns.Add("Abstract", typeof(string)); dataTable.Columns.Add("Description", typeof(string)); dataTable.Columns.Add("MetaDescription", typeof(string)); dataTable.Columns.Add("MetaKeywords", typeof(string)); dataTable.Columns.Add("ViewRoles", typeof(string)); dataTable.Columns.Add("Created", typeof(DateTime)); dataTable.Columns.Add("LastModified", typeof(DateTime)); using (IDataReader reader = DBOffer.GetByPage(siteId, pageId)) { while (reader.Read()) { DataRow row = dataTable.NewRow(); row["ModuleID"] = reader["ModuleID"]; row["ModuleTitle"] = reader["ModuleTitle"]; row["Guid"] = new Guid(reader["Guid"].ToString()); row["Url"] = reader["Url"]; row["Name"] = reader["Name"]; row["Abstract"] = reader["Abstract"]; row["Description"] = reader["Description"]; row["MetaDescription"] = reader["MetaDescription"]; row["MetaKeywords"] = reader["MetaKeywords"]; row["ViewRoles"] = reader["ViewRoles"]; row["Created"] = Convert.ToDateTime(reader["Created"]); row["LastModified"] = Convert.ToDateTime(reader["LastModified"]); dataTable.Rows.Add(row); } } return(dataTable); }
private bool Create() { Guid newID = Guid.NewGuid(); this.guid = newID; int rowsAffected = DBOffer.Create( this.guid, this.storeGuid, this.isVisible, this.isSpecial, this.taxClassGuid, this.url, this.created, this.createdBy, this.createdFromIP, this.lastModified, this.lastModifiedBy, this.lastModifiedFromIP, this.isDonation, this.name, this.description, this.teaser, this.price, this.productListName, this.showDetailLink, this.userCanSetPrice, this.maxPerOrder, this.sortRank1, this.sortRank2, this.metaDescription, this.metaKeywords, this.compiledMeta); bool result = (rowsAffected > 0); if (result) { ContentChangedEventArgs e = new ContentChangedEventArgs(); OnContentChanged(e); } return(result); }
public static IDataReader GetTop10Specials(Guid storeGuid) { return(DBOffer.GetTop10Specials(storeGuid)); }
public static DataTable GetByProduct(Guid productGuid) { return(DBOffer.GetByProduct(productGuid)); }
public void DeleteOffer(int id) { DBOffer.DeleteOffer(id); }
public List <Offer> RetrieveAllJob(int id) { List <Offer> m_Offers = DBOffer.RetrieveAllJob(id); return(m_Offers); }
public Offer RetrieveOne(int id) { Offer m_Offer = DBOffer.RetrieveOne(id); return(m_Offer); }
public void EditOffer(Offer m_Offer) { DBOffer.EditOffer(m_Offer); }
public void AddOffer(Offer m_Offer) { DBOffer.AddOffer(m_Offer); }