Пример #1
0
        /// <summary>
        /// 产品类型切换
        /// </summary>
        public bool SelectType(emType type)
        {
            byte[] sendByte = new byte[1];
            switch (type)
            {
            case emType.Vgs:
                sendByte = new byte [14] {
                    0x01, 0x77, 0, 0, 0x0d, 0, 0, 0, 0, 0, 0, 0x0d, 0x0d, 0x0d
                };
                break;

            case emType.Vds:
                sendByte = new byte[14] {
                    0x01, 0x77, 0x10, 0x48, 0, 0, 0, 0, 0, 0, 0, 0x0d, 0x0d, 0x0d
                };
                break;

            case emType.Vgd:
                sendByte = new byte[14] {
                    0x01, 0x77, 0x02, 0x0d, 0, 0, 0, 0, 0, 0, 0, 0x0d, 0x0d, 0x0d
                };
                break;

            default:
                break;
            }
            comBoard.Write(sendByte, 0, sendByte.Length);
            return(true);
        }
Пример #2
0
 /// <summary>
 /// 构造一条带数据的记录
 /// </summary>
 /// <param name="type"></param>
 /// <param name="errID"></param>
 /// <param name="description"></param>
 public CInfo(emType type, int errID, string description)
 {
     this.time        = DateTime.Now;
     this.type        = type;
     this.threadID    = Thread.CurrentThread.ManagedThreadId;
     this.file        = "";
     this.line        = 0;
     this.function    = "";
     this.errID       = errID;
     this.description = description;
 }
Пример #3
0
        public void showAlert(string msg, emType type)
        {
            this.Opacity       = 0.0;
            this.StartPosition = FormStartPosition.Manual;
            string fname;

            for (int i = 1; i < 10; i++)
            {
                fname = "alert" + i.ToString();
                FAlert frm = (FAlert)Application.OpenForms[fname];
                if (frm == null)
                {
                    this.Name     = fname;
                    this.x        = Screen.PrimaryScreen.WorkingArea.Width - this.Width + 15;
                    this.y        = Screen.PrimaryScreen.WorkingArea.Height - this.Height * i - 5 * i;
                    this.Location = new Point(this.x, this.y);
                    break;
                }
            }
            this.x = Screen.PrimaryScreen.WorkingArea.Width - base.Width - 5;
            switch (type)
            {
            case emType.success:
                this.ptbcheck.BringToFront();
                this.BackColor = Color.SeaGreen;
                break;

            case emType.error:
                this.ptbsad.BringToFront();
                this.BackColor = Color.Brown;
                break;

            case emType.regex:
                this.ptbexclamation.BringToFront();
                this.BackColor = Color.DimGray;
                break;

            case emType.warning:
                this.ptbexclamation.BringToFront();
                this.BackColor = Color.Goldenrod;
                break;
            }
            this.lbmsg.Text = msg;

            this.Show();

            this.action          = emAction.start;
            this.timer1.Interval = 1;
            timer1.Start();
        }
