Ejemplo n.º 1
0
        /// <summary>
        /// 用于创建公司,审核认证
        /// </summary>
        public void NewByUserDT(M_Plat_Comp compMod, DataTable userDT)
        {
            B_Plat_Group gpBll = new B_Plat_Group();

            for (int i = 0; i < userDT.Rows.Count; i++)
            {
                string gname = userDT.Rows[i]["gname"].ToString();
                string uname = userDT.Rows[i]["uname"].ToString();
                string honey = userDT.Rows[i]["honey"].ToString();
                if (string.IsNullOrEmpty(uname))
                {
                    continue;
                }
                M_UserInfo newmu = buser.NewUser(uname, "111111");
                newmu.HoneyName = honey;
                newmu.UserID    = buser.Add(newmu);
                M_Uinfo basemu = buser.NewBase(newmu);
                buser.AddBase(basemu);
                //----能力相关信息
                M_Plat_Group gpMod = gpBll.NewGroup(gname, compMod.ID, newmu.UserID);
                M_User_Plat  upMod = NewUser(newmu, compMod);
                gpMod.ID  = gpBll.Insert(gpMod);
                upMod.Gid = gpMod.ID.ToString();
                Insert(upMod);
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 提交会员信息
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void btnSave_Click(object sender, EventArgs e)
 {
     B_User bll = new B_User();
     userInfo.UserName = this.tbUserName.Text;
     userInfo.UserPwd = this.tbPwd.Text;
     userInfo.Question = this.tbQuestion.Text;
     userInfo.Answer = this.tbAnswer.Text;
     userInfo.Email = this.tbEmail.Text;
     userInfo.FaceHeight = Convert.ToInt32(this.tbPhoHeight.Text);
     userInfo.FaceWidth = Convert.ToInt32(this.tbPhoWidth.Text);
     userInfo.UserFace = this.tbPhotoPlace.Text;
     userInfo.RegTime = DataConverter.CDate(DateTime.Now.ToShortTimeString());
     userInfo.Sign = this.tbUserWrite.Text;
     userInfo.PrivacySetting = 0;
     bll.Add(userInfo);
 }
Ejemplo n.º 3
0
    protected void NextButtonStep5_Click(object sender, EventArgs e)
    {
        B_User buser = new B_User();
        string message=string.Empty;
        string strHostIP = "";
        IPHostEntry oIPHost = Dns.GetHostEntry(Environment.MachineName);
        if (oIPHost.AddressList.Length > 0)
            strHostIP = oIPHost.AddressList[0].ToString();

        string adminname = TxtAdminName.Text.ToString();
        string strtitle =TxtSiteTitle.Text.ToString();

        string Code = TxtSiteManageCode.Text;
        string pwd = TxtAdminPassword.Text.ToString();//管理员密码
        XmlDocument xmlDoc = new XmlDocument();
        xmlDoc.Load(Server.MapPath("../Config/Site.config"));
        XmlElement xmldocSelect = (XmlElement)xmlDoc.DocumentElement.SelectSingleNode("SiteInfo");
        XmlElement xe2 = (XmlElement)xmldocSelect.SelectSingleNode("SiteTitle");
        xe2.InnerText=strtitle;
        XmlNode xe3 = (XmlElement)xmldocSelect.SelectSingleNode("SiteUrl");//.ChildNodes
        xe3.InnerText = TxtSiteUrl.Text.ToString();
        XmlElement xmldocSelect2 = (XmlElement)xmlDoc.DocumentElement.SelectSingleNode("SiteOption");
        XmlElement xe5 = (XmlElement)xmldocSelect2.SelectSingleNode("SiteManageCode");
        xe5.InnerText = Code;
        xmlDoc.Save(Server.MapPath("../Config/Site.config"));

        //WebConfigurationManager.AppSettings["Installed"]="true";

        XmlDocument xmlDoc2 = new XmlDocument();
        xmlDoc2.Load(Server.MapPath("../Config/AppSettings.config"));
        XmlNodeList amde = xmlDoc2.SelectSingleNode("appSettings").ChildNodes;
        foreach (XmlNode xn in amde)
        {
            XmlElement xe = (XmlElement)xn;
            if (xe.GetAttribute("key").ToString() == "Installed")
                xe.SetAttribute("value", "true");
        }
        xmlDoc2.Save(Server.MapPath("../Config/AppSettings.config"));

        if (Install.Add("admin", pwd))
        {
            M_UserInfo muser = new M_UserInfo();
            muser.UserName = "******";
            muser.UserPwd = StringHelper.MD5(pwd);
            muser.RegTime = DateTime.Now;
            muser.LastLockTime = DateTime.MaxValue;
            muser.LastLoginTimes = DateTime.Now;
            muser.LastPwdChangeTime = DateTime.MaxValue;
            muser.Email = TxtEmail.Text;
            muser.Question ="admin";
            muser.Answer = StringHelper.MD5(pwd);
            muser.GroupID = 0;
            muser.UserFace = "";
            muser.Sign = "";
            muser.LastLoginIP = strHostIP;
            muser.CheckNum = new Random().ToString();
            buser.Add(muser);
            message="<script language=javascript> alert('安装完成!');</script>";
        }
        else
        {
            message="<script language=javascript> alert('安装配置失败!请检查后重新操作!');</script>";
        }
        if (!this.IsStartupScriptRegistered("message"))
        {
            Page.RegisterStartupScript("message", message);
        }
    }