Exemplo 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();
        }
        //判断权限
        ps_manager_role_value myrv = new ps_manager_role_value();
        int role_id = Convert.ToInt32(Session["RoleID"]);
        int nav_id  = 21;

        if (!myrv.QXExists(role_id, nav_id))
        {
            Response.Redirect("../error.html");
            Response.End();
        }
        this.product_category_id = AXRequest.GetQueryInt("product_category_id");

        this.note_no = AXRequest.GetQueryString("note_no");

        this.pageSize = GetPageSize(20); //每页数量

        if (!Page.IsPostBack)
        {
            ZYBind();//绑定商品类别
            RptBind("id>0" + CombSqlTxt(this.product_category_id, this.note_no), "add_time desc,id desc");
        }
    }
Exemplo n.º 2
0
 protected void bsClassList(object sender, RepeaterItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
     {
         int      ID     = Convert.ToInt32(((DataRowView)e.Item.DataItem).Row["ID"].ToString()); //获得对应ID
         Repeater sClass = (Repeater)e.Item.FindControl("childCategory");                        //找到要绑定数据的Repeater
         if (sClass != null)
         {
             ps_manager_role_value myrv = new ps_manager_role_value();
             string    sqlstr           = "parent_id=" + ID + "  and(1=2 or ";
             DataTable dt = myrv.GetList("role_id=" + Convert.ToInt32(Session["RoleID"]) + "").Tables[0];
             if (dt.DefaultView.Count > 0)
             {
                 for (int i = 0; i < dt.DefaultView.Count; i++)
                 {
                     sqlstr = sqlstr + "id=" + dt.Rows[i]["nav_id"].ToString() + " or ";
                 }
             }
             sqlstr = sqlstr + "1=2) order by sort_id";
             ps_navigation bll = new ps_navigation();
             sClass.DataSource = bll.GetList(sqlstr);
             sClass.DataBind();
         }
     }
 }
Exemplo n.º 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //判断是否登录
        if (!mym.IsAdminLogin())
        {
            Response.Write("<script>parent.location.href='../index.aspx'</script>");
            Response.End();
        }
        //判断权限
        ps_manager_role_value myrv = new ps_manager_role_value();
        int role_id = Convert.ToInt32(Session["RoleID"]);
        int nav_id  = 30;

        if (!myrv.QXExists(role_id, nav_id))
        {
            Response.Redirect("../error.html");
            Response.End();
        }
        this.keywords = AXRequest.GetQueryString("keywords");
        this.pageSize = GetPageSize(10); //每页数量
        this.page     = AXRequest.GetQueryInt("page", 1);
        if (!Page.IsPostBack)
        {
            RptBind(CombSqlTxt(this.keywords), "sort_id asc,id desc");
        }
    }
Exemplo n.º 4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //判断是否登录
        if (!mym.IsAdminLogin())
        {
            Response.Write("<script>parent.location.href='../index.aspx'</script>");
            Response.End();
        }
        ps_manager_role_value myrv = new ps_manager_role_value();
        int role_id = Convert.ToInt32(Session["RoleID"]);
        int nav_id  = 28;

        if (!myrv.QXExists(role_id, nav_id))
        {
            Response.Redirect("../error.html");
            Response.End();
        }
        if (!Page.IsPostBack)
        {
            this.status      = AXRequest.GetQueryInt("status");
            this.category_id = AXRequest.GetQueryInt("category_id");
            this.keywords    = AXRequest.GetQueryString("keywords");
            binddr();
        }

        Response.Clear();
        Response.Buffer = true;
        Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode("商家信息表" + DateTime.Now.ToString("d") + ".xls", Encoding.UTF8).ToString());
        Response.ContentEncoding = System.Text.Encoding.UTF8;
        Response.ContentType     = "application/vnd.ms-excel";
        this.EnableViewState     = false;
    }
Exemplo n.º 5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //判断是否登录
        if (!mym.IsAdminLogin())
        {
            Response.Write("<script>parent.location.href='../index.aspx'</script>");
            Response.End();
        }
        //判断权限
        ps_manager_role_value myrv = new ps_manager_role_value();
        int role_id = Convert.ToInt32(Session["RoleID"]);
        int nav_id  = 16;

        if (!myrv.QXExists(role_id, nav_id))
        {
            Response.Redirect("../error.html");
            Response.End();
        }
        order_no = AXRequest.GetQueryString("order_no");
        if (order_no == "")
        {
            mym.JscriptMsg(this.Page, "传输参数不正确!", "back", "Error");
            return;
        }
        if (!new ps_orders().Exists(order_no))
        {
            mym.JscriptMsg(this.Page, "订单不存在或已被删除!", "back", "Error");
            return;
        }
        if (!Page.IsPostBack)
        {
            ShowInfo(order_no);
        }
    }
