Пример #1
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/html";
            if (context.Session["Admin"] == null || context.Session["Admin"].ToString() == "")
            {
                context.Response.Redirect("/html/adminLogin.html");
            }

            string    action    = context.Request["Action"];
            string    adminName = context.Session["Admin"].ToString();
            string    adminId   = "";
            DataTable dts       =
                SqlHelper.ExecuteDataTable("select *  from Admin where Account = " + adminName);

            foreach (DataRow dr in dts.Rows)
            {
                adminId = dr["Admin_ID"].ToString();
            }
            //查询学生
            if (action == "Search")
            {
                string requestNum = context.Request["PageNumber"];
                string html       = FenYe.FY("FAQs.ashx", "searchFAQs.html", "V_F", requestNum, "FAQ_ID", adminId);
                context.Response.Write(html);
            }
            else if (action == "add")
            {
                string html = CommonHelper.RenderHtml("addFAQs.html", "");
                context.Response.Write(html);
            }
            else if (action == "Add")
            {
                string aid       = context.Request["Admin_ID"];
                string title     = context.Request["Title"];
                string content   = context.Request["Content"];
                string is_delete = context.Request["IS_DELETE"];
                SqlHelper.ExecuteNonQuery("Insert into FAQs(Admin_ID,Title,Content,IS_DELETE) values(@Admin_ID,@Title,@Content,@IS_DELETE)",
                                          new SqlParameter("@Admin_ID", aid)
                                          , new SqlParameter("@Title", title)
                                          , new SqlParameter("@Content", content)
                                          , new SqlParameter("@IS_DELETE", is_delete)

                                          );
                context.Response.Redirect("http://*****:*****@User_ID,@Admin_ID,@C_Name,@C_Email,@C_Subject,@Message,@IS_DELETE)",
                                          new SqlParameter("@User_ID", uid)
                                          , new SqlParameter("@Admin_ID", aid)
                                          , new SqlParameter("@C_Name", cname)
                                          , new SqlParameter("@C_Email", cemail)
                                          , new SqlParameter("@C_Subject", csubject)
                                          , new SqlParameter("@Message", message)
                                          , new SqlParameter("@IS_DELETE", is_delete)
                                          );
                context.Response.Redirect("http://*****:*****@Admin_ID,Title=@Title,Content=@Content,IS_DELETE=@IS_DELETE where FAQ_ID=@FAQ_ID"
                                          , new SqlParameter("@Admin_ID", aid)
                                          , new SqlParameter("@Title", title)
                                          , new SqlParameter("@Content", content)
                                          , new SqlParameter("@IS_DELETE", is_delete)
                                          , new SqlParameter("@FAQ_ID", id)
                                          );
                context.Response.Redirect("http://*****:*****@IS_DELETE where FAQ_ID=@FAQ_ID",
                                          new SqlParameter("@IS_DELETE", is_delete)
                                          , new SqlParameter("@FAQ_ID", id)
                                          );
                context.Response.Redirect("http://localhost:54436/FAQs.ashx?Action=Search");
            }

            else
            {
                context.Response.Redirect("http://localhost:54436/FAQs.ashx?Action=Search");
            }
        }
