Пример #1
0
        public static int Delete(FishType fishType)
        {
            using (SQLiteConnection conn = new SQLiteConnection(App.DatabaseLocation))
            {
                conn.CreateTable <FishType>();
                int rows = conn.Delete <FishType>(fishType.IdFishType);

                if (rows > 0)
                {
                    return(StaticValues.SUCCESS);
                }
                else
                {
                    return(StaticValues.ERROR);
                }
            }
        }
Пример #2
0
        public static FishType Insert(FishType type)
        {
            using (SQLiteConnection conn = new SQLiteConnection(App.DatabaseLocation))
            {
                type.IdFishType = Guid.NewGuid().ToString();
                conn.CreateTable <FishType>();
                int rows = conn.Insert(type);

                if (rows > 0)
                {
                    return(type);
                }
                else
                {
                    return(null);
                }
            }
        }