Exemplo n.º 6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //判断是否登录
        if (!mym.IsAdminLogin())
        {
            Response.Write("<script>parent.location.href='../index.aspx'</script>");
            Response.End();
        }
        //判断权限
        ps_manager_role_value myrv = new ps_manager_role_value();
        int role_id = Convert.ToInt32(Session["RoleID"]);
        int nav_id  = 5;

        if (!myrv.QXExists(role_id, nav_id))
        {
            Response.Redirect("../error.html");
            Response.End();
        }

        if (!Page.IsPostBack)
        {
            QDBind();
            Focus myFocus = new Focus();
            myFocus.SetEnterControl(this.txtproduct_name);
            myFocus.SetFocus(txtproduct_name.Page, "txtproduct_name");
        }
    }
Exemplo n.º 7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //判断是否登录
        if (!mym.IsAdminLogin())
        {
            Response.Write("<script>parent.location.href='../index.aspx'</script>");
            Response.End();
        }
        //判断权限
        ps_manager_role_value myrv = new ps_manager_role_value();
        int role_id = Convert.ToInt32(Session["RoleID"]);
        int nav_id  = 29;

        if (!myrv.QXExists(role_id, nav_id))
        {
            Response.Redirect("../error.html");
            Response.End();
        }
        this.status      = AXRequest.GetQueryInt("status");
        this.category_id = AXRequest.GetQueryInt("category_id");
        this.depot_id    = AXRequest.GetQueryInt("depot_id");
        this.role_id     = AXRequest.GetQueryInt("role_id");
        this.keywords    = AXRequest.GetQueryString("keywords");
        this.pageSize    = GetPageSize(10); //每页数量
        this.page        = AXRequest.GetQueryInt("page", 1);

        if (!Page.IsPostBack)
        {
            BMBind(Convert.ToInt32(Session["DepotCatID"]));          //绑定地区
            MDBind(category_id);                                     //绑定商家
            RoleBind(ddlRoleId, Convert.ToInt32(Session["RoleID"])); //绑定角色

            if (Convert.ToInt32(Session["DepotID"]) == 0 && Convert.ToInt32(Session["DepotCatID"]) == 0)
            {
                RptBind("role_id>" + Convert.ToInt32(Session["RoleID"]) + CombSqlTxt(this.status, this.category_id, this.depot_id, this.role_id, this.keywords), "add_time desc,id desc");
            }
            else if (Convert.ToInt32(Session["DepotID"]) == 0 && Convert.ToInt32(Session["DepotCatID"]) > 0)
            {
                this.ddlCategoryId.SelectedValue = Session["DepotCatID"].ToString();
                MDBind(Convert.ToInt32(Session["DepotCatID"])); //绑定商家
                this.category_id = Convert.ToInt32(Session["DepotCatID"]);

                RptBind("role_id>" + Convert.ToInt32(Session["RoleID"]) + " and depot_id<>0 and depot_category_id=" + Convert.ToInt32(Session["DepotCatID"]) + CombSqlTxt(this.status, this.category_id, this.depot_id, this.role_id, this.keywords), "add_time desc,id desc");
            }
            else if (Convert.ToInt32(Session["DepotID"]) > 0 && Convert.ToInt32(Session["DepotCatID"]) > 0)
            {
                this.ddlCategoryId.SelectedValue = Session["DepotCatID"].ToString();
                MDYHBind(Convert.ToInt32(Session["DepotID"])); //绑定商家
                this.ddlDepotId.SelectedValue = Session["DepotID"].ToString();
                this.category_id = Convert.ToInt32(Session["DepotCatID"]);
                this.depot_id    = Convert.ToInt32(Session["DepotID"]);
                RptBind("role_id>" + Convert.ToInt32(Session["RoleID"]) + " and depot_id=" + Convert.ToInt32(Session["DepotID"]) + " and depot_category_id=" + Convert.ToInt32(Session["DepotCatID"]) + CombSqlTxt(this.status, this.category_id, this.depot_id, this.role_id, this.keywords), "add_time desc,id desc");
            }
        }
    }
Exemplo n.º 8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //判断是否登录
        if (!mym.IsAdminLogin())
        {
            Response.Write("<script>parent.location.href='../index.aspx'</script>");
            Response.End();
        }
        //判断权限
        ps_manager_role_value myrv = new ps_manager_role_value();
        int role_id = Convert.ToInt32(Session["RoleID"]);
        int nav_id  = 29;

        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 (action == "Edit") //修改
        {
            txtUserName.Attributes.Remove("ajaxurl");
        }
        if (!Page.IsPostBack)
        {
            RoleBind(ddlRoleId, Convert.ToInt32(Session["RoleID"])); //绑定角色

            if (Convert.ToInt32(Session["RoleID"]) == 4)             //店长用户权限
            {
                this.ddlRoleId.SelectedValue = "5";
                role.Visible = false;
                bm.Visible   = false;
                md.Visible   = false;
                CategoryBind(Convert.ToInt32(Session["DepotCatID"])); //绑定地区
                this.ddlCategoryId.SelectedValue = Session["DepotCatID"].ToString();
                DepotBind(Convert.ToInt32(Session["DepotCatID"]));    //绑定商家
                this.ddlDepotId.SelectedValue = Session["DepotID"].ToString();
            }
            if (action == "Edit") //修改
            {
                ShowInfo(this.id);
            }
        }
    }
