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); } }
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); } }
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); } }
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); } }