public void MyBind()
 {
     if (Pid > 0)
     {
         PKnow_L.Text = knowBll.SelReturnModel(Pid).K_name;
     }
     if (NodeID > 0)//添加知识点
     {
         QuessClass_L.Text = classBll.GetSelect(NodeID).C_ClassName;
     }
     if (KnowID > 0)
     {
         M_Questions_Knowledge knowMod = knowBll.SelReturnModel(KnowID);
         Name_T.Text  = knowMod.K_name;
         PKnow_L.Text = "无";
         M_Questions_Knowledge parentMod = knowBll.SelReturnModel(knowMod.Pid);
         if (parentMod != null)
         {
             PKnow_L.Text = knowBll.SelReturnModel(knowMod.Pid).K_name;
         }
         QuessClass_L.Text            = classBll.GetSelect(knowMod.K_class_id).C_ClassName;
         GradeList_Drop.SelectedValue = knowMod.Grade.ToString();
         IsSyst_Check.Checked         = knowMod.IsSys == 1;
         Status_Check.Checked         = knowMod.Status == 1;
         OldName_Hid.Value            = knowMod.K_name;
     }
 }
Exemplo n.º 2
0
 private SqlParameter[] GetParam(M_Questions_Knowledge mqk)
 {
     SqlParameter[] para = new SqlParameter[] {
         new SqlParameter("@k_name", mqk.K_name),
         new SqlParameter("@k_class_id", mqk.K_class_id),
         new SqlParameter("@k_OrderBy", mqk.K_OrderBy),
         new SqlParameter("@k_id", mqk.K_id)
     };
     return(para);
 }
Exemplo n.º 3
0
        public ActionResult AddKnowledge()
        {
            int NodeID = DataConverter.CLng(Request.QueryString["nid"]);

            if (NodeID > 0)
            {
                ViewBag.cname = classBll.GetSelect(NodeID).C_ClassName;
            }
            M_Questions_Knowledge knowMod = knowBll.SelReturnModel(Mid);

            if (knowMod == null)
            {
                knowMod = new M_Questions_Knowledge();
            }
            ViewBag.gradelist = MVCHelper.ToSelectList(B_GradeOption.GetGradeList(6, 0), "GradeName", "GradeID", knowMod.Grade.ToString());
            return(View(knowMod));
        }
Exemplo n.º 4
0
 private List <M_Questions_Knowledge> GetKByds(DataSet ds)
 {
     if (ds != null && ds.Tables[0].Rows.Count > 0)
     {
         List <M_Questions_Knowledge> mqks = new List <M_Questions_Knowledge>();
         foreach (DataRow dr in ds.Tables[0].Rows)
         {
             M_Questions_Knowledge mqk = new M_Questions_Knowledge();
             mqk.K_id       = DataConverter.CLng(dr["k_id"]);
             mqk.K_name     = dr["k_name"].ToString();
             mqk.K_class_id = DataConverter.CLng(dr["k_class_id"]);
             mqk.K_OrderBy  = DataConverter.CLng(dr["k_orderBy"]);
             mqks.Add(mqk);
         }
         return(mqks);
     }
     return(new List <M_Questions_Knowledge>());
 }
Exemplo n.º 5
0
        public void Knowledge_Add()
        {
            M_Questions_Knowledge knowMod = knowBll.SelReturnModel(Mid);

            if (knowMod == null)
            {
                knowMod = new M_Questions_Knowledge();
            }

            int    NodeID = DataConverter.CLng(Request.QueryString["nid"]);
            string name   = Request.Form["K_name"].Trim();

            if ((knowMod.K_id > 0 && !knowMod.K_name.Equals(name)) ||
                knowMod.K_id <= 0)
            {
                DataTable tempdt = knowBll.SelByName(NodeID, name);
                if (tempdt.Rows.Count > 0)
                {
                    function.WriteErrMsg("同级下知识点名称不能重复!"); return;
                }
            }
            knowMod.K_name     = name;
            knowMod.Status     = string.IsNullOrEmpty(Request.Form["Status"]) ? 0 : 1;
            knowMod.IsSys      = string.IsNullOrEmpty(Request.Form["IsSys"]) ? 0 : 1;
            knowMod.Grade      = DataConverter.CLng(Request.Form["Grade"]);
            knowMod.K_class_id = NodeID;
            if (knowMod.K_id > 0)
            {
                knowBll.GetUpdate(knowMod);
            }
            else
            {
                knowMod.CUser = badmin.GetAdminLogin().AdminId;
                knowMod.CDate = DateTime.Now;
                knowBll.insert(knowMod);
            }
            function.WriteSuccessMsg("操作成功", "KnowledgeManage?nid=" + NodeID);
        }
