예제 #1
0
파일: Order.cs 프로젝트: wpmyj/PecsService
        /// <summary>
        /// Method to retrieve orders information
        /// </summary>
        /// <returns>All orders</returns>
        public List <OrderInfo> GetOrders()
        {
            List <OrderInfo> orders = new List <OrderInfo>();

            try {
                //Execute a query to read the orders
                using (SqlDataReader rdr = SqlHelper.ExecuteReader(SqlHelper.ConnectionStringLocalTransaction, CommandType.Text, SqlText.SQL_SELECT_ORDER_GETORDERS, null)) {
                    while (rdr.Read())
                    {
                        OrderInfo order = new OrderInfo();
                        order.LscID      = ComUtility.DBNullInt32Handler(rdr["LscID"]);
                        order.TargetID   = ComUtility.DBNullInt32Handler(rdr["TargetID"]);
                        order.TargetType = ComUtility.DBNullNodeTypeHandler(rdr["TargetType"]);
                        order.OrderType  = ComUtility.DBNullActTypeHandler(rdr["OrderType"]);
                        order.RelValue1  = ComUtility.DBNullStringHandler(rdr["RelValue1"]);
                        order.RelValue2  = ComUtility.DBNullStringHandler(rdr["RelValue2"]);
                        order.RelValue3  = ComUtility.DBNullStringHandler(rdr["RelValue3"]);
                        order.RelValue4  = ComUtility.DBNullStringHandler(rdr["RelValue4"]);
                        order.RelValue5  = ComUtility.DBNullStringHandler(rdr["RelValue5"]);
                        order.UpdateTime = ComUtility.DBNullDateTimeHandler(rdr["UpdateTime"]);

                        orders.Add(order);
                    }
                }

                return(orders);
            } catch {
                throw;
            }
        }