コード例 #1
0
 public SwitchVisableConfig(EagleString.LoginResult lr)
 {
     InitializeComponent();
     m_lr = lr;
     lvAll.Items.Clear();
     label3.Text = "正在使用的配置编号:" + string.Join(",", lr.IpidUsing.ToArray());
     for (int i = 0; i < m_lr.m_ls_office.Count; ++i)
     {
         ListViewItem lvi = new ListViewItem();
         lvi.Text = m_lr.m_ls_office[i].IP_ID.ToString();
         lvi.SubItems.Add(m_lr.m_ls_office[i].OFFICE_NO);
         lvi.SubItems.Add(m_lr.m_ls_office[i].OFFICE_ALLY);
         lvi.SubItems.Add(m_lr.m_ls_office[i].SERVER_NAME);
         lvAll.Items.Add(lvi);
     }
 }
コード例 #2
0
        public void SetDropDownMenu(ToolStripDropDownButton menu, EagleString.LoginResult lr, string ipid)
        {
            try
            {
                if (!EagleString.BaseFunc.OfficeValidate(lr.m_ls_office[lr.indexof(ipid)].OFFICE_NO))
                {
                    throw new Exception("请联系易格客服修改OFFICE号(工作号:为6位OFFICE号)");
                }
                menu.Text = lr.m_ls_office[lr.indexof(ipid)].OFFICE_NO.ToUpper() + "-" + ipid;

                List <string> lsTemp = new List <string>();
                for (int i = 0; i < lr.m_ls_office.Count; i++)
                {
                    if (lr.IpidSameServer(new string[] { ipid, lr.m_ls_office[i].IP_ID.ToString() }))
                    {
                        string office = lr.m_ls_office[i].OFFICE_NO.ToUpper();
                        if (!EagleString.BaseFunc.OfficeValidate(office))
                        {
                            throw new Exception("请联系易格客服修改OFFICE号(工作号:为6位OFFICE号)");
                        }
                        menu.DropDownItems.Add
                            (office + "-" + lr.m_ls_office[i].IP_ID.ToString()
                            , null
                            , new EventHandler(sc));
                        if (!lsTemp.Contains(office))
                        {
                            lsTemp.Add(office);
                        }
                    }
                }

                //menu.DropDownItems.Add("-");
                lsTemp.Sort();
                for (int i = 0; i < lsTemp.Count; i++)
                {
                    //menu.DropDownItems.Add(lsTemp[i] + "-" + "集群");
                }
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.Message);
            }
        }
コード例 #3
0
        void LoginStep2()
        {
            try
            {
                if (string.IsNullOrEmpty(GlobalVar.loginName) || string.IsNullOrEmpty(GlobalVar.loginPassword))
                {
                    Stop();
                    MessageBox.Show("请输入B2B帐号和密码!");
                    return;
                }

                Login lg = new Login();
                //lg.login();
                string strRet;
                try
                {
                    strRet = lg.login();
                }
                catch { strRet = string.Empty; }

                if (string.IsNullOrEmpty(strRet))
                {
                    //不再尝试登陆,直接进入主界面!
                    MessageBox.Show("暂不能提取PNR等编码,请手工输入乘客信息!");
                    this.DialogResult      = DialogResult.OK;
                    GlobalVar.loginSuccess = true;
                    return;
                }

                GlobalVar.loginXml            = strRet;
                Options.GlobalVar.B2bLoginXml = strRet;
                Login_Classes           lc          = new Login_Classes(strRet);
                EagleString.LoginResult loginResult = new EagleString.LoginResult(strRet);
                bool isLogin = loginResult.SUCCEED;

                if (isLogin)//登陆成功
                {
                    if (lc.IPsString.Trim().Length < 7)
                    {
                        Stop();
                        MessageBox.Show("无可用的配置服务器,请与管理员联系!");
                        return;
                    }
                    if (lc.PassPort.Length != 32)
                    {
                        throw new Exception("未获取到PASSPORT,请重试!");
                    }

                    GlobalVar.loginLC      = lc;
                    GlobalVar.loginSuccess = true;
                    //this.Close();
                    this.DialogResult = DialogResult.OK;
                }
                else
                {
                    MessageBox.Show("登录B2B系统失败,详情:" + strRet);
                    Stop();
                    return;
                }
            }
            catch (Exception e)
            {
                this.BeginInvoke(new MethodInvoker(delegate
                {
                    MessageBox.Show("登录B2B系统出错:" + e.Message);
                    Stop();
                }));
            }
            return;
        }
コード例 #4
0
 public void SetDropDownMenu(EagleString.LoginResult lr, string ipid)
 {
     m_lr = lr;
     SetDropDownMenu(mnSwitchVisableConfig2, lr, ipid);
 }