HyperLesson/Student/MyMail-S.aspx.cs

(开头部分) 4KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using BLL;
using Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace HyperLesson
{
    public partial class MyMail_S : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            
        }
        //发送按钮
        protected void btnSend_Click(object sender, EventArgs e)
        {
            if(this.Mailcontent.Text=="")
            {
                Response.Write("<script>alert('请输入邮件内容!');</script>");
                return;
            }
            if(this.ConsignNum.Text=="")
            {
                Response.Write("<script>alert('请输入收件人号码!');</script>");
                return;
            }
            Mail mai = new Mail
            {
                Sender = (Session["userinfo"] as student).StudentName,
                Maicontent = this.Mailcontent.Text,
                SendDate = DateTime.Now,
                MailState = "未读",
                ConsigNum = int.Parse(this.ConsignNum.Text),
                SenderNum = (Session["userinfo"] as student).StudentNum,
            };
            if(StudentManager.getName(mai.ConsigNum)==null&& TeacherManager.getName(mai.ConsigNum) == null)
            {
                Response.Write("<script>alert('该用户不存在!');</script>");
                return;
            }
            
            if (MailManager.sendmail(mai))
            {
                Response.Write("<script>alert('发送成功!');location.href='MyMail-S.aspx';</script>");
            }
            else
            {
                Response.Write("<script>alert('发送失败!');location.href='MyMail-S.aspx';</script>");
            }
        }
        //定时发送
        protected void btnSetTime_Click(object sender, EventArgs e)
        {
            //判断是否设置了时间
            if (this.SetDate.Text == "")
            {
后面还有 58 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。