protected void btnOK_Click(object sender, EventArgs e)
        {
            string id = this.userid.Text.ToString();
            string pwd = this.userpwd.Text.ToString();
            if (id == "" || pwd == "")
            {
                this.falseCause.Text = "*用户名与密码不能为空,请重新输入!";
                return;
            }

            BLL.userTb blluser = new BLL.userTb();
            List<Model.userTb> users = blluser.GetModelList("1=1");
            for (int i = 0; i < users.Count; i++)
            {
                if (Convert.ToString(users[i].userID) == this.userid.Text.ToString())
                {
                    Model.userTb userInfo = blluser.GetModel(Convert.ToInt32(id));
                    if (userInfo.userPwd == pwd) { Response.Redirect("LTsection.aspx"); }
                    else
                    {
                        this.falseCause.Text = "*密码错误,请重新输入!";
                        return;
                    }
                }
                else
                {
                    this.falseCause.Text = "*账号不存在,请重新输入!";

                }

            }
        }
        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;
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     int noveltyID =Convert.ToInt32(Request.QueryString["noveltyID"]);
     BLL.noveltyTb bllNovelty = new BLL.noveltyTb();
     Model.noveltyTb novelty = bllNovelty.GetModel(noveltyID);
     this.labelcommentNum.Text = novelty.commentNum.ToString();
     this.labelContent.Text = novelty.contents;
     this.labelID.Text = novelty.noveltyID.ToString();
     this.labelpublishTime.Text = novelty.publishtime.ToString();
     this.labelreportNum.Text = novelty.reportNum.ToString();
     BLL.userTb bllUser=new BLL.userTb();
     Model.userTb user=bllUser.GetModel(novelty.senderID);
     this.labelSenderName.Text = user.userName;
     this.labelsupportNum.Text = novelty.supportNum.ToString();
     this.labeltransmitNum.Text = novelty.transmitNum.ToString();
     BLL.noveltyGroupTb bllnoveltyGroup = new BLL.noveltyGroupTb();
     Model.noveltyGroupTb noveltyGroup = bllnoveltyGroup.GetModel(Convert.ToInt32(novelty.typeID));
     this.labelType.Text = noveltyGroup.noveltyGroupName;
     if (novelty.hasImgs == 1)
     {
         BLL.noveltyImagesTb bllNoveltyImages = new BLL.noveltyImagesTb();
         List<Model.noveltyImagesTb> noveltyImgs = bllNoveltyImages.GetModelList("noveltyID=" + novelty.noveltyID);
         StringBuilder html = new StringBuilder("");
         this.noveltyImgs.InnerHtml = "";
         foreach (var noveltyImg in noveltyImgs)
         {
             html.Append("<img src='" + noveltyImg.smallImgUrl + "' />");
         }
         this.noveltyImgs.InnerHtml = html.ToString();
     }
     else
     {
         this.noveltyImgs.InnerHtml = "无图片";
     }
 }
        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)
 {
     if (Request.QueryString["userID"]==null)
     {
         return;
     }
     int userID =Convert.ToInt32(Request.QueryString["userID"]);
     BLL.userTb bllUser = new BLL.userTb();
     Model.userTb mUser = bllUser.GetModel(userID);
     this.labelID.Text = mUser.userID.ToString();
     this.labelAddr.Text = mUser.addr;
     this.labelAge.Text = mUser.age.ToString();
     this.labelSex.Text = mUser.sex;
     this.labelUserCollegeSchool.Text = mUser.collegeSchool;
     this.labelUserEmail.Text = mUser.userEmail;
     this.labelUserHighSchool.Text = mUser.highSchool;
     this.labelUserJuniorSchool.Text = mUser.juniorSchool;
     this.labelUserName.Text = mUser.userName;
     this.labelUserPrimarySchool.Text = mUser.primarySchool;
     this.labelUserPwd.Text = mUser.userPwd;
     BLL.interestTb bllInterest = new BLL.interestTb();
     Model.interestTb interset = bllInterest.GetModel(Convert.ToInt32(mUser.interstID));
     this.labelUserInterest.Text = interset.interestName;
     this.userImgs.InnerHtml="<img src='"+mUser.headImgUrl+"'/>";
 }
 public string showSenderName(string userID)
 {
     int userIDs = Convert.ToInt32(userID);
     BLL.userTb bllUser = new BLL.userTb();
     Model.userTb mUser = bllUser.GetModel(userIDs);
     return mUser.userName;
 }
