public void deleteNoveltyAsmx(int noveltyid)
        {
            try
            {
                BLL.noveltyTb bllnovelty = new BLL.noveltyTb();
                Model.noveltyTb novelty = bllnovelty.GetModel(noveltyid);
                novelty.state = "0";
                bllnovelty.Update(novelty);

            }
            catch (Exception)
            {

                throw;
            }
        }
Esempio n. 2
0
 public string HideNov(int noveltyID)
 {
     BLL.noveltyTb bll_nov = new BLL.noveltyTb();
     Model.noveltyTb mod_nov = new Model.noveltyTb();
     mod_nov = bll_nov.GetModel(noveltyID);
     mod_nov.state = "0";
     bll_nov.Update(mod_nov);
     return "1";
 }
Esempio n. 3
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;
            }
        }