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; } } }
public void SaveChanges(AccountBook accountbook) { int a = _dao.Insert(accountbook); }