예제 #1
0
        //赞同
        public int Approval(string id)
        {
            M_UserInfo mu  = buser.GetLogin();
            int        Mid = DataConverter.CLng(id);
            DataTable  dt  = askComBll.U_SelByAnswer(Mid, mu.UserID, 0);

            if (dt.Rows.Count > 0)
            {
                return(1);
            }
            else
            {
                DataTable   dt2       = ansBll.Sel("ID=" + id, "", null);
                M_AskCommon askcomMod = new M_AskCommon();
                askcomMod.AskID   = DataConverter.CLng(dt2.Rows[0]["QueID"]);
                askcomMod.AswID   = Mid;
                askcomMod.UserID  = mu.UserID;
                askcomMod.Content = "赞同";
                askcomMod.AddTime = DateTime.Now;
                askcomMod.Type    = 0;
                int flag = askComBll.insert(askcomMod);
                if (flag == 1)
                {
                    return(2);
                }
                else
                {
                    return(3);
                }
            }
        }
예제 #2
0
        //评论
        public void Comment()
        {
            M_UserInfo  mu        = buser.GetLogin();
            int         Mid       = DataConverter.CLng(Request.Form["mid"]);
            DataTable   dt        = ansBll.Sel("ID=" + Mid, "", null);
            M_AskCommon askcomMod = new M_AskCommon();

            askcomMod.AskID   = DataConverter.CLng(dt.Rows[0]["QueID"]);
            askcomMod.AswID   = Mid;
            askcomMod.UserID  = mu.UserID;
            askcomMod.Content = Request.Form["txtSupplyment"];
            askcomMod.AddTime = DateTime.Now;
            askcomMod.Type    = 1;
            if (askComBll.insert(askcomMod) == 1)
            {
                function.WriteSuccessMsg("评论成功", "SearchDetails?ID=" + Request["ID"]); return;
            }
            else
            {
                function.WriteErrMsg("评论失败", "SearchDetails?ID=" + Request["ID"]); return;
            }
        }
예제 #3
0
 public int insert(M_AskCommon model)
 {
     return(DBCenter.Insert(model));
 }
예제 #4
0
 public bool UpdateByID(M_AskCommon model)
 {
     return(DBCenter.UpdateByID(model, model.ID));
 }