Esempio n. 1
0
        /// <summary>
        /// 将散拼信息显示在ListView中
        /// </summary>
        /// <param name="username">当前登陆用户帐号</param>
        /// <param name="fromto">城市对</param>
        /// <param name="dt">航班日期</param>
        /// <param name="userclass">用户级别A,B,C,D,E,F</param>
        /// <param name="wsaddr">WebService地址</param>
        /// <param name="lv">指向LV_GroupList的ListView</param>
        public static void GroupResultToListView_Group
            (string username, string fromto, DateTime dt, char userclass, string wsaddr, ListView lv)
        {
            EagleWebService.kernalFunc kf = new EagleWebService.kernalFunc(wsaddr);
            string groupstring            = kf.Group_List(username, fromto, dt, userclass);

            EagleExtension.GroupResultToListView_Group(groupstring, lv);
        }
Esempio n. 2
0
        /// <summary>
        /// 登录
        /// </summary>
        /// <param name="isB2c">是否B2C</param>
        /// <param name="b2cService">B2C服务地址</param>
        /// <param name="b2cManager">B2C后台地址</param>
        /// <param name="username">用户名</param>
        /// <param name="password">密码</param>
        /// <param name="lp">网络线路,电信:0,网通:1</param>
        /// <param name="resB2c">B2C结果</param>
        /// <param name="loginInfo">返回结果</param>
        public static void login2server(
            bool isB2c,
            string b2cService,
            string b2cManager,
            string username,
            string password,
            EagleString.LineProvider lp,
            EagleString.LoginResultBtoc.LOGIN_INFO_BTOC resB2c,
            ref EagleString.LoginInfo loginInfo
            )
        {
            loginInfo.borc = (isB2c ? LoginInfo.BORC.b2c : LoginInfo.BORC.b2b);
            if (isB2c)
            {
                EagleExtension.LoginB2c(username, password, ref resB2c, b2cManager, b2cService);
                loginInfo.b2c.username   = username;
                loginInfo.b2c.password   = password;
                loginInfo.b2c.webservice = b2cService;
                loginInfo.b2c.website    = b2cManager;
                loginInfo.b2c.lr         = resB2c;
            }
            string loginb2bxml = "";

            //here todo: get b2b webservice address
            EagleString.ServerCenterB2B scb2b = new ServerCenterB2B();

            string b2bWebSite    = "";
            string b2bWebService = "";

            scb2b.ServerAddressB2B(EagleFileIO.Server, lp, 0, ref b2bWebService, ref b2bWebSite);
            EagleWebService.kernalFunc kf = new EagleWebService.kernalFunc(b2bWebService);
            bool   flagLogin = false;
            string b2buser   = username;
            string b2bpass   = password;

            if (isB2c)
            {
                b2buser = resB2c.mapuser;
                b2bpass = resB2c.mappass;
            }
            kf.LogIn(b2buser, b2bpass, ref loginb2bxml, ref flagLogin);
            if (!flagLogin)
            {
                throw new Exception("登录B2B失败,请检查网络及用户名密码是否正确!");
            }
            EagleString.LoginResult lr = new LoginResult(loginb2bxml);
            if (lr.EXPIRED)
            {
                throw new Exception("该B2B用户已失效!");
            }
            if (lr.AGENT_STAT != 0)
            {
                throw new Exception("该B2B用户所在代理商已失效!");
            }
            if (lr.USER_STAT != 0)
            {
                throw new Exception("该B2B用户状态已失效!");
            }

            loginInfo.b2b.username   = b2buser;
            loginInfo.b2b.password   = b2bpass;
            loginInfo.b2b.webservice = b2bWebService;
            loginInfo.b2b.webside    = b2bWebSite;
            loginInfo.b2b.lr         = lr;
        }