예제 #1
0
        public M_Message GetModelFromReader(DbDataReader rdr)
        {
            M_Message model = new M_Message();

            model.MsgID        = Convert.ToInt32(rdr["MsgID"]);
            model.Title        = ConverToStr(rdr["Title"]);
            model.Content      = ConverToStr(rdr["Content"]);
            model.Sender       = ConvertToInt(rdr["Sender"]);
            model.Incept       = ConverToStr(rdr["Incept"]);
            model.PostDate     = ConvertToDate(rdr["PostDate"]);
            model.Savedata     = ConvertToInt(rdr["Savedata"]);
            model.status       = ConvertToInt(rdr["status"]);
            model.IsDelInbox   = ConvertToInt(rdr["IsDelInbox"]);
            model.IsDelSendbox = ConvertToInt(rdr["IsDelSendbox"]);
            model.Receipt      = ConverToStr(rdr["Receipt"]);
            model.MsgType      = ConvertToInt(rdr["MsgType"]);
            model.CCUser       = ConverToStr(rdr["CCUser"]);
            model.ReadUser     = ConverToStr(rdr["ReadUser"]);
            model.Attachment   = ConverToStr(rdr["Attachment"]);
            model.DelIDS       = ConverToStr(rdr["DelIDS"]);
            model.RealDelIDS   = ConverToStr(rdr["RealDelIDS"]);
            model.UserName     = ConverToStr(rdr["UserName"]);
            rdr.Close();
            return(model);
        }
예제 #2
0
        public override SqlParameter[] GetParameters()
        {
            M_Message model = this;

            if (model.PostDate <= DateTime.MinValue)
            {
                model.PostDate = DateTime.Now;
            }
            SqlParameter[] sp = GetSP();
            sp[0].Value  = model.MsgID;
            sp[1].Value  = model.Title;
            sp[2].Value  = model.Content;
            sp[3].Value  = model.Sender;
            sp[4].Value  = model.Incept;
            sp[5].Value  = model.PostDate;
            sp[6].Value  = model.Savedata;
            sp[7].Value  = model.status;
            sp[8].Value  = model.IsDelInbox;
            sp[9].Value  = model.IsDelSendbox;
            sp[10].Value = model.Receipt;
            sp[11].Value = model.MsgType;
            sp[12].Value = model.CCUser;
            sp[13].Value = model.ReadUser;
            sp[14].Value = model.Attachment;
            sp[15].Value = model.DelIDS;
            sp[16].Value = model.RealDelIDS;
            sp[17].Value = model.UserName;
            return(sp);
        }
예제 #3
0
 //发送
 protected void BtnSend_Click(object sender, EventArgs e)
 {
     if (Page.IsValid)
     {
         M_Message messInfo = new M_Message();
         messInfo.Incept = this.TxtInceptUser.Text;
         string UserName = HttpContext.Current.Request.Cookies["UserState"]["UserName"];
         messInfo.Sender = UserName;
         messInfo.Title = this.TxtTitle.Text;
         messInfo.PostDate = DataConverter.CDate(DateTime.Now.ToShortDateString());
         messInfo.Content = this.EditorContent.Text;
         B_Message.Add(messInfo);
         Response.Redirect("Message.aspx");
     }
 }
예제 #4
0
 //发送
 protected void BtnSend_Click(object sender, EventArgs e)
 {
     if (Page.IsValid)
     {
         M_Message messInfo = new M_Message();
         B_User bll = new B_User();
         messInfo.Sender = "admin";
         messInfo.Title = this.TxtTitle.Text;
         messInfo.PostDate = DataConverter.CDate(DateTime.Now.ToShortDateString());
         messInfo.Content = this.EditorContent.Text;
         if (this.RadIncept1.Checked)
         {
             DataTable dt = bll.GetUserInfos();
             foreach (DataRow dr in dt.Rows)
             {
                 //if (dr["UserName"].ToString() != "admin")
                 //{
                 messInfo.Incept = dr["UserName"].ToString();
                 B_Message.Add(messInfo);
                 //}
             }
         }
         if (this.RadIncept3.Checked)
         {
             string uname = this.TxtInceptUser.Text;
             if (!string.IsNullOrEmpty(uname))
             {
                 string[] namearr = uname.Split(new char[] { ',' });
                 for (int i = 0; i < namearr.Length; i++)
                 {
                     messInfo.Incept = namearr[i];
                     B_Message.Add(messInfo);
                 }
             }
         }
     }
 }
예제 #5
0
 //更新信息
 public static bool Update(M_Message messInfo)
 {
     return message.Update(messInfo);
 }
예제 #6
0
 //增加信息
 public static bool Add(M_Message messInfo)
 {
     return message.Add(messInfo);
 }