Ejemplo n.º 1
0
        public IActionResult SearchDetails()
        {
            AskAuth();
            M_Ask askMod = askBll.SelReturnModel(Mid);

            if (askMod == null)
            {
                return(WriteErr("问题不存在")); return(Content(""));
            }
            ViewBag.dt1 = ansBll.Sel(" QueId=" + Mid + " And Status=1", " Status desc", null);
            ViewBag.dt2 = ansBll.Sel(" QueId=" + Mid + " And Status=0", " AddTime desc", null);
            ViewBag.dt3 = askBll.Sel("Status=1", "Addtime desc", null);
            return(View(askMod));
        }
        protected void Lnk_Click(object sender, GridViewCommandEventArgs e)
        {
            int Id = Convert.ToInt32(e.CommandArgument);

            if (e.CommandName == "Audit")
            {
                M_Ask askMod = askBll.SelReturnModel(Id);
                if (askMod.Status == 0)
                {
                    askBll.UpdateByField("Status", "1", Id);
                }
                else
                {
                    askBll.UpdateByField("Status", "0", Id);
                }
            }
            if (e.CommandName == "Del")
            {
                askBll.Del(Id);
                DataTable dt = answerBll.Sel(" QueId=" + Id, "", null);
                if (dt.Rows.Count > 0)
                {
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        int ID = Convert.ToInt32(dt.Rows[i]["ID"]);
                        answerBll.Del(" ID=" + ID);
                    }
                }
            }
            MyBind();
        }
Ejemplo n.º 3
0
        protected void Lnk_Click(object sender, GridViewCommandEventArgs e)
        {
            int Id = DataConvert.CLng(e.CommandArgument.ToString());

            if (e.CommandName == "Audit")
            {
                m_guestanswer = b_guestanswer.SelReturnModel(Id);
                if (m_guestanswer.Status == 0)
                {
                    b_guestanswer.Update(" Status = 1", " ID=" + Id);
                }
                else
                {
                    b_guestanswer.Update(" Status = 0", " ID=" + Id);
                }
            }
            else if (e.CommandName == "Del")
            {
                b_guestanswer.Del(" ID=" + Id);
                DataTable dt = b_guestanswer.Sel(" QueId=" + Id, "", null);
                if (dt.Rows.Count > 0)
                {
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        int ID = Convert.ToInt32(dt.Rows[i]["ID"]);
                        b_guestanswer.Del(" ID=" + ID);
                    }
                }
            }
            DataBind();
        }
Ejemplo n.º 4
0
        public ActionResult SearchDetails()
        {
            AskAuth();
            int   Mid    = DataConvert.CLng(Request["ID"]);
            M_Ask askMod = askBll.SelReturnModel(Mid);

            if (askMod == null)
            {
                function.WriteErrMsg("问题不存在"); return(Content(""));
            }
            ViewBag.dt1 = ansBll.Sel(" QueId=" + Mid + " And Status=1", " Status desc", null);
            ViewBag.dt2 = ansBll.Sel(" QueId=" + Mid + " And Status=0", " AddTime desc", null);
            ViewBag.dt3 = askBll.Sel("Status=1", "Addtime desc", null);
            return(View(askMod));
        }
Ejemplo n.º 5
0
 protected int  getcount(string id)
 {
     if (id != "")
     {
         int       number;
         DataTable dt = b_Ans.Sel(" QueId=" + Convert.ToInt32(id) + " and supplyment=0", "", null);
         if (dt.Rows.Count > 0)
         {
             number = dt.Rows.Count;
             return(number);
         }
         else
         {
             return(0);
         }
     }
     else
     {
         return(0);
     }
 }