Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
 public int GetRecordCount(string strWhere)
 {
     DAL.OrdersDal ordersDal = new DAL.OrdersDal();
     return(ordersDal.GetRecordCount(strWhere));
 }
Esempio n. 4
0
        //已过期的人是不可以添加订单的

        public DataTable GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
        {
            DAL.OrdersDal ordersDal = new DAL.OrdersDal();
            return(ordersDal.GetListByPage(strWhere, orderby, startIndex, endIndex));
        }