Пример #2
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/html";
            if (context.Session["Admin"] == null || context.Session["Admin"].ToString() == "")
            {
                context.Response.Redirect("/html/adminLogin.html");
            }

            string    action    = context.Request["Action"];
            string    adminName = context.Session["Admin"].ToString();
            string    adminId   = "";
            DataTable dts       =
                SqlHelper.ExecuteDataTable("select *  from Admin where Account = " + adminName);

            foreach (DataRow dr in dts.Rows)
            {
                adminId = dr["Admin_ID"].ToString();
            }
            //查询学生
            if (action == "Search")
            {
                string requestNum = context.Request["PageNumber"];
                string html       = FenYe.FY("backAbout.ashx", "searchAbout.html", "V_About", requestNum, "Article_ID", adminId);
                context.Response.Write(html);
            }
            else if (action == "add")
            {
                string html = CommonHelper.RenderHtml("addAbout.html", "");
                context.Response.Write(html);
            }
            else if (action == "Add")
            {
                string aid       = context.Request["Admin_ID"];
                string title     = context.Request["Title"];
                string content   = context.Request["Content"];
                string judgeTime = context.Request["Time"];

                string time      = null;
                string is_delete = context.Request["IS_DELETE"];

                int judgeTimee = 1;
                judgeTimee = int.Parse(judgeTime);

                if (judgeTimee == 1)
                {
                    System.DateTime currentTime = new System.DateTime();
                    currentTime = System.DateTime.Now;
                    time        = currentTime.ToString("f");
                }
                SqlHelper.ExecuteNonQuery("Insert into Article(Admin_ID,Title,Content,Time,IS_DELETE) values(@Admin_ID,@Title,@Content,@Time,@IS_DELETE)",
                                          new SqlParameter("@Admin_ID", aid)
                                          , new SqlParameter("@Title", title)
                                          , new SqlParameter("@Content", content)
                                          , new SqlParameter("@Time", time)
                                          , new SqlParameter("@IS_DELETE", is_delete)

                                          );
                context.Response.Redirect("http://*****:*****@User_ID,@Admin_ID,@C_Name,@C_Email,@C_Subject,@Message,@IS_DELETE)",
                                          new SqlParameter("@User_ID", uid)
                                          , new SqlParameter("@Admin_ID", aid)
                                          , new SqlParameter("@C_Name", cname)
                                          , new SqlParameter("@C_Email", cemail)
                                          , new SqlParameter("@C_Subject", csubject)
                                          , new SqlParameter("@Message", message)
                                          , new SqlParameter("@IS_DELETE", is_delete)
                                          );
                context.Response.Redirect("http://*****:*****@Admin_ID,Title=@Title,Content=@Content,Time=@Time,IS_DELETE=@IS_DELETE where Article_ID=@Article_ID"
                                          , new SqlParameter("@Admin_ID", aid)
                                          , new SqlParameter("@Title", title)
                                          , new SqlParameter("@Content", content)
                                          , new SqlParameter("@Time", time)
                                          , new SqlParameter("@IS_DELETE", is_delete)
                                          , new SqlParameter("@Article_ID", id)
                                          );
                context.Response.Redirect("http://*****:*****@IS_DELETE where Article_ID=@Article_ID",
                                          new SqlParameter("@IS_DELETE", is_delete)
                                          , new SqlParameter("@Article_ID", id)
                                          );
                context.Response.Redirect("http://localhost:54436/backAbout.ashx?Action=Search");
            }

            else
            {
                context.Response.Redirect("http://localhost:54436/backAbout.ashx?Action=Search");
            }
        }
Пример #3
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/html";
            if (context.Session["Admin"] == null || context.Session["Admin"].ToString() == "")
            {
                context.Response.Redirect("/html/adminLogin.html");
            }
            string    action    = context.Request["Action"];
            string    adminName = context.Session["Admin"].ToString();
            string    adminId   = "";
            DataTable dts       =
                SqlHelper.ExecuteDataTable("select *  from Admin where Account = " + adminName);

            foreach (DataRow dr in dts.Rows)
            {
                adminId = dr["Admin_ID"].ToString();
            }
            //查询学生
            if (action == "Search")
            {
                string requestNum = context.Request["PageNumber"];
                string html       = FenYe.FY("Category.ashx", "Category.html", "Category", requestNum, "Category_ID", adminId);
                context.Response.Write(html);
            }
            else if (action == "add")
            {
                string html = CommonHelper.RenderHtml("addCategory.html", "");
                context.Response.Write(html);
            }
            else if (action == "Add")
            {
                string name      = context.Request["Name"];
                int    is_delete = 0;
                SqlHelper.ExecuteNonQuery("Insert into Category(Admin_ID,C_Name,IS_DELETE) values(@Admin_ID,@C_Name,@IS_DELETE)",
                                          new SqlParameter("@Admin_ID", adminId)
                                          , new SqlParameter("@C_Name", name)
                                          , new SqlParameter("@IS_DELETE", is_delete)
                                          );
                context.Response.Redirect("http://*****:*****@C_Name,IS_DELETE=@IS_DELETE where Category_ID=@Category_ID"
                                          , new SqlParameter("@C_Name", name)
                                          , new SqlParameter("@IS_DELETE", is_delete)
                                          , new SqlParameter("@Category_ID", id)
                                          );
                context.Response.Redirect("http://*****:*****@IS_DELETE where Category_ID=@Category_ID",
                                          new SqlParameter("@IS_DELETE", is_delete)
                                          , new SqlParameter("@Category_ID", id)
                                          );
                context.Response.Redirect("http://localhost:54436/category.ashx?Action=Search");
            }

            else
            {
                context.Response.Redirect("http://localhost:54436/category.ashx?Action=Search");
            }
        }
