async Task ExecuteCompleteOrderCommand() { OrderCompleteIsEnabled = false; PhotoManagerService ms = new PhotoManagerService(); string[] photoPaths = ms.GetPhotoList(SelectedField.FieldGuid); Guid orderGuid = Guid.NewGuid(); OrderModel orderModel = new OrderModel { Orde_LabelStickerName = "abc", Orde_FieldGuid = this.SelectedField.FieldGuid, Orde_UniqueId = orderGuid.ToString(), Orde_StatusId = 1, Orde_CreationDate = DateTime.Now.ToString(), Orde_RowHash = 0, Orde_UpdateDate = string.Empty }; await App.OrderTable.SaveOrder(orderModel); foreach (ThumbNail item in listofImgs) { string orginalImageName = item.OriginalImageName; string cropID = item.CropId; Guid orderCropId = Guid.NewGuid(); OrderDetailModel detail = new OrderDetailModel { Ocad_CropID = Convert.ToInt32(cropID), Ocad_CropPhotoName = item.OriginalImageName, Ocad_OrderGuid = orderGuid.ToString(), Ocad_CropUniqueId = orderCropId.ToString() }; await App.OrderDetailTable.SaveOrderDetail(detail); } foreach (string photo in photoPaths) { ms.SetImageExif(photo, orderGuid.ToString()); } await Navigation.PopAsync(); }
/// <summary> /// Stream back the image to the requestor. /// </summary> /// <param name="context"></param> public void ProcessRequest(HttpContext context) { RequestContext routeContext = (RequestContext)HttpContext.Current.Items["routeContext"]; String imageId = routeContext.RouteData.Values["photoid"].ToString(); using (Stream image = PhotoManagerService.GetImage(imageId)) { Byte[] buffer = new byte[8192]; Int32 readCount; while ((readCount = image.Read(buffer, 0, buffer.Length)) > 0) { context.Response.OutputStream.Write(buffer, 0, readCount); } context.Response.OutputStream.Flush(); } }
public void LoadImages() { PhotoManagerService ms = new PhotoManagerService(); List <ThumbNail> images = new List <ThumbNail>(); List <FileMetaInformation> thumbnails = ms.GetThumbNailPhotos(SelectedField.FieldGuid); foreach (FileMetaInformation item in thumbnails) { ImageSource img; img = ImageSource.FromStream(() => new MemoryStream(item.orjinalImage)); string[] parts = item.leanFileName.Split('_'); images.Add(new ThumbNail { Name = parts[1], OriginalImageName = item.leanFileName, ImgSource = img, CropId = parts[3] }); } listofImgs = new ObservableCollection <ThumbNail>(images); }