Ejemplo n.º 1
0
        static private void setcontrol(object sender, EventArgs e)
        {
            retstring = retstring.Replace('+', ' ');
            retstring = retstring.Replace('-', ' ');
            if (!EagleAPI.GetNoPnr(retstring))
            {
                return;
            }
            context.cb_Name.Items.Clear();
            List <string> names = new List <string>();

            names = EagleAPI.GetNames(retstring);
            for (int i = 0; i < names.Count; i++)
            {
                context.cb_Name.Items.Add(names[i]);
            }
            context.cb_Name.Text   = context.cb_Name.Items[0].ToString();
            context.tb_CardNo.Text = EagleAPI.GetIDCardNo(retstring)[0];
            string date = EagleAPI.GetDateStart(retstring);
            int    imm  = int.Parse(EagleAPI.GetMonthInt(date.Substring(date.Length - 3)));
            int    idd  = int.Parse(date.Substring(date.Length - 5).Substring(0, 2));
            int    iyy  = System.DateTime.Now.Year;

            System.DateTime dt = new DateTime(iyy, imm, idd, 23, 59, 59);
            while (dt < System.DateTime.Now)
            {
                dt = dt.AddYears(1);
            }
            context.dtp_Start.Value = dt;

            context.tbFlightNo.Text   = EagleAPI.GetFlightNo(retstring) + EagleAPI.GetFlightNo2(retstring);
            context.tbFlightDate.Text = dt.ToShortDateString();
        }
Ejemplo n.º 2
0
        static private void setcontrol(object sender, EventArgs e)
        {
            if (GlobalVar.formSendCmdType == GlobalVar.FormSendCommandType.detrF)
            {
                try
                {
                    context.tbCardID.Text = EagleAPI.GetCardIdByDetr_F(retstringDetrF);
                    return;
                }
                catch (Exception ee)
                {
                    MessageBox.Show(ee.Message);
                    return;
                }
            }
            context.cbName.Items.Clear();
            try
            {
                if (context.radioButton1.Checked || context.radioButton2.Checked)
                {
                    retstring = retstring.Replace('+', ' ');
                    retstring = retstring.Replace('-', ' ');
                    if (!EagleAPI.GetNoPnr(retstring))
                    {
                        return;
                    }

                    List <string> names = new List <string>();
                    names = EagleAPI.GetNames(retstring);
                    for (int i = 0; i < names.Count; i++)
                    {
                        context.cbName.Items.Add(names[i]);
                    }
                    context.cbName.Text   = context.cbName.Items[0].ToString();
                    context.tbCardID.Text = EagleAPI.GetIDCardNo(retstring)[0];
                    string          date = EagleAPI.GetDateStart(retstring);
                    int             imm  = int.Parse(EagleAPI.GetMonthInt(date.Substring(date.Length - 3)));
                    int             idd  = int.Parse(date.Substring(date.Length - 5).Substring(0, 2));
                    int             iyy  = System.DateTime.Now.Year;
                    System.DateTime dt   = new DateTime(iyy, imm, idd, 23, 59, 59);
                    while (dt < System.DateTime.Now)
                    {
                        dt = dt.AddYears(1);
                    }
                    //context.dtp_Start.Value = dt;

                    context.tbFlightNo.Text = EagleAPI.GetFlightNo(retstring) + EagleAPI.GetFlightNo2(retstring);
                    context.tbDate.Text     = dt.ToShortDateString();
                }
                if (context.radioButton3.Checked)
                {
                    ePlus.eTicket.etInfomation ei = new ePlus.eTicket.etInfomation();
                    ei.SetVar(retstring);
                    context.cbName.Items.Add(ei.PASSENGER);
                    context.cbName.Text     = ei.PASSENGER;
                    context.tbCardID.Text   = "";
                    context.tbFlightNo.Text = EagleAPI.substring(ei.FROM, 4, 2) + EagleAPI.substring(ei.FROM, 10, 4);
                    string          date = EagleAPI.substring(ei.FROM, 18, 5);
                    int             imm  = int.Parse(EagleAPI.GetMonthInt(date.Substring(date.Length - 3)));
                    int             idd  = int.Parse(date.Substring(date.Length - 5).Substring(0, 2));
                    int             iyy  = System.DateTime.Now.Year;
                    System.DateTime dt   = new DateTime(iyy, imm, idd, 23, 59, 59);
                    while (dt < System.DateTime.Now)
                    {
                        dt = dt.AddYears(1);
                    }
                    context.tbDate.Text = dt.ToShortDateString();
                }
            }
            catch
            {
            }
        }