Пример #4
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/html";
            if (context.Session["Admin"] == null || context.Session["Admin"].ToString() == "")
            {
                context.Response.Redirect("/html/adminLogin.html");
            }
            string    action    = context.Request["Action"];
            string    adminName = context.Session["Admin"].ToString();
            string    adminId   = "";
            DataTable dts       =
                SqlHelper.ExecuteDataTable("select *  from Admin where Account = " + adminName);

            foreach (DataRow dr in dts.Rows)
            {
                adminId = dr["Admin_ID"].ToString();
            }
            //查询学生
            if (action == "Search")
            {
                string requestNum = context.Request["PageNumber"];
                string html       = FenYe.FY("Product.ashx", "product.html", "V_P", requestNum, "Product_ID", adminId);
                context.Response.Write(html);
            }
            else if (action == "add")
            {
                DataTable dt =
                    SqlHelper.ExecuteDataTable("select *  from Category where IS_DELETE = 0 and Admin_ID = " + adminId + "");
                string html = CommonHelper.RenderHtml("addProduct.html", dt.Rows);
                context.Response.Write(html);
            }
            else if (action == "Add")
            {
                HttpServerUtility server   = context.Server;
                HttpRequest       request  = context.Request;
                HttpResponse      response = context.Response;

                HttpPostedFile file     = context.Request.Files[0];
                string         fullName = "";
                if (file.ContentLength > 0)
                {
                    string extName  = Path.GetExtension(file.FileName);
                    string fileName = Guid.NewGuid().ToString();
                    fullName = fileName + extName;

                    string imageFilter = ".jpg|.png|.gif|.ico";// 随便模拟几个图片类型
                    if (imageFilter.Contains(extName.ToLower()))
                    {
                        string phyFilePath = server.MapPath("~/Upload/Image/") + fullName;
                        file.SaveAs(phyFilePath);
                        //response.Write("上传成功!文件名:" + fullName + "<br />");
                        //response.Write(string.Format("<img src='Upload/Image/{0}'/>", fullName));
                    }
                }
                string P_Name       = context.Request["P_Name"];
                string Category_ID  = context.Request["Category_ID"];
                string Availability = context.Request["Availability"];
                string P_Price      = context.Request["P_Price"];
                string Model        = context.Request["Model"];
                string Manufacturer = context.Request["Manufacturer"];
                string Quantity     = context.Request["Quantity"];
                string P_Detail     = context.Request["P_Detail"];
                string IS_TJ        = context.Request["IS_TJ"];
                string P_Pic        = string.Format("http://*****:*****@Category_ID," +
                                          "@Admin_ID,@P_Name,@P_Price,@P_Pic,@Availability,@Model," +
                                          "@Manufacturer,@P_Detail,@IS_DELETE,@Quantity,@IS_TJ)",
                                          new SqlParameter("@Category_ID", Category_ID)
                                          , new SqlParameter("@Admin_ID", adminId)
                                          , new SqlParameter("@P_Name", P_Name)
                                          , new SqlParameter("@P_Price", P_Price)
                                          , new SqlParameter("@P_Pic", P_Pic)
                                          , new SqlParameter("@Availability", Availability)
                                          , new SqlParameter("@Model", Model)
                                          , new SqlParameter("@Manufacturer", Manufacturer)
                                          , new SqlParameter("@P_Detail", P_Detail)
                                          , new SqlParameter("@IS_DELETE", IS_DELETE)
                                          , new SqlParameter("@Quantity", Quantity)
                                          , new SqlParameter("@IS_TJ", IS_TJ)
                                          );
                context.Response.Redirect("http://*****:*****@Category_ID," +
                                          "Admin_ID=@Admin_ID,P_Name=@P_Name,P_Price=@P_Price,P_Pic=@P_Pic" +
                                          ",Availability=@Availability,Model=@Model,Manufacturer=@Manufacturer," +
                                          "P_Detail=@P_Detail,IS_DELETE=@IS_DELETE,Quantity=@Quantity,IS_TJ=@IS_TJ " +
                                          " where Product_ID=@Product_ID",
                                          new SqlParameter("@Category_ID", Category_ID)
                                          , new SqlParameter("@Admin_ID", adminId)
                                          , new SqlParameter("@P_Name", P_Name)
                                          , new SqlParameter("@P_Price", P_Price)
                                          , new SqlParameter("@P_Pic", P_Pic)
                                          , new SqlParameter("@Availability", Availability)
                                          , new SqlParameter("@Model", Model)
                                          , new SqlParameter("@Manufacturer", Manufacturer)
                                          , new SqlParameter("@P_Detail", P_Detail)
                                          , new SqlParameter("@IS_DELETE", IS_DELETE)
                                          , new SqlParameter("@Quantity", Quantity)
                                          , new SqlParameter("@IS_TJ", IS_TJ)
                                          , new SqlParameter("@Product_ID", Product_ID)
                                          );
                context.Response.Redirect("http://*****:*****@IS_DELETE where Product_ID=@Product_ID",
                                          new SqlParameter("@IS_DELETE", is_delete)
                                          , new SqlParameter("@Product_ID", id)
                                          );
                context.Response.Redirect("http://localhost:54436/product.ashx?Action=Search");
            }
            else
            {
                context.Response.Redirect("http://localhost:54436/product.ashx?Action=Search");
            }
        }
