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

            BLL.t_store bll = new BLL.t_store();
            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(DTEnums.ActionEnum.Delete.ToString(), "删除管理员" + sucCount + "条,失败" + errorCount + "条"); //记录日志
            JscriptMsg("删除成功" + sucCount + "条,失败" + errorCount + "条!", Utils.CombUrlTxt("manager_list.aspx", "agentname={0}&storeName={1}&createtime={2}&stateId={3}", agentname, storeName, createtime, stateId));
        }
        private bool DoEdit(int _id)
        {
            bool result = false;

            BLL.t_store   bll   = new BLL.t_store();
            Model.t_store model = bll.GetModel(_id);

            model.StoreName   = txt_StoreName.Text;
            model.PhoneNumber = txt_PhoneNumber.Text;
            model.StoreImgUrl = img_StoreImgUrl.ImageUrl;
            model.Area        = txt_Area.Text;
            model.City        = txt_City.Text;
            model.Province    = txt_Province.Text;
            model.Address     = txt_Address.Text;
            model.Score       = Convert.ToDecimal(txt_Score.Text);
            model.State       = Convert.ToInt32(drp_State.SelectedValue);
            model.IsDeleted   = Convert.ToInt32(drp_IsDeleted.SelectedValue);
            model.PlanId      = txt_PlanId.Text.Trim() == "" ? 0 : Convert.ToInt32(txt_PlanId.Text);
            model.ID          = _id;

            if (bll.Update(model))
            {
                //AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改管理员:" + model.user_name); //记录日志
                result = true;
            }

            return(result);
        }
        private void ShowInfo(int _id)
        {
            BLL.t_store   bll   = new BLL.t_store();
            Model.t_store model = bll.GetModel(_id);

            txt_StoreName.Text          = model.StoreName;
            txt_PhoneNumber.Text        = model.PhoneNumber;
            img_StoreImgUrl.ImageUrl    = model.StoreImgUrl;
            txt_Area.Text               = model.Area;
            txt_City.Text               = model.City;
            txt_Province.Text           = model.Province;
            txt_Address.Text            = model.Address;
            txt_Score.Text              = model.Score.ToString();
            drp_State.SelectedValue     = model.State.ToString();
            drp_IsDeleted.SelectedValue = model.IsDeleted.ToString();
            txt_PlanId.Text             = model.PlanId.ToString();
        }
        private void RptBind(string _strWhere, string _orderby)
        {
            this.page          = DTRequest.GetQueryInt("page", 1);
            txtAgentName.Text  = this.agentname;
            txtStoreName.Text  = this.storeName;
            txtCreateTime.Text = this.createtime;
            ddl_State.Text     = this.stateId;

            BLL.t_store bll = new BLL.t_store();
            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("t_store_list.aspx", "agentname={0}&storeName={1}&createtime={2}&stateId={3}&page={4}", agentname, storeName, createtime, stateId, "__id__");

            PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
        }
 private bool DoAdd()
 {
     Model.t_store model = new Model.t_store();
     BLL.t_store   bll   = new BLL.t_store();
     model.StoreName   = txt_StoreName.Text;
     model.PhoneNumber = txt_PhoneNumber.Text;
     model.StoreImgUrl = img_StoreImgUrl.ImageUrl;
     model.Area        = txt_Area.Text;
     model.City        = txt_City.Text;
     model.Province    = txt_Province.Text;
     model.Address     = txt_Address.Text;
     model.Score       = Convert.ToDecimal(txt_Score.Text);
     model.State       = Convert.ToInt32(drp_State.SelectedValue);
     model.IsDeleted   = Convert.ToInt32(drp_IsDeleted.SelectedValue);
     model.PlanId      = txt_PlanId.Text.Trim() == "" ? 0 :Convert.ToInt32(txt_PlanId.Text);
     if (bll.Add(model))
     {
         //AddAdminLog(DTEnums.ActionEnum.Add.ToString(), "添加管理员:" + model.user_name); //记录日志
         return(true);
     }
     return(false);
 }