Beispiel #1
0
 //设置通过积分
 public void passset(int id, int pass)
 {
     try
     {
         if (identity != null)
         {
             Exam.Entity.tb_School_QuestionClsEntity tmodel = Exam.BLL.tb_School_QuestionClsBLL.GetInstance().GetSchoolQuestionListByQuestionIdSchoolId(id, identity._schoolID);
             if (tmodel == null)
             {
                 Exam.Entity.tb_School_QuestionClsEntity model = new Exam.Entity.tb_School_QuestionClsEntity();
                 model.SchoolId      = identity._schoolID;
                 model.QuestionClsId = id;
                 model.Path          = "1";
                 model.Score         = pass;
                 model.IsMust        = 0;
                 if (Exam.BLL.tb_School_QuestionClsBLL.GetInstance().Insert(model) > 0)
                 {
                     Response.Write("1");
                 }
             }
             else
             {
                 tmodel.Score = pass;
                 Exam.BLL.tb_School_QuestionClsBLL.GetInstance().Update(tmodel);
                 Response.Write("1");
             }
         }
     }
     catch (Exception ex)
     {
         Jnwf.Utils.Log.Logger.Log4Net.Error("data.aspx.cs,passset,ex:" + ex.Message + "|" + ex.StackTrace);
         Response.Write("error");
     }
 }
Beispiel #2
0
 //添加
 public void addconreadbook(int id, int status)
 {
     try
     {
         UserIdentity identyty = User.Identity as UserIdentity;
         if (identyty != null)
         {
             IList <Exam.Entity.tb_School_QuestionClsEntity> list   = Exam.BLL.tb_School_QuestionClsBLL.GetInstance().Gettb_School_QuestionClsList();
             Exam.Entity.tb_School_QuestionClsEntity         tmodel = list.FirstOrDefault(c => c.QuestionClsId == id && c.SchoolId == identyty._schoolID);
             if (tmodel == null && status != 2)
             {
                 Exam.Entity.tb_School_QuestionClsEntity model = new Exam.Entity.tb_School_QuestionClsEntity();
                 model.SchoolId      = identyty._schoolID;
                 model.QuestionClsId = id;
                 model.IsMust        = status;
                 Exam.BLL.tb_School_QuestionClsBLL.GetInstance().Insert(model);
                 Response.Write("1");
             }
             else if (status == 2)
             {
                 Exam.BLL.tb_School_QuestionClsBLL.GetInstance().Delete(id);
                 Response.Write("1");
             }
             else if (status == 0 || status == 1)
             {
                 tmodel.IsMust = status;
                 Exam.BLL.tb_School_QuestionClsBLL.GetInstance().Update(tmodel);
                 Response.Write("1");
             }
         }
     }
     catch (Exception ex)
     {
         Jnwf.Utils.Log.Logger.Log4Net.Error("data.aspx.cs,addconreadbook,ex:" + ex.Message + "|" + ex.StackTrace);
         Response.Write("error");
     }
 }