Ejemplo n.º 1
0
        public MainWindow()
        {
            InitializeComponent();

            LocationViewModel = new LocationDisplayItem();

            SetDataContext();

            // call after initilaze component
            _controler = new MainWindowControler(this);
        }
Ejemplo n.º 2
0
        public LocationTabControler(MainWindowControler mainControler, MainWindow window) : base(window, mainControler)
        {
            DisplayItem = new LocationDisplayItem();

            Window.LocationContentGrid.DataContext  = DisplayItem;
            Window.ShootingLocationControl.Leaving += ShootingLocationNameControl_Leaving;
            Window.ParkingLocationControl.Leaving  += ParkingLocationControl_Leaving;

            RefreshShootingLocationsFromDB();
            RefreshParkingLocationsFromDB();

            _listerWindow = new LocationListerWindow(base.Window, this);

            _currentChangeMode = E_ChangeMode.no_change;
        }
Ejemplo n.º 3
0
        internal static E_DBReturnCode SmartAddShootingLocation(LocationDisplayItem displayItem, long subjectLocationId, long parkingLocationId, out string errorMessage)
        {
            var photosAsByteArray = new List <byte[]>();

            if (displayItem.Photo_1 != null)
            {
                photosAsByteArray.Add(ImageTools.BitmapImageToByteArray(displayItem.Photo_1));
            }
            if (displayItem.Photo_2 != null)
            {
                photosAsByteArray.Add(ImageTools.BitmapImageToByteArray(displayItem.Photo_2));
            }
            if (displayItem.Photo_3 != null)
            {
                photosAsByteArray.Add(ImageTools.BitmapImageToByteArray(displayItem.Photo_3));
            }

            var shootingLocationName = displayItem.ShootingLocationName;
            var shootingLocationGPS  = new GPSCoordinates(displayItem.ShootingLocationLatitude, displayItem.ShootingLocationLongitude);

            return(PersistenceManager.SmartAddShootingLocation(subjectLocationId, parkingLocationId, photosAsByteArray, shootingLocationName, shootingLocationGPS, out errorMessage));
        }