public JsonResult SetImageStamp(AnnoImageStamp stamp) { var client = SvcBldr.StampsV2(); if (stamp.Id == Guid.Empty) { return(Result(null, ExceptionsML.GetExceptionML(new InvalidOperationException("Set Image Stamp not supported. Use UploadImageStamp")))); } var r = client.UpdateImageStamp(stamp); return(Result(stamp, r.Error)); }
public System.Web.Mvc.ActionResult UploadImageStamp(FormCollection form) { try { ExceptionsML bizEx = null; if (Context.Request.Files != null && Context.Request.Files.Count > 0) { HttpPostedFileBase file = Context.Request.Files[0]; var stamp = new AnnoImageStamp(); stamp.Image = new Byte[file.ContentLength]; file.InputStream.Read(stamp.Image, 0, file.ContentLength); stamp.Name = form["Name"]; Guid id = Guid.Empty; if (Guid.TryParse(form["Id"], out id)) { stamp.Id = id; } int seq = 0; if (int.TryParse(form["Sequence"], out seq)) { stamp.Sequence = seq; } if (form["Admin"] != "true") { stamp.Owner = AstriaCookie.GetUserId(); } var client = SvcBldr.StampsV2(); var result = client.CreateImageStamp(stamp); bizEx = result.Error; } return(View("ImageStampFrame", bizEx)); } catch (Exception ex) { return(View("ImageStampFrame", ExceptionsML.GetExceptionML(ex))); } }