Exemplo n.º 1
0
        private void mnuDeleteAll_Click(object sender, EventArgs e)
        {
            switch (type)
            {
            case 1:
                if (MessageBox.Show("确认要删除全部记录吗?", " 系统提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
                {
                    int rows = new SQL().Database("ConnString").Delete(EmailList._).ToExec();
                    EmailListHelper.ClearCacheAll();
                    BindData();
                }
                break;

            case 2:
                if (MessageBox.Show("确认要删除全部记录吗?", " 系统提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
                {
                    int rows = new SQL().Database("ConnString").Delete(SmtpList._).ToExec();
                    SmtpListHelper.ClearCacheAll();
                    BindData();
                }
                break;

            case 3:
                if (MessageBox.Show("确认要删除全部记录吗?", " 系统提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
                {
                    int rows = new SQL().Database("ConnString").Delete(IpHistory._).ToExec();
                    IpHistoryHelper.ClearCacheAll();
                    BindData();
                }
                break;
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// 清理缓存
 /// </summary>
 private void clear()
 {
     SmtpListHelper.ClearCacheAll(); smtpList         = null;
     EmailListHelper.ClearCacheAll(); emailList       = null;
     SendSettingHelper.ClearCacheAll(); sendSetting   = null;
     HtmlTemplateHelper.ClearCacheAll(); templateList = null;
     IpHistoryHelper.ClearCacheAll();
 }
Exemplo n.º 3
0
        private void mnuSearch_Click(object sender, EventArgs e)
        {
            switch (type)
            {
            case 1:
                EmailListHelper.ClearCacheAll();
                break;

            case 2:
                SmtpListHelper.ClearCacheAll();
                break;

            case 3:
                IpHistoryHelper.ClearCacheAll();
                break;
            }
            BindData();
        }
Exemplo n.º 4
0
        private void mnuDisable_Click(object sender, EventArgs e)
        {
            switch (type)
            {
            case 1:
                EmailListHelper.ClearCacheAll();
                break;

            case 2:
                SmtpListHelper.ClearCacheAll();
                foreach (ListViewItem item in listView1.Items)
                {
                    if (item.Checked)
                    {
                        string[] list = item.Tag.ToString().Split(',');

                        SmtpList info = new SmtpList();
                        info.SmtpServer = list[0].ToString();
                        info.SmtpPort   = list[1].ToString().ToInt(25);
                        info.UserName   = list[2].ToString();
                        info.SPassword  = list[3].ToString();
                        info.Status     = 1;
                        SmtpListHelper.Update(info);
                        //if (!info.SmtpServer.IsNullEmpty() || SmtpListHelper.IsExistByID(info.SmtpServer, info.SmtpPort.Value, info.UserName)) {
                        //    SmtpListHelper.Update(info);
                        //}
                    }
                }
                break;

            case 3:
                IpHistoryHelper.ClearCacheAll();
                break;
            }
            BindData();
        }