public async void Refresh()
        {
            IsBusy = true;
            await BoxDAO.GetBoxes(_moveId);

            IsBusy = false;
        }
Beispiel #2
0
        partial void addButtonPressed(UIButton sender)
        {
            var tabBarItems = TabBarController.TabBar.Items;

            if (obj.allDistanceNotZero())
            {
                switch (SegmentChoiceTypeObject.SelectedSegment)
                {
                case 0:
                    Item item = new Item(obj);

                    ItemDAO itemDAO = new ItemDAO();
                    itemDAO.insertItem(item);
                    addBadgeTabBarItem(tabBarItems, 1);

                    break;

                case 1:
                    Box box = new Box(obj);

                    BoxDAO boxDAO = new BoxDAO();
                    boxDAO.insertBox(box);
                    addBadgeTabBarItem(tabBarItems, 2);
                    break;

                default:
                    break;
                }
            }
            else
            {
                alert("Non è possibile aggiungere l'oggetto", "Una delle dimensioni è uguale a 0");
            }
        }
Beispiel #3
0
 public BoxViewController(IntPtr handle) : base(handle)
 {
     boxDAO          = new BoxDAO();
     itemDAO         = new ItemDAO();
     BoxViewDelegate = new BoxViewDelegate(this);
     boxImage        = UIImage.FromBundle("box_image.png");
 }
Beispiel #4
0
        private void deleteVolumeFromPreviusBox()
        {
            var previusBox = BoxDAO.getBox(Item.Container);

            previusBox.RemainVolume += Item.Volume;
            BoxDAO.updateBox(previusBox);
        }
Beispiel #5
0
 public LigneProduitController(AperoBoxApi_dbContext context, IMapper mapper)
 {
     this.context         = context ?? throw new ArgumentNullException(nameof(context));
     this.ligneProduitDAO = new LigneProduitDAO(context);
     this.boxDAO          = new BoxDAO(context);
     this.mapper          = mapper;
 }
Beispiel #6
0
 public override void ViewDidLoad()
 {
     base.ViewDidLoad();
     itemDAO   = new ItemDAO();
     boxDAO    = new BoxDAO();
     Items     = itemDAO.getAllItemInBox(IDBox);
     itemImage = UIImage.FromBundle("item_image.png");
 }
Beispiel #7
0
 public override void ViewDidLoad()
 {
     base.ViewDidLoad();
     boxDAO        = new BoxDAO();
     itemDAO       = new ItemDAO();
     SelectedBoxes = new List <int>();
     setupEditDoneButton();
     TableView.AllowsMultipleSelectionDuringEditing = true;
     loadData();
     boxImage = UIImage.FromBundle("box_image.png");
 }
Beispiel #8
0
        private void insertObjectInBox(NSIndexPath indexPath, Box boxSelected)
        {
            var idBoxSelected           = boxSelected.Id;
            var remainVolumeBoxSelexted = boxSelected.RemainVolume;

            tView.CellAt(indexPath).Accessory = UITableViewCellAccessory.Checkmark;

            Item.Container = idBoxSelected;

            ItemDAO = new ItemDAO();
            ItemDAO.updateItem(Item);

            boxSelected.RemainVolume = remainVolumeBoxSelexted - Item.Volume;
            BoxDAO.updateBox(boxSelected);
            boxes = BoxDAO.getAllBox();
        }
Beispiel #9
0
        private async Task <bool> UpdateBox()
        {
            IsBusy = true;
            System.Diagnostics.Debug.WriteLine("8=============D    Preparing to send box update to PAMS");
            if (SelectedRoom != null)
            {
                _editingBox.DestinationRoomID = SelectedRoom.id;
            }
            _editingBox.name     = _boxName;
            _editingBox.Priority = _boxPriority;
            bool success = await BoxDAO.UpdateBox(_moveId, _editingBox);

            IsBusy = false;
            App.PopNavAsync();
            return(success);
        }
Beispiel #10
0
        private async Task <bool> OnSave()
        {
            if (_editing)
            {
                return(await UpdateBox());
            }
            IsBusy = true;
            bool success = false;

            ValidationResult result = Validator.ValidateName(_boxName);

            ErrBoxName = result.Message;

            if (!result.Error)
            {
                //String roomId = null;

                //if (SelectedRoom != null)
                //     roomId = SelectedRoom.Id;

                Box newBox = new Box(_boxName, _boxPriority, SelectedRoom.id);
                // await _connectionService.CreateBox(_moveId, newBox);
                newBox.id = await BoxDAO.CreateBox(_moveId, newBox);

                if (string.IsNullOrEmpty(newBox.id))
                {
                    ErrBoxName = "Failed to add new box. Please try again";
                    IsBusy     = false;
                }
                else
                {
                    ErrBoxName = "Success!";
                    IsBusy     = false;
                    App.PopNavAsync();
                    success = true;
                }
            }
            IsBusy = false;
            return(success);
        }
Beispiel #11
0
 public BoxViewController()
 {
     boxDAO          = new BoxDAO();
     itemDAO         = new ItemDAO();
     BoxViewDelegate = new BoxViewDelegate(this);
 }
Beispiel #12
0
 public ShowObjectController(IntPtr handle) : base(handle)
 {
     itemDAO = new ItemDAO();
     boxDAO  = new BoxDAO();
 }
Beispiel #13
0
 public override void ViewDidLoad()
 {
     base.ViewDidLoad();
     BoxDAO = new BoxDAO();
     boxes  = BoxDAO.getAllBox();
 }
        internal async void DeleteBox(string id)
        {
            await BoxDAO.DeleteBox(_moveId, id);

            Refresh();
        }
Beispiel #15
0
 public DetailBoxController(IntPtr handle) : base(handle)
 {
     boxDAO = new BoxDAO();
 }
Beispiel #16
0
 private void initDAO()
 {
     itemDAO = new ItemDAO();
     boxDAO  = new BoxDAO();
 }
Beispiel #17
0
 public BoxViewDelegate(UITableViewController source)
 {
     Source  = source;
     itemDAO = new ItemDAO();
     boxDAO  = new BoxDAO();
 }