コード例 #1
0
 public int UpdateGasto(DatabaseModels.Gasto gasto)
 {
     try
     {
         return(_database.Update(gasto));
     }
     catch (Exception)
     {
         return(0);
     }
 }
コード例 #2
0
        public int InsertGasto(DatabaseModels.Gasto gasto)
        {
            try
            {
                var success = _database.Insert(gasto);
                var newId   = success.Equals(1) ? gasto.Id : 0;

                return(newId);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #3
0
        public int DeleteGasto(DatabaseModels.Gasto gasto)
        {
            try
            {
                var result = _database.Delete <DatabaseModels.Gasto>(gasto.Id);

                _database.Commit();

                return(result);
            }
            catch (Exception)
            {
                return(0);
            }
        }