Пример #5
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/html";
            if (context.Session["User"] == null || context.Session["User"].ToString() == "")
            {
                context.Response.Redirect("/html/login.html");
            }
            string action = context.Request["Action"];

            //查询学生
            if (action == "Search")
            {
                string requestNum = context.Request["PageNumber"];
                string html       = FenYe.FY("Teacher.ashx", "teacher.html", "Teacher", requestNum, "T_ID", "");
                context.Response.Write(html);
            }
            else if (action == "Add")
            {
                string name      = context.Request["Name"];
                string phone     = context.Request["Phone"];
                string bir       = context.Request["Bir"];
                string email     = context.Request["Email"];
                int    is_delete = 0;
                SqlHelper.ExecuteNonQuery("Insert into Teacher(T_NAME,T_PHONE,T_EMAIL,T_BR,IS_DELETE) values(@T_NAME,@T_PHONE,@T_EMAIL,@T_BR,@IS_DELETE)",
                                          new SqlParameter("@T_NAME", name)
                                          , new SqlParameter("@T_PHONE", phone)
                                          , new SqlParameter("@T_EMAIL", email)
                                          , new SqlParameter("@T_BR", bir)
                                          , new SqlParameter("@IS_DELETE", is_delete)
                                          );
                context.Response.Redirect("http://*****:*****@T_NAME,@T_PHONE,@T_EMAIL,@T_BR,@IS_DELETE)",
                                          new SqlParameter("@T_NAME", name)
                                          , new SqlParameter("@T_PHONE", phone)
                                          , new SqlParameter("@T_EMAIL", email)
                                          , new SqlParameter("@T_BR", bir)
                                          , new SqlParameter("@IS_DELETE", is_delete)
                                          );
                context.Response.Write("");
            }
            else if (action == "Edit")
            {
                string    id = context.Request["Id"];
                DataTable dt =
                    SqlHelper.ExecuteDataTable("select *  from Teacher where T_ID = " + id);
                string html = CommonHelper.RenderHtml("editTeacher.html", dt.Rows);
                context.Response.Write(html);
            }
            else if (action == "edit")
            {
                string id        = context.Request["Id"];
                string name      = context.Request["Name"];
                string phone     = context.Request["Phone"];
                string bir       = context.Request["Bir"];
                string email     = context.Request["Email"];
                int    is_delete = 0;
                SqlHelper.ExecuteNonQuery("update Teacher set T_NAME=@T_NAME,T_PHONE=@T_PHONE,T_EMAIL=@T_EMAIL,T_BR=@T_BR,IS_DELETE=@IS_DELETE where T_ID=@T_ID",
                                          new SqlParameter("@T_NAME", name)
                                          , new SqlParameter("@T_PHONE", phone)
                                          , new SqlParameter("@T_EMAIL", email)
                                          , new SqlParameter("@T_BR", bir)
                                          , new SqlParameter("@IS_DELETE", is_delete)
                                          , new SqlParameter("@T_ID", id)
                                          );
                context.Response.Redirect("http://*****:*****@IS_DELETE where T_ID=@T_ID",
                                          new SqlParameter("@IS_DELETE", is_delete)
                                          , new SqlParameter("@T_ID", id)
                                          );
                context.Response.Redirect("http://*****:*****@IS_DELETE where T_ID=@T_ID",
                                          new SqlParameter("@IS_DELETE", is_delete)
                                          , new SqlParameter("@T_ID", id)
                                          );
                context.Response.Write("");
            }
            else
            {
                context.Response.Redirect("http://localhost:54436/teacher.ashx?Action=Search");
            }
        }
