/// <summary> /// Gets the localised version of a URL /// </summary> /// <param name="url">URL</param> /// <returns>Localised version</returns> public static string GetLocalisedUrl(string url) { // Get the two-digit culture code string code = CurrentUICulture.Name; // Join them together string result = PathUtility.CombineUrls(new string[2] { url, code }); return(result); }
private SalesViewModel(ETC.Product product) { this.id = product.ID; this.name = product.Name; this.description = product.Description; this.price = product.Price; this.imageName = product.ImageName; this.imageSrc = PathUtility.CombineUrls(Config.StorageUrlProduct, product.ID.ToString(), product.ImageName); this.category = product.ExecuteCreateCategoryByCategoryID().Name; this.categoryID = product.CategoryID; this.status = (product.Status == ETC.Product.STATUS_ACTIVE) ? true : false; this.sellings = CountSells(product); }
/// <summary> /// Get Image Url of the instance /// </summary> /// <returns></returns> public string GetImageSrc() { string result = Constants.DEFAULT_IMAGE_URL; if (this.entity != null) { result = PathUtility.CombineUrls(this.FolderUrl, this.imageName); } else if (this.image != null) { result = PathUtility.CombineUrls(this.TempFolderUrl, this.imageName); } return(result); }
public ShopViewModel(ETC.Product product) { if (product != null) { this.id = product.ID; this.name = product.Name; this.description = product.Description; this.price = product.Price; this.imageSrc = PathUtility.CombineUrls(Config.StorageUrlProduct, product.ID.ToString(), product.ImageName); this.category = product.ExecuteCreateCategoryByCategoryID().Name; this.categoryID = product.CategoryID; this.status = (product.Status == ETC.Product.STATUS_ACTIVE) ? true : false; this.quantity = 1; } }