Example #7
0
 public void getuserinfo()
 {
     BLL.noveltyTb bll = new BLL.noveltyTb();
     Model.noveltyTb ml = bll.GetModel(noveltyID);
     contents = ml.contents;
     senderID = ml.senderID;
     BLL.userTb bllu = new BLL.userTb();
     Model.userTb mlu = bllu.GetModel(senderID);
     userName=mlu.userName;
     headImgUrl = mlu.headImgUrl;
 }
 public void fengAndJieUser(int userid)
 {
     BLL.userTb userBll = new BLL.userTb();
     Model.userTb userM = userBll.GetModel(userid);
     if (userM.state == "1")
     {
         userM.state = "0";
     }
     else
     {
         userM.state = "1";
     }
     userBll.Update(userM);
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     int operatorIDs = Convert.ToInt32(Request.QueryString["EventsID"]);
     BLL.eventsTb bllevent = new BLL.eventsTb();
     Model.eventsTb modevent = bllevent.GetModel(operatorIDs);
     this.labelContent.Text = modevent.operateContent ;
     this.labelID.Text = modevent.ID .ToString ();
     this.labelTime.Text = modevent.operateTime.ToString();
     BLL.userTb bllUser = new BLL.userTb();
     Model.userTb user = bllUser.GetModel(modevent .operatorID );
     this.labelSenderName.Text = user.userName;
     this.labelType.Text = modevent.operateAction;
     this.userImgs .InnerHtml  ="<img src='"+user.headImgUrl+"' />";
     this.labeloperatorID.Text = user.userID.ToString ();
 }
Example #10
0
        protected void loginBtn1_Click(object sender, EventArgs e)
        {
            string email = this.textEmailT.Text.ToString();
            string pwd = this.textPasswordT.Text.ToString();
            BLL.userTb blluser = new BLL.userTb();
            if (email == "" || pwd == "")
            {
                Page.ClientScript.RegisterStartupScript(Page.GetType(), "", "<script language=javascript>alert('邮箱与密码不能为空,请重新输入!');</script>",false  );
                return;
            }

            List<Model.userTb> moduser = blluser.GetModelList("userEmail='" + email + "'");
            foreach (Model.userTb moduser1 in  moduser ){
                if (moduser1.state == "0")
                {

                    Page.ClientScript.RegisterStartupScript(Page.GetType(), "", "<script language=javascript>alert('您的账号已经被封号!');</script>", false );
                }
                else
                {
                    if (moduser1.userPwd != pwd)
                    {

                        Page.ClientScript.RegisterStartupScript(Page.GetType(), "", "<script language=javascript>alert('邮箱与密码不匹配,请重新输入!');</script>",false );
                        //this.textEmailT.Text = "";
                        this.textPasswordT.Text = "";
                        return;
                    }

                    Model.eventsTb modevent = new Model.eventsTb();
                    BLL.eventsTb bllevent = new BLL.eventsTb();
                    modevent.operatorID = moduser[0].userID;
                    modevent.operateAction = "用户登陆";
                    modevent.operateContent = "用户登陆成功";
                    modevent.operateTime = System.DateTime.Now.ToLocalTime();
                    bllevent.Add(modevent);

                    Session["no"] = email;
                    Session["pwd"] = pwd;

                    Response.Redirect("userHome.aspx");

                }
            }
            Page.ClientScript.RegisterStartupScript(Page.GetType(), "", "<script language=javascript>alert('账号不存在,请重新输入!');</script>", false);
            this.textEmailT.Text = "";
            this.textPasswordT.Text = "";
        }
Example #11
0
        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)
        {
            int userid = 5;
            if (!IsPostBack)
            {
                BLL.userTb blluser = new BLL.userTb();
                Model.userTb f = blluser.GetModel(userid);
                this._user = f;

                this.lbluserage.Text = this._user.age.ToString();
                string username = this._user.userName.ToString();
                this.lblusername.Text = this._user.userName.ToString();
                this.userage.Text = this._user.age.ToString();
                this.lblloginname.Text = this._user.userEmail.ToString();
                this.lblh.Text = this._user.userEmail.ToString();
                // this.lblusername.Text = this._user.userName.ToString();
                this.username.Text = this._user.userName.ToString();

                this.useraddr.Text = this._user.addr.ToString();
                this.lbluseraddr.Text = this._user.addr.ToString();
                this.lblusersax.Text = this._user.sex.ToString();
                if (this.lblusersax.Text == "男")
                {
                    this.man.Checked = true;
                }
                else
                {
                    this.woman.Checked = true;
                }
                this.lblprimarySchool.Text = this._user.primarySchool.ToString();
                this.primarySchool.Text = this._user.primarySchool.ToString();
                this.lbljuniorSchool.Text = this._user.juniorSchool.ToString();
                this.juniorSchool.Text = this._user.juniorSchool.ToString();
                this.lblhighSchool.Text = this._user.highSchool.ToString();
                this.highSchool.Text = this._user.highSchool.ToString();
                this.lblcollegeSchool.Text = this._user.collegeSchool.ToString();
                this.collegeSchool.Text = this._user.collegeSchool.ToString();

            }
        }
