protected bool InsertImage(IBasicWithImageModel Entity, string ImageUploadName, string ModelName) { try { var image = WebImage.GetImageFromRequest(ImageUploadName); if (image != null) Entity.MainImage = Server.MapPath(string.Format("/Images/{0}/", ModelName)).SaveImage(image); } catch (Exception) { return false; } return true; }
protected bool InsertImage(IBasicWithImageModel Entity, string ImageUploadName, string ModelName) { try { var image = WebImage.GetImageFromRequest(ImageUploadName); if (image != null) { Entity.MainImage = Server.MapPath(string.Format("/Images/{0}/", ModelName)).SaveImage(image); } } catch (Exception) { return(false); } return(true); }