protected void Page_Load(object sender, EventArgs e) { if (Request.Form["pid"] != null) { string pid = Request.Form["pid"].ToString(); string getSql = "select isexam from H_Order where id=" + pid + ""; string isexam = DbHelperSQL.GetSingle(getSql).ToString(); if (isexam == "1") { Response.Write(Tool.CreateJson("该订单已核对,不能被删除", "2")); } else { if (H_OrderClass.Delete(pid)) { Response.Write(Tool.CreateJson("操作成功", "1")); } else { Response.Write(Tool.CreateJson("操作失败", "2")); } } } else { Response.Write(Tool.CreateJson("缺少参数", "3")); } Response.End(); }
public void InitData() { string strWhere = "ispayclerk=1"; HttpCookie cookie = Request.Cookies["qx"]; if (cookie != null) { qx = cookie.Values["qxid"].ToString(); username = HttpUtility.UrlDecode(cookie.Values["user"].ToString(), Encoding.UTF8); } if (qx == "2") { strWhere += " and pay_cle_handler='" + username + "'"; } if (Request.QueryString["pay_cle_handler"] != null) { string pay_cle_handler = HttpUtility.UrlDecode(Request.QueryString["pay_cle_handler"].ToString(), Encoding.UTF8); strWhere += " and pay_cle_handler='" + pay_cle_handler + "'"; } if (Request.QueryString["begintime"] != null) { string begintime = DateTime.Parse(Request.QueryString["begintime"].ToString()).ToString("yyyy-MM-dd HH:mm:ss"); strWhere += " and pay_cle_time>='" + begintime + "'"; } if (Request.QueryString["endtime"] != null) { string endtime = DateTime.Parse(Request.QueryString["endtime"].ToString()).ToString("yyyy-MM-dd HH:mm:ss"); strWhere += " and pay_cle_time<='" + endtime + "'"; } string getSql = "select sum(clerk_share) from H_OrderView where " + strWhere; object objzj = DbHelperSQL.GetSingle(getSql); string total = ""; if (objzj != null) { total = objzj.ToString(); } int PageIndex = 1; if (Request.QueryString["page"] != null) { int.TryParse(Request.QueryString["page"].ToString(), out PageIndex); } int PageSize = 10; int TotalCount = 0; DataTable dt = H_OrderClass.GetList(PageSize, PageIndex, strWhere, out TotalCount); this.Repeater1.DataSource = dt; this.Repeater1.DataBind(); this.LiteralTotal.Text = total; this.LiteralPage.Text = PageClass.BuildPage(PageIndex, TotalCount, PageSize); }
protected void Page_Load(object sender, EventArgs e) { HttpCookie cookie = Request.Cookies["qx"]; if (cookie != null) { qx = cookie.Values["qxid"].ToString(); username = HttpUtility.UrlDecode(cookie.Values["user"].ToString(), Encoding.UTF8); if (qx == "3" || qx == "4") { Response.Redirect("Error.aspx"); } } if (Request.Form["idArray"] != null) { string idArray = Request.Form["idArray"].ToString(); string[] split = idArray.Split(new char[] { '|' }); Dictionary <string, SqlParameter[]> dic = new Dictionary <string, SqlParameter[]>(); foreach (string pid in split) { if (pid != "") { Model.H_Order order = H_OrderClass.GetModel(pid); order.id = int.Parse(pid); order.ispaystudent = 1; order.pay_stu_handler = username; order.pay_stu_time = System.DateTime.Now; dic.Add(pid, H_OrderClass.Param(order)); } } StringBuilder strSql = new StringBuilder(); strSql.Append("update H_Order set "); strSql.Append("ispaystudent=@ispaystudent,"); strSql.Append("pay_stu_handler=@pay_stu_handler,"); strSql.Append("pay_stu_time=@pay_stu_time"); strSql.Append(" where id=@id"); if (DbHelperSQL.ExecuteSqlTran(strSql.ToString(), dic)) { Response.Write(Tool.CreateJson("操作成功!", "1")); } else { Response.Write(Tool.CreateJson("操作失败!", "2")); } } else { Response.Write(Tool.CreateJson("缺少参数", "3")); } Response.End(); }
protected void Button1_Click(object sender, EventArgs e) { Model.H_Order order = new Model.H_Order(); order.course_id = int.Parse(this.HiddenCourse.Value); order.order_number = this.TextOrder_num.Value.Trim(); order.username = username; order.isexam = 0; order.ispaystudent = 0; order.ispayservice = 0; order.ispayclerk = 0; order.create_time = System.DateTime.Now; if (H_OrderClass.Add(order)) { JScript.AlertAndRedirect("操作成功!", "OrderList.aspx", this); } else { JScript.Alert("操作失败!", "a2", this); } }
public void InitData() { if (Request.QueryString["pid"] != null) { pid = Request.QueryString["pid"].ToString(); Model.H_Order order = H_OrderClass.GetModel(pid); this.TextOrder_num.Value = order.order_number; sub_courseID = order.course_id.ToString(); detail_courseID = order.course_id.ToString(); string subBasicID = "select subordinate_course_id from H_Detail_Course where id=" + sub_courseID; sub_courseID = DbHelperSQL.GetSingle(subBasicID).ToString(); string getBasicID = "select father from H_Subordinate_Course where id=" + sub_courseID; basic_courseID = DbHelperSQL.GetSingle(getBasicID).ToString(); // this.TextOrder_num.Value = H_OrderClass.GetModel(Request.QueryString["pid"].ToString()).order_number; } }
private void InitData() { HttpCookie cookie = Request.Cookies["qx"]; if (cookie != null) { qx = cookie.Values["qxid"].ToString(); username = HttpUtility.UrlDecode(cookie.Values["user"].ToString(), Encoding.UTF8); } if (qx == "4") { string student_name = HttpUtility.UrlDecode(cookie.Values["user"].ToString(), Encoding.UTF8); strWhere = "student_name='" + student_name + "'"; } if (qx == "3") { string clerk_name = HttpUtility.UrlDecode(cookie.Values["user"].ToString(), Encoding.UTF8); strWhere = "clerk_name='" + clerk_name + "'"; } if (Request.QueryString["order_number"] != null) { string order_number = HttpUtility.UrlDecode(Request.QueryString["order_number"].ToString(), Encoding.UTF8); strWhere += " and order_number='" + order_number + "'"; } if (Request.QueryString["student_name"] != null) { string student_name = HttpUtility.UrlDecode(Request.QueryString["student_name"].ToString(), Encoding.UTF8); strWhere += " and student_name like '%" + student_name + "%'"; } if (Request.QueryString["clerk_name"] != null) { if (qx == "4") { Response.Redirect("Error.aspx"); } string clerk_name = HttpUtility.UrlDecode(Request.QueryString["clerk_name"].ToString(), Encoding.UTF8); strWhere += " and clerk_name='" + clerk_name + "'"; } if (Request.QueryString["course_name"] != null) { string course_name = HttpUtility.UrlDecode(Request.QueryString["course_name"].ToString(), Encoding.UTF8); strWhere += " and course_name like '%" + course_name + "%'"; } if (Request.QueryString["isexam"] != null) { isexam = Request.QueryString["isexam"].ToString(); strWhere += " and isexam =" + isexam; } if (Request.QueryString["ispaystudent"] != null) { if (qx == "3") { Response.Redirect("Error.aspx"); } ispaystudent = Request.QueryString["ispaystudent"].ToString(); strWhere += " and ispaystudent =" + ispaystudent; } if (Request.QueryString["ispayclerk"] != null) { if (qx == "4") { Response.Redirect("Error.aspx"); } ispayclerk = Request.QueryString["ispayclerk"].ToString(); strWhere += " and ispayclerk =" + ispayclerk; } if (Request.QueryString["ispayservice"] != null) { if (qx == "4" || qx == "3") { Response.Redirect("Error.aspx"); } ispayservice = Request.QueryString["ispayservice"].ToString(); strWhere += " and ispayservice =" + ispayservice; } if (Request.QueryString["begintime"] != null) { string begintime = DateTime.Parse(Request.QueryString["begintime"].ToString()).ToString("yyyy-MM-dd"); strWhere += " and create_time>='" + begintime + "'"; } if (Request.QueryString["endtime"] != null) { string endtime = DateTime.Parse(Request.QueryString["endtime"].ToString()).ToString("yyyy-MM-dd"); strWhere += " and create_time<='" + endtime + "'"; } int PageIndex = 1; if (Request.QueryString["page"] != null) { int.TryParse(Request.QueryString["page"].ToString(), out PageIndex); } int PageSize = 10; int TotalCount = 0; DataTable dt; if (qx == "3") { dt = H_OrderClass2.GetList(PageSize, PageIndex, strWhere, out TotalCount); this.Repeater1.DataSource = dt; this.Repeater1.DataBind(); } else { dt = H_OrderClass.GetList(PageSize, PageIndex, strWhere, out TotalCount); this.Repeater1.DataSource = dt; this.Repeater1.DataBind(); } this.LiteralPage.Text = PageClass.BuildPage(PageIndex, TotalCount, PageSize); if (qx == "4") { getSql = "select sum(student_share)from H_OrderView where " + strWhere; object objzj = DbHelperSQL.GetSingle(getSql); if (objzj != null) { this.LiteralTotal.Text = objzj.ToString(); } } if (qx == "3") { getSql = "select sum(clerk_share)from H_OrderView2 where " + strWhere; object objzj = DbHelperSQL.GetSingle(getSql); if (objzj != null) { this.LiteralTotal.Text = objzj.ToString(); } } }