Exemplo n.º 1
0
        public void UpdateNotation(NotationModel n)
        {
            Notation n1 = db.Notations.Where(i => i.ID == n.ID).FirstOrDefault();

            db.Entry(ToNotation(n1, n)).State = EntityState.Modified;
            db.SaveChanges();
        }
Exemplo n.º 2
0
 public Notation ToNotation(Notation n, NotationModel n1)
 {
     n.ID         = n1.ID;
     n.Note       = n1.Note;
     n.Project_ID = n1.Project_ID;
     n.Author     = n1.Author;
     n.Date       = n1.Date;
     return(n);
 }
Exemplo n.º 3
0
        public NotationModel ToNotationModel(Notation n1)
        {
            NotationModel n = new NotationModel();

            n.ID         = n1.ID;
            n.Note       = n1.Note;
            n.Author     = n1.Author;
            n.AuthorName = db.Employees.Where(i => i.ID == n1.Author).FirstOrDefault().Name;
            n.Project_ID = n1.Project_ID;
            n.Date       = n1.Date;
            return(n);
        }
Exemplo n.º 4
0
 public void DeleteNotation(NotationModel n)
 {
     db.Notations.Remove(db.Notations.Find(n.ID));
 }
Exemplo n.º 5
0
 public void AddNotation(NotationModel n)
 {
     db.Notations.Add(ToNotation(new Notation(), n));
 }