/// <summary>
        /// Updates the loading photo table.
        /// </summary>
        /// <param name="imagePath">The image path.</param>
        /// <param name="newLoading">The new loading.</param>
        private async Task UpdateLoadingPhotoTable(string imagePath, NewLoadingModel newLoading)
        {
            ItemPhotoModel photoModel = new ItemPhotoModel();

            //tring imageBase64 = DependencyService.Get<IFileMgr>().GetBase64ImageString(imagePath);

            photoModel.Barecode  = newLoading.FileItemModel.Barecode;
            photoModel.Comments  = newLoading.FileItemModel.Comments_loading;
            photoModel.Photo     = newLoading.FileItemModel.PhotoPath;
            photoModel.OSDS      = Constants.Loading;
            photoModel.Telephone = newLoading.FileItemModel.Telephone_loading;

            await _dbAccess.InsertLoadingPhoto(photoModel);
        }
예제 #2
0
        /// <summary>
        /// Posts the loading photo.
        /// </summary>
        /// <returns></returns>
        private async Task PostLoadingPhoto()
        {
            List <FileItemModel> photoListLoadingDetails;

            photoListLoadingDetails = _db.GetLoadingPhotoListDetail();
            List <ItemPhotoModel> ListForOneBarcode;

            ProgressValue = _progressStart;

            if (photoListLoadingDetails.Count > 0)
            {
                for (int i = 0; i < photoListLoadingDetails.Count; i++)
                {
                    ListForOneBarcode = new List <ItemPhotoModel>();
                    if (!string.IsNullOrEmpty(photoListLoadingDetails[i].PhotoPath))
                    {
                        string[] photoPathListForEachBarcode = photoListLoadingDetails[i].PhotoPath.Split(',');

                        for (int j = 0; j < photoPathListForEachBarcode.Length; j++)
                        {
                            string image64 = DependencyService.Get <IFileMgr>().GetBase64ImageString(photoPathListForEachBarcode[j]);

                            ItemPhotoModel photoModel = new ItemPhotoModel()
                            {
                                Barecode  = photoListLoadingDetails[i].Barecode,
                                Telephone = _fileInfo.Mobile_Number,
                                Comments  = photoListLoadingDetails[i].Comments_loading,
                                OSDS      = Constants.Loading,
                                Photo     = image64
                            };
                            ListForOneBarcode.Add(photoModel);
                        }
                        await _newLoadingService.PackingCygestPostItemsPhotos(ListForOneBarcode);
                    }
                }
            }
            else
            {
                System.Diagnostics.Debug.WriteLine(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> No Photo To send");
            }
            ProgressValue = _progressSentPhoto;
            //LoadingText = LoadingTextWait;
            LoadingIndicator = true;
        }
예제 #3
0
        private async Task PostPhoto()
        {
            var photoListDetails = _db.GetPhotoListDetail();
            List <ItemPhotoModel> listForOneBarcode;

            if (photoListDetails.Count > 0)
            {
                for (int i = 0; i < photoListDetails.Count; i++)
                {
                    listForOneBarcode = new List <ItemPhotoModel>();
                    if (!string.IsNullOrEmpty(photoListDetails[i].PhotoPath))
                    {
                        string[] photoPathListForEachBarcode = photoListDetails[i].PhotoPath.Split(',');

                        for (int j = 0; j < photoPathListForEachBarcode.Length; j++)
                        {
                            string image64 = DependencyService.Get <IFileMgr>().GetBase64ImageString(photoPathListForEachBarcode[j]);

                            ItemPhotoModel photoModel = new ItemPhotoModel()
                            {
                                Barecode  = photoListDetails[i].Barecode,
                                Telephone = InfoModel.Mobile_Number,
                                // Telephone = "230",
                                Comments = photoListDetails[i].comments_Delivery,
                                OSDS     = Constants.Delivery,
                                Photo    = image64
                            };
                            listForOneBarcode.Add(photoModel);
                        }
                    }

                    _sentPhoto = await _service.PostItemsPhotos(listForOneBarcode);
                }
            }
            else
            {
                System.Diagnostics.Debug.WriteLine(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> No Photo To send");
            }

            ProgressValue = 50;

            LoadingIndicator = true;
        }
예제 #4
0
 public async Task MakeProfilePhoto([FromBody] ItemPhotoModel itemPhoto)
 {
     ItemDE itemDE = new ItemDE();
     await itemDE.MakeProfilePhoto(itemPhoto.ItemID, itemPhoto.Path);
 }
예제 #5
0
        /// <summary>
        /// Inserts the loading photo.
        /// </summary>
        /// <param name="itemPhoto">The item photo.</param>
        public async Task InsertLoadingPhoto(ItemPhotoModel itemPhoto)
        {
            await _con.CreateTableAsync <ItemPhotoModel>();

            await _con.InsertAsync(itemPhoto);
        }