|
Server : Microsoft-IIS/10.0 System : Windows NT EBS-6136 10.0 build 17763 (Windows Server 2016) i586 User : jxgj ( 0) PHP Version : 7.0.33 Disable Function : passthru,exec,system,shell_exec,proc_open,popen,pcntl_exec,socket_bind,stream_socket_server Directory : D:/tmp_aspnet/root/04556082/ecc0c5af/ |
?#pragma checksum "d:\wwwroot\gzgunuo\wwwroot\qiao\GongList_yuyue.aspx.cs" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "E54E8B375A569604743D44F0614487D8"
#line 1 "d:\wwwroot\gzgunuo\wwwroot\qiao\GongList_yuyue.aspx.cs"
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Model;
using System.IO;
public partial class GongList : System.Web.UI.Page
{
#region Url参数
private int pageSize = 15; //每頁大幼
private int pageCount = 0; //总頁数
private int Pages { get { int d; int.TryParse(Request.QueryString["page"], out d); return d > 0 ? d - 1 : 0; } }
private int Id { get { int d; int.TryParse(Request.QueryString["id"], out d); return d; } }
private int CID { get { int d; int.TryParse(Request.QueryString["c"], out d); return d; } }
#endregion
public string Name { get { return Convert.ToString(Request.QueryString["n"]); } }
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
if (this.Name == null || this.Name == "")
return;
DataBin();
}
}
private void DataBin()
{
string where = " where tableName='" + this.Name + "'";
if (this.CID > 0)
where += " and CID=" + this.CID;
this.Repeater1.DataSource = SqlManager.GetGong(this.Pages, this.pageSize, out this.pageCount, where);
this.Repeater1.DataBind();
////设置頁码
this.AspNetPager1.UrlPaging = true;
this.AspNetPager1.PageSize = this.pageSize;
this.AspNetPager1.RecordCount = this.pageCount;
}
protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e)
{
//单个删除
if (e.CommandName == "Del")
{
int Id = Convert.ToInt32(e.CommandArgument);
if (SqlManager.DelGong(Id))
{
List<Images> list = SqlManager.GetImagesList(this.Name, Id);
foreach (var img in list)
{
//删除图片
StringHelper.DelImgFile(Server.MapPath("~/Images/" + this.Name + @"\"), img.ImgUrl, this.Name);
}
if (list.Count > 0)
SqlManager.DelImages(this.Name, Id);
}
}
if (e.CommandName == "up")
{
string KindID = e.CommandArgument.ToString().Split(',')[0];
int itemIndex = Convert.ToInt32(e.CommandArgument.ToString().Split(',')[1]);
TextBox TextBox1 = this.Repeater1.Items[itemIndex].FindControl("text") as TextBox;
if (TextBox1.Text.Trim() != "")
SqlManager.Get("update Gong set [Order]=" + TextBox1.Text + " where Id=" + KindID);
}
DataBin();
}
//多选删除
protected void Button1_Click(object sender, EventArgs e)
{
if (Request.Form["c1"] == null)
return;
string[] AllId = Request.Form["c1"].Split(',');
foreach (string item in AllId)
{
int Id = Convert.ToInt32(item);
if (SqlManager.DelGong(Id))
{
List<Images> list = SqlManager.GetImagesList(this.Name, Id);
foreach (var img in list)
{
//删除图片
StringHelper.DelImgFile(Server.MapPath("~/Images/" + this.Name + @"\"), img.ImgUrl, this.Name);
}
if (list.Count > 0)
SqlManager.DelImages(this.Name, Id);
}
}
DataBin();
}
}
#line default
#line hidden