예제 #1
0
        public int Insert(AccountBook instance)
        {
            const string sqlStatement = "Insert Into accountbook(Id,Categoryyy,Amounttt,Dateee,Remarkkk)Values(@Id,@Categoryyy,@Amounttt,@Dateee,@Remarkkk)";

            using (var conn = new SqlConnection(this.ConnectionString))
            {
                try
                {
                    return(conn.Execute(sqlStatement, new
                    {
                        Id = Guid.NewGuid(),
                        Categoryyy = instance.Categoryyy,
                        Amounttt = instance.Amounttt,
                        Dateee = instance.Dateee,
                        Remarkkk = instance.Remarkkk
                    }));
                }
                catch (Exception)
                {
                    throw;
                }
            }
        }
예제 #2
0
 public void SaveChanges(AccountBook accountbook)
 {
     int a = _dao.Insert(accountbook);
 }