Exemple #1
0
    private void ShowInfo(int _id)
    {
        ps_manager model = new ps_manager();

        model.GetModel(_id);
        Lituser_name.Text = model.user_name;
        Litreal_name.Text = model.real_name;
        txtmobile.Text    = model.mobile;
        Litdepot_id.Text  = model.depot_id.ToString();

        if (Convert.ToInt32(model.depot_id) != 0)
        {
            mdxx.Visible = true;
            ps_depot model1 = new ps_depot();
            model1.GetModel(Convert.ToInt32(model.depot_id));

            Litdepotname.Text       = model1.title;
            Litcontact_name.Text    = model1.contact_name;
            Litcontact_tel.Text     = model1.contact_mobile;
            txtcontact_address.Text = model1.contact_address;
        }

        if (Convert.ToInt32(model.depot_category_id) != 0)
        {
            bmxx.Visible = true;
            ps_depot_category model2 = new ps_depot_category();
            model2.GetModel(Convert.ToInt32(model.depot_category_id));
            Litdepot_category_name.Text = model2.title;
        }
    }
    private bool DoEdit(int _id)
    {
        bool result = false;

        ps_depot_category model = new ps_depot_category();

        if (model.Exists(txttitle.Text.Trim(), _id))
        {
            mym.JscriptMsg(this.Page, "您输入的地区名称已经存在,请检查!", "", "Error");
            return(false);
        }
        model.GetModel(_id);

        model.title   = txttitle.Text.Trim();
        model.sort_id = int.Parse(txtSortId.Text.Trim());
        model.remark  = txtremark.Text.Trim();

        if (model.Update())
        {
            mym.AddAdminLog("修改", "修改地区:" + txttitle.Text); //记录日志
            result = true;
        }

        return(result);
    }
    private void ShowInfo(int _id)
    {
        ps_depot_category model = new ps_depot_category();

        model.GetModel(_id);

        txttitle.Text  = model.title;
        txtSortId.Text = model.sort_id.ToString();
        txtremark.Text = model.remark;
    }
Exemple #4
0
    private void TreeBind(int _category_id)
    {
        ps_depot_category bll = new ps_depot_category();
        DataTable         dt  = bll.GetList(_category_id);

        this.ddlCategoryId.Items.Clear();
        this.ddlCategoryId.Items.Add(new ListItem("==全部==", ""));
        foreach (DataRow dr in dt.Rows)
        {
            string Id    = dr["id"].ToString();
            string Title = dr["title"].ToString().Trim();
            this.ddlCategoryId.Items.Add(new ListItem(Title, Id));
        }
    }
Exemple #5
0
    private void RptBind(string _strWhere, string _orderby)
    {
        this.page        = AXRequest.GetQueryInt("page", 1);
        txtKeywords.Text = this.keywords;
        ps_depot_category bll = new ps_depot_category();

        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("depot_category_list.aspx", "keywords={0}&page={1}", this.keywords, "__id__");

        PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
    }
Exemple #6
0
    //保存排序
    protected void btnSave_Click(object sender, EventArgs e)
    {
        ps_depot_category bll     = new ps_depot_category();
        Repeater          rptList = new Repeater();

        rptList = this.rptList;

        for (int i = 0; i < rptList.Items.Count; i++)
        {
            int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
            int sortId;
            if (!int.TryParse(((TextBox)rptList.Items[i].FindControl("txtSortId")).Text.Trim(), out sortId))
            {
                sortId = 99;
            }
            bll.UpdateField(id, "sort_id=" + sortId.ToString());
        }

        mym.JscriptMsg(this.Page, " 排序保存成功", Utils.CombUrlTxt("depot_category_list.aspx", "keywords={0}&page={1}", this.keywords, this.page.ToString()), "Success");
    }
    private bool DoAdd()
    {
        ps_depot_category model = new ps_depot_category();

        if (model.Exists(txttitle.Text.Trim()))
        {
            mym.JscriptMsg(this.Page, "您输入的地区名称已经存在,请检查!", "", "Error");
            return(false);
        }

        model.title   = txttitle.Text.Trim();
        model.sort_id = int.Parse(txtSortId.Text.Trim());
        model.remark  = txtremark.Text.Trim();
        if (model.Add() > 0)
        {
            mym.AddAdminLog("增加", "添加地区:" + txttitle.Text); //记录日志
            return(true);
        }

        return(false);
    }
Exemple #8
0
    // 单个删除
    protected void lbtnDelCa_Click(object sender, EventArgs e)
    {
        // 当前点击的按钮
        LinkButton        lb   = (LinkButton)sender;
        int               caId = int.Parse(lb.CommandArgument);
        ps_depot_category bll  = new ps_depot_category();

        bll.GetModel(caId);
        string   title = bll.title;
        ps_depot bllpp = new ps_depot();

        bllpp.category_id = caId;
        if (!bllpp.ExistsBM())//查找是否存在下级商家
        {
            bll.Delete(caId);
            mym.AddAdminLog("删除", "删除地区:" + title + ""); //记录日志
            mym.JscriptMsg(this.Page, " 成功删除地区:" + title + "", Utils.CombUrlTxt("depot_category_list.aspx", "keywords={0}&page={1}", this.keywords, this.page.ToString()), "Success");
        }
        else
        {
            mym.JscriptMsg(this.Page, "有商家属于该地区,不能删除!", "", "Error");
            return;
        }
    }