private void GetReader(int userId) { XYECOM.Business.UserInfo userInfoBLL = new XYECOM.Business.UserInfo(); XYECOM.Business.UserReg regBLL = new UserReg(); XYECOM.Model.UserInfo userInfo = userInfoBLL.GetItem(userId); XYECOM.Model.UserRegInfo reginfo = regBLL.GetItem(userId); //企业信息 if (userInfo != null) { this.lbcompanyname.InnerHtml = userInfo.Name;//公司名称 this.phone.InnerHtml = userInfo.Telephone; this.address.InnerHtml = userInfo.Address; this.linkman.InnerHtml = userInfo.LinkMan; this.tdDescription.InnerHtml = userInfo.Description; this.area.InnerHtml = userInfo.AreaInfo.FullNameAll; } this.U_ID.Value = userId.ToString(); //用户基本信息 if (userInfo.RegInfo != null) { this.mail.InnerHtml = userInfo.RegInfo.Email; this.Email.Value = userInfo.RegInfo.Email; this.othercontract.InnerHtml = userInfo.RegInfo.OtherContact;//担任职位 } }
/// <summary> /// 绑定要修改的新闻信息 /// </summary> /// <param name="id">要修改的新闻ID</param> private void NewsDataBind(Int64 id) { newsInfo = new XYECOM.Business.News().GetItem(newsId); if (newsInfo != null) { string newstypeckId = ""; //新闻类型 if (newsInfo.Type == XYECOM.Model.NewsType.TextNews) { this.rbcommonnews.Checked = true; this.rbpicnews.Checked = false; this.rbcaptionnews.Checked = false; newstypeckId = this.rbcommonnews.ClientID; } else if (newsInfo.Type == XYECOM.Model.NewsType.ImageNews) { this.rbpicnews.Checked = true; this.rbcommonnews.Checked = false; this.rbcaptionnews.Checked = false; newstypeckId = this.rbpicnews.ClientID; } else if (newsInfo.Type == XYECOM.Model.NewsType.HeadlineNews) { this.rbcaptionnews.Checked = true; this.rbcommonnews.Checked = false; this.rbpicnews.Checked = false; newstypeckId = this.rbcaptionnews.ClientID; } this.tbnewsname.Text = newsInfo.Title; //if (newsInfo.FileUrl != "") //{ // rbfileUrl.Checked = true; // txtfileUrl.Text = newsInfo.FileUrl; //} if (!newsInfo.TitleStyle.Equals("")) { string[] strs = newsInfo.TitleStyle.Split(';'); foreach (string s in strs) { if (s.Equals("")) continue; string[] ss = s.Split(':'); if (ss.Length != 2) continue; if (ss[0].Equals("color")) { this.txtTitleColor.Value = ss[1]; this.selTitleColor.Value = ss[1]; } if (ss[0].Equals("font-weight")) this.chkFontBold.Checked = true; if (ss[0].Equals("font-style")) this.chkFontItalic.Checked = true; if (ss[0].Equals("text-decoration")) this.chkFontUnderline.Checked = true; } } if (newsInfo.TypeIds != "") { this.hdgetid.Value = XYECOM.Core.Utils.RemoveComma(newsInfo.TypeIds.ToString()); } hidTopicID.Value = newsInfo.TopicType; this.tbtwoname.Text = newsInfo.SubTitle; this.reswords.Text = newsInfo.Keyword; this.tbnewsness.Text = newsInfo.Leadin; this.tblinkaddress.Text = newsInfo.HeadlineNewsUrl; //附件信息 DataTable tableAttInfo = new XYECOM.Business.Attachment().GetDataTable(newsInfo.NewsId, XYECOM.Model.AttachmentItem.News, XYECOM.Model.UploadFileType.Image); string uploadTypeckId = ""; if (tableAttInfo.Rows.Count > 0 && newsInfo.PicUrl.Equals("Image")) { this.rbpicupload.Checked = true; this.rbpicurl.Checked = false; uploadTypeckId = this.rbpicupload.ClientID; } else { this.hipictype.Value = "-1"; this.hdpicurl.Value = newsInfo.PicUrl; this.rbpicurl.Checked = true; this.rbpicupload.Checked = false; this.tbpinurl.Value = newsInfo.PicUrl; uploadTypeckId = this.rbpicurl.ClientID; } this.tbnewsauthor.Text = newsInfo.Author; this.ddlnewsauthor.SelectedValue = this.tbnewsauthor.Text.Trim(); this.tbnewsorigin.Text = newsInfo.Origin; this.ddlnewsorigin.SelectedValue = this.tbnewsorigin.Text.Trim(); this.newsBody.Value = newsInfo.Content; if (newsInfo.AddTime != "") { try { this.tbaddtime.Value = Convert.ToDateTime(newsInfo.AddTime).ToShortDateString(); } catch { this.tbaddtime.Value = DateTime.Now.ToShortDateString(); } } this.tbcount.Text = newsInfo.ClickNumber.ToString(); this.cbIsFlag.Checked = newsInfo.IsCommend; this.cbIsDiscuss.Checked = newsInfo.IsAllowComment; this.cbIsTop.Checked = newsInfo.IsTop; this.cbIsHot.Checked = newsInfo.IsHot; this.cbIsSlide.Checked = newsInfo.IsSlide; if (newsInfo.State == XYECOM.Model.AuditingState.NoPass) { this.cbAuditing.Checked = false; } if (newsInfo.State == XYECOM.Model.AuditingState.Passed) { this.cbAuditing.Checked = true; } if (newsInfo.ChargeState != "1") { if (newsInfo.HTMLPage != "") { this.cbcreate.Checked = true; } } else { this.cbcreate.Enabled = false; } if (newsInfo.Contributor.Equals(0)) { this.IsContributor.Visible = false; } else { if (newsInfo.Contributor.ToString() == "-1") { this.Contributor.InnerHtml = "<a href=\"#\">游客</a>"; } else { XYECOM.Business.UserReg urBLL = new UserReg(); XYECOM.Model.UserRegInfo urinfo = new XYECOM.Model.UserRegInfo(); urinfo = urBLL.GetItem(newsInfo.Contributor); if (!urinfo.Type) this.Contributor.InnerHtml = "<a href=\"../UserManage/IndividualInfo.aspx?U_ID=" + newsInfo.Contributor + "&backURL=../news/AddNews.aspx?id=" + newsId + "&" + XYECOM.Core.XYRequest.GetQueryString("backURL") + "\">" + newsInfo.Author + "(个人会员)</a>"; else this.Contributor.InnerHtml = "<a href=\"../UserManage/UserInfo.aspx?U_ID=" + newsInfo.Contributor + "&backURL=../news/AddNews.aspx?id=" + newsId + "&" + XYECOM.Core.XYRequest.GetQueryString("backURL") + "\">" + newsInfo.Author + "(企业会员)</a>"; } } this.city.Value = XYECOM.Core.Utils.RemoveComma(newsInfo.AreaIds); this.tradeid.Value = XYECOM.Core.Utils.RemoveComma(newsInfo.TradeIds); this.offerid.Value = XYECOM.Core.Utils.RemoveComma(newsInfo.ProtypeIds); InitOption(newsInfo.FileUrl); ClientScript.RegisterStartupScript(GetType(), Guid.NewGuid().ToString(), "myclick('" + newstypeckId + "','click');", true); ClientScript.RegisterStartupScript(GetType(), Guid.NewGuid().ToString(), "myclick('" + uploadTypeckId + "','click');", true); if (newsInfo.IsScheme == 1) this.cbIsScheme.Checked = true; if (newsInfo.IsScheme != 0 && newsInfo.ProIds != null) { string StrHtml = ""; string[] IdsArry = newsInfo.ProIds.Split(','); string ItemStr = ""; for (int i = 0; i < IdsArry.Length; i++) { if (IdsArry[i] != null) { XYECOM.Model.SupplyInfo SupplyInfo = SupplyBLL.GetSupplyById(XYECOM.Core.MyConvert.GetInt32(IdsArry[i])); StrHtml += "<input checked='checked' onclick=\"Selectchange('" + IdsArry[i] + "')\" type='checkbox' id='cbsel_" + IdsArry[i] + "' value='" + IdsArry[i] + "'/><label>" + SupplyInfo.Title + "</label>"; ItemStr += IdsArry[i] + ":" + SupplyInfo.Title + ","; } } this.Infostxt.Text = StrHtml; this.HidItemStr.Value = ItemStr.Substring(0, ItemStr.Length - 1); } } }
protected string Link(string id) { if (id == "-1") { return "游客"; } XYECOM.Business.UserReg urBLL = new UserReg(); XYECOM.Model.UserRegInfo urinfo = new XYECOM.Model.UserRegInfo(); urinfo = urBLL.GetItem(XYECOM.Core.MyConvert.GetInt64(id)); if (urinfo == null) { return "用户已删除"; } if (!urinfo.Type) return "<a href='../UserManage/IndividualInfo.aspx?U_ID=" + id + "&backURL=../news/ContributorList.aspx'>" + urinfo.LoginName + "</a><br/>(个人会员)"; else return "<a href='../UserManage/UserInfo.aspx?U_ID=" + id + "&backURL=../news/ContributorList.aspx'>" + urinfo.LoginName + "</a><br/>(企业会员)"; }
private void GetReader(int userId) { XYECOM.Business.UserInfo userInfoBLL = new XYECOM.Business.UserInfo(); XYECOM.Business.UserAccount userAccountBLL = new XYECOM.Business.UserAccount(); XYECOM.Business.UserFictitiouCount userFictitiouCountBLL = new XYECOM.Business.UserFictitiouCount(); XYECOM.Business.UserLogin userLoginBLL = new UserLogin(); XYECOM.Business.Auditing auditingBLL = new Auditing(); XYECOM.Business.UserReg regBLL = new UserReg(); XYECOM.Model.UserInfo userInfo = userInfoBLL.GetItem(userId); XYECOM.Model.UserRegInfo reginfo = regBLL.GetItem(userId); //XYECOM.Model.UserAccountInfo userAccountInfo = userAccountBLL.GetItem(userId); XYECOM.Model.UserFictitiouCountInfo userFictitiouCountInfo = userFictitiouCountBLL.GetItem(userId); XYECOM.Model.UserLoginInfo userLoginInfo = userLoginBLL.GetItem(userId); XYECOM.Model.AuditingInfo atinfo = auditingBLL.GetItem(userId.ToString(), "u_User"); //企业信息 if (userInfo != null) { this.lbcompanyname.InnerHtml = userInfo.Name + " <a href=\"UserMoreInfo.aspx?U_ID=" + userId.ToString() + "&backURL=" + XYECOM.Core.Utils.JSEscape(XYECOM.Core.XYRequest.GetQueryString("backURL")) + "\">查看(编辑)公司详细资料>></a> <a href='EnterUserCenter.aspx?u_id=" + userId + "' target='_blank'>进入企业会员中心>></a>"; //公司名称 this.lbsection.InnerHtml = userInfo.Section;//所在部门 this.lbpost.InnerHtml = userInfo.Post;//担任职位 this.lblevel.InnerHtml = userInfo.RegInfo.GradeInfo.GradeName + " <a href=\"ChangeUserGrade.aspx?ui=" + userId.ToString() + "&BackURL=" + XYECOM.Core.Utils.JSEscape(XYECOM.Core.XYRequest.GetQueryString("backURL")) + "\">更改会员等级>></a>";//更改会员等级 this.phone.InnerHtml = userInfo.Telephone; this.linkman.InnerHtml = userInfo.LinkMan; } this.U_ID.Value = userId.ToString(); //用户基本信息 if (userInfo.RegInfo != null) { this.mail.InnerHtml = userInfo.RegInfo.Email; this.Email.Value = userInfo.RegInfo.Email; this.lbmark.InnerHtml = userInfo.RegInfo.Mark.ToString();//用户积分 } //虚拟账户信息 this.lbfcleftmoney.InnerHtml = userFictitiouCountInfo.C_LeftMoney.ToString(".#");//虚拟账户余额 if (userLoginInfo != null) { this.regip.InnerHtml = userLoginInfo.RegIP; this.lastloginip.InnerHtml = userLoginInfo.LastLoginIP; this.lastlogintime.InnerHtml = userLoginInfo.LastLoginDate.ToString(); ; this.loginnum.InnerHtml = userLoginInfo.LoginNum.ToString(); } else { this.regip.InnerHtml = "暂无信息"; this.lastloginip.InnerHtml = "暂无信息"; this.lastlogintime.InnerHtml = "暂无信息"; this.loginnum.InnerHtml = "暂无信息"; } if (userInfo.RegInfo.AuditingState == XYECOM.Model.AuditingState.Null) { this.lbmessage.Text = "未审核"; } else if (userInfo.RegInfo.AuditingState == XYECOM.Model.AuditingState.Passed) { this.lbmessage.Text = "通过审核"; this.Button5.Enabled = false; } else if (userInfo.RegInfo.AuditingState == XYECOM.Model.AuditingState.NoPass) { this.lbmessage.Text = "未通过审核"; if (atinfo != null) { if (atinfo.A_Reason != "" || atinfo.A_Advice != "") { this.plreason.Visible = true; if (atinfo.A_Reason != "") { this.labreason.Text = atinfo.A_Reason; this.tbA_Reason.Text = atinfo.A_Reason; } else { this.labreason.Text = "暂无原因"; this.tbA_Reason.Text = "暂无原因"; } if (atinfo.A_Advice != "") { this.labadv.Text = atinfo.A_Advice; this.tbA_Advice.Text = atinfo.A_Advice; } else { this.labadv.Text = "暂无建议"; this.tbA_Advice.Text = "暂无建议"; } } } } }
public bool verifyUser(UserReg login) { return(true); }
public void Post([FromBody] UserReg user) { database.UserRegAdd(user.Firstname, user.Lastname, user.Email); }
public List <UserReg> Get([FromBody] UserReg user) { return(database.UserRegFind(user)); }
public IHttpActionResult getUserProfile(int userId, string password, bool register) { UserReg user = db.UserRegs.Find(userId); returnUser ru; //this user id does not exist and user wants to login if (user == null && register == false) { ru = new returnUser { status = 0, code = 1 }; return(Ok(ru)); }// user id exist but user is trying to register else if (user != null && register == true) { ru = new returnUser { status = 0, code = 2 }; return(Ok(ru)); }// user id exists and user is trying to login else if (user != null && register == false) { //check the user's password if (user.Password == password) { ru = new returnUser { status = 1, code = 0 }; return(Ok(ru)); } else { ru = new returnUser { status = 0, code = 1 }; return(Ok(ru)); } } else if (user == null && register == true) { //register the user UserReg newUser = new UserReg { UserId = userId, Password = password }; db.UserRegs.Add(newUser); try { db.SaveChanges(); } catch { return(BadRequest("Error registering new user")); } ru = new returnUser { status = 0, code = 0 }; return(Ok(ru)); } else { return(BadRequest("Error registering new user")); } }
public Response RegisterUser(UserReg model) { try { var response = new Response(); string jsonResult = ""; DataSet ds = null; ds = blObj.ResgerUser(model); if (ds != null && ds.Tables.Count > 0) { if (ds.Tables[0].Rows[0]["Statuscode"].ToString() == "200") { blObj.mail(ds.Tables[0].Rows[0]["UserId"].ToString(), "Reg"); RegResponse usrreg = new RegResponse(); usrreg.Message = ds.Tables[0].Rows[0]["Message"].ToString(); usrreg.FirstName = ds.Tables[0].Rows[0]["FirstName"].ToString(); usrreg.LastName = ds.Tables[0].Rows[0]["LastName"].ToString(); usrreg.UserId = ds.Tables[0].Rows[0]["UserId"].ToString(); usrreg.UserType = ds.Tables[0].Rows[0]["UserType"].ToString(); usrreg.Country = ds.Tables[0].Rows[0]["Country"].ToString(); response = new Response { ResponseCode = ds.Tables[0].Rows[0]["Statuscode"].ToString(), ResponseMessage = ds.Tables[0].Rows[0]["Message"].ToString(), ResponseList = new { usrreg } }; } else { response = new Response { ResponseCode = ds.Tables[0].Rows[0]["Statuscode"].ToString(), ResponseMessage = ds.Tables[0].Rows[0]["Message"].ToString() }; } } else { response = new Response { ResponseCode = Common.ReturnCode("ErrorCode"), ResponseMessage = Common.ReturnCode("ErrorMessage") }; } //var JSS = new JavaScriptSerializer(); //jsonResult = JSS.Serialize(response); return(response); } catch (Exception ex) { return(new Response { ResponseCode = Common.ReturnCode("ErrorCode"), ResponseMessage = Common.ReturnCode("ErrorMessage") }); } }