예제 #1
0
        private void SetCaseIsShow()
        {
            int id = RequestHelper.GetFormInt("id");

            BLL.common_resource   bll   = new BLL.common_resource();
            Model.common_resource model = bll.GetModel(id);
            if (model != null)
            {
                if (model.is_del == (int)EnumCollection.YesOrNot.是)
                {
                    model.is_del = (int)EnumCollection.YesOrNot.否;
                }
                else
                {
                    model.is_del = (int)EnumCollection.YesOrNot.是;
                }

                bll.Update(model);

                HttpContext.Current.Response.Write("1");
                HttpContext.Current.Response.End();
            }
            else
            {
                HttpContext.Current.Response.Write("0");
                HttpContext.Current.Response.End();
            }
        }
예제 #2
0
        private bool DoEdit(int id)
        {
            BLL.common_resource   bll   = new BLL.common_resource();
            Model.common_resource model = bll.GetModel(id);

            model.from_id     = (int)EnumCollection.resource_from.课堂;
            model.group_id    = (int)EnumCollection.resource_group.公共资源;
            model.type        = (int)EnumCollection.resource_type.图文资源;
            model.school_id   = 0;
            model.school_name = "";
            model.data_id     = class_id;
            model.user_id     = user_id;
            model.title       = Convert.ToString(txttitle.Text.Trim());
            model.cover       = "";
            model.path        = Convert.ToString(txtcontents.Text.Trim());
            model.qrcode      = "/QrCode.aspx?type=re&id=" + id;
            model.file_name   = "";
            model.extend      = "";
            model.likn_url    = "";
            model.share_user  = "";

            if (bll.Update(model))
            {
                AddAdminLog(EnumCollection.ActionEnum.Modify.ToString(), "修改课堂知识点信息,主键:" + id); //记录日志
                return(true);
            }
            else
            {
                return(false);
            }
        }
예제 #3
0
        //保存
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            ChkAdminLevel("_ybd_common_resource", EnumCollection.ActionEnum.Modify.ToString()); //检查权限
            BLL.common_resource   bll   = new BLL.common_resource();
            Model.common_resource model = bll.GetModel(this.id);

            model.from_id     = Convert.ToInt32(txtfrom_id.Text);
            model.group_id    = Convert.ToInt32(txtgroup_id.Text);
            model.type        = Convert.ToInt32(txttype.Text);
            model.school_id   = Convert.ToInt32(txtschool_id.Text);
            model.school_name = Convert.ToString(txtschool_name.Text);
            model.data_id     = Convert.ToInt32(txtdata_id.Text);
            model.user_id     = Convert.ToInt32(txtuser_id.Text);
            model.title       = Convert.ToString(txttitle.Text);
            model.cover       = Convert.ToString(txtcover.Text);
            model.path        = Convert.ToString(txtpath.Text);
            model.qrcode      = Convert.ToString(txtqrcode.Text);
            model.file_name   = Convert.ToString(txtfile_name.Text);
            model.extend      = Convert.ToString(txtextend.Text);
            model.likn_url    = Convert.ToString(txtlikn_url.Text);
            model.share_user  = Convert.ToString(txtshare_user.Text);
            model.sort        = Convert.ToInt32(txtsort.Text);
            model.add_time    = Convert.ToDateTime(txtadd_time.Text);
            model.is_del      = Convert.ToInt32(txtis_del.Text);

            if (bll.Update(model))
            {
                AddAdminLog(EnumCollection.ActionEnum.Modify.ToString(), "修改资源信息信息,主键:" + id); //记录日志
                JscriptMsg("修改资源信息信息成功!", "Manage.aspx");
            }
            else
            {
                JscriptMsg("保存过程中发生错误!", "");
            }
        }