Пример #6
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/html";
            if (context.Session["User"] == null || context.Session["User"].ToString() == "")
            {
                context.Response.Redirect("/html/loginContact.html");
            }
            string User_ID = context.Session["Id"].ToString();
            string action  = context.Request["Action"];

            /*
             * context.Response.ContentType = "text/html";
             * if (context.Session["Admin"] == null || context.Session["Admin"].ToString() == "")
             * {
             *  context.Response.Redirect("/html/adminLogin.html");
             * }
             *
             * string action = context.Request["Action"];
             */
            /*
             * string adminName = context.Session["Admin"].ToString();
             * string adminId = "";
             * DataTable dts =
             * SqlHelper.ExecuteDataTable("select *  from Admin where Account = " + adminName);
             * foreach (DataRow dr in dts.Rows)
             * {
             *  adminId = dr["Admin_ID"].ToString();
             * }
             */
            //查询学生
            if (action == "Search")
            {
                string requestNum = context.Request["PageNumber"];
                string html       = FenYe.FY("Contact.ashx", "searchContact.html", "V_C", requestNum, "Contact_ID", "");
                context.Response.Write(html);
            }
            else if (action == "add")
            {
                string html = CommonHelper.RenderHtml("addContact.html", "");
                context.Response.Write(html);
            }
            else if (action == "Add")
            {
                /*
                 * id="User_ID" name="User_ID"
                 * id="Admin_ID" name="Admin_ID
                 * id="C_Name" name="C_Name"
                 * id="C_Email" name="C_Email"
                 * id="C_Subject" name="C_Subject"
                 * id="Message" name="Message"
                 */
                string uid      = context.Request["User_ID"];
                string aid      = context.Request["Admin_ID"];
                string cname    = context.Request["C_Name"];
                string cemail   = context.Request["C_Email"];
                string csubject = context.Request["C_Subject"];
                string message  = context.Request["Message"];

                int is_delete = 0;
                SqlHelper.ExecuteNonQuery("Insert into Contact(User_ID,Admin_ID,C_Name,C_Email,C_Subject,Message,IS_DELETE) values(@User_ID,@Admin_ID,@C_Name,@C_Email,@C_Subject,@Message,@IS_DELETE)",
                                          new SqlParameter("@User_ID", uid)
                                          , new SqlParameter("@Admin_ID", aid)
                                          , new SqlParameter("@C_Name", cname)
                                          , new SqlParameter("@C_Email", cemail)
                                          , new SqlParameter("@C_Subject", csubject)
                                          , new SqlParameter("@Message", message)
                                          , new SqlParameter("@IS_DELETE", is_delete)
                                          );

                context.Response.Redirect("http://*****:*****@User_ID,@Admin_ID,@C_Name,@C_Email,@C_Subject,@Message,@IS_DELETE)",
                                          new SqlParameter("@User_ID", uid)
                                          , new SqlParameter("@Admin_ID", aid)
                                          , new SqlParameter("@C_Name", cname)
                                          , new SqlParameter("@C_Email", cemail)
                                          , new SqlParameter("@C_Subject", csubject)
                                          , new SqlParameter("@Message", message)
                                          , new SqlParameter("@IS_DELETE", is_delete)
                                          );
                context.Response.Redirect("http://*****:*****@C_Name,IS_DELETE=@IS_DELETE where Category_ID=@Category_ID"
                                          , new SqlParameter("@C_Name", name)
                                          , new SqlParameter("@IS_DELETE", is_delete)
                                          , new SqlParameter("@Category_ID", id)
                                          );
                context.Response.Redirect("http://*****:*****@IS_DELETE where Category_ID=@Category_ID",
                                          new SqlParameter("@IS_DELETE", is_delete)
                                          , new SqlParameter("@Category_ID", id)
                                          );
                context.Response.Redirect("http://localhost:54436/category.ashx?Action=Search");
            }

            else
            {
                context.Response.Redirect("http://localhost:54436/category.ashx?Action=Search");
            }
        }
