Exemplo n.º 1
0
 public static string NoteUpdate(NoteViews note)
 {
     try
     {
         using (WebdeNotEntities db = new WebdeNotEntities())
         {
             TblNote upnote = db.TblNote.Find(note.ID);
             if (upnote != null)
             {
                 upnote.Title            = note.Title;
                 upnote.Description      = note.Description;
                 upnote.ReminderDate     = note.ReminderDate;
                 upnote.İmportantyDegree = note.İmportantyDegree;
                 db.SaveChanges();
                 return("+ note guncellendi.");
             }
             else
             {
                 return("- note bulunamadi.");
             }
         }
     }
     catch (Exception ex)
     {
         return("- " + ex.Message);
     }
 }
Exemplo n.º 2
0
 public static string SignUp(userView newUser)
 {
     try
     {
         using (WebdeNotEntities db = new WebdeNotEntities())
         {
             TblUser nUser = new TblUser {
                 Name = newUser.Name, Email = newUser.Email, Nickname = newUser.Nickname, Photo = newUser.Photo, Password = newUser.Password, Surname = newUser.Surname, BirthDate = newUser.BirtDate
             };
             nUser.JoinDate = DateTime.Now;
             nUser.Existing = true;
             db.TblUser.Add(nUser);
             db.SaveChanges();
             return("+ okey");
         };
     }
     catch (Exception ex)
     {
         return("- " + ex.Message);
     }
 }
Exemplo n.º 3
0
 public static string NoteAdd(NoteViews newnote)
 {
     try
     {
         using (WebdeNotEntities db = new WebdeNotEntities())
         {
             TblNote new_note = new TblNote
             {
                 Title            = newnote.Title,
                 Description      = newnote.Description,
                 ReminderDate     = newnote.ReminderDate,
                 İmportantyDegree = newnote.İmportantyDegree,
             };
             db.TblNote.Add(new_note);
             db.SaveChanges();
             return("+ Note eklendi");
         }
     }
     catch (Exception ex)
     {
         return("- " + ex.Message);
     }
 }
Exemplo n.º 4
0
 public static string DeleteNote(int noteID)
 {
     try
     {
         using (WebdeNotEntities db = new WebdeNotEntities())
         {
             TblNote delnote = db.TblNote.Find(noteID);
             if (delnote != null)
             {
                 delnote.Existing = false;
                 return("+ Silindi.");
             }
             else
             {
                 return("- not bulunamadı.");
             }
             db.SaveChanges();
         }
     }
     catch (Exception ex)
     {
         return("- " + ex.Message);
     }
 }