Example #1
0
        public ActionResult ReplySave(string category, string id, FormCollection collection)
        {
            var comment = collection[0];
            var from = collection[1];
            var r = new Reply();
            r.Create(comment, from, id, category);

            return Redirect("/Home/Index");
        }
Example #2
0
 public object Save(FormCollection collection)
 {
     var comment = collection[0];
     var from = collection[1];
     var day = collection[2];
     var category = collection[3];
     var r = new Reply();
     r.Create(comment, from, day, category);
     return Redirect("/");
 }
Example #3
0
 public static List<Reply> GetReplies(string sPath)
 {
     var l = new List<Reply>();
     var dir = new DirectoryInfo(sPath);
     foreach (var fileInfo in dir.GetFiles("comment_*.txt"))
     {
         var fullPath = fileInfo.FullName;
         var comment = TextFile.ReadFileWithoutEncoding(fullPath);
         var dateStamp = fileInfo.ToString().Replace("comment_", "").Replace(".txt", "");
         var r = new Reply
                       {
                           DateStamp =  dateStamp,
                           Text = comment
                       };
         l.Add(r);
     }
     return l;
 }