예제 #4
0
        private bool DoEdit(int id)
        {
            BLL.common_resource   bll   = new BLL.common_resource();
            Model.common_resource model = bll.GetModel(id);

            model.from_id     = (int)EnumCollection.resource_from.课堂;
            model.group_id    = (int)EnumCollection.resource_group.公共资源;
            model.type        = (int)EnumCollection.resource_type.视频资源;
            model.school_id   = 0;
            model.school_name = "";
            model.data_id     = class_id;
            model.user_id     = admin_info.id;
            model.title       = getStr(this.hdfVal.Value, 1);
            model.cover       = this.txtcover.Text.Trim();
            model.path        = this.txtpath.Text.Trim();
            model.file_name   = this.hdfVal.Value;
            model.extend      = getStr(this.hdfVal.Value, 2);
            model.likn_url    = "";
            model.qrcode      = "/QrCode.aspx?type=re&id=" + id;
            model.share_user  = "";

            if (bll.Update(model))
            {
                AddAdminLog(EnumCollection.ActionEnum.Modify.ToString(), "修改课堂视频资源信息,主键:" + id); //记录日志
                return(true);
            }
            else
            {
                return(false);
            }
        }
예제 #5
0
        private bool DoAdd()
        {
            BLL.common_resource   bll   = new BLL.common_resource();
            Model.common_resource model = new Model.common_resource();

            model.from_id     = (int)EnumCollection.resource_from.课堂;
            model.group_id    = (int)EnumCollection.resource_group.公共资源;
            model.type        = (int)EnumCollection.resource_type.图文资源;
            model.school_id   = 0;
            model.school_name = "";
            model.data_id     = class_id;
            model.user_id     = user_id;
            model.title       = Convert.ToString(txttitle.Text.Trim());
            model.cover       = "";
            model.path        = Convert.ToString(txtcontents.Text.Trim());
            model.qrcode      = "";
            model.file_name   = "";
            model.extend      = "";
            model.likn_url    = "";
            model.share_user  = "";
            model.add_time    = System.DateTime.Now;

            Model.common_resource maxModel = bll.GetModel(" from_id = " + model.from_id + " and group_id = " + model.group_id + " and type = " + model.type + " and data_id = " + class_id + " order by sort desc ");
            if (maxModel != null)
            {
                model.sort = maxModel.sort + 1;
            }
            else
            {
                model.sort = 1;
            }

            int id = bll.Add(model);

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

                AddAdminLog(EnumCollection.ActionEnum.Add.ToString(), "添加课堂知识点信息,主键:" + id); //记录日志
                return(true);
            }
            else
            {
                return(false);
            }
        }
        private bool DoEdit(int id)
        {
            BLL.common_resource   bll   = new BLL.common_resource();
            Model.common_resource model = bll.GetModel(id);

            model.from_id     = (int)EnumCollection.resource_from.课堂;
            model.group_id    = (int)EnumCollection.resource_group.公共资源;
            model.type        = (int)EnumCollection.resource_type.文档资源;
            model.school_id   = 0;
            model.school_name = "";
            model.data_id     = class_id;
            model.user_id     = user_id;

            string fileNames = Utils.DelLastChar(this.hdfVal.Value, "|");
            string path      = Utils.DelLastChar(this.txtpath.Text, "|");

            string[] files = fileNames.Split('|');
            string[] paths = path.Split('|');

            model.title      = getStr(files[0], 1);
            model.cover      = "";
            model.path       = paths[0];
            model.file_name  = files[0];
            model.extend     = getStr(files[0], 2);
            model.likn_url   = "";
            model.qrcode     = "/QrCode.aspx?type=re&id=" + id;
            model.share_user = "";

            if (bll.Update(model))
            {
                AddAdminLog(EnumCollection.ActionEnum.Modify.ToString(), "修改资源信息,主键:" + id); //记录日志
                return(true);
            }
            else
            {
                return(false);
            }
        }
