Esempio n. 1
0
 public DelItemViewModel(IPageService pageService, FileInfoDeliveryModel fileInfo, ItemDeliveredModel deliveryItem)
 {
     HandleTranslation(_appViewModel.DefaultedCultureInfo);
     PageService    = pageService;
     _delivery      = deliveryItem;
     _fileInfo      = fileInfo;
     _db            = new DatabaseAccess();
     _photoPathList = new List <string>();
     SetValueByBinding(deliveryItem);
     SaveItemAndGoBackToDeliveryControl = new Command(SaveItemAndGoBack);
     Back      = new Command(GoBack);
     TakePhoto = new Command(TakeAndSavePhoto);
     GetPhotoPathFromDbForDelivery(_delivery.Barecode);
 }
Esempio n. 2
0
        /// <summary>
        /// Updates the delivery data.
        /// </summary>
        /// <param name="deliveryModelData">The delivery model data.</param>
        public void UpdateDeliveryData(ItemDeliveredModel deliveryModelData)
        {
            SQLiteConnection _con = OpenConnect();

            try
            {
                _con.Update(deliveryModelData);
                CloseConenct(_con);
            }
            catch (Exception e)
            {
                CloseConenct(_con);
                System.Diagnostics.Debug.WriteLine(e);
                throw;
            }
        }
Esempio n. 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PhotoAndCommentPage"/> class.
 /// </summary>
 public PhotoAndCommentPage(FileInfoDeliveryModel fileInfo, ItemDeliveredModel cartonModel)
 {
     InitializeComponent();
     _itemModel = cartonModel;
     CallLabel(true, false);
     Appear         = true;
     BindingContext = new PhotoAndCommentViewModel(new PageService(), fileInfo, cartonModel, "delivery");
     if (!string.IsNullOrEmpty(_itemModel.comments_Delivery))
     {
         MyEditor.Text = _itemModel.comments_Delivery;
     }
     else
     {
         MyEditor.Text = "";
     }
     Appear = false;
 }