Пример #7
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/html";
            if (context.Session["User"] == null || context.Session["User"].ToString() == "")
            {
                context.Response.Redirect("/html/login.html");
            }
            string action = context.Request["Action"];

            //查询学生
            if (action == "Search")
            {
                string requestNum = context.Request["PageNumber"];
                string html       = FenYe.FY("Student.ashx", "student.html", "V_S", requestNum, "S_ID", "");
                context.Response.Write(html);
            }
            else if (action == "add")
            {
                DataTable dt =
                    SqlHelper.ExecuteDataTable("select *  from BanJi where IS_DELETE = 0");
                string html = CommonHelper.RenderHtml("addStudent.html", dt.Rows);
                context.Response.Write(html);
            }
            else if (action == "Add")
            {
                string name      = context.Request["Name"];
                string sex       = context.Request["Sex"];
                string bir       = context.Request["Bir"];
                string high      = context.Request["High"];
                string tc        = context.Request["TC"];
                string bj        = context.Request["BJ"];
                int    is_delete = 0;
                SqlHelper.ExecuteNonQuery("Insert into Student(S_NAME,B_ID,S_SEX,S_HIGH,IS_TC,IS_DELETE,S_BIR) values(@S_NAME,@B_ID,@S_SEX,@S_HIGH,@IS_TC,@IS_DELETE,@S_BIR)",
                                          new SqlParameter("@S_NAME", name)
                                          , new SqlParameter("@B_ID", bj)
                                          , new SqlParameter("@S_SEX", sex)
                                          , new SqlParameter("@S_HIGH", high)
                                          , new SqlParameter("@IS_TC", tc)
                                          , new SqlParameter("@IS_DELETE", is_delete)
                                          , new SqlParameter("@S_BIR", bir)
                                          );
                context.Response.Redirect("http://*****:*****@S_NAME,@B_ID,@S_SEX,@S_HIGH,@IS_TC,@IS_DELETE,@S_BIR)",
                                          new SqlParameter("@S_NAME", name)
                                          , new SqlParameter("@B_ID", bj)
                                          , new SqlParameter("@S_SEX", sex)
                                          , new SqlParameter("@S_HIGH", high)
                                          , new SqlParameter("@IS_TC", tc)
                                          , new SqlParameter("@IS_DELETE", is_delete)
                                          , new SqlParameter("@S_BIR", bir)
                                          );
                context.Response.Write("");
            }
            else if (action == "Edit")
            {
                string    id = context.Request["Id"];
                DataTable dt =
                    SqlHelper.ExecuteDataTable("select *  from V_S where S_ID = " + id);
                DataTable dt2 =
                    SqlHelper.ExecuteDataTable("select *  from BanJi where IS_DELETE = 0");
                string html = CommonHelper2.RenderHtml("editStudent.html", dt.Rows, dt2.Rows);
                context.Response.Write(html);
            }
            else if (action == "edit")
            {
                string id        = context.Request["Id"];
                string name      = context.Request["Name"];
                string sex       = context.Request["Sex"];
                string bir       = context.Request["Bir"];
                string high      = context.Request["High"];
                string tc        = context.Request["TC"];
                string bj        = context.Request["BJ"];
                int    is_delete = 0;
                SqlHelper.ExecuteNonQuery("update Student set B_ID=@B_ID,S_NAME=@S_NAME,S_SEX=@S_SEX,S_HIGH=@S_HIGH,IS_TC=@IS_TC,IS_DELETE=@IS_DELETE,S_BIR=@S_BIR where S_ID=@S_ID",
                                          new SqlParameter("@B_ID", bj)
                                          , new SqlParameter("@S_NAME", name)
                                          , new SqlParameter("@S_SEX", sex)
                                          , new SqlParameter("@S_HIGH", high)
                                          , new SqlParameter("@IS_TC", tc)
                                          , new SqlParameter("@IS_DELETE", is_delete)
                                          , new SqlParameter("@S_BIR", bir)
                                          , new SqlParameter("@S_ID", id)
                                          );
                context.Response.Redirect("http://*****:*****@IS_DELETE where S_ID=@S_ID",
                                          new SqlParameter("@IS_DELETE", is_delete)
                                          , new SqlParameter("@S_ID", id)
                                          );
                context.Response.Redirect("http://*****:*****@IS_DELETE where S_ID=@S_ID",
                                          new SqlParameter("@IS_DELETE", is_delete)
                                          , new SqlParameter("@S_ID", id)
                                          );
                context.Response.Write("");
            }
            else
            {
                context.Response.Redirect("http://localhost:54436/student.ashx?Action=Search");
            }
        }
