コード例 #1
0
ファイル: DictController.cs プロジェクト: baixue001/IPS
        public ContentResult GOptionAdd_Submit()
        {
            M_Grade model = new M_Grade();

            if (Mid > 0)
            {
                model = gradeBll.GetGradeOption(Mid);
            }
            model.GradeName = GetParam("GradeName");
            if (model.GradeID > 0)
            {
                gradeBll.UpdateDic(model);
            }
            else
            {
                model.Cate     = CateID;
                model.ParentID = ParentID;
                if (ParentID == 0)
                {
                    model.Grade = 1;
                }
                else
                {
                    model.Grade = gradeBll.GetGradeOption(model.ParentID).Grade + 1;
                }
                gradeBll.AddGradeOption(model);
            }

            return(JavaScript("<script>parent.mybind();</script>"));
        }
コード例 #2
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string GradeName = this.txtGradeName.Text.Trim();

            if (string.IsNullOrEmpty(GradeName))
            {
                function.WriteErrMsg("选项值不能为空!");
            }
            else
            {
                int GradeID = DataConverter.CLng(this.HdnGradeID.Value);
                if (GradeID > 0)
                {
                    M_Grade info = B_GradeOption.GetGradeOption(GradeID);
                    info.GradeName = GradeName;
                    B_GradeOption.UpdateDic(info);
                }
                else
                {
                    M_Grade info = new M_Grade();
                    info.GradeID   = 0;
                    info.GradeName = GradeName;
                    info.ParentID  = DataConverter.CLng(this.HdnParentID.Value);
                    info.Cate      = CateID;
                    info.Grade     = DataConverter.CLng(this.LblLevel.Text);
                    B_GradeOption.AddGradeOption(info);
                }
                this.txtGradeName.Text = "";
                this.HdnGradeID.Value  = "0";
                this.btnSave.Text      = "添加";
                dBind();
            }
        }
コード例 #3
0
        protected void Save_Btn_Click(object sender, EventArgs e)
        {
            M_Grade GradeMod = new M_Grade();

            GradeMod.GradeID   = DataConverter.CLng(GradeID_Hid.Value);
            GradeMod.ParentID  = 0;
            GradeMod.GradeName = GradeName_T.Text;
            GradeMod.Cate      = CateID;
            if (GradeMod.GradeID > 0)
            {
                B_GradeOption.UpdateDic(GradeMod);
                function.WriteSuccessMsg("修改成功!");
            }
            else
            {
                B_GradeOption.AddGradeOption(GradeMod);
                function.WriteSuccessMsg("添加成功!");
            }
            MyBind();
        }
コード例 #4
0
ファイル: ExamController.cs プロジェクト: zoomlacms/web049
        public void QuestGrade_Add()
        {
            int     CateID   = DataConverter.CLng(Request["cate"]);
            M_Grade GradeMod = new M_Grade();

            GradeMod.GradeID   = DataConverter.CLng(Request.Form["GradeID_Hid"]);
            GradeMod.ParentID  = 0;
            GradeMod.GradeName = Request.Form["GradeName_T"];
            GradeMod.Cate      = CateID;
            if (GradeMod.GradeID > 0)
            {
                B_GradeOption.UpdateDic(GradeMod);
                function.WriteSuccessMsg("修改成功!", "QuestGrade?cate=" + CateID); return;
            }
            else
            {
                B_GradeOption.AddGradeOption(GradeMod);
                function.WriteSuccessMsg("添加成功!", "QuestGrade?cate=" + CateID);
            }
        }
コード例 #5
0
        public IActionResult QuestGrade_Add()
        {
            int     CateID   = DataConverter.CLng(RequestEx["cate"]);
            M_Grade GradeMod = new M_Grade();

            GradeMod.GradeID   = DataConverter.CLng(RequestEx["GradeID_Hid"]);
            GradeMod.ParentID  = 0;
            GradeMod.GradeName = RequestEx["GradeName_T"];
            GradeMod.Cate      = CateID;
            if (GradeMod.GradeID > 0)
            {
                gradeBll.UpdateDic(GradeMod);
                return(WriteOK("修改成功!", "QuestGrade?cate=" + CateID));
            }
            else
            {
                gradeBll.AddGradeOption(GradeMod);
                return(WriteOK("添加成功!", "QuestGrade?cate=" + CateID));
            }
        }