예제 #1
0
        public Work Update(Work work)
        {
            _databasecontext.Entry(work).State = EntityState.Modified;
            _databasecontext.SaveChanges();

            return work;
        }
예제 #2
0
        public Work Add(Work work)
        {
            _databasecontext.Works.Add(work);
            _databasecontext.SaveChanges();

            return work;
        }
예제 #3
0
 public WorkViewModel(int id)
 {
     _work = new WorkBl().GetById(int.Parse(id.ToString()));
     if (_work.UserId != Assets.CurrentUser.Id)
     {
         _work = new Work();
     }
 }
예제 #4
0
 public void Delete(Work work)
 {
     _databasecontext.Works.Remove(work);
     _databasecontext.SaveChanges();
 }
예제 #5
0
 public WorkViewModel()
 {
     _work = new Work();
 }