Ejemplo n.º 1
0
 //批量删除
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     ChkAdminLevel("user_mail_template", OSEnums.ActionEnum.Delete.ToString()); //检查权限
     int sucCount = 0;
     int errorCount = 0;
     BLL.configs.mail_template bll = new BLL.configs.mail_template();
     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(OSEnums.ActionEnum.Delete.ToString(), "删除邮件模板成功" + sucCount + "条,失败" + errorCount + "条"); //记录日志
     Response.Redirect(Utils.CombUrlTxt("mail_template_list.aspx", "keywords={0}", this.keywords));
 }
Ejemplo n.º 2
0
        //批量删除
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            ChkAdminLevel("user_mail_template", OSEnums.ActionEnum.Delete.ToString()); //检查权限
            int sucCount   = 0;
            int errorCount = 0;

            BLL.configs.mail_template bll = new BLL.configs.mail_template();
            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(OSEnums.ActionEnum.Delete.ToString(), "删除邮件模板成功" + sucCount + "条,失败" + errorCount + "条"); //记录日志
            Response.Redirect(Utils.CombUrlTxt("mail_template_list.aspx", "keywords={0}", this.keywords));
        }
Ejemplo n.º 3
0
        private void ShowInfo(int _id)
        {
            BLL.configs.mail_template   bll   = new BLL.configs.mail_template();
            Model.configs.mail_template model = bll.GetModel(_id);

            txtTitle.Text     = model.title;
            txtCallIndex.Text = model.call_index;
            txtMailTitle.Text = model.maill_title;
            txtContent.Value  = model.content;
        }
Ejemplo n.º 4
0
        private void RptBind(string _strWhere, string _orderby)
        {
            this.page        = OSRequest.GetQueryInt("page", 1);
            txtKeywords.Text = this.keywords;
            BLL.configs.mail_template bll = new BLL.configs.mail_template();
            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("mail_template_list.aspx", "keywords={0}&page={1}", this.keywords, "__id__");

            PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
        }
Ejemplo n.º 5
0
        private bool DoAdd()
        {
            Model.configs.mail_template model = new Model.configs.mail_template();
            BLL.configs.mail_template bll = new BLL.configs.mail_template();

            model.title = txtTitle.Text.Trim();
            model.call_index = txtCallIndex.Text.Trim();
            model.maill_title = txtMailTitle.Text.Trim();
            model.content = txtContent.Value;

            if (bll.Add(model) > 0)
            {
                AddAdminLog(OSEnums.ActionEnum.Add.ToString(), "添加邮件模板:" + model.title); //记录日志
                return true;
            }
            return false;
        }
Ejemplo n.º 6
0
        private bool DoAdd()
        {
            Model.configs.mail_template model = new Model.configs.mail_template();
            BLL.configs.mail_template   bll   = new BLL.configs.mail_template();

            model.title       = txtTitle.Text.Trim();
            model.call_index  = txtCallIndex.Text.Trim();
            model.maill_title = txtMailTitle.Text.Trim();
            model.content     = txtContent.Value;

            if (bll.Add(model) > 0)
            {
                AddAdminLog(OSEnums.ActionEnum.Add.ToString(), "添加邮件模板:" + model.title); //记录日志
                return(true);
            }
            return(false);
        }
Ejemplo n.º 7
0
        private bool DoEdit(int _id)
        {
            bool result = false;

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

            model.title       = txtTitle.Text.Trim();
            model.call_index  = txtCallIndex.Text.Trim();
            model.maill_title = txtMailTitle.Text.Trim();
            model.content     = txtContent.Value;

            if (bll.Update(model))
            {
                AddAdminLog(OSEnums.ActionEnum.Edit.ToString(), "修改邮件模板:" + model.title); //记录日志
                result = true;
            }

            return(result);
        }
Ejemplo n.º 8
0
        private void RptBind(string _strWhere, string _orderby)
        {
            this.page = OSRequest.GetQueryInt("page", 1);
            txtKeywords.Text = this.keywords;
            BLL.configs.mail_template bll = new BLL.configs.mail_template();
            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("mail_template_list.aspx", "keywords={0}&page={1}", this.keywords, "__id__");
            PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
        }
Ejemplo n.º 9
0
        private bool DoEdit(int _id)
        {
            bool result = false;
            BLL.configs.mail_template bll = new BLL.configs.mail_template();
            Model.configs.mail_template model = bll.GetModel(_id);

            model.title = txtTitle.Text.Trim();
            model.call_index = txtCallIndex.Text.Trim();
            model.maill_title = txtMailTitle.Text.Trim();
            model.content = txtContent.Value;

            if (bll.Update(model))
            {
                AddAdminLog(OSEnums.ActionEnum.Edit.ToString(), "修改邮件模板:" + model.title); //记录日志
                result = true;
            }

            return result;
        }
Ejemplo n.º 10
0
        private void ShowInfo(int _id)
        {
            BLL.configs.mail_template bll = new BLL.configs.mail_template();
            Model.configs.mail_template model = bll.GetModel(_id);

            txtTitle.Text = model.title;
            txtCallIndex.Text = model.call_index;
            txtMailTitle.Text = model.maill_title;
            txtContent.Value = model.content;
        }