public IActionResult CreateOneNote([FromForm]IFormCollection webFormData) { int userId = int.Parse(User.FindFirst("userid").Value); AppNote newNote = new AppNote(); try { newNote.Note = webFormData["note"]; newNote.DeadLine = DateTime.ParseExact(webFormData["deadline"], "dd/MM/yyyy", CultureInfo.InvariantCulture); newNote.CreatedById = userId; newNote.CreatedAt = _appDateTimeService.GetCurrentDateTime(); newNote.AppNotePriorityLevelId = int.Parse(webFormData["priorityLevelId"].ToString()); newNote.DoneAt = null; Database.Add(newNote); Database.SaveChanges(); } catch (Exception exceptionObject) { return BadRequest(exceptionObject.InnerException.Message); }//End of Try..Catch block return Ok(new { message = "Saved note record." }); }
public JsonResult MakeNote(AppNote appnote) { var apps = (IEnumerable <RegularApplication>)TempData["StudentAppRecovereds1"]; var application = (RegularApplication)TempData["ReviewingApp1"]; Employee emp = new Employee(); //false for nothing string msg = emp.UpdateAppNote(application.ManagerId, appnote.Sl, appnote.Note, false); application.ManagerNote = appnote.Note; apps.Where(x => x.Sl == appnote.Sl).First().ManagerNote = appnote.Note; TempData["ReviewingApp1"] = application; TempData["StudentAppRecovereds1"] = apps; return(Json(msg, JsonRequestBehavior.AllowGet)); }
public JsonResult MakeNote(AppNote appnote) { var apps = (IEnumerable <RegularApplication>)TempData["StudentAppRecovereds"]; var application = (RegularApplication)TempData["ReviewingApp"]; bool accepted = appnote.Accepted == "Accepted" ? true : false; Employee emp = new Employee(); string msg = emp.UpdateAppNote(application.PartnerId, appnote.Sl, appnote.Note, accepted); application.PartnerNote = appnote.Note; application.Accepted = accepted; apps.Where(x => x.Sl == appnote.Sl).First().PartnerNote = appnote.Note; apps.Where(x => x.Sl == appnote.Sl).First().Accepted = accepted; TempData["ReviewingApp"] = application; TempData["StudentAppRecovereds"] = apps; return(Json(msg, JsonRequestBehavior.AllowGet)); }