private void PostMessage()
 {
     try
     {
         if (Session["login"] != null &&
             Session["AccountID"] != null)
         {
             var obj = new DTOTweet {
                 AccountID = int.Parse(Session["AccountID"].ToString()), AccountID2 = int.Parse(lbAccountID2.Text), Message = txtMessage.Value
             };
             BllTweet.Insert(obj);
             _ErrorPostMessage =
                 LibAlert.Alert.AlertSucess("Bạn đã gửi tin nhắn thành công đến <b style='color:black'>" + lbFullNameMessage.Text +
                                            "</b>");
         }
         else
         {
             _ErrorPostMessage =
                 LibAlert.Alert.AlertError(
                     "<b>Chương trình bị ngắt quãng vì lý do an toàn</b><br/>Vui lòng thoát ra và đăng nhập lại !");
         }
     }
     catch (Exception ex)
     {
         _ErrorPostMessage =
             LibAlert.Alert.AlertError("Có lỗi xảy ra trong quá trình gửi tin nhắn <br/>" + ex.Message);
     }
 }
示例#2
0
 private void PostMessage()
 {
     try
     {
         var obj = new DTOTweet {
             AccountID = int.Parse(Session["AccountID"].ToString()), AccountID2 = int.Parse(lbAccountIDRequest.Text), Message = txtMessageRquest.Value
         };
         BllTweet.Insert(obj);
         _ErrorPostMessageRequest =
             LibAlert.Alert.AlertSucess("Bạn đã gửi tin nhắn thành công đến <b style='color:black'>" + lbFullNameMessageRequest.Text +
                                        "</b>");
     }
     catch (Exception ex)
     {
         _ErrorPostMessageRequest =
             LibAlert.Alert.AlertError("Có lỗi xảy ra trong quá trình gửi tin nhắn <br/>" + ex.Message);
     }
 }