public void Update( Note note ) { if (note == null) return; db.Entry( note ).State = EntityState.Modified; db.SaveChanges(); }
public static bool IsInBase( Note note ) { IList<UniversityInfo> univers = UniversityBusiness.GetListUniversityInfo( note.UniversityID ); if (univers.Count > 0) return true; return false; }
public static void Add(Note note) { if (note != null) { Notes db = new Notes(); db.Save( note ); } }
public void Save( Note note ) { if (note == null) return; note.Id = GetLastId(); db.Notes.Add( note ); db.SaveChanges(); }
public ActionResult UpdateInfo( Note note ) { if (note.ExpensesTravel != 0 && note.ExpensesFood != 0) if (ModelState.IsValid) { NotesBusiness.Add( note ); } return View(); }
public ActionResult StudentPage(Note note) { ViewBag.Title = "Відправка форми"; note.MinimalTaitionFee = note.MaximalTaitionFee; if(note.ExpensesTravel != 0 && note.ExpensesFood !=0) if (ModelState.IsValid) { if(NotesBusiness.IsInBase( note ) == false) NotesBusiness.Add(note); return RedirectToAction( "Success", new { Id = note.UniversityID } ); } return View(); }
public Note IsInBase( Note note ) { return db.Notes.Find( note ); }