// ---------------------------------------------- // Helper Functions Folowing // \/ private bool SessionAndThisSupplementAreSame(ISupplementFiltersProperties sessoinSupplementFilters, ISupplementFilters thisSupplementFilters) { if (sessoinSupplementFilters.CategoryEnabled != thisSupplementFilters.CategoryEnabled) { return(false); } if (sessoinSupplementFilters.TopicEnabled != thisSupplementFilters.TopicEnabled) { return(false); } if (sessoinSupplementFilters.BrandEnabled != thisSupplementFilters.BrandEnabled) { return(false); } if (!sessoinSupplementFilters.CategoryName.Equals(thisSupplementFilters.CategoryName)) { return(false); } if (!sessoinSupplementFilters.TopicName.Equals(thisSupplementFilters.TopicName)) { return(false); } if (!sessoinSupplementFilters.BrandName.Equals(thisSupplementFilters.BrandName)) { return(false); } return(true); }
protected void SupplementFiltersPropertiesTransferToThisElement(ISupplementFiltersProperties fromSessionElement) { this.SupplementFilters.BrandEnabled = fromSessionElement.BrandEnabled; this.SupplementFilters.BrandName = fromSessionElement.BrandName; this.SupplementFilters.CategoryEnabled = fromSessionElement.CategoryEnabled; this.SupplementFilters.CategoryName = fromSessionElement.CategoryName; this.SupplementFilters.TopicEnabled = fromSessionElement.TopicEnabled; this.SupplementFilters.TopicName = fromSessionElement.TopicName; }
private void SetSessionItemsFromThis() { if (this.SupplementFilters == null) { string errorMessage = string.Format("SupplementFilters item is null and can not be edited further."); throw new ArgumentException(errorMessage); } ISupplementFiltersProperties sessionSupplementFilters = this.SupplementFiltersPropertiesTransferToSessionElement(this.SupplementFilters); Session["SupplementFilters"] = sessionSupplementFilters; }
private void GetSessionItemToThis() { ISupplementFiltersProperties sessionSupplementFilters = (SessionSupplementFilters)this.Session["SupplementFilters"]; if (sessionSupplementFilters == null) { string errorMessage = string.Format("Session item Supplement is null and can not be edited further."); throw new ArgumentException(errorMessage); } this.SupplementFiltersPropertiesTransferToThisElement(sessionSupplementFilters); }