public bool Update(Model.Orders orders) { bool ok; DAL.OrdersDal ordersDal = new DAL.OrdersDal(); OleDbConnection conn = MyData.DataBase.Conn(); conn.Open(); OleDbTransaction tr = conn.BeginTransaction(); try { //先把订单添加到数据库 ordersDal.Update(orders, tr); orders.Price = (decimal)0 - orders.Price; new IncomeBLL().alljisuan(orders, tr); tr.Commit(); ok = true; } catch (Exception ex) { tr.Rollback(); ok = false; } conn.Close(); return(ok); }
public bool Insert(Model.Orders orders, String ordersId) { bool ok; DAL.OrdersDal ordersDal = new DAL.OrdersDal(); OleDbConnection conn = MyData.DataBase.Conn(); conn.Open(); OleDbTransaction tr = conn.BeginTransaction(); try { //先把订单添加到数据库 ordersDal.Insert(orders, ordersId, tr); new IncomeBLL().alljisuan(orders, tr); tr.Commit(); ok = true; } catch (Exception ex) { tr.Rollback(); ok = false; } conn.Close(); return(ok); }
public int GetRecordCount(string strWhere) { DAL.OrdersDal ordersDal = new DAL.OrdersDal(); return(ordersDal.GetRecordCount(strWhere)); }
//已过期的人是不可以添加订单的 public DataTable GetListByPage(string strWhere, string orderby, int startIndex, int endIndex) { DAL.OrdersDal ordersDal = new DAL.OrdersDal(); return(ordersDal.GetListByPage(strWhere, orderby, startIndex, endIndex)); }