コード例 #1
0
ファイル: MyOrder.cs プロジェクト: karthik-kt/SWAT-Main
 public MyOrder(TestStartInfo teststartinfo, DataManager datamanager)
 {
     _MyOrderPage = new MyOrderPage(teststartinfo);
     _MyOrderData = new MyOrderData(datamanager);
     _PurchaseOrderShippingUnitData = new PurchaseOrderShippingUnitData(datamanager);
     _PurchaseOrderCommodityData    = new PurchaseOrderCommodityData(datamanager);
 }
コード例 #2
0
ファイル: MySQLHelper.cs プロジェクト: Drygi/PUTAirlines
        public static List <MyOrderData> get_order_data(int ClientID, MySqlConnection conn)
        {
            List <MyOrderData> returned  = new List <MyOrderData>();
            string             SelectCMD = "call GetOrderData(@thisClientID)";

            MySqlCommand cmd = new MySqlCommand(SelectCMD, conn);

            cmd.Parameters.AddWithValue("@thisClientID", ClientID);
            conn.Open();
            var result = cmd.ExecuteReader();

            while (result.Read())
            {
                MyOrderData order_1 = new MyOrderData();
                order_1.NazwaLotniskaOdlotu   = result.GetString("NameDeparture");
                order_1.NazwaLotniskaPrzylotu = result.GetString("NameArrival");
                order_1.DataWylotu            = result.GetString("DepartureDate");
                order_1.ReservationID         = result.GetInt16("ReservationID");
                order_1.CenaBiletu            = result.GetFloat("PriceOfTicket");
                order_1.KosztRezerwacji       = result.GetFloat("Price");
                MyOrderDataDetails d_order_1 = new MyOrderDataDetails();
                d_order_1.DataPrzylotu        = result.GetString("ArrivalDate");
                d_order_1.DataRezerwacji      = result.GetString("ReservationDate");
                d_order_1.KrajOdlotu          = result.GetString("CountryDeparture");
                d_order_1.KrajPrzylotu        = result.GetString("CountryArrival");
                d_order_1.MiejscowoscOdlotu   = result.GetString("CityDeparture");
                d_order_1.MiejscowoscPrzylotu = result.GetString("CityArrival");


                List <ClientShort> c_order_1 = GlobalHelper.parsing_JSON(result.GetString(1));

                d_order_1.client = c_order_1;
                order_1.details  = d_order_1;

                returned.Add(order_1);
            }

            conn.Close();
            foreach (var i in returned)
            {
                i.luggages = get_LuggageForReservation(i.ReservationID, conn);
            }

            return(returned);
        }
コード例 #3
0
        //获取未完成订单的列表
        private List<MyOrderData> GetOrderItems(string html)
        {
            List<MyOrderData> orderData = new List<MyOrderData>();//<div class="jdan_tfont">
            int length=0;

            table = StringHelper.FindString(ref html, "<divclass=\"jdan_tfont\">", "</table>");
            string tmpTable=StringHelper.FindString(ref html, "<divclass=\"jdan_tfont\">", "</table>");
            length = Convert.ToInt16(Regex.Match(html, "(?<=总张数:)\\d+").ToString());

            string[] trCollection = new string[length + 2];
            int i = 0;
            while (tmpTable.IndexOf("<tr") > -1)
            {
                trCollection[i] = StringHelper.FindString(ref tmpTable, "<tr", "</tr>");
                tmpTable = tmpTable.Replace(trCollection[i], "");
                i++;
            }
            for (int a = 1; a < trCollection.Length - 1; a++)
            {
                var myData = new MyOrderData(trCollection[a]);
                if (table.IndexOf("订单号") > -1)
                {
                    myData.OrderID = Regex.Match(table, "E\\d{9}").ToString();
                    myData.OrderDate = Regex.Match(table, "订单时间[::0-9\\-]+").ToString();
                    myData.OrderTotalPrice = Regex.Match(table, "总票价[::0-9\\.]+\\(元\\)").ToString();
                    myData.TicketCount = Regex.Match(table, "总张数[::0-9]+").ToString();
                }
                orderData.Add(myData);
                if (myData.StatusInfo!="订票成功"&&FailedOrderDetail.Flag == false)
                {
                    FailedOrderDetail.Flag = true;
                    FailedOrderDetail._Status = myData.Status;
                    FailedOrderDetail._StatusInfo = myData.StatusInfo;
                    FailedOrderDetail._TrainCode = myData.TrainCode;
                    FailedOrderDetail._TrainDate = myData.TrainDate;
                    FailedOrderDetail._TrainNo = myData.TrainNo;
                    FailedOrderDetail._TrainStationInfo = myData.TrainStationInfo;
                }
            }

            return orderData;
        }