Exemplo n.º 9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //判断是否登录
        if (!mym.IsAdminLogin())
        {
            Response.Write("<script>parent.location.href='../index.aspx'</script>");
            Response.End();
        }
        //判断权限
        ps_manager_role_value myrv = new ps_manager_role_value();
        int role_id = Convert.ToInt32(Session["RoleID"]);
        int nav_id  = 20;

        if (!myrv.QXExists(role_id, nav_id))
        {
            Response.Redirect("../error.html");
            Response.End();
        }

        this.product_category_id = AXRequest.GetQueryInt("product_category_id");

        this.note_no = AXRequest.GetQueryString("note_no");

        if (AXRequest.GetQueryString("start_time") == "")
        {
            this.start_time = DateTime.Now.ToString("yyyy-MM-dd");
        }
        else
        {
            this.start_time = AXRequest.GetQueryString("start_time");
        }
        if (AXRequest.GetQueryString("stop_time") == "")
        {
            this.stop_time = DateTime.Now.ToString("yyyy-MM-dd");
        }
        else
        {
            this.stop_time = AXRequest.GetQueryString("stop_time");
        }
        this.pageSize = GetPageSize(10); //每页数量

        if (!Page.IsPostBack)
        {
            ZYBind();//绑定商品类别

            txtstart_time.Value = DateTime.Now.ToString("d");
            txtstop_time.Value  = DateTime.Now.ToString("d");
            if (Convert.ToInt32(Session["DepotID"]) == 0 && Convert.ToInt32(Session["DepotCatID"]) == 0)//公司用户
            {
                RptBind("product_code_state='退货' " + CombSqlTxt(this.product_category_id, this.note_no, this.start_time, this.stop_time), "add_time desc,id desc");
            }
        }
    }
Exemplo n.º 10
0
    protected void articleBind()
    {
        ps_manager_role_value myrv = new ps_manager_role_value();
        string    sqlstr           = "parent_id=0 and(1=2 or ";
        DataTable dt = myrv.GetList("role_id=" + Convert.ToInt32(Session["RoleID"]) + "").Tables[0];

        if (dt.DefaultView.Count > 0)
        {
            for (int i = 0; i < dt.DefaultView.Count; i++)
            {
                sqlstr = sqlstr + "id=" + dt.Rows[i]["nav_id"].ToString() + " or ";
            }
        }
        sqlstr = sqlstr + "1=2) order by sort_id";
        ps_navigation bll = new ps_navigation();

        this.repCategory.DataSource = bll.GetList(sqlstr);
        this.repCategory.DataBind();
    }
Exemplo n.º 11
0
    private void ShowInfo(int _id)
    {
        ps_manager_role model = new ps_manager_role();

        model.GetModel(_id);
        Litrole_name.Text = model.role_name;
        NavBind();

        for (int i = 0; i < rptList.Items.Count; i++)
        {
            CheckBox cb               = (CheckBox)rptList.Items[i].FindControl("chkId");
            int      nav_id           = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
            ps_manager_role_value bll = new ps_manager_role_value();
            if (bll.QXExists(_id, nav_id))
            {
                cb.Checked = true;
            }
        }
    }
Exemplo n.º 12
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //判断是否登录
        if (!mym.IsAdminLogin())
        {
            Response.Write("<script>parent.location.href='../index.aspx'</script>");
            Response.End();
        }
        //判断权限
        ps_manager_role_value myrv = new ps_manager_role_value();
        int role_id = Convert.ToInt32(Session["RoleID"]);
        int nav_id  = 11;

        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)
        {
            if (action == "Edit") //修改
            {
                QDBind();
                ShowInfo(this.id);
                Focus myFocus = new Focus();
                myFocus.SetEnterControl(this.txtsalse_price);
                myFocus.SetFocus(txtsalse_price.Page, "txtsalse_price");
            }
        }
    }
Exemplo n.º 13
0
    private bool DoEdit(int _id)
    {
        bool result = false;
        ps_manager_role_value model = new ps_manager_role_value();

        model.Delete(_id);

        for (int i = 0; i < rptList.Items.Count; i++)
        {
            CheckBox cb     = (CheckBox)rptList.Items[i].FindControl("chkId");
            int      nav_id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
            if (cb.Checked)
            {
                model.role_id = _id;
                model.nav_id  = nav_id;
                model.Add();
            }
        }
        result = true;
        return(result);
    }
Exemplo n.º 14
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //判断是否登录
        if (!mym.IsAdminLogin())
        {
            Response.Write("<script>parent.location.href='../index.aspx'</script>");
            Response.End();
        }
        //判断权限
        ps_manager_role_value myrv = new ps_manager_role_value();
        int role_id = Convert.ToInt32(Session["RoleID"]);
        int nav_id  = 21;

        if (!myrv.QXExists(role_id, nav_id))
        {
            Response.Redirect("../error.html");
            Response.End();
        }

        if (!Page.IsPostBack)
        {
            RptBind();
        }
    }