예제 #1
0
        public ActionResult ForwardInward(InwardEntry model)
        {
            InwardNotes note = db.InwardNotes.Find(model.NoteId);

            model.Notes             = note;
            model.Notes.ForwardedTo = string.Join(",", model.ForwardedTo);
            model.Notes.FwdToCC     = string.Join(",", model.FwdToCC);
            model.Notes.FwdToDept   = string.Join(",", model.FwdToDept);
            model.Notes.ForwardedBy = User.Identity.Name;
            model.Notes.ForwardedOn = DateTime.Now;
            db.Entry(note).State    = EntityState.Modified;
            db.SaveChanges();
            TempData["Notification"] = "Note forwarded by " + User.Identity.Name;
            return(Redirect(Request.UrlReferrer.PathAndQuery));
        }
예제 #2
0
        public ActionResult ReplyNote(InwardEntry model)
        {
            var note = new InwardNotes();

            model.Notes        = new InwardNotes();
            model.Notes        = db.InwardNotes.Find(model.NoteId);
            note.RepliedToNote = model.Notes.NotesId;
            note.NoteType      = model.Notes.NoteType;
            note.InwardId      = model.Notes.InwardId;
            note.ReplyTo       = model.Notes.CreatedBy;
            note.ReplyToCC     = string.Join(",", model.ReplyToCC);
            note.ReplyToDept   = string.Join(",", model.ReplyToDept);
            note.CreatedBy     = User.Identity.Name;
            note.CreatedDate   = DateTime.Now;
            note.NoteText      = model.NoteText;
            note.InwardDoc     = model.DocumentLocation;

            db.InwardNotes.Add(note);
            //db.Entry(note).State = EntityState.Modified;
            db.SaveChanges();
            TempData["Notification"] = "Note replied by " + User.Identity.Name;
            return(Redirect(Request.UrlReferrer.PathAndQuery));
        }