예제 #7
0
        //保存
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            BLL.common_resource   bll   = new BLL.common_resource();
            Model.common_resource model = null;

            if (action == EnumCollection.ActionEnum.Modify.ToString())                        //修改
            {
                ChkAdminLevel("_resource_list", EnumCollection.ActionEnum.Modify.ToString()); //检查权限
                if (!DoEdit(this.id))
                {
                    JscriptMsg("保存过程中发生错误!", "");
                    return;
                }

                JscriptMsg("修改资源成功!", "resource_list.aspx?page=" + this.page + "&chapter=" + this.chapter + "&course_id=" + this.course_id);
            }
            else //添加
            {
                ChkAdminLevel("_resource_list", EnumCollection.ActionEnum.Add.ToString()); //检查权限

                #region 添加操作
                if (Convert.ToInt32(this.rbtnType.SelectedValue) == (int)EnumCollection.resource_type.图文资源)
                {
                    model = new Model.common_resource();

                    model.from_id  = (int)EnumCollection.resource_from.精品微课;
                    model.group_id = Convert.ToInt32(this.rbtnGroup.SelectedValue);
                    model.type     = Convert.ToInt32(this.rbtnType.SelectedValue);
                    if (model.group_id != (int)EnumCollection.resource_group.学校资源)
                    {
                        model.school_id   = 0;
                        model.school_name = "";
                    }
                    else
                    {
                        model.school_id   = Convert.ToInt32(this.ddlSchool.SelectedValue);
                        model.school_name = this.ddlSchool.SelectedItem.Text;
                    }
                    model.data_id   = chapter;
                    model.user_id   = admin_info.id;
                    model.title     = Convert.ToString(txttitle.Text.Trim());
                    model.cover     = "";
                    model.path      = Convert.ToString(txtcontents.Text.Trim());
                    model.qrcode    = "";
                    model.file_name = "";
                    model.extend    = "";
                    model.likn_url  = "";
                    model.add_time  = System.DateTime.Now;

                    Model.common_resource maxModel = bll.GetModel(" from_id = " + (int)EnumCollection.resource_from.精品微课 + " and data_id = " + chapter + " order by sort desc ");
                    if (maxModel != null)
                    {
                        model.sort = maxModel.sort + 1;
                    }
                    else
                    {
                        model.sort = 1;
                    }

                    string userids = string.Empty;
                    for (int i = 0; i < ckbUser.Items.Count; i++)
                    {
                        if (ckbUser.Items[i].Selected)
                        {
                            userids += "," + ckbUser.Items[i].Value + ",";
                        }
                    }
                    model.share_user = userids;

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

                        AddAdminLog(EnumCollection.ActionEnum.Add.ToString(), "添加图文资源信息,主键:" + id); //记录日志
                        JscriptMsg("添加图文资源成功!", "resource_list.aspx?chapter=" + this.chapter + "&course_id=" + this.course_id);
                    }
                    else
                    {
                        JscriptMsg("保存过程中发生错误!", "");
                        return;
                    }
                }
                else
                {
                    string   fileNames             = Utils.DelLastChar(this.hdfVal.Value, "|");
                    string   path                  = Utils.DelLastChar(this.txtpath.Text, "|");
                    string[] files                 = fileNames.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries);
                    string[] paths                 = path.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries);
                    int      count                 = 0;
                    Model.common_resource maxModel = null;

                    for (int i = 0; i < files.Length; i++)
                    {
                        model = new Model.common_resource();

                        model.from_id  = (int)EnumCollection.resource_from.精品微课;
                        model.group_id = Convert.ToInt32(this.rbtnGroup.SelectedValue);
                        model.type     = Convert.ToInt32(this.rbtnType.SelectedValue);
                        if (model.group_id == (int)EnumCollection.resource_group.公共资源)
                        {
                            model.school_id   = 0;
                            model.school_name = "";
                        }
                        else
                        {
                            model.school_id   = Convert.ToInt32(this.ddlSchool.SelectedValue);
                            model.school_name = this.ddlSchool.SelectedItem.Text;
                        }
                        model.data_id = chapter;
                        model.user_id = admin_info.id;

                        string file = files[i];

                        model.title     = getStr(file, 1);
                        model.cover     = "";
                        model.path      = paths[i];
                        model.qrcode    = "";
                        model.file_name = file;
                        model.extend    = getStr(file, 2);
                        model.likn_url  = "";
                        model.add_time  = System.DateTime.Now;

                        maxModel = bll.GetModel(" from_id = " + (int)EnumCollection.resource_from.精品微课 + " and data_id = " + chapter + " order by sort desc ");
                        if (maxModel != null)
                        {
                            model.sort = maxModel.sort + 1;
                        }
                        else
                        {
                            model.sort = 1;
                        }

                        string userids = string.Empty;
                        for (int j = 0; j < ckbUser.Items.Count; j++)
                        {
                            if (ckbUser.Items[j].Selected)
                            {
                                userids += "," + ckbUser.Items[j].Value + ",";
                            }
                        }
                        model.share_user = userids;

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

                            AddAdminLog(EnumCollection.ActionEnum.Add.ToString(), "添加" + Enum.GetName(typeof(EnumCollection.resource_type), model.type) + "资源信息,主键:" + id); //记录日志
                            count++;
                        }
                    }

                    JscriptMsg("添加" + Enum.GetName(typeof(EnumCollection.resource_type), model.type) + "资源成功!总文件" + files.Length + "个,成功" + count + "个", "resource_list.aspx?chapter=" + this.chapter + "&course_id=" + this.course_id);
                }
                #endregion
            }
        }
