Exemplo n.º 1
0
        /// <summary>
        /// 体格登録
        /// </summary>
        /// <param name="base64String"></param>
        /// <returns></returns>
        public static bool RegistBodyImage(string base64String)
        {
            var model = new BodyImageModel
            {
                ImageBase64String = base64String,
                RegistedDate      = DateTime.Now
            };

            using (var db = new SQLiteConnection(DbConst.DbPath))
            {
                var result = db.Insert(model);
                if (result == DbConst.Failed)
                {
                    return(false);
                }
                db.Commit();
                return(true);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 体格更新
        /// </summary>
        /// <param name="id"></param>
        /// <param name="base64String"></param>
        /// <returns></returns>
        public static bool UpdateBodyImage(int id, string base64String)
        {
            var model = new BodyImageModel
            {
                Id = id,
                ImageBase64String = base64String,
                RegistedDate      = DateTime.Now
            };
            var s = JsonConvert.SerializeObject(model);

            Debug.WriteLine(s);
            using (var db = new SQLiteConnection(DbConst.DbPath))
            {
                var result = db.Update(model);
                if (result == DbConst.Failed)
                {
                    return(false);
                }
                db.Commit();
                return(true);
            }
        }