public Note Get(Agenda _par_objAgenda) { try { if (_par_objAgenda.Id <= 0) { throw new Exception("Nenhuma agenda selecionada"); } var _objDao = new NoteDAO(new EntidadesContext()).Get(_par_objAgenda.Id); if (_objDao != null) { return(DaoToModel(_objDao)); } else { return(null); } } catch (Exception _par_objException) { throw _par_objException; } }
//노트 디테일에서 노트북 선택하는 함수 public ActionResult SelectNoteBook(int noteid) { var allBooks = NoteBookDAO.GetNoteBookList(); //노트북 전체 불러오기 List <SelectListItem> items = new List <SelectListItem>(); //select list item 초기화 String noteBookId = NoteDAO.GetNotebyId(noteid).NoteBookId.ToString(); //노트의 노트북아이디 foreach (var noteBook in allBooks) { items.Add(new SelectListItem() { Text = noteBook.Name, Value = noteBook.NoteBookId.ToString(), Selected = false }); } foreach (var item in items) { if (item.Value == noteBookId) { item.Selected = true; } } ViewBag.noteBookId = items; return(View()); }
public ActionResult Account() { var cookieId = Request.Cookies["userId"]; string userId = ""; if (cookieId != null) { userId = cookieId.Value; var user = UserDAO.GetUser(int.Parse(userId)); var likedList = NoteDAO.GetLikedPosts(user.Id); var repostedist = NoteDAO.GetRepostedNotes(user.Id); var originalPosts = NoteDAO.GetOriginalPosts(user.Id); var accountViewItem = new AccountViewModel { LikedNotes = likedList, RepostedNotes = repostedist, OriginalNotes = originalPosts }; return(View(accountViewItem)); } return(View()); }
public static NoteDAO getInsence() { if (noteDAO == null) { noteDAO = new NoteDAOImplementation(); } return(noteDAO); }
public ActionResult DeletedNote(int noteid) { NoteVO DeletedNote = NoteDAO.GetNotebyId(noteid); ViewBag.DeletedNote = DeletedNote; return(View()); }
public ActionResult Deleted() { var noteList = NoteDAO.GetNoteList(OrderColumn.Notedate, OrderType.Desc, noteBookId: -1); //-1은 휴지통 ViewBag.noteList = noteList; return(View()); }
public ActionResult Detail(string id) { var logger = NLog.LogManager.GetCurrentClassLogger(); logger.Info("로그 테스트입니다."); NoteIndexVM model = new NoteIndexVM(); //int id; //노트아이디 OrderColumn defaultOrderColumn = OrderColumn.Notedate; OrderType defaultOrderType = OrderType.Desc; OrderColumn selectedOrderColumn; OrderType selectedOrderType; if (Session["OrderColumn"] != null) { selectedOrderColumn = (OrderColumn)Enum.Parse(typeof(OrderColumn), Session["OrderColumn"].ToString()); } else { // use default value selectedOrderColumn = defaultOrderColumn; } if (Session["OrderType"] != null) { selectedOrderType = (OrderType)Enum.Parse(typeof(OrderType), Session["OrderType"].ToString()); } else { // use default value selectedOrderType = defaultOrderType; } model.NoteList = NoteDAO.GetNoteList((OrderColumn)selectedOrderColumn, (OrderType)selectedOrderType, 0); if (String.IsNullOrEmpty(id)) { model.SelectedNote = NoteDAO.GetNotebyId(model.NoteList[0].NoteId); id = model.SelectedNote.NoteId.ToString(); return(RedirectToAction("detail", new { id = id })); } model.SelectedNote = NoteDAO.GetNotebyId(int.Parse(id)); //노트북선택 SelectNoteBook(int.Parse(id)); //노트 아이디로 노트북 얻어옴 model.NoteBook = NoteBookDAO.GetNoteBookbyId(model.SelectedNote.NoteBookId); return(View(model)); }
public PartialViewResult Info(int noteid) { var logger = NLog.LogManager.GetCurrentClassLogger(); logger.Info($"note id: {noteid}"); NoteVO note = NoteDAO.GetNotebyId(noteid); return(PartialView(note)); }
public void NotesDaoInsertWorking() { var note = new NoteDAO(); var note1 = new Note { Topic = "Title", Value = "Filler" }; note.InsertNote(note1); Assert.Equals(note, note1); }
private static void SetCurrentDAL(string configValue) { switch (configValue.ToLower()) { case "xml": NoteDAO = new NoteDAO(); break; default: throw new ApplicationException( string.Format("Incorrect configuration file. Unexpected \"DAL\" key value: {0}", configValue)); } }
public IHttpActionResult Delete([FromBody] string idNota) { try { NoteDAO.Delete(Convert.ToInt64(idNota)); return(Ok(true)); } catch (Exception ex) { string messaggio = $"Errore durante la Delete in NotesController --- {ex}"; log.Error(messaggio); return(BadRequest(messaggio)); } }
public IHttpActionResult GetAll() { try { List <Nota> items = NoteDAO.GetAll(); return(Ok(items)); } catch (Exception ex) { string messaggio = $"Errore durante la GetAll in NotesController --- {ex}"; log.Error(messaggio); return(BadRequest(messaggio)); } }
public IHttpActionResult Insert([FromBody] string nota) { try { long idNota = NoteDAO.Insert(nota); return(Ok(idNota)); } catch (Exception ex) { string messaggio = $"Errore durante la Insert in NotesController --- {ex}"; log.Error(messaggio); return(BadRequest(messaggio)); } }
private void btnAdd_Click(object sender, EventArgs e) { try { double result = 0.0; if (txtNote.Text == "") { return; } bool isDouble = double.TryParse(txtNote.Text, out result); if (!isDouble) { return; } var semestre = ""; if (rdSemestreOne.Checked) { semestre = "1ere Semestre"; } else { semestre = "2eme Semestre"; } var note = new Note(0, cbMatiere.Text, double.Parse(txtNote.Text), 5, semestre); var classe = new ClasseDAO().GetClasse(int.Parse(cbClasse.SelectedValue.ToString())); var etudiant = new EtudiantDAO().GetEtudiant(int.Parse(cbEtudiant.Text)); note.Classe = classe; note.Etudiant = etudiant; var nDAO = new NoteDAO(); nDAO.InsertNote(note); } catch (Exception ex) { MessageBox.Show(ex.Message); return; } MessageBox.Show(this, "Insertion avec succée", "Succée", MessageBoxButtons.OK, MessageBoxIcon.Information); cbMatiere.Focus(); }
public ActionResult Index() { var cookieId = Request.Cookies["userId"]; if (cookieId == null) { return(RedirectToAction("Login", "Users")); } string userId = ""; if (cookieId != null) { userId = cookieId.Value; var user = UserDAO.GetUser(int.Parse(userId)); var noteList = NoteDAO.GetNotes(); var likedList = NoteDAO.GetLikedPosts(user.Id); var repostedist = NoteDAO.GetRepostedNotes(user.Id); var originalPosts = NoteDAO.GetOriginalPosts(user.Id); // list of items they have not deleted to populate var like = new Like(); var author = new User(); var repost = new Note(); var likeItem = new LikeViewModel { UserItem = user, Author = author, LikedItem = like, //should be list of Like Repost = repost, NoteList = noteList, LikedList = likedList, RepostedNotes = repostedist, OriginalNotes = originalPosts }; return(View(likeItem)); } return(RedirectToAction("Login", "Users")); }
public ActionResult UserAccount(int id) { if (id != 0) { var user = UserDAO.GetUser(id); var likedList = NoteDAO.GetLikedPosts(user.Id); var repostedist = NoteDAO.GetRepostedNotes(user.Id); var originalPosts = NoteDAO.GetOriginalPosts(user.Id); var accountViewItem = new AccountViewModel { LikedNotes = likedList, RepostedNotes = repostedist, OriginalNotes = originalPosts }; return(View(accountViewItem)); } return(View()); }
public ActionResult Create(Note note) { try { NoteDAO.Create(note); //get tags var tagList = note.TagList; char[] delimiter = { ' ' }; string[] tags = tagList.Split(delimiter); foreach (var tag in tags) { if (tag != null || tag != "") { var t = new Tag { Name = tag }; TagDAO.Create(t); } var tagItem = TagDAO.GetTag(tag); var nTag = new Note_Tag(); nTag.NoteId = note.NoteId; nTag.TagId = tagItem.Id; Note_TagDAO.Create(nTag); } return(RedirectToAction("Index", "Home")); } catch { return(RedirectToAction("Index", "Home")); return(View()); } return(RedirectToAction("Index", "Home")); }
public ActionResult Update(int noteId, String title, String contents, string noteBookId) { NoteDAO.Update(noteId, title, contents, noteBookId); return(RedirectToAction("Detail", new { id = noteId })); }
public void Save(Note note) { NoteDAO dao = new NoteDAO(m_DB); dao.Save(note); }
public List <Note> GetAllNotes() { NoteDAO dao = new NoteDAO(m_DB); return(dao.GetAll()); }
private void VerifyDatabase() { NoteTypeDAO noteTypeDao = new NoteTypeDAO(m_DB); NoteDAO noteDao = new NoteDAO(m_DB); NoteRelationshipDAO nrDao = new NoteRelationshipDAO(m_DB); }
public List <Note> GetAllNotes() { List <Note> notes = new NoteDAO().Select_AllNotes(); return(notes); }
public bool DeleteNote(int ID) { bool notes = new NoteDAO().DeleteNote(ID); return(notes); }
public bool UpdateNotes(Note newNote) { bool result = new NoteDAO().UpdateNote(newNote); return(result); }
public List <Note> Search(String keyword) { List <Note> notes = new NoteDAO().Search_AllNotes(keyword); return(notes); }
public ActionResult Delete(int noteId) { NoteDAO.Delete(noteId); return(RedirectToAction("deleted")); }
private NoteBLO() { baseDao = NoteDAO.Current; dao = NoteDAO.Current; }
public ActionResult List(string orderColumn, string orderType, string noteId, string tagId) { OrderColumn defaultOrderColumn = OrderColumn.Notedate; OrderType defaultOrderType = OrderType.Desc; OrderColumn selectedOrderColumn; OrderType selectedOrderType; int selectedTagId; if (String.IsNullOrEmpty(orderColumn)) { // parameter is empty //selectedOrderColumn = defaultOrderColumn; if (Session["OrderColumn"] != null) { // do nothing } else { // use default value Session["OrderColumn"] = defaultOrderColumn; } } else { // parameter is delivered by user selectedOrderColumn = (OrderColumn)Enum.Parse(typeof(OrderColumn), orderColumn); Session["OrderColumn"] = selectedOrderColumn; } if (String.IsNullOrEmpty(orderType)) { // parameter is empty //selectedOrderColumn = defaultOrderColumn; if (Session["OrderType"] != null) { // do nothing } else { // use default value Session["OrderType"] = defaultOrderType; } } else { // parameter is delivered by user selectedOrderType = (OrderType)Enum.Parse(typeof(OrderType), orderType); Session["OrderType"] = selectedOrderType; } //Tagid selectedTagId = int.Parse(tagId); var noteList = TagDAO.GetNoteListByTagId(selectedTagId); // 리스트 정렬 정보 (column, asc|desc) // note detail int selectedNoteid = noteList[0].NoteId; NoteVO selectedNote = NoteDAO.GetNotebyId(selectedNoteid); NoteIndexVM model = new NoteIndexVM(); model.NoteList = noteList; model.SelectedNote = selectedNote; int notebookIdParsedInt = int.Parse(tagId); model.NoteBook = NoteBookDAO.GetNoteBookbyId(notebookIdParsedInt); //바로가기 여부 보여줌 //ViewBag.isShortCut = ShortcutManager.IsShorcut(id, 1); return(View(model)); }
public bool AddNote(Note newNote) { bool notes = new NoteDAO().AddNote(newNote); return(notes); }
public ActionResult RecoverNote(int noteid) { NoteDAO.RecoverNote(noteid); return(RedirectToAction("Deleted")); }