代码修改后的版本,全部提交
This commit is contained in:
120
Mtxfw.VipSite/bindtihuodians.aspx.cs
Normal file
120
Mtxfw.VipSite/bindtihuodians.aspx.cs
Normal file
@@ -0,0 +1,120 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Text;
|
||||
using System.Data;
|
||||
using System.IO;
|
||||
namespace Mtxfw.VipSite
|
||||
{
|
||||
public partial class bindtihuodians : Mtxfw.Utility.MemberBase
|
||||
{
|
||||
public Mtxfw.DAL.Ads daoAds = new Mtxfw.DAL.Ads();
|
||||
public Mtxfw.DAL.P_Product daoProduct = new Mtxfw.DAL.P_Product();
|
||||
public Mtxfw.DAL.P_Category daoCategory = new Mtxfw.DAL.P_Category();
|
||||
public Mtxfw.DAL.Article daoArt = new Mtxfw.DAL.Article();
|
||||
public Mtxfw.Utility.Config config = new Mtxfw.Utility.Config("");
|
||||
public Mtxfw.DAL.user_proxy daoproxy = new Mtxfw.DAL.user_proxy();
|
||||
public int gtype = 0, id = 0;
|
||||
public string strTitle = "选择提货点";
|
||||
#region 判断页面是否刷新
|
||||
private bool _refreshState;
|
||||
private bool _isRefresh;
|
||||
|
||||
/// <summary>
|
||||
/// 判断页面是否刷新
|
||||
/// </summary>
|
||||
public bool IsRefresh
|
||||
{
|
||||
get
|
||||
{
|
||||
return _isRefresh;
|
||||
}
|
||||
}
|
||||
protected override void LoadViewState(object savedState)
|
||||
{
|
||||
object[] allStates = (object[])savedState;
|
||||
base.LoadViewState(allStates[0]);
|
||||
_refreshState = (bool)allStates[1];
|
||||
_isRefresh = _refreshState == (bool)Session["__ISREFRESH"];
|
||||
}
|
||||
protected override object SaveViewState()
|
||||
{
|
||||
Session["__ISREFRESH"] = _refreshState;
|
||||
object[] allStates = new object[2];
|
||||
allStates[0] = base.SaveViewState();
|
||||
allStates[1] = !_refreshState;
|
||||
return allStates;
|
||||
}
|
||||
#endregion
|
||||
|
||||
protected override void OnLoad(EventArgs e)
|
||||
{
|
||||
base.OnLoad(e);
|
||||
string hostname = Request.Url.Host;
|
||||
if (!String.IsNullOrEmpty(Request.QueryString["id"]))
|
||||
{
|
||||
id = Convert.ToInt32(Request.QueryString["id"].ToString());
|
||||
}
|
||||
if (!IsPostBack)
|
||||
{
|
||||
|
||||
if (Session["IFPassword"] == null)
|
||||
{
|
||||
Response.Redirect("/Member_IFPassword.aspx?Url=/bindtihuodians.aspx");
|
||||
}
|
||||
if (IFStores != 1)
|
||||
{
|
||||
Mtxfw.Utility.Tools.Message("您没有权限!", "/gl.aspx");
|
||||
}
|
||||
|
||||
Page.Title = "选择提货点 - " + GetWebName;
|
||||
|
||||
Data_Bind();
|
||||
}
|
||||
MyPager.PageChanged += delegate(object s, EventArgs ex)
|
||||
{
|
||||
Data_Bind();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
protected void Data_Bind()
|
||||
{
|
||||
System.Text.StringBuilder sb = new System.Text.StringBuilder();
|
||||
String cls = Request.QueryString["cls"];
|
||||
String type = Request.QueryString["type"];
|
||||
String morn = Request.QueryString["morn"];
|
||||
String key = HttpUtility.UrlDecode(Request.QueryString["key"]);
|
||||
String state = HttpUtility.UrlDecode(Request.QueryString["state"]);
|
||||
|
||||
|
||||
sb.Append("gtype=" + gtype + " and TType=0 and seef=1");
|
||||
|
||||
|
||||
if (!String.IsNullOrEmpty(key))
|
||||
{
|
||||
sb.Append(" and AName like '%" + key + "%'");
|
||||
}
|
||||
string groupby = "";
|
||||
string strOrder = " addtime desc";
|
||||
int Start = 0;
|
||||
int Limit = 0;
|
||||
Int32 Recount = 0;
|
||||
MyPager.PageSize = 50;
|
||||
Start = MyPager.PageSize * (MyPager.CurrentPageIndex - 1);
|
||||
Limit = MyPager.PageSize;
|
||||
DataSet dss = daoproxy.GetDataSet(groupby, strOrder, "ID,AName,ATel,Agenprovince,Agencity,Agencounty,IFFill,Agentrading,AAddress", "", sb.ToString(), Start, Limit, out Recount);
|
||||
Mtxfw.Utility.Tools.ToBind(Repeater1, dss.Tables[1]);
|
||||
MyPager.RecordCount = Recount;
|
||||
if (MyPager.RecordCount == 0)
|
||||
{
|
||||
MyPager.Visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user