Пример #4
0
    /// <summary>
    /// 设置实体数据
    /// </summary>
    /// <param name="printData"></param>
    /// <returns></returns>
    public PnrAnalysis.Model.TripPrintData SetPrintData(PnrAnalysis.Model.TripPrintData printData, emType emtype)
    {
        if (emtype == emType.界面数据到实体)
        {
            if (printData == null)
            {
                printData = new PnrAnalysis.Model.TripPrintData();
            }
            printData.m_strTravelNumber     = txtTravelNumber.Value.Trim();
            printData.m_strPassengerName    = txtPassengerName.Value.Trim();
            printData.m_strPassengerCardId  = txtPassengerCardId.Value.Trim();
            printData.m_strEndorsements     = ddlEndorsements.SelectedValue;
            printData.m_strPnrB             = txtPnrB.Value.Trim();
            printData.m_strSpaceFare        = txtSpaceFare.Value.Trim();
            printData.m_strABFare           = txtABFare.Value.Trim();
            printData.m_strFuelFare         = txtFuelFare.Value.Trim();
            printData.m_strOtherFare        = txtOtherFare.Value.Trim();
            printData.m_strTotalFare        = txtTotalFare.Value.Trim();
            printData.m_strTicketNumber     = txtTicketNumber.Value.Trim();
            printData.m_strCheckNum         = txtCheckNum.Value.Trim();
            printData.m_strPromptMsg        = txtPromptMsg.Value.Trim();
            printData.m_strInsuranceFare    = txtInsuranceFare.Value.Trim();
            printData.m_strAgentOffice      = txtAgentOffice.Value.Trim();
            printData.m_strIataCode         = txtIataCode.Value.Trim();
            printData.m_strCNTKTConjunction = txtCNTKTConjunction.Value.Trim();
            printData.m_strIssuedDate       = txtIssuedDate.Value.Trim();

            //航段一
            printData.m_strFCityName1 = txtFCityName1.Value.Trim();
            //printData.m_strTCityName1 = txtTCityName1.Value.Trim();
            printData.m_strAirName1           = txtAirName1.Value.Trim();
            printData.m_strFlightNum1         = txtFlightNum1.Value.Trim();
            printData.m_strSpace1             = txtSpace1.Value.Trim();
            printData.m_strFlyDate1           = txtFlyDate1.Value.Trim();
            printData.m_strFlyStartTime1      = txtFlyStartTime1.Value.Trim();
            printData.m_strTicketBasis1       = txtTicketBasis1.Value.Trim();
            printData.m_strTicketValidBefore1 = txtTicketValidBefore1.Value.Trim();
            printData.m_strTicketValidAfter1  = txtTicketValidAfter1.Value.Trim();
            printData.m_strAllowPacket1       = txtAllowPacket1.Value.Trim();

            //航段二
            printData.m_strFCityName2 = txtFCityName2.Value.Trim();
            //printData.m_strTCityName2 = txtTCityName2.Value.Trim();
            printData.m_strAirName2           = txtAirName2.Value.Trim();
            printData.m_strFlightNum2         = txtFlightNum2.Value.Trim();
            printData.m_strSpace2             = txtSpace2.Value.Trim();
            printData.m_strFlyDate2           = txtFlyDate2.Value.Trim();
            printData.m_strFlyStartTime2      = txtFlyStartTime2.Value.Trim();
            printData.m_strTicketBasis2       = txtTicketBasis2.Value.Trim();
            printData.m_strTicketValidBefore2 = txtTicketValidBefore2.Value.Trim();
            printData.m_strTicketValidAfter2  = txtTicketValidAfter2.Value.Trim();
            printData.m_strAllowPacket2       = txtAllowPacket2.Value.Trim();


            //航段三
            printData.m_strFCityName3 = txtFCityName3.Value.Trim();
            //printData.m_strTCityName3 = txtTCityName3.Value.Trim();
            printData.m_strAirName3           = txtAirName3.Value.Trim();
            printData.m_strFlightNum3         = txtFlightNum3.Value.Trim();
            printData.m_strSpace3             = txtSpace3.Value.Trim();
            printData.m_strFlyDate3           = txtFlyDate3.Value.Trim();
            printData.m_strFlyStartTime3      = txtFlyStartTime3.Value.Trim();
            printData.m_strTicketBasis3       = txtTicketBasis3.Value.Trim();
            printData.m_strTicketValidBefore3 = txtTicketValidBefore3.Value.Trim();
            printData.m_strTicketValidAfter3  = txtTicketValidAfter3.Value.Trim();
            printData.m_strAllowPacket3       = txtAllowPacket3.Value.Trim();

            //航段四
            printData.m_strFCityName4 = txtFCityName4.Value.Trim();
            //printData.m_strTCityName4 = txtTCityName4.Value.Trim();
            printData.m_strAirName4           = txtAirName4.Value.Trim();
            printData.m_strFlightNum4         = txtFlightNum4.Value.Trim();
            printData.m_strSpace4             = txtSpace4.Value.Trim();
            printData.m_strFlyDate4           = txtFlyDate4.Value.Trim();
            printData.m_strFlyStartTime4      = txtFlyStartTime4.Value.Trim();
            printData.m_strTicketBasis4       = txtTicketBasis4.Value.Trim();
            printData.m_strTicketValidBefore4 = txtTicketValidBefore4.Value.Trim();
            printData.m_strTicketValidAfter4  = txtTicketValidAfter4.Value.Trim();
            printData.m_strAllowPacket4       = txtAllowPacket4.Value.Trim();

            //航段五
            printData.m_strFCityName5 = txtFCityName5.Value.Trim();
        }
        if (printData != null && emtype == emType.实体数据到界面)
        {
            txtTravelNumber.Value         = printData.m_strTravelNumber;
            txtPassengerName.Value        = printData.m_strPassengerName;
            txtPassengerCardId.Value      = printData.m_strPassengerCardId;
            ddlEndorsements.SelectedValue = printData.m_strEndorsements;
            txtPnrB.Value             = printData.m_strPnrB;
            txtSpaceFare.Value        = printData.m_strSpaceFare;
            txtABFare.Value           = printData.m_strABFare;
            txtFuelFare.Value         = printData.m_strFuelFare;
            txtOtherFare.Value        = printData.m_strOtherFare;
            txtTotalFare.Value        = printData.m_strTotalFare;
            txtTicketNumber.Value     = printData.m_strTicketNumber;
            txtCheckNum.Value         = printData.m_strCheckNum;
            txtPromptMsg.Value        = printData.m_strPromptMsg;
            txtInsuranceFare.Value    = printData.m_strInsuranceFare;
            txtAgentOffice.Value      = printData.m_strAgentOffice;
            txtIataCode.Value         = printData.m_strIataCode;
            txtCNTKTConjunction.Value = printData.m_strCNTKTConjunction;
            txtIssuedDate.Value       = printData.m_strIssuedDate;



            //航段一
            txtFCityName1.Value = printData.m_strFCityName1;
            //txtTCityName1.Value = printData.m_strTCityName1;
            txtAirName1.Value           = printData.m_strAirName1;
            txtFlightNum1.Value         = printData.m_strAirCode1 + printData.m_strFlightNum1;
            txtSpace1.Value             = printData.m_strSpace1;
            txtFlyDate1.Value           = printData.m_strFlyDate1;
            txtFlyStartTime1.Value      = printData.m_strFlyStartTime1;
            txtTicketBasis1.Value       = printData.m_strTicketBasis1;
            txtTicketValidBefore1.Value = printData.m_strTicketValidBefore1;
            txtTicketValidAfter1.Value  = printData.m_strTicketValidAfter1;
            txtAllowPacket1.Value       = printData.m_strAllowPacket1;
            if (printData.m_strTravelType == "1")//单程
            {
                txtFCityName2.Value = printData.m_strTCityName1;
            }
            else if (printData.m_strTravelType == "2")//往返
            {
                txtFCityName2.Value         = printData.m_strTCityName1;
                txtFCityName3.Value         = printData.m_strTCityName2;
                txtAirName2.Value           = printData.m_strAirName2;
                txtFlightNum2.Value         = printData.m_strAirCode2 + printData.m_strFlightNum2;
                txtSpace2.Value             = printData.m_strSpace2;
                txtFlyDate2.Value           = printData.m_strFlyDate2;
                txtFlyStartTime2.Value      = printData.m_strFlyStartTime2;
                txtTicketBasis2.Value       = printData.m_strTicketBasis2;
                txtTicketValidBefore2.Value = printData.m_strTicketValidBefore2;
                txtTicketValidAfter2.Value  = printData.m_strTicketValidAfter2;
                txtAllowPacket2.Value       = printData.m_strAllowPacket2;
                txtAirName3.Value           = "VOID";
            }
            else if (printData.m_strTravelType == "3")
            {
                txtFCityName2.Value         = printData.m_strTCityName1;
                txtFCityName3.Value         = printData.m_strTCityName2;
                txtAirName2.Value           = printData.m_strAirName2;
                txtFlightNum2.Value         = printData.m_strAirCode2 + printData.m_strFlightNum2;
                txtSpace2.Value             = printData.m_strSpace2;
                txtFlyDate2.Value           = printData.m_strFlyDate2;
                txtFlyStartTime2.Value      = printData.m_strFlyStartTime2;
                txtTicketBasis2.Value       = printData.m_strTicketBasis2;
                txtTicketValidBefore2.Value = printData.m_strTicketValidBefore2;
                txtTicketValidAfter2.Value  = printData.m_strTicketValidAfter2;
                txtAllowPacket2.Value       = printData.m_strAllowPacket2;
                txtAirName3.Value           = "VOID";
            }
            else if (printData.m_strTravelType == "4")
            {
            }
            else if (printData.m_strTravelType == "5")
            {
            }
            txtFCityName5.Value = "VOID";

            /*
             * //航段二
             * txtFCityName2.Value = printData.m_strFCityName2;
             * txtTCityName2.Value = printData.m_strTCityName2;
             * txtAirName2.Value = printData.m_strAirName2;
             * txtFlightNum1.Value = printData.m_strFlightNum2;
             * txtSpace2.Value = printData.m_strSpace2;
             * txtFlyDate2.Value = printData.m_strFlyDate2;
             * txtFlyStartTime2.Value = printData.m_strFlyStartTime2;
             * txtTicketBasis2.Value = printData.m_strTicketBasis2;
             * txtTicketValidBefore2.Value = printData.m_strTicketValidBefore2;
             * txtTicketValidAfter2.Value = printData.m_strTicketValidAfter2;
             * txtAllowPacket2.Value = printData.m_strAllowPacket2;
             *
             * //航段三
             * txtFCityName3.Value = printData.m_strFCityName3;
             * txtTCityName3.Value = printData.m_strTCityName3;
             * txtAirName3.Value = printData.m_strAirName3;
             * txtFlightNum3.Value = printData.m_strFlightNum3;
             * txtSpace3.Value = printData.m_strSpace3;
             * txtFlyDate3.Value = printData.m_strFlyDate3;
             * txtFlyStartTime3.Value = printData.m_strFlyStartTime3;
             * txtTicketBasis3.Value = printData.m_strTicketBasis3;
             * txtTicketValidBefore3.Value = printData.m_strTicketValidBefore3;
             * txtTicketValidAfter3.Value = printData.m_strTicketValidAfter3;
             * txtAllowPacket3.Value = printData.m_strAllowPacket3;
             *
             * //航段四
             * txtFCityName4.Value = printData.m_strFCityName4;
             * txtTCityName4.Value = printData.m_strTCityName4;
             * txtAirName4.Value = printData.m_strAirName4;
             * txtFlightNum4.Value = printData.m_strFlightNum4;
             * txtSpace4.Value = printData.m_strSpace4;
             * txtFlyDate4.Value = printData.m_strFlyDate4;
             * txtFlyStartTime4.Value = printData.m_strFlyStartTime4;
             * txtTicketBasis4.Value = printData.m_strTicketBasis4;
             * txtTicketValidBefore4.Value = printData.m_strTicketValidBefore4;
             * txtTicketValidAfter4.Value = printData.m_strTicketValidAfter4;
             * txtAllowPacket4.Value = printData.m_strAllowPacket4;
             *
             * //航段五
             * txtFCityName5.Value = printData.m_strFCityName5;
             */
        }
        return(printData);
    }