コード例 #1
0
ファイル: OrdersBLL.cs プロジェクト: qingxuebei/junhe
        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);
        }
コード例 #2
0
ファイル: OrdersBLL.cs プロジェクト: qingxuebei/junhe
        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);
        }
コード例 #3
0
ファイル: OrdersBLL.cs プロジェクト: qingxuebei/junhe
 public int GetRecordCount(string strWhere)
 {
     DAL.OrdersDal ordersDal = new DAL.OrdersDal();
     return(ordersDal.GetRecordCount(strWhere));
 }
コード例 #4
0
ファイル: OrdersBLL.cs プロジェクト: qingxuebei/junhe
        //已过期的人是不可以添加订单的

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