public int DeleteRelations(string fromid, string toid)
{
const string sql2 =
"delete from cust_relations where (userid=@fromid and friendsid=@toid) or (userid=@toid and friendsid=@fromid);";
using (var conn = Helper.GetConnection())
{
var tran = conn.BeginTransaction();
try
{
conn.Execute(sql2, new {fromid, toid}, tran);
tran.Commit();
return 1;
}
catch (Exception ex)
{
tran.Rollback();
return 0;
}
}
}