protected override void OnEnter()
        {
            GetElementById("Ok").Click     += Ok_Click;
            GetElementById("Return").Click += Return_Click;
            _passangerList = new List <PassangerData>();
            _carEntity     = GetBusinessEntity <CarEntity>();
            TicketLines line = _carEntity.SelectLine;

            GetElementById("bus_type_name").InnerText  = line.BusTypeName;
            GetElementById("sch_id").InnerText         = line.SchId;
            GetElementById("service_price").InnerText  = line.ServicePrice;
            GetElementById("mile").InnerText           = line.Mile;
            GetElementById("full_price").InnerText     = line.FullPrice;
            GetElementById("riding_date").InnerText    = _carEntity._BstTicketByCityRequest.RidingDate;
            GetElementById("city").InnerText           = line.City;
            GetElementById("carry_sta_name").InnerText = line.CarryStaName;
            GetElementById("drv_date_time").InnerText  = line.DrvDateTime;
            GetElementById("sch_type_name").InnerText  = line.SchTypeName;
            GetElementById("stop_name").InnerText      = line.StopName;
            InitPassagerView();
            GetElementById("confirm").Click += Confirm_Click;
            GetElementById("cancel").Click  += Cancel_Click;

            GetElementById("passName").GotFocus     += frmInput_GotFocus;
            GetElementById("passName").LostFocus    += frmInput_LostFocus;
            GetElementById("cerNumValue").GotFocus  += numberInput_GotFocus;
            GetElementById("cerNumValue").LostFocus += numberInput_LostFocus;
            GetElementById("passTel").GotFocus      += numberInput_GotFocus;
            GetElementById("passTel").LostFocus     += numberInput_LostFocus;
        }
Beispiel #2
0
        private void SetEleVioIndex(int index)
        {
            int row = (_currPage - 1) * 8 + index;

            if (row >= _ticketLineList.Count)
            {
                string format = string.Format("msg{0}-", index);
                GetElementById(format + "0").InnerText = "";
                GetElementById(format + "1").InnerText = "";
                GetElementById(format + "2").InnerText = "";
                GetElementById(format + "3").InnerText = "";
                GetElementById(format + "4").InnerText = "";
                GetElementById(format + "5").InnerText = "";
            }
            else
            {
                TicketLines line   = _ticketLineList[row];
                string      format = string.Format("msg{0}-", index);
                GetElementById(format + "0").InnerText = line.CarryStaName;
                GetElementById(format + "1").InnerText = line.City;
                GetElementById(format + "2").InnerText = line.DrvDateTime;
                GetElementById(format + "3").InnerText = line.FullPrice;
                GetElementById(format + "4").InnerText = line.EndStaName;
                GetElementById(format + "5").InnerText = line.Amount;
            }
        }
Beispiel #3
0
        private TicketLines CreateNewTicketLine()
        {
            List <int> generatedNumbers = new List <int>();

            Random random = new Random();

            // Generate randon number between 0 and 2
            for (int i = 0; i < 3; i++)
            {
                int num = random.Next(0, 3);
                generatedNumbers.Add(num);
            }

            var lineResult = CalculateLineResult.GetResult(generatedNumbers);

            TicketLines newLine = new TicketLines();

            newLine.Number1 = generatedNumbers.ElementAt(0);
            newLine.Number2 = generatedNumbers.ElementAt(1);
            newLine.Number3 = generatedNumbers.ElementAt(2);
            newLine.Result  = lineResult;

            return(newLine);
        }