public int POST(MayTinh mt) { //System.Data.Common.DbTransaction transaction = dt.Connection.BeginTransaction(); try { //dt.Transaction = transaction; dt.MayTinhs.InsertOnSubmit(mt); dt.SubmitChanges(); //dt.Transaction.Commit(); return(1); } catch (Exception e) { //dt.Transaction.Rollback(); return(-1); } }
public bool POST(PhongMay p) { try { dt.PhongMays.InsertOnSubmit(p); dt.SubmitChanges(); return(true); } catch (Exception e) { return(false); } }