Esempio n. 4
0
        public void InsertDeliveryData(ItemDeliveredModel deliveryModelData)
        {
            SQLiteConnection _con = OpenConnect();

            try
            {
                _con.CreateTable <ItemDeliveredModel>();

                if (!string.IsNullOrEmpty(deliveryModelData.Barecode))
                {
                    _con.Insert(deliveryModelData);
                    CloseConenct(_con);
                }
            }
            catch (Exception ex)
            {
                CloseConenct(_con);
                throw ex;
            }
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="PhotoAndCommentViewModel"/> class.
 /// </summary>
 /// <param name="pageService">The page service.</param>
 /// <param name="fileInfo">The file information.</param>
 /// <param name="deliveryItem">The delivery item.</param>
 /// <param name="status">The status.</param>
 public PhotoAndCommentViewModel(IPageService pageService, FileInfoDeliveryModel fileInfo, ItemDeliveredModel deliveryItem, string status)
 {
     /**
      * Get Image quality from database at initial stage to set compression ratio
      *
      */
     CrossMedia.Current.Initialize();
     HandleTranslation(_appViewModel.DefaultedCultureInfo);
     PageService    = pageService;
     _fileInfo      = fileInfo;
     _status        = status;
     _db            = new DatabaseAccess();
     _photoPathList = new List <string>();
     _delivery      = deliveryItem;
     GetPhotoPathFromDb(_status, _delivery.Barecode);
     GetPhotoQualityFromDb();
     DetermineValues();
     AddPhoto           = new Command(TakePhoto);
     SaveLoadingDetails = new Command(CallSaveLoadingAsync);
     SaveAndGoBack      = new Command(SaveImageAndGoBack);
     TakePhoto();
 }
Esempio n. 6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DelItem"/> class.
 /// </summary>
 /// <param name="fileInfo">The file information.</param>
 /// <param name="itemDelModel">The item delete model.</param>
 public DelItem(FileInfoDeliveryModel fileInfo, ItemDeliveredModel itemDelModel)
 {
     InitializeComponent();
     BindingContext = new DelItemViewModel(new PageService(), fileInfo, itemDelModel);
 }
Esempio n. 7
0
        /// <summary>
        /// SetValueByBinding field UI with value from paramater of constructor .
        /// </summary>
        /// <param name="deliveryItem">The delivery item.</param>
        private void SetValueByBinding(ItemDeliveredModel deliveryItem)
        {
            TxtBarcode       = deliveryItem.Barecode.Substring(deliveryItem.Barecode.Length - 3, 3);
            TxtName          = deliveryItem.Name;
            ItemsInformation = new ObservableCollection <ListViewItemModel>();

            var packBy          = deliveryItem.packed_by;
            var mountedType     = deliveryItem.Dismounting_type;
            var cubReassembly   = deliveryItem.Reassembling_type;
            var mechanicalState = deliveryItem.mechanical_statement;

            //var cubReassembly = deliveryItem.cub_Reassembly;

            if (!string.IsNullOrEmpty(mountedType))
            {
                ListViewItemModel mountedTypeModel = new ListViewItemModel()
                {
                    //ItemDetail = "Reassembled"
                    ItemDetail      = LblDismounting,
                    ItemDetailValue = mountedType,
                    SvgPath         = "",
                    ItemName        = "",
                    Quantity        = 0,
                };
                ItemsInformation.Add(mountedTypeModel);
            }

            if (!string.IsNullOrEmpty(mechanicalState))
            {
                ListViewItemModel mechanicalModel = new ListViewItemModel()
                {
                    ItemDetail      = LblMechanicalState,
                    ItemDetailValue = mechanicalState,
                    SvgPath         = "",
                    ItemName        = "",
                    Quantity        = 0,
                };
                ItemsInformation.Add(mechanicalModel);
            }

            if (!string.IsNullOrEmpty(packBy))
            {
                ListViewItemModel packByTypeModel = new ListViewItemModel()
                {
                    //ItemDetail = "PackingCygest"
                    ItemDetail      = LblPackingCygest,
                    ItemDetailValue = packBy,
                    SvgPath         = "",
                    ItemName        = "",
                    Quantity        = 0,
                };
                ItemsInformation.Add(packByTypeModel);
            }

            if (!string.IsNullOrEmpty(cubReassembly))
            {
                ListViewItemModel cubReassemblyModel = new ListViewItemModel()
                {
                    //ItemDetail = "Reassemble"
                    ItemDetail      = LblReassemble,
                    ItemDetailValue = cubReassembly,
                    SvgPath         = "",
                    ItemName        = "",
                    Quantity        = 0,
                };
                ItemsInformation.Add(cubReassemblyModel);
            }

            //Display loading photo comment if any
            if (!string.IsNullOrEmpty(deliveryItem.comments_Loading))
            {
                LoadingComment = TxtComment + ": " + deliveryItem.comments_Loading;
            }
            else
            {
                LoadingComment = TxtComment + ": ";
            }

            //display if FileRoom
            if (!string.IsNullOrEmpty(deliveryItem.IdFileRoom))
            {
                if (!deliveryItem.IdFileRoom.Equals("0"))
                {
                    TxtRoom = _db.GetFileRoom(deliveryItem.IdFileRoom);
                }
            }

            //display if Room

            if (!string.IsNullOrEmpty(deliveryItem.IdRoom))
            {
                if (!deliveryItem.IdRoom.Equals("0"))
                {
                    if (_appViewModel.DefaultedCultureInfo.Equals("en-US"))
                    {
                        TxtRoom = _db.GetRoomNameEN(deliveryItem.IdRoom);
                    }
                    else
                    {
                        TxtRoom = _db.GetRoomNameFR(deliveryItem.IdRoom);
                    }
                }
            }
        }