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

            BLL.CustomerType bll = new BLL.CustomerType();
            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("customer_type_list.aspx", "keywords={0}", this.keywords), "Success");
        }
Ejemplo n.º 2
0
 //批量删除
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     ChkAdminLevel("customer_type", DTEnums.ActionEnum.Delete.ToString()); //检查权限
     int sucCount = 0;
     int errorCount = 0;
     BLL.CustomerType bll = new BLL.CustomerType();
     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("customer_type_list.aspx", "keywords={0}", this.keywords), "Success");
 }
Ejemplo n.º 3
0
        private void ShowInfo(int _id)
        {
            BLL.CustomerType   bll   = new BLL.CustomerType();
            Model.CustomerType model = bll.GetModel(_id);

            txtName.Text = model.Name;
        }
Ejemplo n.º 4
0
        private bool DoAdd()
        {
            bool result = false;
            Model.CustomerType model = new Model.CustomerType();
            BLL.CustomerType bll = new BLL.CustomerType();

            model.Name = txtName.Text.Trim();

            if (bll.Add(model) > 0)
            {
                AddAdminLog(DTEnums.ActionEnum.Add.ToString(), "添加客户类别:" + model.Name); //记录日志
                result = true;
            }
            return result;
        }
Ejemplo n.º 5
0
        private void RptBind(string _strWhere, string _orderby)
        {
            this.page             = DTRequest.GetQueryInt("page", 1);
            this.txtKeywords.Text = this.keywords;
            BLL.CustomerType bll = new BLL.CustomerType();
            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("customer_type_list.aspx", "keywords={0}&page={1}",
                                              this.keywords, "__id__");

            PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
        }
Ejemplo n.º 6
0
        private bool DoEdit(int _id)
        {
            bool result = false;

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

            model.Name = txtName.Text.Trim();

            if (bll.Update(model))
            {
                AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改客户类别信息:" + model.Name); //记录日志
                result = true;
            }
            return(result);
        }
Ejemplo n.º 7
0
        private bool DoAdd()
        {
            bool result = false;

            Model.CustomerType model = new Model.CustomerType();
            BLL.CustomerType   bll   = new BLL.CustomerType();

            model.Name = txtName.Text.Trim();

            if (bll.Add(model) > 0)
            {
                AddAdminLog(DTEnums.ActionEnum.Add.ToString(), "添加客户类别:" + model.Name); //记录日志
                result = true;
            }
            return(result);
        }
Ejemplo n.º 8
0
        private void TreeBind(string strWhere)
        {
            BLL.CustomerType bll = new BLL.CustomerType();
            DataTable        dt  = bll.GetList(0, strWhere, "Id desc").Tables[0];

            ddlTypeName.Items.Clear();
            ddlTypeName.Items.Add(new ListItem("不限", ""));
            foreach (DataRow dr in dt.Rows)
            {
                this.ddlTypeName.Items.Add(new ListItem(dr["Name"].ToString(), dr["Name"].ToString()));
            }

            ddlCategory.Items.Clear();
            ddlCategory.Items.Add(new ListItem("不限", ""));
            ddlCategory.Items.Add(new ListItem("托运方", "托运方"));
            ddlCategory.Items.Add(new ListItem("收货方", "收货方"));
            ddlCategory.Items.Add(new ListItem("托收两者", "托收两者"));
        }
Ejemplo n.º 9
0
        private bool DoEdit(int _id)
        {
            bool result = false;
            BLL.CustomerType bll = new BLL.CustomerType();
            Model.CustomerType model = bll.GetModel(_id);

            model.Name = txtName.Text.Trim();

            if (bll.Update(model))
            {
                AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改客户类别信息:" + model.Name); //记录日志
                result = true;
            }
            return result;
        }
Ejemplo n.º 10
0
        private void ShowInfo(int _id)
        {
            BLL.CustomerType bll = new BLL.CustomerType();
            Model.CustomerType model = bll.GetModel(_id);

            txtName.Text = model.Name;
        }
Ejemplo n.º 11
0
        private void RptBind(string _strWhere, string _orderby)
        {
            this.page = DTRequest.GetQueryInt("page", 1);
            this.txtKeywords.Text = this.keywords;
            BLL.CustomerType bll = new BLL.CustomerType();
            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("customer_type_list.aspx", "keywords={0}&page={1}",
               this.keywords, "__id__");
            PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
        }