//批量删除
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            ChkAdminLevel("_ybd_goods_spec_item", EnumCollection.ActionEnum.Delete.ToString()); //检查权限
            int sucCount   = 0;
            int errorCount = 0;

            BLL.goods_spec_item bll = new BLL.goods_spec_item();
            for (int i = 0; i < rptList.Items.Count; i++)
            {
                int      id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
                CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId");
                if (cb.Checked)
                {
                    if (bll.Delete(id))
                    {
                        sucCount += 1;
                    }
                    else
                    {
                        errorCount += 1;
                    }
                }
            }
            AddAdminLog(EnumCollection.ActionEnum.Delete.ToString(), "删除商品规格项" + sucCount + "条,失败" + errorCount + "条"); //记录日志
            JscriptMsg("删除成功" + sucCount + "条,失败" + errorCount + "条!", Utils.CombUrlTxt("Manage.aspx", "keywords={0}", this.keywords));
        }
        private bool DoAdd()
        {
            BLL.goods_goods   bll   = new BLL.goods_goods();
            Model.goods_goods model = new Model.goods_goods();

            model.ct_id       = 0;
            model.group_id    = Convert.ToInt32(rbtnGroup.SelectedValue);
            model.category_id = Convert.ToInt32(ddlCategory.SelectedValue);
            model.title       = Convert.ToString(txttitle.Text);
            model.subtitle    = Convert.ToString(txtsubtitle.Text);
            model.img_src     = Convert.ToString(txtimg_src.Text);
            model.oprice      = Convert.ToDecimal(txtoprice.Text);
            model.price       = Convert.ToDecimal(txtprice.Text);
            model.parameters  = Convert.ToString(txtparameters.Text);
            model.details     = Convert.ToString(txtdetails.Text);
            model.sales_num   = Convert.ToInt32(txtsales_num.Text);
            model.status      = Convert.ToInt32(rbtnStatus.SelectedValue);
            model.sj_time     = System.DateTime.Now;
            model.xj_time     = System.DateTime.Now;
            model.add_time    = System.DateTime.Now;

            int row = bll.Add(model);

            if (row > 0)
            {
                #region 添加轮播图
                string[] albumArr = Request.Form.GetValues("hid_photo_name");
                if (albumArr != null && albumArr.Length > 0)
                {
                    for (int i = 0; i < albumArr.Length; i++)
                    {
                        string[] imgArr = albumArr[i].Split('|');
                        if (imgArr.Length == 3)
                        {
                            Model.common_albums pic_model = new Model.common_albums();
                            pic_model = new Model.common_albums()
                            {
                                group_id = (int)EnumCollection.img_group.商品轮播图, rc_data_id = row, rc_type = 0, original_path = imgArr[1], thumb_path = imgArr[2], remark = "", add_time = DateTime.Now
                            };
                            new BLL.common_albums().Add(pic_model);
                        }
                    }
                }
                #endregion

                #region 添加默认规格
                BLL.goods_spec_item   specBll = new BLL.goods_spec_item();
                Model.goods_spec_item item    = new Model.goods_spec_item();
                item.name      = "规格";
                item.parent_id = 0;
                item.goods_id  = row;
                item.sort      = 1;

                int spec = specBll.Add(item);
                if (spec > 0)
                {
                    item           = new Model.goods_spec_item();
                    item.name      = "平装";
                    item.parent_id = spec;
                    item.goods_id  = row;
                    item.sort      = 1;

                    int subspec = specBll.Add(item);
                    if (subspec > 0)
                    {
                        Model.goods_spec_type type = new Model.goods_spec_type();
                        type.goods_id = row;
                        type.price    = model.price;
                        type.stock    = 100;
                        type.spec     = subspec;

                        if (new BLL.goods_spec_type().Add(type) <= 0)
                        {
                            specBll.DeleteList(spec + "," + subspec);
                        }
                    }
                    else
                    {
                        specBll.Delete(spec);
                    }
                }
                #endregion

                AddAdminLog(EnumCollection.ActionEnum.Modify.ToString(), "添加商品信息,主键:" + row); //记录日志
                return(true);
            }
            return(false);
        }