public JsonResult DeleteFile(int idFile) { var client = new SedesolService.SedesolServiceClient(); string data = client.DeleteCaptureImage(idFile); CaptureModel captureModel = (CaptureModel)Session["CaptureModel"]; List <CaptureImageDTO> listImage = new List <CaptureImageDTO>(); listImage = client.GetImageByCaptureId(captureModel.Capture.Id); foreach (CaptureImageDTO item in listImage) { item.ImageFileB64 = "data:image/jpeg; base64," + Convert.ToBase64String(item.ImageFile); } Session["CountImg"] = null; Session.Add("CountImg", listImage.Count()); client.Close(); string viewContent = ConvertViewToString("ImageList", listImage); var sjonResult = Json(new { message = data, PartialView = viewContent }); sjonResult.MaxJsonLength = int.MaxValue; return(sjonResult); }
public PartialViewResult Pictures(int hq) { var client = new SedesolService.SedesolServiceClient(); List <CaptureImageDTO> pictures = new List <CaptureImageDTO>(); pictures = client.GetImageByCaptureId(hq); foreach (CaptureImageDTO item in pictures) { item.ImageFileB64 = Convert.ToBase64String(item.ImageFile); } return(PartialView(pictures)); }