Example #13
0
        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.userTb blluser = new BLL.userTb();
            List<Model.userTb> users = blluser.GetModelList(selectWhere);
            PagedDataSource pds = new PagedDataSource();
            pds.DataSource = users;
            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 pageA0' href='adminSeeUser.aspx?pageInd=0'>首页</a>");
            for (int i = 0; i < pageCount; i++)
            {
                html.Append("<a class='pageA pageNum pageA" + i.ToString() + "' href='adminSeeUser.aspx?pageInd=" + i.ToString() + "'>" + (i + 1).ToString() + "</a>");
            }
            html.Append("<a class='pageA pageStart pageA"+(pageCount-1).ToString()+"' href='adminSeeUser.aspx?pageInd=" + (pageCount - 1).ToString() + "'>尾页</a>");
            this.dgvpage.InnerHtml = html.ToString();
            ScriptManager.RegisterStartupScript(searchBtn, this.GetType(), "clickPage", "clickPage(" + pageIn.ToString() + ");", true);
        }
        protected void btnOK_Click(object sender, EventArgs e)
        {
            /*         BLL.userTb bllutb = new BLL.userTb();
            List<Model.userTb> listmodelutb = bllutb.GetModelList("1=1");
            foreach (Model.userTb u in listmodelutb)
            {
                if (u.userEmail == loginemail)
                {
                    u.userPwd = this.txtpwd.Text;
                    bllutb.Update(u);
                }
            }     */

            if (this.txtpwd.Text == "" || this.txtpwdagain.Text == "")
            {
                this.lblmsg3.Visible = true;
                this.lblmsg4.Visible=false;
                this.lblmsg5.Visible = false;
            }
            if (this.txtpwd.Text != this.txtpwdagain.Text && this.txtpwd.Text != "" && this.txtpwdagain.Text != "")
            {
                this.lblmsg3.Visible = false;
                this.lblmsg4.Visible = true;
                this.lblmsg5.Visible = false;
            }
            if (this.txtpwd.Text == this.txtpwdagain.Text && this.txtpwd.Text != "" && this.txtpwdagain.Text != "")
            {
                BLL.userTb bllutb = new BLL.userTb();
                List<Model.userTb> listmodelutb = bllutb.GetModelList("1=1");
                listmodelutb[0].userPwd = this.txtpwd.Text;
                bllutb.Update(listmodelutb[0]);
                this.lblmsg3.Visible = false;
                this.lblmsg4.Visible = false;
                this.lblmsg5.Visible = true;
            }
        }
Example #16
0
        protected void btnOK_Click(object sender, EventArgs e)
        {
            string addr = this.txtaddr.Text.ToString();
            string pri = this.txtpri.Text.ToString();
            string mid = this.txtmid.Text.ToString();
            string sen = this.txtsenior.Text.ToString();
            string col = this.txtcol.Text.ToString();
            string age = this.txtage.Text.ToString();

            BLL.userTb blluser = new BLL.userTb();
            Model.userTb moduser = new Model.userTb();
            moduser.addr = addr;
            moduser.primarySchool = pri;
            moduser.juniorSchool = mid;
            moduser.highSchool = sen;
            moduser.collegeSchool = col;
            moduser.age = Convert .ToInt32 (age);
            moduser.userName = Session["name"].ToString ();
            moduser.userEmail = Session["email"].ToString();
            moduser.state = "1";
            if (Rbtnsex.Checked)
            {
                moduser.sex = "男";
            }
            else {
                moduser.sex = "女";
            }
               if(this.DropDownList1.Text =="游泳")
               {
               moduser.interstID = 1;
               }
               if (this.DropDownList1.Text == "旅游")
               {
               moduser.interstID = 2;
               }
               if (this.DropDownList1.Text == "登山")
               {
               moduser.interstID = 3;
               }
               if (this.DropDownList1.Text == "听音乐")
               {
               moduser.interstID = 4;
               }
               if (this.DropDownList1.Text == "看书")
               {
               moduser.interstID = 5;
               }
               if (this.DropDownList1.Text == "蹦极")
               {
               moduser.interstID = 6;
               }
               if (this.DropDownList1.Text == "娱乐八卦")
               {
               moduser.interstID = 7;
               }
            moduser.userPwd =Session["pwd"].ToString();
            moduser.headImgUrl = "images/Temp/" + Session["imageurl"].ToString ();

            int t = blluser.Add(moduser);
            if (t <= 0)
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language=javascript>alert('保存失败,请重新输入!');</script> ", false);

            }
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language=javascript>alert('保存成功!');</script> ", false);

            this.txtaddr.Text = "";
            this.txtage.Text = "";
            this.txtcol.Text = "";
            this.txtmid.Text = "";
            this.txtpri.Text = "";
            this.txtsenior.Text = "";
            Response.Redirect("userLogin.aspx");
        }
