//保存
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            ChkAdminLevel("_ybd_course_info", EnumCollection.ActionEnum.Modify.ToString()); //检查权限
            BLL.course_info   bll   = new BLL.course_info();
            Model.course_info model = bll.GetModel(this.id);

            model.group_id    = Convert.ToInt32(txtgroup_id.Text);
            model.category_id = Convert.ToInt32(txtcategory_id.Text);
            model.name        = Convert.ToString(txtname.Text);
            model.cover       = Convert.ToString(txtcover.Text);
            model.info        = Convert.ToString(txtinfo.Text);
            model.notice      = Convert.ToString(txtnotice.Text);
            model.qrcode      = Convert.ToString(txtqrcode.Text);
            model.qrcode_logo = Convert.ToString(txtqrcode_logo.Text);
            model.user_id     = Convert.ToInt32(txtuser_id.Text);
            model.is_show     = Convert.ToInt32(txtis_show.Text);
            model.add_time    = Convert.ToDateTime(txtadd_time.Text);

            if (bll.Update(model))
            {
                AddAdminLog(EnumCollection.ActionEnum.Modify.ToString(), "修改课程信息信息,主键:" + id); //记录日志
                JscriptMsg("修改课程信息信息成功!", "Manage.aspx");
            }
            else
            {
                JscriptMsg("保存过程中发生错误!", "");
            }
        }
Exemplo n.º 2
0
        private bool DoAdd()
        {
            BLL.course_info   bll   = new BLL.course_info();
            Model.course_info model = new Model.course_info();

            model.group_id    = (int)EnumCollection.course_group.精品微课;
            model.category_id = Convert.ToInt32(this.ddlCategory.SelectedValue);
            model.name        = Convert.ToString(txtname.Text);
            model.cover       = Convert.ToString(txtcover.Text);
            model.info        = Convert.ToString(txtinfo.Text);
            model.qrcode      = "";
            model.qrcode_logo = Convert.ToString(txtqrcode_logo.Text);
            model.user_id     = admin_info.id;
            model.is_show     = (int)EnumCollection.course_is_show.是;
            model.add_time    = System.DateTime.Now;

            int id = bll.Add(model);

            if (id > 0)
            {
                model.id     = id;
                model.qrcode = "/QrCode.aspx?type=course&id=" + id;
                bll.Update(model);

                AddAdminLog(EnumCollection.ActionEnum.Add.ToString(), "添加课程信息,主键:" + id); //记录日志
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 3
0
        private void SetIsShow()
        {
            int id = RequestHelper.GetFormInt("id");

            BLL.course_info   bll   = new BLL.course_info();
            Model.course_info model = bll.GetModel(id);
            if (model != null)
            {
                if (model.is_show == (int)EnumCollection.course_is_show.是)
                {
                    model.is_show = (int)EnumCollection.course_is_show.否;
                }
                else
                {
                    model.is_show = (int)EnumCollection.course_is_show.是;
                }

                bll.Update(model);

                HttpContext.Current.Response.Write("1");
                HttpContext.Current.Response.End();
            }
            else
            {
                HttpContext.Current.Response.Write("0");
                HttpContext.Current.Response.End();
            }
        }
Exemplo n.º 4
0
        private bool DoEdit(int id)
        {
            BLL.course_info   bll   = new BLL.course_info();
            Model.course_info model = bll.GetModel(id);

            model.group_id    = (int)EnumCollection.course_group.精品微课;
            model.category_id = Convert.ToInt32(this.ddlCategory.SelectedValue);
            model.name        = Convert.ToString(txtname.Text);
            model.cover       = Convert.ToString(txtcover.Text);
            model.info        = Convert.ToString(txtinfo.Text);
            model.qrcode      = "/QrCode.aspx?type=course&id=" + model.id;
            model.qrcode_logo = Convert.ToString(txtqrcode_logo.Text);

            if (bll.Update(model))
            {
                AddAdminLog(EnumCollection.ActionEnum.Modify.ToString(), "修改课程信息,主键:" + model.id); //记录日志
                return(true);
            }
            else
            {
                return(false);
            }
        }