private void GetPaymentMethod(int paymentMethodId) { using (IDataReader reader = DBPaymentMethod.GetOne(paymentMethodId)) { if (reader.Read()) { this.paymentMethodID = Convert.ToInt32(reader["PaymentMethodID"]); this.siteID = Convert.ToInt32(reader["SiteID"]); this.paymentProvider = Convert.ToInt32(reader["PaymentProvider"]); this.name = reader["Name"].ToString(); this.description = reader["Description"].ToString(); this.displayOrder = Convert.ToInt32(reader["DisplayOrder"]); this.isActive = Convert.ToBoolean(reader["IsActive"]); this.additionalFee = Convert.ToDecimal(reader["AdditionalFee"]); this.usePercentage = Convert.ToBoolean(reader["UsePercentage"]); this.freeOnOrdersOverXEnabled = Convert.ToBoolean(reader["FreeOnOrdersOverXEnabled"]); this.freeOnOrdersOverXValue = Convert.ToDecimal(reader["FreeOnOrdersOverXValue"]); this.useSandbox = Convert.ToBoolean(reader["UseSandbox"]); this.businessEmail = reader["BusinessEmail"].ToString(); this.securePass = reader["SecurePass"].ToString(); this.hashcode = reader["Hashcode"].ToString(); this.merchantId = reader["MerchantId"].ToString(); this.merchantSiteCode = reader["MerchantSiteCode"].ToString(); this.accessCode = reader["AccessCode"].ToString(); this.guid = new Guid(reader["Guid"].ToString()); this.isDeleted = Convert.ToBoolean(reader["IsDeleted"]); } } }
/// <summary> /// Persists a new instance of PaymentMethod. Returns true on success. /// </summary> /// <returns></returns> private bool Create() { int newID = 0; this.guid = Guid.NewGuid(); newID = DBPaymentMethod.Create( this.siteID, this.paymentProvider, this.name, this.description, this.displayOrder, this.isActive, this.additionalFee, this.usePercentage, this.freeOnOrdersOverXEnabled, this.freeOnOrdersOverXValue, this.useSandbox, this.businessEmail, this.securePass, this.hashcode, this.merchantId, this.merchantSiteCode, this.accessCode, this.guid, this.isDeleted); this.paymentMethodID = newID; return(newID > 0); }
/// <summary> /// Gets a payment method /// </summary> /// <param name="PaymentMethodID">Payment method identifier</param> /// <returns>Payment method</returns> public static PaymentMethod GetPaymentMethodByID(int PaymentMethodID) { if (PaymentMethodID == 0) { return(null); } string key = string.Format(PAYMENTMETHODS_BY_ID_KEY, PaymentMethodID); object obj2 = NopCache.Get(key); if (PaymentMethodManager.CacheEnabled && (obj2 != null)) { return((PaymentMethod)obj2); } DBPaymentMethod dbItem = DBProviderManager <DBPaymentMethodProvider> .Provider.GetPaymentMethodByID(PaymentMethodID); PaymentMethod paymentMethod = DBMapping(dbItem); if (PaymentMethodManager.CacheEnabled) { NopCache.Max(key, paymentMethod); } return(paymentMethod); }
/// <summary> /// Gets a payment method /// </summary> /// <param name="SystemKeyword">Payment method system keyword</param> /// <returns>Payment method</returns> public static PaymentMethod GetPaymentMethodBySystemKeyword(string SystemKeyword) { DBPaymentMethod dbItem = DBProviderManager <DBPaymentMethodProvider> .Provider.GetPaymentMethodBySystemKeyword(SystemKeyword); PaymentMethod paymentMethod = DBMapping(dbItem); return(paymentMethod); }
private DBPaymentMethod GetPaymentMethodFromReader(IDataReader dataReader) { DBPaymentMethod paymentMethod = new DBPaymentMethod(); paymentMethod.PaymentMethodID = NopSqlDataHelper.GetInt(dataReader, "PaymentMethodID"); paymentMethod.Name = NopSqlDataHelper.GetString(dataReader, "Name"); paymentMethod.VisibleName = NopSqlDataHelper.GetString(dataReader, "VisibleName"); paymentMethod.Description = NopSqlDataHelper.GetString(dataReader, "Description"); paymentMethod.ConfigureTemplatePath = NopSqlDataHelper.GetString(dataReader, "ConfigureTemplatePath"); paymentMethod.UserTemplatePath = NopSqlDataHelper.GetString(dataReader, "UserTemplatePath"); paymentMethod.ClassName = NopSqlDataHelper.GetString(dataReader, "ClassName"); paymentMethod.SystemKeyword = NopSqlDataHelper.GetString(dataReader, "SystemKeyword"); paymentMethod.IsActive = NopSqlDataHelper.GetBoolean(dataReader, "IsActive"); paymentMethod.DisplayOrder = NopSqlDataHelper.GetInt(dataReader, "DisplayOrder"); return paymentMethod; }
/// <summary> /// Updates the payment method /// </summary> /// <param name="PaymentMethodID">The payment method identifer</param> /// <param name="Name">The name</param> /// <param name="VisibleName">The visible name</param> /// <param name="Description">The description</param> /// <param name="ConfigureTemplatePath">The configure template path</param> /// <param name="UserTemplatePath">The user template path</param> /// <param name="ClassName">The class name</param> /// <param name="SystemKeyword">The system keyword</param> /// <param name="IsActive">A value indicating whether the payment method is active</param> /// <param name="DisplayOrder">The display order</param> /// <returns>Payment method</returns> public static PaymentMethod UpdatePaymentMethod(int PaymentMethodID, string Name, string VisibleName, string Description, string ConfigureTemplatePath, string UserTemplatePath, string ClassName, string SystemKeyword, bool IsActive, int DisplayOrder) { DBPaymentMethod dbItem = DBProviderManager <DBPaymentMethodProvider> .Provider.UpdatePaymentMethod(PaymentMethodID, Name, VisibleName, Description, ConfigureTemplatePath, UserTemplatePath, ClassName, SystemKeyword, IsActive, DisplayOrder); PaymentMethod paymentMethod = DBMapping(dbItem); if (PaymentMethodManager.CacheEnabled) { NopCache.RemoveByPattern(PAYMENTMETHODS_PATTERN_KEY); } return(paymentMethod); }
private static PaymentMethod DBMapping(DBPaymentMethod dbItem) { if (dbItem == null) return null; PaymentMethod item = new PaymentMethod(); item.PaymentMethodID = dbItem.PaymentMethodID; item.Name = dbItem.Name; item.VisibleName = dbItem.VisibleName; item.Description = dbItem.Description; item.ConfigureTemplatePath = dbItem.ConfigureTemplatePath; item.UserTemplatePath = dbItem.UserTemplatePath; item.ClassName = dbItem.ClassName; item.SystemKeyword = dbItem.SystemKeyword; item.IsActive = dbItem.IsActive; item.DisplayOrder = dbItem.DisplayOrder; return item; }
private static PaymentMethod DBMapping(DBPaymentMethod dbItem) { if (dbItem == null) { return(null); } var item = new PaymentMethod(); item.PaymentMethodId = dbItem.PaymentMethodId; item.Name = dbItem.Name; item.VisibleName = dbItem.VisibleName; item.Description = dbItem.Description; item.ConfigureTemplatePath = dbItem.ConfigureTemplatePath; item.UserTemplatePath = dbItem.UserTemplatePath; item.ClassName = dbItem.ClassName; item.SystemKeyword = dbItem.SystemKeyword; item.IsActive = dbItem.IsActive; item.DisplayOrder = dbItem.DisplayOrder; return(item); }
/// <summary> /// Updates this instance of PaymentMethod. Returns true on success. /// </summary> /// <returns>bool</returns> private bool Update() { return(DBPaymentMethod.Update( this.paymentMethodID, this.siteID, this.paymentProvider, this.name, this.description, this.displayOrder, this.isActive, this.additionalFee, this.usePercentage, this.freeOnOrdersOverXEnabled, this.freeOnOrdersOverXValue, this.useSandbox, this.businessEmail, this.securePass, this.hashcode, this.merchantId, this.merchantSiteCode, this.accessCode, this.guid, this.isDeleted)); }
public static List <PaymentMethod> GetByActive(int siteId, int activeStatus, int languageId) { IDataReader reader = DBPaymentMethod.GetByActive(siteId, activeStatus, languageId); return(LoadListFromReader(reader)); }
public static bool Delete(int paymentMethodID) { return(DBPaymentMethod.Delete(paymentMethodID)); }