Example #17
0
        protected void BtnSend_Email_Click(object sender, EventArgs e)
        {
            if (this.Txt_Email.Text == "")
            {
                this.Lblsryx.Visible = true;
                this.Lblwzc.Visible = false;

            }
            else
            {
                this.Lblsryx.Visible = false;
                BLL.userTb buser = new BLL.userTb();
                List<Model.userTb> lmuser = buser.GetModelList("1=1");
                    int i = 0;
                    for (; i < lmuser.Count; )
                    {

                        if (this.Txt_Email.Text != lmuser[i].userEmail)
                        {
                            i++;
                        }

                        else
                            break;
                    }
                    if (i >= lmuser.Count)
                    {
                        this.Lblwzc.Visible = true;
                    }
                    if (i < lmuser.Count && (Txtyzm.Text == "ym3w" || Txtyzm.Text == "ym3w"))
                    {
                        this.Lblwzc.Visible = false;
                        MailMessage m_message = new MailMessage();

                        m_message.From = new MailAddress("*****@*****.**");

                        m_message.To.Add(new MailAddress(this.Txt_Email.Text));

                        m_message.Subject = "LittleWorld";

                        m_message.Body = "邮箱验证信息:http://localhost:3448/userResetPwd.aspx 载入重置密码界面";

                        SmtpClient m_smtpClient = new SmtpClient();

                        m_smtpClient.Send(m_message);

                        Response.Write("<script>alert('验证信息已发送至您邮箱,请进入邮箱验证!');</script>");

                    }

            }

            if (this.Txtyzm.Text =="")
            {
                this.Lblsryzm.Visible = true;
            }
            else
            {
                this.Lblsryzm.Visible = false;
                if (Txtyzm.Text != "ym3w" || Txtyzm.Text != "ym3w")
                {
                    this.Lblyzm.Visible = true;
                }
                else
                    this.Lblyzm.Visible = false;
            ;
            }
        }
Example #18
0
        public string AddNews(int sendID,string state,string txtcomment,string paths)
        {
            string[] s = paths.Split(';');
            BLL.userTb bll_user = new BLL.userTb();
            Model.userTb me = new Model.userTb();
            me = bll_user.GetModel(sendID);

            //添加文字
            BLL.noveltyTb bll_notb = new BLL.noveltyTb();
            Model.noveltyTb mod_notb = new Model.noveltyTb();
            mod_notb.senderID = sendID;
            mod_notb.contents = txtcomment;

            mod_notb.state = state;
            if (s.Length == 1)
            {
                mod_notb.hasImgs = 0;
            }
            else {
                mod_notb.hasImgs = 1;
            }
            mod_notb.typeID = 1;
            mod_notb.commentNum = 0;
            mod_notb.supportNum = 0;
            mod_notb.reportNum = 0;
            mod_notb.transmitNum = 0;
            mod_notb.publishtime = DateTime.Now;

            bll_notb.Add(mod_notb);

            int maxID=bll_notb.GetMaxId()-1;

            BLL.noveltyImagesTb bll_noImg = new BLL.noveltyImagesTb();
            Model.noveltyImagesTb mod_Img = new Model.noveltyImagesTb();
            for (int i = 0; i < s.Length - 1; i++)
            {

                mod_Img.noveltyID = maxID;
                mod_Img.imgUrl = s[i];
                mod_Img.smallImgUrl = s[i];
                bll_noImg.Add(mod_Img);
            }
            string new_novelty = "";
            new_novelty += me.userName.ToString() + ";" + mod_notb.contents + ";" + mod_notb.publishtime.ToString() + ";" + mod_notb.supportNum.ToString() + ";" + mod_notb.transmitNum.ToString() + ";" + mod_notb.commentNum.ToString() + ";" + me.headImgUrl + ";" + maxID + ";";

            return new_novelty;
        }
