Exemplo n.º 1
0
 public void Update( Note note )
 {
     if (note == null)
         return;
     db.Entry( note ).State = EntityState.Modified;
     db.SaveChanges();
 }
Exemplo n.º 2
0
 public static bool IsInBase( Note note )
 {
     IList<UniversityInfo> univers = UniversityBusiness.GetListUniversityInfo( note.UniversityID );
     if (univers.Count > 0)
         return true;
     return false;
 }
Exemplo n.º 3
0
 public static void Add(Note note)
 {
     if (note != null)
     {
         Notes db = new Notes();
         db.Save( note );
     }
 }
Exemplo n.º 4
0
 public void Save( Note note )
 {
     if (note == null)
         return;
         note.Id = GetLastId();
         db.Notes.Add( note );
         db.SaveChanges();
 }
Exemplo n.º 5
0
 public ActionResult UpdateInfo( Note note )
 {
     if (note.ExpensesTravel != 0 && note.ExpensesFood != 0)
         if (ModelState.IsValid)
         {
             NotesBusiness.Add( note );
         }
     return View();
 }
Exemplo n.º 6
0
 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();
 }
Exemplo n.º 7
0
 public Note IsInBase( Note note )
 {
     return db.Notes.Find( note );
 }