internal Award Edit(AwardEditVM model) { var award = Mapper.Map <Award>(model); if (model.Image != null) { WebImage img = new WebImage(model.Image.InputStream); img.Resize(imageWidth, imageHeight); award.Image = new PictureData(); award.Image.Data = img.GetBytes(); award.Image.ContentType = "image/" + img.ImageFormat; } else// for web api { var image = new WebImage(@"D:\it2017_1\Task1\Epam.UsersAwards.MVC\Content\Images\award-default.png"); award.Image.ContentType = "image/" + image.ImageFormat; award.Image.Data = image.GetBytes(); } return(awardLogic.Update(award)); }
public static bool UpdateAward(Award award) { return(_awardLogic.Update(award)); }