Example #19
0
        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;
        }
Example #20
0
        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;
        }
Example #21
0
        public string Addsupport(string novityID,string type,int ID)
        {
            int noID;
            BLL.transmitTb bll_transmit = new BLL.transmitTb();
            BLL.noveltyTb bll_nov = new BLL.noveltyTb();
            BLL.supportTb bll_support = new BLL.supportTb();
            Model.noveltyTb mod_nov = new Model.noveltyTb();
            mod_nov = bll_nov.GetModel(Convert.ToInt16(novityID));
            if (type.Equals("1"))
            {   //新鲜事表操作

                //赞表操作
                List<Model.supportTb> temp=new List<Model.supportTb>();
                temp= bll_support.GetModelList("noveltyID='" +novityID + "'and suppoterID='" + ID.ToString() + "'");

                 if (temp.Count() == 0)
                 {
                     Model.supportTb mod_sup = new Model.supportTb();
                     mod_sup.noveltyID = (Convert.ToInt16(novityID));
                     mod_sup.state = "1";
                     mod_sup.suppoterID = ID;
                     mod_sup.suppotTime = DateTime.Now;
                     bll_support.Add(mod_sup);

                     noID = Convert.ToInt16(mod_nov.supportNum);
                     noID++;
                     mod_nov.supportNum = noID;
                     bll_nov.Update(mod_nov);
                     string str="1"+"@=@"+noID.ToString();
                     return str;
                 }
                 else//找到
                 {

                     noID = Convert.ToInt16(mod_nov.supportNum);
                     noID--;
                     mod_nov.supportNum = noID;
                     bll_nov.Update(mod_nov);
                     bll_support.Delete(temp[0].ID);
                     string str = "-1" + "@=@" + noID.ToString();
                     return str;
                 }

            }
            else
            {
                //转发微博操作
                //新鲜事表操作
                noID = Convert.ToInt16(mod_nov.transmitNum);
                noID++;
                mod_nov.transmitNum = noID;
                bll_nov.Update(mod_nov);

                //添加转发新鲜事
                Model.noveltyTb news= new Model.noveltyTb();
                news.senderID = ID;
                news.noveltyID = bll_nov.GetMaxId();
                news.hasImgs = 0;
                news.publishtime = DateTime.Now;
                news.reportNum = 0;
                news.state = "1";
                news.supportNum = 0;
                news.transmitNum = 0;
                news.typeID = 1;
                news.contents = "转发微博";
                bll_nov.Add(news);
                //转发表操作

                Model.transmitTb mod_tr = new Model.transmitTb();
                mod_tr.noveltyID = Convert.ToInt16(novityID);
                mod_tr.power = 1;
                mod_tr.state = "1";
                mod_tr.transmiterID = mod_nov.senderID;
                mod_tr.transmitTime = DateTime.Now;
                mod_tr.contents = mod_nov.contents;
                bll_transmit.Add(mod_tr);

                Model.userTb user = new Model.userTb();
                BLL.userTb bll_user = new BLL.userTb();
                user = bll_user.GetModel(ID);

                List<Model.fansTb> mod_fan = new List<Model.fansTb>();
                BLL.fansTb bll_fan = new BLL.fansTb();
                mod_fan = bll_fan.GetModelList("ownedID='"+mod_nov.senderID.ToString()+"'and ownID='"+user.userID.ToString()+"'");
                string trString = "";

                trString = noID.ToString() + "@=@" + user.userName + ";" + news.contents + ";" + news.publishtime.ToString() + ";" + news.supportNum.ToString() + ";" + news.transmitNum.ToString() + ";" + news.commentNum.ToString() + ";" + user.headImgUrl + ";" + news.noveltyID.ToString();

                return trString;
            }
        }
 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.userTb blluserTb = new BLL.userTb();
         List<Model.userTb> users = blluserTb.GetModelList("userID like '%" + searchT + "%'");
         if (users.Count == 0)
         {
             ScriptManager.RegisterStartupScript(searchBtn, this.GetType(), "showNoticeAlert", "showNoticeAlert('没有您要找的用户!');", true);
             return;
         }
         bindData(0, "userID like '%" + searchT + "%'");
     }
     catch (Exception)
     {
         ScriptManager.RegisterStartupScript(searchBtn, this.GetType(), "showErrorAlert", "showErrorAlert('发生错误,请重新输入关键字!');", true);
     }
 }