Пример #8
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/html";
            if (context.Session["User"] == null || context.Session["User"].ToString() == "")
            {
                context.Response.Redirect("/html/login.html");
            }
            string action = context.Request["Action"];

            //查询学生
            if (action == "Search")
            {
                string requestNum = context.Request["PageNumber"];
                string html       = FenYe.FY("BanJi.ashx", "bJ.html", "V_BJ", requestNum, "B_ID", "");
                context.Response.Write(html);
            }
            else if (action == "add")
            {
                DataTable dt =
                    SqlHelper.ExecuteDataTable("select *  from Teacher where IS_DELETE = 0");
                string html = CommonHelper.RenderHtml("addBJ.html", dt.Rows);
                context.Response.Write(html);
            }
            else if (action == "Add")
            {
                string name      = context.Request["Name"];
                string t_id      = context.Request["Teacher"];
                string num       = context.Request["Num"];
                int    is_delete = 0;
                SqlHelper.ExecuteNonQuery("Insert into BanJi(T_ID,B_NAME,B_NUM,IS_DELETE) values(@T_ID,@B_NAME,@B_NUM,@IS_DELETE)",
                                          new SqlParameter("@T_ID", t_id)
                                          , new SqlParameter("@B_NAME", name)
                                          , new SqlParameter("@B_NUM", num)
                                          , new SqlParameter("@IS_DELETE", is_delete)
                                          );
                context.Response.Redirect("http://*****:*****@T_ID,@B_NAME,@B_NUM,@IS_DELETE)",
                                          new SqlParameter("@T_ID", t_id)
                                          , new SqlParameter("@B_NAME", name)
                                          , new SqlParameter("@B_NUM", num)
                                          , new SqlParameter("@IS_DELETE", is_delete)
                                          );
                context.Response.Write("");
            }
            else if (action == "Edit")
            {
                string    id = context.Request["Id"];
                DataTable dt =
                    SqlHelper.ExecuteDataTable("select *  from V_BJ where B_ID = " + id);
                DataTable dt2 =
                    SqlHelper.ExecuteDataTable("select *  from Teacher where IS_DELET = 0");
                string html = CommonHelper2.RenderHtml("editBJ.html", dt.Rows, dt2.Rows);
                context.Response.Write(html);
            }
            else if (action == "edit")
            {
                string id        = context.Request["Id"];
                string name      = context.Request["Name"];
                string t_id      = context.Request["Teacher"];
                string num       = context.Request["Num"];
                int    is_delete = 0;
                SqlHelper.ExecuteNonQuery("update BanJi set T_ID=@T_ID,B_NAME=@B_NAME,B_NUM=@B_NUM,IS_DELETE=@IS_DELETE where B_ID=@B_ID",
                                          new SqlParameter("@T_ID", t_id)
                                          , new SqlParameter("@B_NAME", name)
                                          , new SqlParameter("@B_NUM", num)
                                          , new SqlParameter("@IS_DELETE", is_delete)
                                          , new SqlParameter("@B_ID", id)
                                          );
                context.Response.Redirect("http://*****:*****@IS_DELETE where B_ID=@B_ID",
                                          new SqlParameter("@IS_DELETE", is_delete)
                                          , new SqlParameter("@B_ID", id)
                                          );
                context.Response.Redirect("http://*****:*****@IS_DELETE where B_ID=@B_ID",
                                          new SqlParameter("@IS_DELETE", is_delete)
                                          , new SqlParameter("@B_ID", id)
                                          );
                context.Response.Write("");
            }
            else
            {
                context.Response.Redirect("http://localhost:54436/banji.ashx?Action=Search");
            }
        }