Ejemplo n.º 1
0
 //写信
 public ActionResult Write(MessageInfo Rei)
 {
     try
     {
         var user = Session["CurrentUser"] as UserAndRole;
         MessageListViewModel WriteView = new MessageListViewModel();
         if (Rei.SendByName != null)
         {
             WriteView.Receiver = Rei.SendByName + ";" + " ";
         }
         WriteView.UserId = user.UserId;
         WriteView.ModuleInfoList = GetModuleInfo();
         WriteView.ContactsList = GetContactsById(WriteView.UserId, WriteView.ModuleInfoList);
         return View(WriteView);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 2
0
 //获取消息详细信息
 public MessageInfo GetMessageDetail(string MessageNo)
 {
     MessageInfo item = new MessageInfo();
     var MessageDetail = _ServicesSoapClient.GetMessageDetail(MessageNo);
     if (MessageDetail != null)
     {
         item.SendBy = MessageDetail.SendBy;
         item.SendByName = MessageDetail.SendByName;
         item.Receiver = MessageDetail.Reciever;
         item.ReceiverName = MessageDetail.RecieverName;
         item.Title = MessageDetail.Title;
         item.SendDateTime = MessageDetail.SendDateTime;
         item.Content = MessageDetail.Content;
     }
     return item;
 }
Ejemplo n.º 3
0
 //获取已发送消息或草稿箱消息列表
 public List<MessageInfo> GetHaveSentList(string UserId, string Type)
 {
     DataSet DS = new DataSet();
     if (Type == "Draft")
     {
         DS = _ServicesSoapClient.GetDraftList(UserId);
     }
     else
     {
         DS = _ServicesSoapClient.GetHaveSentList(UserId);
     }
     List<MessageInfo> items = new List<MessageInfo>();
     if (!(DS == null))
     {
         foreach (DataTable dt in DS.Tables)
         {
             foreach (DataRow dr in dt.Rows)
             {
                 MessageInfo item = new MessageInfo();
                 //MessageNo, Receiver, ReceiverName, Title, piSendDateTime, Content
                 item.MessageNo = dr["MessageNo"].ToString();
                 item.Receiver = dr["Reciever"].ToString();
                 item.ReceiverName = dr["RecieverName"].ToString();
                 item.Title = dr["Title"].ToString();
                 item.SendDateTime = dr["SendDateTime"].ToString();
                 item.Content = dr["Content"].ToString();
                 item.OutDateFlag = Convert.ToInt32(dr["Flag"]);
                 items.Add(item);
             }
         }
     }
     return items;
 }
Ejemplo n.º 4
0
 //获取已收消息列表
 public List<MessageInfo> GetReceiveList(string UserId)
 {
     DataSet DS = new DataSet();
     DS = _ServicesSoapClient.GetReceiveList(UserId);
     List<MessageInfo> items = new List<MessageInfo>();
     if (DS != null)
     {
         foreach (DataTable dt in DS.Tables)
         {
             foreach (DataRow dr in dt.Rows)
             {
                 MessageInfo item = new MessageInfo();
                 //MessageNo, Receiver, ReceiverName, Title, SendDateTime, Content, ReadStatus
                 item.MessageNo = dr["MessageNo"].ToString();
                 item.SendBy = dr["SendBy"].ToString();
                 item.SendByName = dr["SendByName"].ToString();
                 item.Title = dr["Title"].ToString();
                 item.SendDateTime = dr["SendDateTime"].ToString();
                 item.Content = dr["Content"].ToString();
                 item.ReadStatus = Convert.ToInt32(dr["ReadStatus"]);
                 item.OutDateFlag = Convert.ToInt32(dr["Flag"]);
                 items.Add(item);
             }
         }
     }
     return items;
 }
Ejemplo n.º 5
0
 public ActionResult FastWrite(string SendBy, string Receiver)
 {
     var user = Session["CurrentUser"] as UserAndRole;
     MessageInfo Meg = new MessageInfo();
     Meg.Receiver = Receiver;
     Meg.SendBy = SendBy;
     Meg.SendByName = user.UserName;
    // Meg.UserId = user.UserId;
     Meg.ServerIP = _ServicesSoapClient.getLocalmachineIPAddress();//ServerIP
     return View(Meg);
 }