Exemplo n.º 6
0
        public IActionResult Knowledge_Add()
        {
            M_Questions_Knowledge knowMod = knowBll.SelReturnModel(Mid);

            if (knowMod == null)
            {
                knowMod = new M_Questions_Knowledge();
            }

            int    NodeID = DataConverter.CLng(RequestEx["nid"]);
            string name   = RequestEx["K_name"].Trim();

            if ((knowMod.K_id > 0 && !knowMod.K_name.Equals(name)) ||
                knowMod.K_id <= 0)
            {
                DataTable tempdt = knowBll.SelByName(NodeID, name);
                if (tempdt.Rows.Count > 0)
                {
                    return(WriteErr("同级下知识点名称不能重复!"));
                }
            }
            knowMod.K_name     = name;
            knowMod.Status     = string.IsNullOrEmpty(RequestEx["Status"]) ? 0 : 1;
            knowMod.IsSys      = string.IsNullOrEmpty(RequestEx["IsSys"]) ? 0 : 1;
            knowMod.Grade      = DataConverter.CLng(RequestEx["Grade"]);
            knowMod.K_class_id = NodeID;
            if (knowMod.K_id > 0)
            {
                knowBll.GetUpdate(knowMod);
            }
            else
            {
                knowMod.CUser = adminMod.AdminId;
                knowMod.CDate = DateTime.Now;
                knowBll.insert(knowMod);
            }
            return(WriteOK("操作成功", "KnowledgeManage?nid=" + NodeID));
        }
        protected void Save_Btn_Click(object sender, EventArgs e)
        {
            M_Questions_Knowledge knowMod = new M_Questions_Knowledge();

            if (KnowID > 0)
            {
                knowMod = knowBll.SelReturnModel(KnowID);
            }
            knowMod.CDate = DateTime.Now;
            knowMod.CUser = badmin.GetAdminLogin().AdminId;
            string name = Name_T.Text.Replace(" ", "");//替换空格

            knowMod.K_name     = name;
            knowMod.Status     = Status_Check.Checked ? 1 : 0;
            knowMod.IsSys      = IsSyst_Check.Checked ? 1 : 0;
            knowMod.Pid        = KnowID > 0 ? knowMod.Pid : Pid;
            knowMod.Grade      = DataConverter.CLng(GradeList_Drop.SelectedValue);
            knowMod.K_class_id = NodeID;
            if (!OldName_Hid.Value.Equals(name))
            {
                DataTable tempdt = knowBll.SelByName(NodeID, Name_T.Text);
                if (tempdt.Rows.Count > 0)
                {
                    function.WriteErrMsg("同级下知识点名称不能重复!");
                }
            }
            if (KnowID > 0)
            {
                knowMod.K_id = KnowID;
                knowBll.GetUpdate(knowMod);
            }
            else
            {
                knowBll.insert(knowMod);
            }
            function.WriteSuccessMsg("操作成功!", "KnowledgeManage.aspx?nid=" + NodeID);
        }
Exemplo n.º 8
0
 public int insert(M_Questions_Knowledge model)
 {
     return(DBCenter.Insert(model));
 }
Exemplo n.º 9
0
 public bool GetUpdate(M_Questions_Knowledge model)
 {
     return(DBCenter.UpdateByID(model, model.K_id));
 }
Exemplo n.º 10
0
 public int insert(M_Questions_Knowledge model)
 {
     return(Sql.insertID(strTableName, model.GetParameters(), BLLCommon.GetParas(model), BLLCommon.GetFields(model)));
 }
Exemplo n.º 11
0
 public bool GetUpdate(M_Questions_Knowledge model)
 {
     return(Sql.UpdateByIDs(strTableName, PK, model.K_id.ToString(), BLLCommon.GetFieldAndPara(model), initMod.GetParameters()));
 }