public Task <int> SaveItemAsync(Mes item) { if (!string.IsNullOrEmpty(item.Id)) { return(database.InsertOrReplaceAsync(item)); } else { return(database.InsertAsync(item)); } }
public async Task removeMes(Mes mes) { try { await App.Database.DeleteItemAsync <Mes>(mes); Meses.Remove(mes); } catch (Exception ex) { Debug.WriteLine(ex); } }
public NewClientePage(Mes mes) { InitializeComponent(); ClienteNuevo = new Cliente { //Nombre = "Ingrese el nombre del cliente", Nombre = "", MesId = mes.Id, Id = Guid.NewGuid().ToString() }; BindingContext = this; }
// Note - The Xamarin.Forms Previewer requires a default, parameterless constructor to render a page. public DetalleMesPage() { InitializeComponent(); var item = new Mes { //TODO - Name of the month Nombre = DateTime.UtcNow.Month.ToString(), Anio = DateTime.UtcNow.Year, NumeroMes = DateTime.UtcNow.Month }; viewModel = new ItemDetailViewModel(item); BindingContext = viewModel; }
public NewMesPage() { InitializeComponent(); Item = new Mes { //TODO - Name of the month //Nombre = DateTime.UtcNow.Month.ToString(), Anio = DateTime.UtcNow.Year, NumeroMes = DateTime.UtcNow.Month, Id = Guid.NewGuid().ToString() }; BindingContext = this; }
//public Task<List<Mes>> GetItemsNotDoneAsync() //{ // return database.QueryAsync<Mes>("SELECT * FROM [Mes] WHERE [Anio] = 2017"); //} public Task <List <Cliente> > GetClientesForMesAsync(Mes mes) { return(database.QueryAsync <Cliente>($"SELECT * FROM [Cliente] " + $"WHERE [MesId] = '{mes.Id}'")); }
public ItemDetailViewModel(Mes item = null) { Title = item?.Nombre; Item = item; }