protected void Page_Load(object sender, EventArgs e) { AdminPopedom.IsHoldModel("15"); DataSet ds = DbSession.Default.FromProc("Web_pGetDataPager") .AddInputParameter("@PageSize", DbType.Int32, anpPageIndex.PageSize) .AddInputParameter("@CurrentPage", DbType.Int32, PageIndex) .AddInputParameter("@Columns", DbType.String, "*") .AddInputParameter("@TableName", DbType.String, "Web_ClearFasciPropDefine") .AddInputParameter("@Wheres", DbType.String, "") .AddInputParameter("@KeyName", DbType.String, "ID") .AddInputParameter("@OrderBy", DbType.String, "ID") .ToDataSet(); if (ds.Tables.Count > 0 && ds.Tables[1].Rows.Count > 0) { anpPageIndex.RecordCount = (int)ds.Tables[0].Rows[0][0]; anpPageIndex.CurrentPageIndex = PageIndex; ProList.DataSource = ds.Tables[1]; ProList.DataBind(); ProList.Visible = true; NoProList.Visible = false; } else { ProList.Visible = false; NoProList.Visible = true; } }
protected void Page_Load(object sender, EventArgs e) { AdminPopedom.IsHoldModel("15"); DataSet ds = DbSession.Default.FromProc("Web_pGetDataPager") .AddInputParameter("@PageSize", DbType.Int32, anpPageIndex.PageSize) .AddInputParameter("@CurrentPage", DbType.Int32, PageIndex) .AddInputParameter("@Columns", DbType.String, "*") .AddInputParameter("@TableName", DbType.String, "TPropDefine") .AddInputParameter("@Wheres", DbType.String, " and proptype=0") .AddInputParameter("@KeyName", DbType.String, "PropID") .AddInputParameter("@OrderBy", DbType.String, "PropID desc") .ToDataSet(); if (ds.Tables.Count > 0) { anpPageIndex.RecordCount = (int)ds.Tables[0].Rows[0][0]; anpPageIndex.CurrentPageIndex = PageIndex; if (ds.Tables[1].Rows.Count > 0) { ProList.Visible = true; NoProList.Visible = false; ProList.DataSource = ds.Tables[1]; ProList.DataBind(); } else { NoProList.Visible = false; ProList.Visible = true; } } /* * DataTable sd = new DataTable(); * string para = ""; * string[] sql = new string[2]; * sql[0] = "select ROW_NUMBER() OVER(ORDER BY PropID DESC) AS RowNumber,* from TPropDefine"; * sql[1] = "select Count(*) from TPropDefine"; * string url = "JpPrices.aspx"; * PageLink page_set = new PageLink(url, 20, 10, para, sql); * page_set.paraLinkType = paraLinkShow.middling.ToString(); * sd = page_set.get_table(); * if (sd.Rows.Count > 0) * { * Repeater Viste = (Repeater)Page.FindControl("ProList"); * Viste.DataSource = sd; * Viste.DataBind(); * this.pageList.Text = page_set.pageList(); * } * else * this.NoProList.Visible = true; * sd.Clear();*/ }
protected void Page_Load(object sender, EventArgs e) { client = new UserServiceClient(); pClient = new ProductServiceClient(); users = client.GetAllUsers(); products = pClient.GetAllProducts(); if (!IsPostBack) { List <ListItem> items = new List <ListItem>(); List <ListItem> prods = new List <ListItem>(); foreach (User u in users) { if (!u.User_Type.Equals("admin")) { ListItem li = new ListItem(); li.Text = u.UserID + " " + u.Name.ToString() + "(" + u.User_Type + ")"; li.Value = u.UserID + " " + u.Name.ToString() + "(" + u.User_Type + ")"; items.Add(li); } } Towner.DataSource = items; Towner.DataBind(); foreach (Product p in products) { ListItem x = new ListItem(); x.Text = p.P_ID + " " + p.P_Name + " " + "Current Quantity=" + " " + p.P_Quantity.ToString(); x.Value = p.P_ID.ToString(); prods.Add(x); } ListItem newProd = new ListItem(); newProd.Text = "New Incoming Product!!!"; newProd.Text = "New Incoming Product!!!"; prods.Add(newProd); ProList.DataSource = prods; ProList.DataBind(); } }