using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Model;
using BLL;
namespace ComResProSystem
{
    public partial class usermail:BasePage
    {
        BaseBLL bll = new BaseBLL();
        UserBll usebll = new UserBll();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string ID = Request.QueryString["ID"];
                if (Request.QueryString["type"] == "in")
                {
                    usebll.update("mail", "State=1", "ID=" + ID);
                    Lb_Type.Text = "发件人:";
                    List<object> list = bll.SelectObject(typeof(Model.mail), "mail", "Theme,Senduser,MailContents,SendTime", "ID=" + ID);
                    Model.mail usermail = (Model.mail)list[0];
                    Lb_Senduser.Text = usermail.Senduser;
                    Lb_Theme.Text = usermail.Theme;
                    Lb_SendTime.Text = usermail.SendTime;
                    Tb_MailContents.Text = usermail.MailContents;
                }
                else
                {
                    Lb_Type.Text = "收件人:";
                    List<object> list = bll.SelectObject(typeof(Model.mail), "mail", "Theme,Recipients,MailContents,SendTime", "ID=" + ID);
                    Model.mail usermail = (Model.mail)list[0];
                    Lb_Senduser.Text = usermail.Recipients;
                    Lb_Theme.Text = usermail.Theme;
                    Lb_SendTime.Text = usermail.SendTime;
                    Tb_MailContents.Text = usermail.MailContents;
                }
            }
        }
    }
}