Exemplo n.º 1
0
 public ActionResult Send(string message, string file, chatSendModel model)
 {
     /*
      * If message isn't empty, write into log file with appropriate date and user tags
      * */
     if (ModelState.IsValid)
     {
         var    date        = DateTime.Now;
         string lineToWrite = "<!--" + date.ToString("hh:mm:ss tt") + "--> <span class='umessage'>(" + Session["email"] + ")</span> : " + message + "<br />";
         string fileString  = file;
         var    path        = Server.MapPath("~/chatLogs/" + fileString + ".txt");
         objChat.writeChat(lineToWrite, path);
         return(PartialView());
     }
     else
     {
         return(PartialView());
     }
 }
Exemplo n.º 2
0
        public ActionResult nSend(string message, string file, chatSendModel model)
        {
            /*
             * IF message is not empty string, send to chat room
             * */

            if (ModelState.IsValid)
            {
                var    date        = DateTime.Now;
                string lineToWrite = "<!--" + date.ToString("yyyy-MM-dd hh:mm:ss tt") + "--> <span class='nmessage'>(" + User.Identity.Name + ")</span> : " + message + "<br />";
                string fileString  = file;
                var    path        = Server.MapPath("~/chatLogs/" + fileString + ".txt");
                objChat.writeChat(lineToWrite, path);
                return(PartialView());
            }
            else
            {
                return(PartialView());
            }
        }