예제 #1
0
        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;
        }
예제 #2
0
        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);
        }