Ejemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //判断是否登录
        if (!mym.IsAdminLogin())
        {
            Response.Write("<script>parent.location.href='../index.aspx'</script>");
            Response.End();
        }
        //判断权限
        tbl_admin_role_value myrv = new tbl_admin_role_value();
        int role_id = Convert.ToInt32(Session["RoleID"]);
        int nav_id  = 82;

        if (!myrv.QXExists(role_id, nav_id))
        {
            Response.Redirect("../error.html");
            Response.End();
        }
        string _action = AXRequest.GetQueryString("action");

        this.page = AXRequest.GetQueryInt("page", 1);
        if (!string.IsNullOrEmpty(_action) && _action == "Edit")
        {
            this.action = "Edit";//修改类型
            if (!int.TryParse(Request.QueryString["id"] as string, out this.id))
            {
                mym.JscriptMsg(this.Page, "传输参数不正确!", "back", "Error");
                return;
            }
        }
        if (!Page.IsPostBack)
        {
            tbl_product bll = new tbl_product();
            DataTable   dt  = bll.GetList("pro_isok=1 order by salse_price asc").Tables[0];
            this.pid.Items.Clear();
            this.pid.Items.Add(new ListItem("请选择秒杀商品...", ""));
            foreach (DataRow dr in dt.Rows)
            {
                string Id    = dr["pro_id"].ToString();
                string Title = dr["pro_name"].ToString().Trim();
                this.pid.Items.Add(new ListItem(Title, Id));
            }
            if (action == "Edit") //修改
            {
                ShowInfo(this.id);
            }
        }
    }
Ejemplo n.º 2
0
    private void RptBind(string _strWhere, string _orderby)
    {
        this.page = AXRequest.GetQueryInt("page", 1);

        if (this.product_category_id > 0)
        {
            this.ddlproduct_category_id.SelectedValue = this.product_category_id.ToString();
        }

        txtNote_no.Text = this.note_no;

        tbl_product bll = new tbl_product();

        this.rptList.DataSource = bll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount);
        this.rptList.DataBind();

        //绑定页码
        txtPageNum.Text = this.pageSize.ToString();
        string pageUrl = Utils.CombUrlTxt("pro_list.aspx", "product_category_id={0}&note_no={1}&page={2}", this.product_category_id.ToString(), this.note_no, "__id__");

        PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
    }