//添加联系人 public void AddOrgContect(OrgContactModel orgModel) { SqlParameter[] parameters = { new SqlParameter("@loginName", SqlDbType.Char, 16), new SqlParameter("@organizationName", SqlDbType.VarChar, 100), new SqlParameter("@name", SqlDbType.VarChar, 20), new SqlParameter("@telCountry", SqlDbType.Char, 6), new SqlParameter("@telZone", SqlDbType.Char, 8), new SqlParameter("@tel", SqlDbType.VarChar, 100), new SqlParameter("@email", SqlDbType.VarChar, 50), new SqlParameter("@mobile", SqlDbType.VarChar, 30), new SqlParameter("@isdel", SqlDbType.Bit) }; parameters[0].Value = orgModel.LoginName; parameters[1].Value = orgModel.OrganizationName; parameters[2].Value = orgModel.Name; parameters[3].Value = orgModel.TelCountryCode; parameters[4].Value = orgModel.TelStateCode; parameters[5].Value = orgModel.TelNum; parameters[6].Value = orgModel.Email; parameters[7].Value = orgModel.Mobile; parameters[8].Value = orgModel.IsDel; try { DbHelperSQL.RunProcedure("OrgContectTab_Add", parameters); } catch (SqlException exp) { throw new Exception(exp.Message); } }
/// <summary> /// 获取联系人详细信息,结合注册信息 /// </summary> /// <param name="str"></param> /// <returns></returns> public Tz888.Model.Register.OrgContactModel getContactModel(string LoginName) { Tz888.SQLServerDAL.Conn con = new Conn(); Tz888.Model.Register.OrgContactModel model = new OrgContactModel(); DataTable dt = con.GetList("OrgContactTab", "*", "ContactID", 100, 1, 0, 1, "LoginName like '" + LoginName + "%'"); if (dt.Rows.Count > 0) { // model.ContactID = ContactID; model.LoginName = dt.Rows[0]["LoginName"].ToString(); model.OrganizationName = dt.Rows[0]["OrganizationName"].ToString(); model.Name = dt.Rows[0]["Name"].ToString(); model.Career = dt.Rows[0]["Career"].ToString(); model.TelCountryCode = dt.Rows[0]["TelCountryCode"].ToString(); model.TelStateCode = dt.Rows[0]["TelStateCode"].ToString(); model.TelNum = dt.Rows[0]["TelNum"].ToString(); //取消注释掉原来 model.FaxCountryCode = dt.Rows[0]["FaxCountryCode"].ToString(); model.FaxStateCode = dt.Rows[0]["FaxStateCode"].ToString(); model.FaxNum = dt.Rows[0]["FaxNum"].ToString(); model.PostCode = dt.Rows[0]["PostCode"].ToString(); model.Website = dt.Rows[0]["Website"].ToString(); //结束处 model.Email = dt.Rows[0]["Email"].ToString(); model.Mobile = dt.Rows[0]["Mobile"].ToString(); model.address = dt.Rows[0]["address"].ToString(); //返回 新加 职位 model.Position = dt.Rows[0]["Position"].ToString(); if (dt.Rows[0]["IsDel"].ToString() != "") { if ((dt.Rows[0]["IsDel"].ToString() == "1") || (dt.Rows[0]["IsDel"].ToString().ToLower() == "true")) { model.IsDel = true; } else { model.IsDel = false; } } model.remark = dt.Rows[0]["remark"].ToString(); return(model); } else { return(null); } }
private void sdt() { string loginName; string passWord; string nikeName; string email; string phone; string zone; string mobile; string groupName; //单位名称 string requirInfo; //意向 string country; string invite; string tel; string answer; string question; loginName = this.usrname.Value; passWord = Request.Form["repwd"]; nikeName = Request.Form["nikemame"]; email = Request.Form["email"]; tel = Request.Form["phone"]; groupName = Request.Form["comname"]; country = Request.Form["country"]; zone = Request.Form["zone"]; mobile = Request.Form["mobile"]; requirInfo = Request.Form["coop"]; invite = Request.Form["invite"]; answer = Request.Form["answer"]; question = Request.Form["question"]; phone = country + "-" + zone + "-" + tel; #region 验证提交的验证码并清空验证码 ///-------------------------------------------------- ///--验证提交的验证码并清空验证码 ///-------------------------------------------------- string vercode; vercode = Request.Form["vercode"]; string strRndNum = ""; //SESSION丢失 if (Session["valationNo"] == null) { Response.Write("<script>alert('操作超时!请刷新页面!');</script>"); return; } else { if (vercode.Trim() == "") { Response.Write("<script>alert('验证码不能为空,请重新提交!');</script>"); return; } else { strRndNum = Session["valationNo"].ToString(); if (vercode.Trim() != "" && vercode.ToLower().Trim() == strRndNum.ToLower()) { Session["valationNo"] = ""; } else { Response.Write("<script>alert('验证码错误,请重新提交!');</script>"); return; } } } #endregion //注册信息 SHA1 sha1 = SHA1.Create(); byte[] passWord2 = sha1.ComputeHash(Encoding.Unicode.GetBytes(passWord.Trim())); LoginInfoModel model = new LoginInfoModel(); if (Request.Cookies["adv_cpa"] != null) { HttpCookie logCook = Request.Cookies["adv_cpa"]; model.adsiteID = logCook.Value.ToString(); model.autoReg = 2; } model.CompanyName = this.comname.Value; model.LoginName = loginName; model.Password = passWord2; model.NickName = nikeName; model.PWDQuestion = question; model.PWDAnswere = answer; model.RoleName = "0";//会员 model.ManageTypeID = "2001"; model.MemberGradeID = "1001"; model.IsCheckUp = false; model.Email = email; model.Tel = phone; model.RequirInfo = requirInfo; //----联系信息 OrgContactModel orgModel = new OrgContactModel(); orgModel.Email = email; //邮箱 orgModel.IsDel = false; orgModel.LoginName = loginName; //登录名 orgModel.Mobile = mobile; //电话 orgModel.Name = this.contactname.Value; //用户真实姓名 orgModel.OrganizationName = this.comname.Value; //招商机构名称 orgModel.TelCountryCode = country; orgModel.TelNum = tel; orgModel.TelStateCode = zone; orgModel.address = this.TAddres.Value; //通讯地址 orgModel.PostCode = this.PpstCode.Value.ToString().Trim(); //邮编 //--------会员信息 MemberInfoModel memberModel = new MemberInfoModel(); memberModel.LoginName = loginName; //登录名 memberModel.NickName = nikeName; //昵称 memberModel.Email = email; //邮箱 memberModel.RequirInfo = requirInfo; memberModel.Tel = phone; //电话 memberModel.Mobile = mobile; //手机 memberModel.Birthday = DateTime.Now; //生日 memberModel.ContactTitle = this.contacttitle.Value.ToString().Trim(); //职位名称 memberModel.PostCode = this.PpstCode.Value.ToString().Trim(); //邮编 memberModel.CountryCode = this.ZoneSelectControl1.CountryID; //国别 memberModel.ProvinceID = this.ZoneSelectControl1.ProvinceID; //省 memberModel.CountyID = this.ZoneSelectControl1.CountyID; //市 memberModel.CityID = this.ZoneSelectControl1.CityID; //县 memberModel.Address = this.TAddres.Value; //地址 memberModel.MemberName = this.contactname.Value.ToString().Trim(); //用户真实姓名 LoginInfoBLL loginfo = new LoginInfoBLL(); common orgContect = new common(); MemberInfoBLL member = new MemberInfoBLL(); try { //向注册表写数据 try { loginfo.LogInfoAdd(model); } catch (System.Data.SqlClient.SqlException ex) { throw (new Exception(ex.Message)); } //政府注册 orgContect.AddOrgContect(orgModel); //会员信息 int i = member.MemberMessage_Insert(memberModel); //论坛会员注册 if (i > 0) { //BBS_Reg.Reg(nikeName, passWord, email); } //邀请注册 if (invite.Trim().Length > 0) { loginfo.InviterRegiste(Request.UserHostAddress, email, invite); } //添加邀请人 //if (loginName.Trim() != "" && invite.Trim() != "") //{ // AdSystem.Introducer ad = new AdSystem.Introducer(); // ad.AddIntroducer(loginName, invite); //} string encryEmail = Server.UrlEncode(DEncrypt.Encrypt(email)); string encryLogname = Server.UrlEncode(DEncrypt.Encrypt(loginName)); string act = Server.UrlEncode(DEncrypt.Encrypt("register")); string strPass = Server.UrlEncode(DEncrypt.Encrypt(passWord)); string ValidUrl = "ValidSuccessGov.aspx?email=" + encryEmail + "&logname=" + encryLogname + "&act=" + act + "&PassWord="******"数据提交时出错,注册失败。"); } finally { string encryEmail = Server.UrlEncode(DEncrypt.Encrypt(email)); string encryLogname = Server.UrlEncode(DEncrypt.Encrypt(loginName)); string act = Server.UrlEncode(DEncrypt.Encrypt("register")); string strPass = Server.UrlEncode(DEncrypt.Encrypt(passWord)); string ValidUrl = "ValidSuccessGov.aspx?email=" + encryEmail + "&logname=" + encryLogname + "&act=" + act + "&PassWord=" + strPass; Response.Redirect(ValidUrl, true); } }
private void Merchant() { //注册信息 SHA1 sha1 = SHA1.Create(); byte[] passWord2 = sha1.ComputeHash(Encoding.Unicode.GetBytes(this.txtpassWords.Value.ToString().Trim())); LoginInfoModel model = new LoginInfoModel(); if (Request.Cookies["adv_cpa"] != null) { HttpCookie logCook = Request.Cookies["adv_cpa"]; model.adsiteID = logCook.Value.ToString(); model.autoReg = 2; } model.CompanyName = ""; model.LoginName = this.txtloginName.Value.ToString().Trim(); model.Password = passWord2; model.NickName = ""; model.PWDQuestion = ""; model.PWDAnswere = ""; model.RoleName = "0";//会员 model.ManageTypeID = "2001"; model.MemberGradeID = "1001"; model.IsCheckUp = false; model.Email = this.txtemail.Value.ToString().Trim(); string phone = txtCount.Value.ToString().Trim() + "-" + txtStatCount.Value.ToString().Trim() + "-" + txtTel.Value.ToString().Trim(); model.Tel = phone; model.RequirInfo = "0"; //----联系信息 OrgContactModel orgModel = new OrgContactModel(); orgModel.Email = this.txtemail.Value.ToString().Trim();; //邮箱 orgModel.IsDel = false; orgModel.LoginName = this.txtloginName.Value.ToString().Trim(); //登录名 orgModel.Mobile = txtMoblie.Value.ToString().Trim(); //手机 orgModel.Name = ""; //用户真实姓名 orgModel.OrganizationName = ""; //招商机构名称 orgModel.TelCountryCode = txtCount.Value.ToString().Trim(); orgModel.TelNum = txtTel.Value.ToString().Trim(); orgModel.TelStateCode = txtStatCount.Value.ToString().Trim(); orgModel.address = ""; //通讯地址 orgModel.PostCode = ""; //邮编 //--------会员信息 MemberInfoModel memberModel = new MemberInfoModel(); memberModel.LoginName = this.txtloginName.Value.ToString().Trim(); //登录名 memberModel.NickName = ""; //昵称 memberModel.Email = this.txtemail.Value.ToString().Trim(); //邮箱 memberModel.RequirInfo = ""; memberModel.Tel = phone.ToString().Trim(); //电话 memberModel.Mobile = txtMoblie.Value.ToString().Trim(); //手机 memberModel.Birthday = DateTime.Now; //生日 memberModel.ContactTitle = ""; //招商机构名称 memberModel.PostCode = ""; //邮编 memberModel.CountryCode = null; //国别 memberModel.ProvinceID = null; //省 memberModel.CountyID = null; //市 memberModel.CityID = null; //县 memberModel.Address = ""; //地址 memberModel.MemberName = ""; //用户真实姓名 LoginInfoBLL loginfo = new LoginInfoBLL(); common orgContect = new common(); MemberInfoBLL member = new MemberInfoBLL(); try { //向注册表写数据 try { loginfo.LogInfoAdd(model); } catch (System.Data.SqlClient.SqlException ex) { throw (new Exception(ex.Message)); } //政府注册 orgContect.AddOrgContect(orgModel); //会员信息 int i = member.MemberMessage_Insert(memberModel); //邀请注册 //if (invite.Trim().Length > 0) //{ // loginfo.InviterRegiste(Request.UserHostAddress, email, invite); //} string encryEmail = Server.UrlEncode(DEncrypt.Encrypt(this.txtemail.Value.ToString().Trim())); string encryLogname = Server.UrlEncode(DEncrypt.Encrypt(this.txtloginName.Value.ToString().Trim())); string act = Server.UrlEncode(DEncrypt.Encrypt("register")); string strPass = Server.UrlEncode(DEncrypt.Encrypt(this.txtpassWords.Value.ToString().Trim())); string ValidUrl = "ValidSuccessGov.aspx?email=" + encryEmail + "&logname=" + encryLogname + "&act=" + act + "&PassWord="******"数据提交时出错,注册失败。"); } finally { string encryEmail = Server.UrlEncode(DEncrypt.Encrypt(this.txtemail.Value.ToString().Trim())); string encryLogname = Server.UrlEncode(DEncrypt.Encrypt(this.txtloginName.Value.ToString().Trim())); string act = Server.UrlEncode(DEncrypt.Encrypt("register")); string strPass = Server.UrlEncode(DEncrypt.Encrypt(this.txtpassWords.Value.ToString().Trim())); string ValidUrl = "ValidSuccessGov.aspx?email=" + encryEmail + "&logname=" + encryLogname + "&act=" + act + "&PassWord=" + strPass; Response.Redirect(ValidUrl, true); } }
//添加联系人 public void AddOrgContect(OrgContactModel orgModel) { dal.AddOrgContect(orgModel); }
protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { string loginName; string passWord; string nikeName; string email; string phone; string zone; string country; string mobile; string groupName;//单位名称 string invite; string countrycode; string province; string capital; string city; string address; string intent;//意向 decimal cap = 1111; string tel; string anwser; string question; loginName = this.usrname.Value; passWord = Request.Form["repwd"]; nikeName = Request.Form["nikename"]; email = Request.Form["email"]; tel = Request.Form["phone"]; groupName = Request.Form["comname"]; zone = Request.Form["zone"]; country = Request.Form["country"]; mobile = Request.Form["mobile"]; invite = Request.Form["invite"]; countrycode = Request.Form["CountryListCN"]; province = Request.Form["provinceCN"]; capital = Request.Form["capitalCN"]; city = Request.Form["cityCN"]; address = Request.Form["address"]; intent = Request.Form["intent"]; anwser = Request.Form["answer"]; question = Request.Form["question"]; phone = country + "-" + zone + "-" + tel; #region 验证提交的验证码并清空验证码 ///-------------------------------------------------- ///--验证提交的验证码并清空验证码 ///-------------------------------------------------- string vercode = Request.Form["vercode"]; string strRndNum = ""; //SESSION丢失 if (Session["valationNo"] == null) { Response.Write("<script>alert('操作超时!请刷新页面!');</script>"); return; } else { if (vercode.Trim() == "") { Response.Write("<script>alert('验证码不能为空,请重新提交!');</script>"); return; } else { strRndNum = Session["valationNo"].ToString(); if (vercode.Trim() != "" && vercode.ToLower().Trim() == strRndNum.ToLower()) { Session["valationNo"] = ""; } else { Response.Write("<script>alert('验证码错误,请重新提交!');</script>"); return; } } } #endregion if (capital != "") { cap = Convert.ToDecimal(capital); } //注册信息 SHA1 sha1 = SHA1.Create(); byte[] passWord2 = sha1.ComputeHash(Encoding.Unicode.GetBytes(passWord.Trim())); LoginInfoModel model = new LoginInfoModel(); model.LoginName = loginName; model.Password = passWord2; model.NickName = nikeName; model.PWDAnswere = anwser; model.PWDQuestion = question; model.RoleName = "0";//会员 model.ManageTypeID = "1003"; model.MemberGradeID = "1001"; model.IsCheckUp = false; model.Email = email; model.Tel = phone; model.RequirInfo = intent; //--------会员信息 MemberInfoModel memberModel = new MemberInfoModel(); memberModel.LoginName = loginName; memberModel.NickName = nikeName; memberModel.Email = email; memberModel.Tel = phone; memberModel.Mobile = mobile; memberModel.CountryCode = country; memberModel.CountyID = city; memberModel.ProvinceID = province; memberModel.RequirInfo = intent; memberModel.Address = address; memberModel.Birthday = DateTime.Now; OrgContactModel contactModel = new OrgContactModel(); contactModel.address = address; contactModel.IsDel = false; contactModel.Mobile = mobile; contactModel.OrganizationName = groupName; contactModel.Email = email; contactModel.LoginName = loginName; contactModel.Name = ""; contactModel.TelCountryCode = country; contactModel.TelNum = tel; contactModel.TelStateCode = zone; contactModel.FaxCountryCode = country; LoginInfoBLL loginfo = new LoginInfoBLL(); common orgContact = new common(); MemberInfoBLL member = new MemberInfoBLL(); //向注册表写数据 try { try { loginfo.LogInfoAdd(model); } catch (System.Data.SqlClient.SqlException exp) { throw (new Exception(exp.Message)); } //企业注册 orgContact.AddOrgContect(contactModel); //会员信息 int i = member.MemberMessage_Insert(memberModel); //论坛会员注册 if (i > 0) { BBS_Reg.Reg(nikeName, passWord, email); } //邀请注册处理 if (invite.Trim().Length > 0) { loginfo.InviterRegiste(Request.UserHostAddress, email, invite); } //添加邀请人 if (loginName.Trim() != "" && invite.Trim() != "") { AdSystem.Introducer ad = new AdSystem.Introducer(); ad.AddIntroducer(loginName, invite); } string encryEmail = Server.UrlEncode(DEncrypt.Encrypt(email)); string encryLogname = Server.UrlEncode(DEncrypt.Encrypt(loginName)); string act = Server.UrlEncode(DEncrypt.Encrypt("register")); string ValidUrl = "ValidSuccessEnter.aspx?email=" + encryEmail + "&logname=" + encryLogname + "&act=" + act; Response.Redirect(ValidUrl, true); } catch (Exception ex) { Response.Write(ex.Message); //Tz888.Common.MessageBox.ShowBack("数据提交时出错,注册失败。"); } }
public void getMessageForAdd() { Tz888.BLL.Register.common obj1 = new common(); Tz888.Model.Register.OrgContactModel mod1 = new OrgContactModel(); Tz888.BLL.Conn obj2 = new Tz888.BLL.Conn(); string sUserName = Page.User.Identity.Name; //会员注册信息MemberInfoVIW DataTable dt = obj2.GetList("LoginInfoTab", "ManageTypeID,RealName,Email", "LoginName", 1, 1, 0, 1, "LoginName='" + sUserName + "'"); if (dt.Rows.Count > 0) { string InfoManageType = dt.Rows[0]["ManageTypeID"].ToString().Trim(); if (Page.User.IsInRole("MT2003")) { managetype.Text = "项目方"; this.ViewState["ManageType"] = "2003"; } if (Page.User.IsInRole("MT2002")) { managetype.Text = "投资机构"; this.ViewState["ManageType"] = "2002"; } if (Page.User.IsInRole("MT2001")) { managetype.Text = "政府机构"; this.ViewState["ManageType"] = "2001"; } tbRealName.Text = dt.Rows[0]["RealName"].ToString(); //rblSex.SelectedValue = dt.Rows[0]["Sex"].ToString(); DataTable dt1 = obj2.GetList("memberInfoTab", "sex", "LoginName", 1, 1, 0, 1, "LoginName='" + sUserName + "'"); if (dt != null && dt.Rows.Count > 0) { bool bSex = false; if (dt1.Rows[0]["Sex"].ToString() != "") { bSex = Convert.ToBoolean(dt1.Rows[0]["Sex"]); } if (bSex) { rblSex.SelectedIndex = 1; //女 } else { rblSex.SelectedIndex = 0; } } // txtMobile.Text = dt.Rows[0]["Mobile"].ToString(); txtEmail.Text = dt.Rows[0]["Email"].ToString(); } //会员公司登记信息 mod1 = obj1.getContactModel(sUserName); if (mod1 != null) { tbOrgName.Text = mod1.OrganizationName; tbPosition.Text = mod1.Career; txtTelCountry.Text = mod1.TelCountryCode; txtTelZoneCode.Text = mod1.TelStateCode; txtTelNumber.Text = mod1.TelNum; } }