Exemple #1
0
        /// <summary>
        /// 密码取回
        /// </summary>
        private void GetPassWord()
        {
            DataTable dtList = ds.Tables["List"];

            string strVexSSOLoginUser = dtList.Rows[0]["LoginUser"].ToString();
            string strAuthCode = dtList.Rows[0]["AuthCode"].ToString();

            if (strVexSSOLoginUser == "")
            {
                throw new Exception("SSO用户名不能为空。");
            }


            //验证码是否正确
            if (strAuthCode == "")
            {
                throw new Exception("验证码不能为空。");
            }
            else
            {
                VexSSOAuthCode cls = new VexSSOAuthCode();
                cls.Conn = m_conn;
                cls.CheckAuthCode(strVexSSOLoginUser, strAuthCode, "GetPassWord");
            }

            string strPassWord = m_conn.GetDataTableFirstValue(@"SELECT VexSSOPassWord FROM B01_MDM.[VEXSSOUser] WHERE 
                                                    VexSSOLoginUser=@PARAM0 AND ISNULL(Disabled, 0) = 0", new string[] { strVexSSOLoginUser }).ToString();
            if (strPassWord == "")
            {
                throw new Exception("帐户不存在!");
            }

            dt_EditResult.Clear(); //清除在绑定时写入的信息
            m_dsRequturn = new DataSet();
            dt_EditResult.Rows.Add(new object[] { true, strPassWord });

            m_dsRequturn.Tables.Add(dt_EditResult.Copy());
        }
Exemple #2
0
        /// <summary>
        /// 用户注册
        /// </summary>
        private void SignUp()
        {
            DataTable dtList = ds.Tables["List"];
            DataTable dtVexSSO = new MDM.VEXSSOUserDataTable();

            int nCount = 0;

            VexSSOAccreditatio clsVexSSOAccreditatio = new VexSSOAccreditatio();

            string strVexSSOLoginUser = dtList.Rows[0]["LoginUser"].ToString();
            string strAuthCode = dtList.Rows[0]["AuthCode"].ToString();
            string strAccreditationType = "";
            if (dtList.Columns.Contains("AccreditationType"))
            {
                strAccreditationType = dtList.Rows[0]["AccreditationType"].ToString().ToUpper();
            }

            if (strVexSSOLoginUser == "")
            {
                throw new Exception("SSO用户名不能为空。");
            }

            if (dtList.Rows[0]["PassWord"].ToString() == "")
            {
                throw new Exception("SSO密码不能为空。");
            }

            //验证码是否正确
            if (strAuthCode == "")
            {
                throw new Exception("验证码不能为空。");
            }
            else
            {
                VexSSOAuthCode cls = new VexSSOAuthCode();
                cls.Conn = m_conn;
                cls.CheckAuthCode(strVexSSOLoginUser, strAuthCode, "SignUp");
            }

            nCount = m_conn.GetDataTableRowCount(@"SELECT 1 AS A FROM B01_MDM.[VEXSSOUser] WHERE 
                                                    VexSSOLoginUser=@PARAM0 AND ISNULL(Disabled,0)=0", new string[] { strVexSSOLoginUser });
            if (nCount > 0)
            {
                throw new Exception("该手机号码已被注册!");
            }

            string strVexSSONewID = Guid.NewGuid().ToString();
            DataRow dr = dtVexSSO.NewRow();
            dr["VexSSONewID"] = strVexSSONewID;
            dr["VexSSOLoginUser"] = strVexSSOLoginUser;
            dr["VexSSOPassWord"] = dtList.Rows[0]["PassWord"];
            dr["VexSSOPassWordMd52"] = Common.Common.GetMD5(Common.Common.GetMD5(dr["VexSSOPassWord"].ToString()));
            dr["Disabled"] = "0";

            dtVexSSO.Rows.Add(dr);

            m_conn.HZYMessage = this.hzyMessage;
            m_conn.InsertByVex("B01_MDM.VEXSSOUser", dtVexSSO);


            if (strAccreditationType.Trim() != "")
            {
                m_SSOCheck = false;
                this.Bind();//进行账户绑定

                //更新Info表的用户姓名
                DataTable dtInfo = new MDM.VexSSOUserInfoDataTable();
                DataRow drInfo = dtInfo.NewRow();
                drInfo["VexSSONewId"] = strVexSSONewID;
                drInfo["Name"] = m_BindsysInfo.User_Name_CN;
                dtInfo.Rows.Add(drInfo);

                m_conn.InsertByVex("B01_MDM.VexSSOUserInfo", dtInfo);
            }

            dt_EditResult.Clear(); //清除在绑定时写入的信息
            m_dsRequturn = new DataSet();
            dt_EditResult.Rows.Add(new object[] { true, "注册成功!" });

            m_dsRequturn.Tables.Add(dt_EditResult.Copy());
        }