Example #1
0
        protected void EBtnSubmit_Click(object sender, EventArgs e)
        {
            int      id      = DataConverter.CLng(coureId.Value);
            M_Course mcourse = bcourse.GetSelect(id);

            mcourse.AddUser       = B_Admin.GetLogin().AdminId;
            mcourse.CoureseClass  = DataConverter.CLng(hfid.Value);
            mcourse.CoureseCode   = txt_Code.Text;
            mcourse.CoureseCredit = DataConverter.CDouble(txt_Creidt.Text);
            mcourse.CoureseRemark = txtRemark.Text;
            mcourse.CoureseThrun  = PYtitle.Text;
            mcourse.CourseName    = txt_Courename.Text;
            mcourse.Hot           = rblHot.Checked ? 1 : 0;
            if (mcourse != null && mcourse.id > 0)
            {
                bool result = bcourse.GetUpdate(mcourse);
                if (result)
                {
                    function.WriteSuccessMsg("修改成功!");
                }
                else
                {
                    function.WriteErrMsg("修改失败!");
                }
            }
            else
            {
                mcourse.AddTime = DateTime.Now;
                int ids = bcourse.GetInsert(mcourse);
                if (ids > 0)
                {
                    Button2.Enabled       = true;
                    Button2.OnClientClick = "location.href='AddCourseware.aspx?CourseID=" + ids + "'; return false;";
                    function.WriteSuccessMsg("添加成功!");
                }
                else
                {
                    function.WriteErrMsg("添加失败!");
                }
            }
        }
Example #2
0
        public void Course_Add()
        {
            M_Course courMod = courBll.GetSelect(Mid);

            courMod.CoureseClass  = DataConverter.CLng(Request.Form["TreeTlp_hid"]);
            courMod.CoureseCode   = Request.Form["CoureseCode"];
            courMod.CoureseCredit = DataConverter.CDouble(Request.Form["CoureseCredit"]);
            courMod.CoureseRemark = Request.Form["CoureseRemark"];
            courMod.CoureseThrun  = Request.Form["CoureseThrun"];
            courMod.CourseName    = Request.Form["CourseName"];
            courMod.Hot           = string.IsNullOrEmpty(Request.Form["Hot"]) ? 0 : 1;
            if (courMod.id > 0)
            {
                courBll.GetUpdate(courMod);
                function.WriteSuccessMsg("修改成功", "CourseManage"); return;
            }
            else
            {
                courMod.AddUser = badmin.GetAdminLogin().AdminId;
                courMod.AddTime = DateTime.Now;
                courBll.GetInsert(courMod);
                function.WriteSuccessMsg("添加成功", "CourseManage"); return;
            }
        }
Example #3
0
        public IActionResult Course_Add()
        {
            M_Course courMod = courBll.GetSelect(Mid);

            courMod.CoureseClass  = DataConverter.CLng(RequestEx["TreeTlp_hid"]);
            courMod.CoureseCode   = RequestEx["CoureseCode"];
            courMod.CoureseCredit = DataConverter.CDouble(RequestEx["CoureseCredit"]);
            courMod.CoureseRemark = RequestEx["CoureseRemark"];
            courMod.CoureseThrun  = RequestEx["CoureseThrun"];
            courMod.CourseName    = RequestEx["CourseName"];
            courMod.Hot           = string.IsNullOrEmpty(RequestEx["Hot"]) ? 0 : 1;
            if (courMod.id > 0)
            {
                courBll.GetUpdate(courMod);
                return(WriteOK("修改成功", "CourseManage"));
            }
            else
            {
                courMod.AddUser = adminMod.AdminId;
                courMod.AddTime = DateTime.Now;
                courBll.GetInsert(courMod);
                return(WriteOK("添加成功", "CourseManage"));
            }
        }