예제 #8
0
        private bool DoEdit(int id)
        {
            BLL.common_resource   bll   = new BLL.common_resource();
            Model.common_resource model = bll.GetModel(id);

            model.from_id  = (int)EnumCollection.resource_from.精品微课;
            model.group_id = Convert.ToInt32(this.rbtnGroup.SelectedValue);
            model.type     = Convert.ToInt32(this.rbtnType.SelectedValue);
            if (model.group_id != (int)EnumCollection.resource_group.学校资源)
            {
                model.school_id   = 0;
                model.school_name = "";
            }
            else
            {
                model.school_id   = Convert.ToInt32(this.ddlSchool.SelectedValue);
                model.school_name = this.ddlSchool.SelectedItem.Text;
            }
            model.data_id = chapter;
            model.user_id = admin_info.id;

            if (model.type == (int)EnumCollection.resource_type.图文资源)
            {
                model.title     = Convert.ToString(txttitle.Text.Trim());
                model.cover     = "";
                model.path      = Convert.ToString(txtcontents.Text.Trim());
                model.qrcode    = "/QrCode.aspx?type=re&id=" + id;
                model.file_name = "";
                model.extend    = "";
                model.likn_url  = "";
            }
            else
            {
                string   fileNames = Utils.DelLastChar(this.hdfVal.Value, "|");
                string   path      = Utils.DelLastChar(this.txtpath.Text, "|");
                string[] files     = fileNames.Split('|');
                string[] paths     = path.Split('|');

                model.title     = getStr(files[0], 1);
                model.cover     = "";
                model.path      = paths[0];
                model.file_name = files[0];
                model.extend    = getStr(files[0], 2);
                model.likn_url  = "";
                model.qrcode    = "/QrCode.aspx?type=re&id=" + id;
            }

            string userids = string.Empty;

            for (int i = 0; i < ckbUser.Items.Count; i++)
            {
                if (ckbUser.Items[i].Selected)
                {
                    userids += "," + ckbUser.Items[i].Value + ",";
                }
            }
            model.share_user = userids;

            if (bll.Update(model))
            {
                AddAdminLog(EnumCollection.ActionEnum.Modify.ToString(), "修改资源信息,主键:" + id); //记录日志
                return(true);
            }
            else
            {
                return(false);
            }
        }
예제 #9
0
        private void saveWordVoice()
        {
            int    id          = RequestHelper.GetFormInt("id");
            int    group       = RequestHelper.GetFormInt("group");
            int    school      = RequestHelper.GetFormInt("school");
            string school_name = RequestHelper.GetFormString("school_name");
            int    chapter     = RequestHelper.GetFormInt("chapter");
            string title       = RequestHelper.GetFormString("title");
            string userids     = RequestHelper.GetFormString("userids");
            string words       = RequestHelper.GetFormString("words");

            Appoa.Web.UI.ManagePage mngPage = new Web.UI.ManagePage();
            BLL.common_resource     bll     = new BLL.common_resource();
            Model.common_resource   model   = bll.GetModel(id);

            if (model != null)
            {
                model.group_id = group;
                if (model.group_id == (int)EnumCollection.resource_group.公共资源)
                {
                    model.school_id   = 0;
                    model.school_name = "";
                }
                else
                {
                    model.school_id   = school;
                    model.school_name = school_name;
                }

                model.data_id = chapter;
                model.user_id = mngPage.GetAdminInfo().id;

                model.title      = title;
                model.path       = words;
                model.share_user = userids;

                if (bll.Update(model))
                {
                    mngPage.AddAdminLog(EnumCollection.ActionEnum.Modify.ToString(), "修改英文发音资源信息,主键:" + id); //记录日志

                    writeMsgSuccess("保存成功");
                }
                else
                {
                    writeMsgError("保存失败");
                }
            }
            else
            {
                model          = new Model.common_resource();
                model.from_id  = (int)EnumCollection.resource_from.精品微课;
                model.group_id = group;
                model.type     = (int)EnumCollection.resource_type.英文发音;

                if (model.group_id == (int)EnumCollection.resource_group.公共资源)
                {
                    model.school_id   = 0;
                    model.school_name = "";
                }
                else
                {
                    model.school_id   = school;
                    model.school_name = school_name;
                }
                model.data_id = chapter;
                model.user_id = mngPage.GetAdminInfo().id;

                model.title      = title;
                model.cover      = "";
                model.path       = words;
                model.qrcode     = "";
                model.file_name  = "";
                model.extend     = "";
                model.likn_url   = "";
                model.add_time   = System.DateTime.Now;
                model.share_user = userids;

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

                    mngPage.AddAdminLog(EnumCollection.ActionEnum.Add.ToString(), "添加英文发音资源信息,主键:" + row); //记录日志

                    writeMsgSuccess("保存成功");
                }
                else
                {
                    writeMsgError("保存失败");
                }
            }
        }
예제 #10
0
        //保存
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            BLL.common_resource   bll   = new BLL.common_resource();
            Model.common_resource model = null;

            if (action == EnumCollection.ActionEnum.Add.ToString())                                    //添加
            {
                ChkAdminLevel("_classroom_video_materials", EnumCollection.ActionEnum.Add.ToString()); //检查权限

                #region 添加操作

                string[] files  = this.hdfVal.Value.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries);
                string[] thumbs = this.hdfThumb.Value.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries);
                string[] paths  = this.txtpath.Text.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries);
                int      count  = 0;
                Model.common_resource maxModel = null;

                for (int i = 0; i < files.Length; i++)
                {
                    model = new Model.common_resource();

                    model.from_id     = (int)EnumCollection.resource_from.课堂;
                    model.group_id    = (int)EnumCollection.resource_group.公共资源;
                    model.type        = (int)EnumCollection.resource_type.视频资源;
                    model.school_id   = 0;
                    model.school_name = "";
                    model.data_id     = class_id;
                    model.user_id     = admin_info.id;

                    string file = files[i];

                    model.title      = getStr(file, 1);
                    model.cover      = thumbs[i];
                    model.path       = paths[i];
                    model.qrcode     = "";
                    model.file_name  = file;
                    model.extend     = getStr(file, 2);
                    model.likn_url   = "";
                    model.share_user = "";
                    model.add_time   = System.DateTime.Now;

                    maxModel = bll.GetModel(" from_id = " + model.from_id + " and group_id = " + model.group_id + " and type = " + model.type + " and data_id = " + class_id + " order by sort desc ");
                    if (maxModel != null)
                    {
                        model.sort = maxModel.sort + 1;
                    }
                    else
                    {
                        model.sort = 1;
                    }

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

                        AddAdminLog(EnumCollection.ActionEnum.Add.ToString(), "添加" + Enum.GetName(typeof(EnumCollection.resource_type), model.type) + "资源信息,主键:" + id); //记录日志
                        count++;
                    }

                    JscriptMsg("添加" + Enum.GetName(typeof(EnumCollection.resource_type), model.type) + "资源成功!总文件" + files.Length + "个,成功" + count + "个", "video_list.aspx?class_id=" + this.class_id);
                }
                #endregion
            }
        }