Ejemplo n.º 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Request.Form["pid"] != null)
     {
         string pid    = Request.Form["pid"].ToString();
         string getSql = "select * from H_Detail_Course where subordinate_course_id=" + pid;
         int    count  = DbHelperSQL.Query(getSql).Tables[0].Rows.Count;
         if (count > 0)
         {
             Response.Write(Tool.CreateJson("此基础课程下有详细课程,不能被删除掉", "2"));
             Response.End();
             return;
         }
         else
         {
             if (H_Basic_CourseClass.Delete(pid))
             {
                 Response.Write(Tool.CreateJson("操作成功", "1"));
             }
             else
             {
                 Response.Write(Tool.CreateJson("操作失败", "2"));
             }
         }
     }
     else
     {
         Response.Write(Tool.CreateJson("缺少参数", "3"));
     }
     Response.End();
 }
Ejemplo n.º 2
0
        private void InitData()
        {
            HttpCookie cookie = Request.Cookies["qx"];

            if (cookie != null)
            {
                qx = cookie.Values["qxid"].ToString();
            }
            if (qx != "1")
            {
                Response.Redirect("Error.aspx");
            }
            int PageIndex = 1;

            if (Request.QueryString["page"] != null)
            {
                int.TryParse(Request.QueryString["page"].ToString(), out PageIndex);
            }

            int       PageSize   = 10;
            int       TotalCount = 0;
            string    strWhere   = " 1=1 ";
            DataTable dt         = H_Basic_CourseClass.GetList(PageSize, PageIndex, strWhere, out TotalCount);

            this.Repeater1.DataSource = dt;
            this.Repeater1.DataBind();
            this.LiteralPage.Text = PageClass.BuildPage(PageIndex, TotalCount, PageSize);
        }
        private void InitData()
        {
            if (Request.QueryString["pid"] != null)
            {
                string pid = Request.QueryString["pid"].ToString();
                Model.H_Basic_Course basic_course = H_Basic_CourseClass.GetModel(pid);

                this.TextBasicCourse.Value = basic_course.basiccourse;
            }
        }
Ejemplo n.º 4
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     Model.H_Basic_Course basic_course = new Model.H_Basic_Course();
     basic_course.province    = this.HiddenProvince.Value.ToString();
     basic_course.basiccourse = this.TextBasicCourse.Value;
     if (H_Basic_CourseClass.Add(basic_course))
     {
         JScript.Alert("操作成功!", "a2", this);
     }
     else
     {
         JScript.Alert("操作失败!", "a2", this);
     }
 }
        protected void Button1_Click(object sender, EventArgs e)
        {
            Model.H_Basic_Course basic_course = new Model.H_Basic_Course();
            basic_course.id          = int.Parse(Request.QueryString["pid"]);
            basic_course.basiccourse = this.TextBasicCourse.Value.Trim();

            if (H_Basic_CourseClass.Update(basic_course))
            {
                JScript.AlertAndRedirect("操作成功", "BasicCourseList.aspx", this);
            }
            else
            {
                JScript.AlertAndRedirect("操作失败", "a2", this);
            }
        }