Esempio n. 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}");
        }
    }