Пример #1
0
    //品牌修改
    public void EditBrand()
    {
        int    Brand_ID          = tools.CheckInt(Request.Form["Brand_ID"]);
        string Brand_Name        = tools.CheckStr(Request.Form["Brand_Name"].Trim());
        string Brand_Img         = Request.Form["Brand_Img"];
        string Brand_Url         = Request.Form["Brand_Url"].Trim();
        string Brand_Description = Request.Form["Brand_Description"];
        int    Brand_Sort        = tools.CheckInt(Request.Form["Brand_Sort"]);
        int    Brand_IsRecommend = tools.CheckInt(Request.Form["Brand_IsRecommend"]);
        int    Brand_IsActive    = tools.CheckInt(Request.Form["Brand_IsActive"]);
        string Brand_Site        = Public.GetCurrentSite();

        if (Brand_ID == 0)
        {
            Public.Msg("error", "错误信息", "请选择您要修改的商品品牌!", false, "{back}");
        }

        if (Brand_Name.Length == 0)
        {
            Public.Msg("error", "错误信息", "请填写品牌名称!", false, "{back}");
        }

        BrandInfo entity = new BrandInfo();

        entity.Brand_ID          = Brand_ID;
        entity.Brand_Name        = Brand_Name;
        entity.Brand_Img         = Brand_Img;
        entity.Brand_URL         = Brand_Url;
        entity.Brand_Description = Brand_Description;
        entity.Brand_Sort        = Brand_Sort;
        entity.Brand_IsRecommend = Brand_IsRecommend;
        entity.Brand_IsActive    = Brand_IsActive;
        entity.Brand_Site        = Brand_Site;

        if (brand.EditBrand(entity, Public.GetUserPrivilege()))
        {
            string ProductTypeID = tools.CheckStr(Request["ProductTypeID"]);
            MyProductType.DelProductType_Brand(0, Brand_ID, Public.GetUserPrivilege());
            if (ProductTypeID.Length > 0)
            {
                foreach (string typeid in ProductTypeID.Split(','))
                {
                    if (tools.CheckInt(typeid) > 0)
                    {
                        MyProductType.AddProductType_Brand(tools.CheckInt(typeid), Brand_ID, Public.GetUserPrivilege());
                    }
                }
            }
            Public.Msg("positive", "操作成功", "操作成功", true, "brand.aspx");
        }
        else
        {
            Public.Msg("error", "错误信息", "操作失败,请稍后重试", false, "{back}");
        }
    }
Пример #2
0
    //修改产品类型
    public void EditProductType()
    {
        int    ProductType_ID       = tools.CheckInt(Request.Form["ProductType_ID"]);
        string ProductType_Name     = tools.CheckStr(Request.Form["ProductType_Name"]);
        int    ProductType_Sort     = tools.CheckInt(Request.Form["ProductType_Sort"]);
        int    ProductType_IsActive = tools.CheckInt(Request.Form["ProductType_IsActive"]);
        string ProductType_Site     = Public.GetCurrentSite();
        string brand_select         = tools.CheckStr(Request.Form["ProductType_Brand"]) + ",";

        string[] Product_Brand = brand_select.Split(',');

        if (ProductType_Name == "")
        {
            Public.Msg("error", "错误信息", "请填写类型名称!", false, "{back}");
        }

        ProductTypeInfo entity = new ProductTypeInfo();

        entity.ProductType_ID       = ProductType_ID;
        entity.ProductType_Name     = ProductType_Name;
        entity.ProductType_Sort     = ProductType_Sort;
        entity.ProductType_IsActive = ProductType_IsActive;
        entity.ProductType_Site     = ProductType_Site;


        if (MyProductType.EditProductType(entity, Public.GetUserPrivilege()))
        {
            MyProductType.DelProductType_Brand(entity.ProductType_ID, Public.GetUserPrivilege());
            foreach (string i in Product_Brand)
            {
                if (tools.CheckInt(i) > 0)
                {
                    MyProductType.AddProductType_Brand(entity.ProductType_ID, tools.CheckInt(i), Public.GetUserPrivilege());
                }
            }
            Public.Msg("positive", "操作成功", "操作成功", true, "ProductType.aspx");
        }
        else
        {
            Public.Msg("error", "错误信息", "操作失败,请稍后重试", false, "{back}");
        }
    }