Example #1
0
        protected void gv01_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            int ID = int.Parse(gv01.DataKeys[e.RowIndex]["ID"].ToString());

            BLL.Papers          bll   = new BLL.Papers();
            Model.Papers        model = new Model.Papers();
            List <Model.Papers> list  = new List <Model.Papers>();

            list       = bll.Details(ID);
            model.ID   = ID;
            model.Name = list[0].Name;
            if (list[0].Lock > 0)
            {
                model.Lock = 0;
            }
            else
            {
                model.Lock = 1;
            }
            if (bll.Updata(model) > 0)
            {
                Common.Function.Redirect("List.aspx?TitleType=" + Request.QueryString["TitleType"] + "&CourseID=" + lb_CourseID.Text);
            }
            else
            {
                Common.Function.AlertRedirect("系统繁忙!", "List.aspx?TitleType=" + Request.QueryString["TitleType"] + "&CourseID=" + lb_CourseID.Text);
            }
        }
Example #2
0
        private void Bind(int ID)
        {
            BLL.Papers          bll  = new BLL.Papers();
            List <Model.Papers> list = new List <Model.Papers>();

            list         = bll.Details(ID);
            lb_Name.Text = list[0].Name;
            string url = "Radio.aspx?ID=" + ID;

            myIframe.Attributes.Add("src", url);

            CourseBind(list[0].CourseID);
        }
Example #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int ID = int.Parse(Request.QueryString["ID"]);

            BLL.Papers bll = new BLL.Papers();
            if (bll.Del(ID) > 0)
            {
                Common.Function.AlertRedirect("删除成功!", "List.aspx?TitleType=" + Request.QueryString["TitleType"] + "&CourseID=" + Request.QueryString["CourseID"]);
            }
            else
            {
                Common.Function.AlertRedirect("系统繁忙!", "List.aspx?TitleType=" + Request.QueryString["TitleType"] + "&CourseID=" + Request.QueryString["CourseID"]);
            }
        }
Example #4
0
 /// <summary>
 /// 添加试卷
 /// </summary>
 private void Papers()
 {
     BLL.Papers   bll   = new BLL.Papers();
     Model.Papers model = new Model.Papers();
     model.Name     = Common.Function.StringEncode(tb_Name.Text.Trim());
     model.CourseID = int.Parse(lb_CourseID.Text);
     model.Type     = Request.QueryString["TitleType"];
     PapersID       = bll.Add(model);
     if (PapersID > 0)
     {
     }
     else
     {
         Common.Function.AlertRedirect("系统繁忙!", "Auto.aspx?TitleType=" + Request.QueryString["TitleType"] + "&CourseID=" + int.Parse(lb_CourseID.Text));
     }
 }
Example #5
0
        protected void imgbt_Save_Click(object sender, ImageClickEventArgs e)
        {
            BLL.Papers   bll   = new BLL.Papers();
            Model.Papers model = new Model.Papers();
            model.Name     = Common.Function.StringEncode(tb_Name.Text.Trim());
            model.CourseID = int.Parse(lb_CourseID.Text);
            model.Type     = Request.QueryString["TitleType"];
            int PapersID = bll.Add(model);

            if (PapersID > 0)
            {
                AddPapersTitleList(PapersID);
            }
            else
            {
                Common.Function.AlertRedirect("系统繁忙!", "Add.aspx?TitleType=" + Request.QueryString["TitleType"] + "&CourseID=" + int.Parse(lb_CourseID.Text));
            }
        }
        /// <summary>
        /// 保存试卷
        /// </summary>
        /// <param name="context"></param>
        private void SavePaper(HttpContext context)
        {
            string Name      = context.Request["Name"].ToString();                //类别ID
            int    CourseID  = int.Parse(context.Request["CourseID"].ToString()); //课程ID
            string TitleType = context.Request["Type"].ToString();                //类型
            string TitleID   = context.Request["array"].ToString();               //题目ID字符串
            int    StatusID  = int.Parse(context.Request["Status_id"].ToString());

            //string[] arrayTitle = DelLastComma(TitleID).Split(',');
            string[] arrayTitle = TitleID.Split(',');
            string   str_score  = context.Request["str_score"].ToString();//分数字符串

            //string[] arrayScore= DelLastComma(str_score).Split(',');
            string[] arrayScore = str_score.Split(',');

            //context.Response.Write("{\"status\": 0, \"msg\": \"系统繁忙!\"}");
            //return;

            BLL.Papers   bll   = new BLL.Papers();
            Model.Papers model = new Model.Papers();
            model.Name     = Common.Function.StringEncode(Name);
            model.CourseID = CourseID;
            model.Type     = TitleType;
            int PapersID = bll.Add(model);

            if (PapersID > 0)
            {
                AddPapersTitleList(PapersID, arrayTitle, arrayScore, CourseID, StatusID);
            }
            else
            {
                context.Response.Write("{\"status\": 0, \"msg\": \"系统繁忙!\"}");
                return;
            }
            context.Response.Write("{\"status\": 1, \"msg\": \"保存成功!\"}");
            return;
        }
Example #7
0
        private void gv01_Bind()
        {
            BLL.Papers          bll  = new BLL.Papers();
            List <Model.Papers> list = new List <Model.Papers>();


            if (ViewState["PageCount"] == null)
            {
                ViewState["PageCount"] = 1;
            }
            if (int.Parse(lb_CourseID.Text) > 0)
            {
                list = bll.GetList(Convert.ToInt32(ViewState["PageCount"]), PageSize, Request.QueryString["TitleType"], int.Parse(lb_CourseID.Text));
            }
            else
            {
                list = bll.GetList(Convert.ToInt32(ViewState["PageCount"]), PageSize, Request.QueryString["TitleType"]);
            }
            gv01.DataSource = list;
            gv01.DataBind();

            if (list.Count > 0)
            {
                Total            = list[0].RowTotal;
                labAlert.Visible = false;
            }
            else
            {
                labAlert.Visible = true;
                labAlert.Text    = "没有任何资料!";
            }
            PageCount();
            Page_Status();

            aboutLock();
        }