예제 #1
0
 protected void btEnter_Click(object sender, EventArgs e)
 {
     CY.CSTS.Core.Business.Question question = new CY.CSTS.Core.Business.Question();
     CY.CSTS.Core.Business.User user = (CY.CSTS.Core.Business.User)Session["User"];
     question.Title = this.txtQues.Text;
     question.Content = this.txtCont.Text;
     question.CreateDate = DateTime.Now;
     question.UserID = user.Id;
     question.Save();
     Session.Add("Id", question.Id);
     Response.Redirect("AnswerQues.aspx");
 }
        protected void btnDel_Click(object sender, EventArgs e)
        {
            string idstr = Context.Request.QueryString["ID"];
               Guid id = new Guid(idstr);
               question = CY.CSTS.Core.Business.Question.Load(id);
            if (question != null)
            {

                question.DeleteOnSave();
                question.Save();
                DelQuesAnswer(question.Id);
                DelQuesDomain(question.Id);
                Response.Redirect("QuestionManage.aspx");
             }
        }