⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 shopcategoryoperation.aspx.cs

📁 易想商城系统
💻 CS
字号:
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Collections.Generic;
using YXShop.Common;
using Shop.Web.UI;

namespace YXShop.Web.Admin.Shop
{
    public partial class ShopCategoryOperation : System.Web.UI.Page
    {
        BLL.ShopCategory B_ShopCategory = new YXShop.BLL.ShopCategory();
        BasePage bp = null;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!PowerTree.PowerPass.isPass("014001002", PowerTree.PowerPanel.PowerType.add))
            {
                bp = new BasePage();
                bp.PageError("对不起,你没有添加此项的权限!", "../index.aspx");
            }
            if (!IsPostBack)
            {
                int scID = Convert.ToInt32(Request.QueryString["SCID"]);
                if (scID > 0)
                {
                    BindData(scID);
                }
            }
        }

        void BindData(int scID)
        {
            List<Model.ShopCategory> listShopCategory = B_ShopCategory.GetListByColumn("scID", scID);
            if (listShopCategory.Count > 0)
            {
                txtName.Text = listShopCategory[0].scName;
                rblIsUse.Text = listShopCategory[0].IsUse.ToString();
            }
        }

        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                int scID = Convert.ToInt32(Request.QueryString["SCID"]);
                Model.ShopCategory M_ShopCategory = new YXShop.Model.ShopCategory();

                M_ShopCategory.scName = txtName.Text;
                M_ShopCategory.IsUse = Convert.ToInt32(rblIsUse.Text);

                if (scID > 0)
                {
                    B_ShopCategory.Amend(scID, "scName", M_ShopCategory.scName);
                    B_ShopCategory.Amend(scID, "IsUse", M_ShopCategory.IsUse);
                    alert.showAndGo("修改成功", "ShopCategory.aspx");
                }
                else
                {
                    M_ShopCategory.AddDate = DateTime.Now;
                    M_ShopCategory.scOrderBy = 0;
                    M_ShopCategory.scPath = "0";
                    B_ShopCategory.Create(M_ShopCategory);
                    alert.showAndGo("添加成功", "ShopCategory.aspx");
                }
            }
            catch { alert.showOnly("操作失败"); }
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -