Exemplo n.º 1
0
 public void InsertDWD(DWD dwd, string fk)
 {
     dwd.DWDID  = Guid.NewGuid().ToString();
     dwd.PLOTID = fk;
     _databaseHelper.InsertDWD(dwd);
     _databaseHelper.SetPlotSynch(dwd.PLOTID);
 }
        public bool IsDWDNumUnique(DWD _dwd)
        {
            // for examinginif a unique tree number is being saved
            string qry;

            if (_dwd.DWDID != null)
            {
                qry = "select count(DWDID) from DWD where PLOTID = '" + _dwd.PLOTID + "' and DWDNUM = '" + _dwd.DWDNUM + "' and LINE = " + _dwd.LINE + " and PLOTID <> '" + _dwd.PLOTID + "'";
            }
            else
            {
                qry = "select count(DWDID) from DWD where PLOTID = '" + _dwd.PLOTID + "' and DWDNUM = '" + _dwd.DWDNUM + "' and LINE = " + _dwd.LINE;
            }

            try
            {
                var num = sqliteconnection.ExecuteScalar <int>(qry);
                if (num > 0)
                {
                    return(false);
                }
                else
                {
                    return(true);
                }
            }
            catch (Exception e)
            {
                var myerror = e.Message; // erro
                return(false);
            }
        }
Exemplo n.º 3
0
        public void DeleteDWD(DWD _table)
        {
//            _databaseHelper.DeleteDWD(ID);
            _table.IsDeleted = "Y";
            _databaseHelper.UpdateDWD(_table);
            _databaseHelper.SetPlotSynch(_table.PLOTID);
        }
 // Insert new to DB
 public void InsertDWD(DWD dwd)
 {
     try
     {
         sqliteconnection.Insert(dwd);
     }
     catch (Exception ex)
     { logger.LogWrite(ex.Message); }
 }
Exemplo n.º 5
0
 async Task ShowDWD(DWD _dwd)
 {
     if (_dwd.IS_ACCUM == "Y")
     {
         // launch the form - filtered to a specific projectid
         await _navigation.PushAsync(new DWDDetailsPage(_dwd.DWDID));
     }
     else
     {
         await _navigation.PushAsync(new DWDAccumDetailsPage(_dwd.DWDID));
     }
 }
Exemplo n.º 6
0
 public DWDListViewModel(INavigation navigation, string fk)
 {
     _navigation         = navigation;
     _dwdRepository      = new DWDRepository();
     _fk                 = fk;
     _dwd                = new DWD();
     AddCommand          = new Command(async() => await ShowAdd(_fk));
     AddAccumCommand     = new Command(async() => await ShowAddAccum(_fk));
     DeleteAllCommand    = new Command(async() => await DeleteAll());
     ShowFilteredCommand = new Command <DWD>(async(x) => await ShowDWD(x));
     FetchDetails();
 }
        public AddDWDViewModel(INavigation navigation, string selectedID)
        {
            _navigation     = navigation;
            _dwd            = new DWD();
            _dwd.DWDID      = selectedID;
            _dwdRepository  = new DWDRepository();
            _fk             = selectedID;
            AddCommand      = new Command(async() => await Update());
            AddAccumCommand = new Command(async() => await Update(true));

            DeleteCommand   = new Command(async() => await Delete());
            ListSpecies     = PickerService.SpeciesItems().ToList();
            ListOrigin      = PickerService.OriginItems().ToList();
            ListDecompClass = PickerService.DecompClassItems().ToList();
            ListLine        = PickerService.LineItems().ToList();
        }
Exemplo n.º 8
0
        public DWDDetailsViewModel(INavigation navigation, string selectedID)
        {
            _navigation = navigation;
            _dwd        = new DWD();
            //_vegetation.VEGETATIONID  = selectedID;
            _dwdRepository  = new DWDRepository();
            _fk             = selectedID;
            AddCommand      = new Command(async() => await Update(false));
            AddAccumCommand = new Command(async() => await Update(true));

            DeleteCommand   = new Command(async() => await Delete());
            ListSpecies     = PickerService.SpeciesItems().ToList();
            ListOrigin      = PickerService.OriginItems().ToList();
            ListDecompClass = PickerService.DecompClassItems().ToList();
            ListLine        = PickerService.LineItems().ToList();
            FetchDetails(selectedID);
        }
        public AddDWDViewModel(INavigation navigation, string selectedID, bool IsAccumulation = false)
        {
            _navigation     = navigation;
            _dwd            = new DWD();
            _isaccum        = IsAccumulation;
            _dwd.DWDID      = selectedID;
            _dwdRepository  = new DWDRepository();
            _fk             = selectedID;
            _dwd.BURNED     = "N";
            _dwd.HOLLOW     = "N";
            AddCommand      = new Command(async() => await Update());
            AddAccumCommand = new Command(async() => await Update(IsAccumulation));

            DeleteCommand         = new Command(async() => await Delete());
            ListSpecies           = PickerService.SpeciesItems().ToList();
            ListOrigin            = PickerService.OriginItems().ToList();
            ListDecompClass       = PickerService.DecompClassItems().ToList();
            ListLine              = PickerService.LineItems().ToList();
            IsChanged             = false;
            OnAppearingCommand    = new Command(() => OnAppearing());
            OnDisappearingCommand = new Command(() => OnDisappearing());
        }
 // Update Data
 public void UpdateDWD(DWD dwd)
 {
     sqliteconnection.Update(dwd);
 }
Exemplo n.º 11
0
 public void UpdateDWD(DWD dwd)
 {
     _databaseHelper.UpdateDWD(dwd);
     _databaseHelper.SetPlotSynch(dwd.PLOTID);
 }
 public void UpdateDWD(DWD dwd)
 {
     _databaseHelper.UpdateDWD(dwd);
 }
 public Task DeleteTaskAsync(DWD item)
 {
     return(restService.DeleteAsync(tablename, item.DWDID));
 }