Esempio n. 1
0
        public string AgencyLogin(string userName, string pwd, string role, string isCookie)
        {
            string result = new MT4AccountBll().DGMFXLogIn(userName, pwd, role);

            if (result == "Success")
            {
                DGMUserInfo userInfo = new MT4AccountBll().GetAccountInfo(userName);

                if (userInfo != null)
                {
                    userInfo.DGMUser_Login   = userName;
                    userInfo.DGMUser_Pwd     = pwd;
                    userInfo.DGMUser_Role    = role;
                    userInfo.DGMUser_Account = new MT4AccountBll().GetAccountByAccountNumberLogin(userName);
                    Session["DGMUserInfo"]   = userInfo;
                    if (userInfo.DGMUser_Account == null)//系统后台是否录入数据
                    {
                        InsertLogs(new UserLog {
                            Account = userName, Explain = "登入系统", LogDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), LogIP = IPHelper.GetIp(), Property1 = "登录失败,账户信息不全"
                        });
                        result = "NotPlatformAccountInfo";
                    }
                    else
                    {
                        HttpCookie cookie = new HttpCookie("MT4User");//初使化并设置Cookie的名称
                        cookie.Values.Add("login", userName);
                        cookie.Values.Add("userName", userInfo.DGMUser_Name);
                        cookie.Values.Add("role", role);
                        cookie.Values.Add("IsCookie", isCookie);
                        if (Convert.ToBoolean(isCookie))
                        {
                            cookie.Expires = DateTime.Now.AddDays(1.0);
                        }
                        else
                        {
                            cookie.Expires = DateTime.Now.AddHours(2.0);
                        }
                        Response.SetCookie(cookie);
                        InsertLogs(new UserLog {
                            Account = userName, Explain = "登入系统", LogDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), LogIP = IPHelper.GetIp(), Property1 = "登录成功"
                        });
                    }
                }
                else
                {
                    InsertLogs(new UserLog {
                        Account = userName, Explain = "登入系统", LogDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), LogIP = IPHelper.GetIp(), Property1 = "登录失败,账户信息不全"
                    });
                    result = "NotPlatformAccountInfo";
                }
            }
            else
            {
                InsertLogs(new UserLog {
                    Account = userName, Explain = "登入系统", LogDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), LogIP = IPHelper.GetIp(), Property1 = "登录失败,用户名或密码错误"
                });
                result = "Failure";
            }
            return(result);
        }
Esempio n. 2
0
        public JsonResult Mt4AccountInfo()
        {
            DGMUserInfo user = Session["DGMUserInfo"] as DGMUserInfo;
            DGMUserInfo info = new MT4AccountBll().GetAccountInfo(user.DGMUser_Login);

            return(Json(info));
        }
Esempio n. 3
0
        public string ShowAccountInfo(string login)
        {
            string        aa       = "";
            DGMUserInfo   userInfo = Session["DGMUserInfo"] as DGMUserInfo;
            MT4AccountBll mt4Bll   = new MT4AccountBll();

            userInfo = mt4Bll.GetAccountInfo(login);
            userInfo.DGMUser_Account = new AccountBll().GetAccountByAccountNumber(login);
            if (userInfo != null && userInfo.DGMUser_Account != null)
            {
                string AccountName  = userInfo.DGMUser_Account.CH_Surname + userInfo.DGMUser_Account.CH_Name; //姓名
                string AccountLogin = userInfo.DGMUser_Login;                                                 //账户
                string AccountEmail = userInfo.DGMUser_Account.Email;                                         //邮箱
                string pwd          = userInfo.DGMUser_Account.AccountPassword;
                aa += AccountName + "#" + AccountLogin + "#" + AccountEmail + "#" + pwd;
                ApplyForLiveAccountBll applyBll       = new ApplyForLiveAccountBll();
                ProfessionInfo         professioninfo = applyBll.GetProfessionInfoByAccountInformationId(userInfo.DGMUser_Account.InformationId);
                PersonalInformation    personal       = applyBll.GetPersonalInformationByProfessionInfoPersonalInformationId(professioninfo.PersonalInformationId);
                if (personal != null)
                {
                    string AccountPhone   = personal.PhoneNumber; //电话
                    string AccountAddress = personal.LiveAddress; //地址
                    //string AccountRevenue = professioninfo.BEFOREYearRevenue;//税前年收入
                    //string AccountInvested = professioninfo.DepositAndInvestment;//储蓄和投资总额
                    aa += "#" + AccountPhone + "#" + AccountAddress;
                }
            }
            return(aa);
        }