Esempio n. 1
0
 public static string DeleteBigData(string ParentId)
 {
     try
     {
         if (!string.IsNullOrEmpty(ParentId.Filter()))
         {
             BLL_TestPaper_FrameDetail bll = new BLL_TestPaper_FrameDetail();
             if (bll.GetRecordCount("ParentId='" + ParentId + "'") > 0)
             {
                 return("2");
             }
             else
             {
                 if (bll.Delete(ParentId))
                 {
                     return("1");
                 }
                 else
                 {
                     return("");
                 }
             }
         }
         else
         {
             return("");
         }
     }
     catch (Exception)
     {
         return("");
     }
 }
Esempio n. 2
0
 protected void btnSubmit_Click(object sender, EventArgs e)
 {
     try
     {
         if (new BLL_TestPaper_FrameToTestpaper().GetRecordCount("TestPaper_Frame_Id='" + TestPaper_Frame_Id + "'") > 0)
         {
             ClientScript.RegisterStartupScript(this.GetType(), "save", "<script type='text/javascript'>layer.msg('操作失败,此试卷结构已关联试卷无法操作。',{ time: 2000,icon:2});</script>");
             return;
         }
         if (!string.IsNullOrEmpty(TestPaper_FrameDetail_Id))
         {
             Model_TestPaper_FrameDetail model = new BLL_TestPaper_FrameDetail().GetModel(TestPaper_FrameDetail_Id);
             if (model != null)
             {
                 //model.Remark = txtRemark.Text.TrimEnd();
                 model.TestQuestions_NumStr = txtBigNum.Text.TrimEnd();
                 model.TestQuestions_Num    = Convert.ToInt32(txtSort.Text.TrimEnd());
                 //model.TestQuestions_Type = ddlTestQuestions_Type.SelectedValue;
                 if (new BLL_TestPaper_FrameDetail().Update(model))
                 {
                     ClientScript.RegisterStartupScript(this.GetType(), "save", "<script type='text/javascript'>layer.msg('修改成功!',{ time: 2000,icon:1},function(){parent.loadData();parent.layer.close(index)});</script>");
                 }
                 else
                 {
                     ClientScript.RegisterStartupScript(this.GetType(), "save", "<script type='text/javascript'>layer.msg('修改失败!',{ time: 2000,icon:2});</script>");
                     return;
                 }
             }
         }
         else
         {
             Model_TestPaper_FrameDetail model = new Model_TestPaper_FrameDetail();
             model.TestPaper_FrameDetail_Id = Guid.NewGuid().ToString();
             model.TestPaper_Frame_Id       = TestPaper_Frame_Id;
             //model.Remark = txtRemark.Text.TrimEnd();
             model.TestQuestions_NumStr = txtBigNum.Text.TrimEnd();
             model.TestQuestions_Num    = Convert.ToInt32(txtSort.Text.TrimEnd());
             model.ParentId             = "0";
             model.CreateUser           = loginUser.SysUser_ID;
             model.CreateTime           = DateTime.Now;
             //model.TestQuestions_Type = ddlTestQuestions_Type.SelectedValue;
             if (new BLL_TestPaper_FrameDetail().Add(model))
             {
                 ClientScript.RegisterStartupScript(this.GetType(), "save", "<script type='text/javascript'>layer.msg('增加成功!',{ time: 2000,icon:1},function(){parent.loadData();parent.layer.close(index)});</script>");
             }
             else
             {
                 ClientScript.RegisterStartupScript(this.GetType(), "save", "<script type='text/javascript'>layer.msg('增加失败!',{ time: 2000,icon:2});</script>");
                 return;
             }
         }
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Esempio n. 3
0
        public static string GetSxxmbList(string TestPaper_Frame_Id)
        {
            try
            {
                #region 双向细目表
                DataTable     dt         = new DataTable();
                List <object> listReturn = new List <object>();
                //string strSql = string.Empty;
                //string strSqlCount = string.Empty;
                //strSql = @"select * from TestPaper_FrameDetail where TestPaper_Frame_Id ='" + TestPaper_Frame_Id + "' and ParentId<>'0' order by TestQuestions_Num,CreateTime";
                dt = new BLL_TestPaper_FrameDetail().GetList("TestPaper_Frame_Id ='" + TestPaper_Frame_Id + "' and ParentId<>'0' order by TestQuestions_Num,CreateTime").Tables[0]; //Rc.Common.DBUtility.DbHelperSQL.Query(strSql).Tables[0];
                int       inum   = 0;
                DataTable dtAttr = new BLL_TestPaper_FrameDetailToTestQuestions_Attr().GetList("TestPaper_Frame_Id='" + TestPaper_Frame_Id + "'").Tables[0];
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    inum++;
                    listReturn.Add(new
                    {
                        inum = (i + 1),
                        TestQuestions_NumStr = dt.Rows[i]["TestQuestions_NumStr"].ToString(),
                        TestQuestions_Type   = Rc.Common.EnumService.GetDescription <Rc.Model.Resources.TestQuestions_Type>(dt.Rows[i]["TestQuestions_Type"].ToString()),
                        KnowledgePoint       = GetAttr(dtAttr, dt.Rows[i]["TestPaper_FrameDetail_Id"].ToString(), "1").TrimEnd(','),
                        TargetText           = GetAttr(dtAttr, dt.Rows[i]["TestPaper_FrameDetail_Id"].ToString(), "2").TrimEnd(','),
                        ComplexityText       = GetAttr(dtAttr, dt.Rows[i]["TestPaper_FrameDetail_Id"].ToString(), "3").TrimEnd(','),
                        Score = dt.Rows[i]["Score"].ToString().clearLastZero(),
                    });
                }
                #endregion

                if (inum > 0)
                {
                    return(JsonConvert.SerializeObject(new
                    {
                        err = "null",
                        list = listReturn
                    }));
                }
                else
                {
                    return(JsonConvert.SerializeObject(new
                    {
                        err = "暂无数据"
                    }));
                }
            }
            catch (Exception ex)
            {
                return(JsonConvert.SerializeObject(new
                {
                    err = "error"// ex.Message.ToString()
                }));
            }
        }
Esempio n. 4
0
 public void LoadData()
 {
     try
     {
         Model_TestPaper_FrameDetail model = new BLL_TestPaper_FrameDetail().GetModel(TestPaper_FrameDetail_Id);
         if (model != null)
         {
             this.txtBigNum.Text = model.TestQuestions_NumStr;
             this.txtSort.Text   = model.TestQuestions_Num.ToString();
             //this.txtRemark.Text = model.Remark;
             //ddlTestQuestions_Type.SelectedValue = model.TestQuestions_Type;
         }
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Esempio n. 5
0
        public static string DeleteSmallData(string TestPaper_FrameDetail_Id, string TestPaper_Frame_Id)
        {
            try
            {
                TestPaper_FrameDetail_Id = TestPaper_FrameDetail_Id.Filter();
                TestPaper_Frame_Id       = TestPaper_Frame_Id.Filter();
                if (!string.IsNullOrEmpty(TestPaper_FrameDetail_Id) && !string.IsNullOrEmpty(TestPaper_Frame_Id))
                {
                    if (new BLL_TestPaper_FrameToTestpaper().GetRecordCount("TestPaper_Frame_Id='" + TestPaper_Frame_Id + "'") > 0)
                    {
                        return("2");
                    }
                    if (new BLL_TestPaper_FrameToTestpaper().GetRecordCount("TestPaper_Frame_Id='" + TestPaper_FrameDetail_Id + "'") > 0)
                    {
                        return("3");
                    }
                    else
                    {
                        BLL_TestPaper_FrameDetail bll = new BLL_TestPaper_FrameDetail();

                        if (bll.Delete(TestPaper_FrameDetail_Id))
                        {
                            return("1");
                        }
                        else
                        {
                            return("");
                        }
                    }
                }

                else
                {
                    return("");
                }
            }
            catch (Exception)
            {
                return("");
            }
        }
Esempio n. 6
0
 public void LoadData()
 {
     try
     {
         Model_TestPaper_FrameDetail model = new BLL_TestPaper_FrameDetail().GetModel(TestPaper_FrameDetail_Id);
         if (model != null)
         {
             txtSort.Text = model.TestQuestions_Num.ToString();
             this.txtTestQuestions_NumStr.Text = model.TestQuestions_NumStr;
             this.txtScore.Text = model.Score.ToString();
             ddlTestQuestionType_Web.SelectedValue = model.TestQuestionType_Web;
             //this.txtKnowledgePoint.Text = model.KnowledgePoint;
             //this.txtTargetText.Text = model.TargetText;
             ////this.txtRemark.Text = model.Remark;
             //ddlComplexityText.SelectedValue = model.ComplexityText;
             ddlTestQuestions_Type.SelectedValue = model.TestQuestions_Type;
         }
     }
     catch (Exception ex)
     {
         throw;
     }
 }