public List<Model.getmessage> Getmessage(int userid) { BLL.fansTb bllfan = new BLL.fansTb(); List<Model.fansTb> mfan = bllfan.GetModelList("ownID="+ userid ); BLL.noveltyTb bllnov = new BLL.noveltyTb(); List<Model.noveltyTb> mon = new List<Model.noveltyTb>(); List<Model.getmessage> mg = new List<Model.getmessage>(); foreach (Model.fansTb mf in mfan) { mon = bllnov.GetModelList("senderID=" + mf.ownedID); if (mon.Count>=0) { for (int j = 0; j <mon.Count; j++) { Model.getmessage mgetm = new Model.getmessage(); mgetm.Id = mon[j].senderID; mgetm.Contents = mon[j].contents; mgetm.Publishtime = mon[j].publishtime; BLL.userTb bllu = new BLL.userTb(); Model.userTb muser = bllu.GetModel(mon[j].senderID); mgetm.HeadimgUrl = muser.headImgUrl; mgetm.OwnedName = muser.userName; mg.Add(mgetm); } } } return mg; }
public string Addinfo(string sendID) { BLL.userTb bll_user = new BLL.userTb(); Model.userTb mod_user = new Model.userTb(); BLL.fansTb bll_fans = new BLL.fansTb(); List<Model.fansTb> Guanzhu = bll_fans.GetModelList("ownID='" + sendID + "'"); BLL.noveltyTb bll_nov = new BLL.noveltyTb(); List<Model.noveltyTb> mod_novlist = new List<Model.noveltyTb>(); string fans = Guanzhu.Count + "%"; for (int i = 0; i < Guanzhu.Count(); i++) { mod_user = bll_user.GetModel(Guanzhu[i].ownedID); mod_novlist = bll_nov.GetModelList("senderID='" + Guanzhu[i].ownedID + "'"); int index = mod_novlist.Count();//某好友新鲜事总数 fans += index + "#+#"; for (int j = 0; j < index; j++) { fans += Guanzhu[i].ownedName + ";" + mod_novlist[j].contents + ";" + mod_novlist[j].publishtime.ToString() + ";" + mod_novlist[j].supportNum.ToString() + ";" + mod_novlist[j].transmitNum.ToString() + ";" + mod_novlist[j].commentNum.ToString() + ";" + mod_user.headImgUrl + ";" + mod_novlist[j].noveltyID.ToString() + "!=!"; } fans += "@"; } return fans; }
protected void Page_Load(object sender, EventArgs e) { BLL.userTb user=new BLL.userTb(); Model.userTb moduser=user.GetModel(5); this.lblname.Text = moduser.userName.ToString(); string sax = moduser.sex.ToString(); if (sax == "女") { this.imgsax.ImageUrl = "../images/userSpaceImg/girl.gif"; } else { this.imgsax.ImageUrl = "../images/userSpaceImg/boy.gif"; } this.state.InnerText = moduser.addr.ToString(); this.conlege.InnerText = moduser.collegeSchool.ToString(); this.imghead.ImageUrl = moduser.headImgUrl.ToString(); BLL.fansTb bllfans = new BLL.fansTb(); List<Model.fansTb> myattention = bllfans.GetModelList("ownID=5"); int attention = 0; foreach (Model.fansTb item in myattention) { attention++; } this.lblattention.Text = attention.ToString(); List<Model.fansTb> myfans = bllfans.GetModelList("ownedID=5"); int fans = 0; foreach (Model.fansTb i in myfans) { fans++; } this.lblfans.Text = fans.ToString(); BLL.noveltyTb bllnov = new BLL.noveltyTb(); List<Model.noveltyTb> mynov = bllnov.GetModelList("senderID=5"); int news = 0; foreach (Model.noveltyTb n in mynov) { news++; } this.lblnews.Text = news.ToString(); }
protected void Page_Load(object sender, EventArgs e) { string myEmail = Session["no"].ToString(); string myname; string fansnum; string noveltynum; string guanzhunum; string myImg; BLL.userTb bll_user = new BLL.userTb(); Model.userTb me = new Model.userTb(); List<Model.userTb> myspace = new List<Model.userTb>(); myspace = bll_user.GetModelList("userEmail='" + myEmail + "'"); me = myspace[0]; MyID = me.userID; myname = me.userName; myImg = me.headImgUrl; BLL.fansTb bll_fans = new BLL.fansTb(); List<Model.fansTb> fans = new List<Model.fansTb>(); fans = bll_fans.GetModelList("ownedID='" + MyID.ToString() + "'"); fansnum = fans.Count().ToString(); BLL.noveltyTb bll_noveltyTb = new BLL.noveltyTb(); List<Model.noveltyTb> novs = new List<Model.noveltyTb>(); novs = bll_noveltyTb.GetModelList("senderID='" + MyID.ToString() + "'"); noveltynum = novs.Count().ToString(); BLL.fansTb bll_guanzhu = new BLL.fansTb(); List<Model.fansTb> guanzhus = new List<Model.fansTb>(); guanzhus = bll_guanzhu.GetModelList("ownID='" + MyID.ToString() + "'"); guanzhunum = guanzhus.Count().ToString(); this.myImg.Src = myImg; this.myname.InnerText = myname; this.noveltynum.InnerHtml = noveltynum; this.fansnum.InnerText = fansnum; this.guanzhunum.InnerText = guanzhunum; }
public void bindData(int pageIn, string selectWhere) { BLL.noveltyTb bllAdmin = new BLL.noveltyTb(); List<Model.noveltyTb> admins = bllAdmin.GetModelList(selectWhere); PagedDataSource pds = new PagedDataSource(); pds.DataSource = admins; pds.PageSize = 8; pds.AllowPaging = true; pds.CurrentPageIndex = pageIn; this.gvSuperAdminSeeInfo.DataSource = pds; this.gvSuperAdminSeeInfo.DataBind(); int pageCount = pds.PageCount; StringBuilder html = new StringBuilder(""); html.Append("<a class='pageA pageStart' href='adminSeeNovelty.aspx?pageInd=0'>首页</a>"); for (int i = 0; i < pageCount; i++) { html.Append("<a class='pageA pageNum pageA" + (i + 1).ToString() + "' href='adminSeeNovelty.aspx?pageInd=" + i.ToString() + "'>" + (i + 1).ToString() + "</a>"); } html.Append("<a class='pageA pageStart' href='adminSeeNovelty.aspx?pageInd=" + (pageCount - 1).ToString() + "'>尾页</a>"); this.dgvpage.InnerHtml = html.ToString(); ScriptManager.RegisterStartupScript(searchBtn, this.GetType(), "clickPage", "clickPage(" + (pageIn + 1).ToString() + ");", true); }
protected void search_Click(object sender, EventArgs e) { string searchT = this.searchText.Text; if (searchT == "") { ScriptManager.RegisterStartupScript(searchBtn, this.GetType(), "showErrorAlert", "showErrorAlert('请输入关键字!');", true); return; } try { BLL.noveltyTb bllnovelTy = new BLL.noveltyTb(); List<Model.noveltyTb> noveltys = bllnovelTy.GetModelList("noveltyID like '%" + searchT + "%'"); if (noveltys.Count == 0) { ScriptManager.RegisterStartupScript(searchBtn, this.GetType(), "showNoticeAlert", "showNoticeAlert('没有您要找的新鲜事!');", true); return; } bindData(0, "noveltyID like '%" + searchT + "%'"); } catch (Exception) { ScriptManager.RegisterStartupScript(searchBtn, this.GetType(), "showErrorAlert", "showErrorAlert('发生错误,请重新输入关键字!');", true); } }
public string[] FaceHover(string ID,string me) { string nickname; BLL.noveltyTb bll_nov=new BLL.noveltyTb(); Model.noveltyTb mod_nov=new Model.noveltyTb(); mod_nov=bll_nov.GetModel(Convert.ToInt16(ID)); BLL.userTb bll_user = new BLL.userTb(); Model.userTb mod_user = new Model.userTb(); mod_user = bll_user.GetModel(mod_nov.senderID); BLL.fansTb bll_fans=new BLL.fansTb(); List<Model.fansTb> mod_fan=new List<Model.fansTb>(); if (me.Equals(mod_nov.senderID.ToString())) { nickname = mod_user.userName; } else { mod_fan = bll_fans.GetModelList("ownID='" + me + "'and ownedID='" + mod_nov.senderID.ToString() + "'"); nickname = mod_fan[0].ownedName; } List<Model.fansTb> mod_guanzhu = new List<Model.fansTb>(); mod_guanzhu = bll_fans.GetModelList("ownID='"+me+"'"); List<Model.fansTb> mod_fans = new List<Model.fansTb>(); mod_fans = bll_fans.GetModelList("ownedID='" + me + "'"); List<Model.noveltyTb> noveltys = new List<Model.noveltyTb>(); noveltys = bll_nov.GetModelList("senderID='"+me+"'"); string[] arr = new string[8]; arr[0] = mod_user.userName; arr[1] = nickname; arr[2] = mod_user.addr; arr[3] = mod_user.highSchool; arr[4] = mod_guanzhu.Count().ToString(); arr[5] = mod_fans.Count().ToString(); arr[6] = noveltys.Count().ToString(); arr[7] = mod_user.headImgUrl; return arr; }
public List<noveltyInfo> Addinfo(string sendID) { List<noveltyInfo> novs = new List<noveltyInfo>(); BLL.userTb bll_user = new BLL.userTb(); BLL.fansTb bll_fans = new BLL.fansTb(); List<Model.fansTb> Guanzhu = bll_fans.GetModelList("ownID='" + sendID + "'and groupID!=-1 "); //List<int> list = new List<int>(); //foreach (Model.fansTb fan in Guanzhu) //{ // list.Add(fan.ownedID); //} BLL.noveltyTb bll_nov = new BLL.noveltyTb(); List<Model.noveltyTb> mod_novlist = new List<Model.noveltyTb>(); List<Model.noveltyTb> mod_alllist = new List<Model.noveltyTb>(); for (int i = 0; i < Guanzhu.Count(); i++) { mod_novlist = bll_nov.GetModelList("senderID='" + Guanzhu[i].ownedID + "'and state=1"); mod_alllist.AddRange(mod_novlist); } List<Model.noveltyTb> mod_melist = new List<Model.noveltyTb>(); mod_melist = bll_nov.GetModelList("senderID='" + sendID + "'and state=1"); mod_alllist.AddRange(mod_melist); Model.noveltyTb temp = new Model.noveltyTb(); for (int i = 0; i < mod_alllist.Count() - 1; i++) { for (int j = i + 1; j < mod_alllist.Count(); j++) { if (mod_alllist[i].noveltyID < mod_alllist[j].noveltyID) { temp = mod_alllist[i]; mod_alllist[i] = mod_alllist[j]; mod_alllist[j] = temp; } } } //string all_novety = ""; //all_novety += mod_alllist.Count().ToString() + "@+@"; for (int i = 0; i < mod_alllist.Count(); i++) { Model.userTb mod_user = new Model.userTb(); mod_user = bll_user.GetModel(mod_alllist[i].senderID); List<Model.fansTb> mod_f = new List<Model.fansTb>(); mod_f = bll_fans.GetModelList("ownID='"+sendID+"'and ownedID='"+mod_user.userID.ToString()+"'"); noveltyInfo nov = new noveltyInfo(); if (mod_user.userID == Convert.ToInt16(sendID)) { nov.UserName =mod_user.userName; } else { nov.UserName = mod_f[0].ownedName; } nov.TypeID =Convert.ToInt16(mod_alllist[i].typeID); nov.Supportnum =Convert.ToInt16(mod_alllist[i].supportNum); nov.Transmitnum = Convert.ToInt16(mod_alllist[i].transmitNum); nov.Headurl = mod_user.headImgUrl; nov.Time = mod_alllist[i].publishtime.ToString(); nov.Commentnum =Convert.ToInt16(mod_alllist[i].commentNum); nov.Contents = mod_alllist[i].contents; nov.NovID = mod_alllist[i].noveltyID; novs.Add(nov); } return novs; //return all_novety; }