public void UpdateFinalComment(EditFinalCommentViewModel fcvm) { var Config = new MapperConfiguration(cfg => { cfg.CreateMap <EditFinalCommentViewModel, FinalComments>(); }); IMapper mapper = Config.CreateMapper(); FinalComments finalComments = mapper.Map <EditFinalCommentViewModel, FinalComments>(fcvm); fr.UpdateFinalComment(finalComments); }
public void InsertFinalComment(NewFinalCommentViewModel fcvm) { var Config = new MapperConfiguration(cfg => { cfg.CreateMap <NewFinalCommentViewModel, FinalComments>(); }); IMapper mapper = Config.CreateMapper(); FinalComments finalComments = mapper.Map <NewFinalCommentViewModel, FinalComments>(fcvm); fr.InsertFinalComment(finalComments); }
public void DeleteFinalComment(int FinalCommentID) { FinalComments ExistingFinalComment = db.finalComments.Where(temp => temp.FinalCommentID == FinalCommentID).FirstOrDefault(); if (ExistingFinalComment != null) { db.finalComments.Remove(ExistingFinalComment); db.SaveChanges(); } }
public void UpdateFinalComment(FinalComments Task) { FinalComments ExistingTaskDone = db.finalComments.Where(temp => temp.FinalCommentID == Task.FinalCommentID).FirstOrDefault(); if (ExistingTaskDone != null) { ExistingTaskDone.Screen = Task.Screen; ExistingTaskDone.FinalCommentDescription = Task.FinalCommentDescription; ExistingTaskDone.DateOfFinalComment = Task.DateOfFinalComment; ExistingTaskDone.Attachments = Task.Attachments; db.SaveChanges(); } }
public FinalCommentViewModel GetFinalCommentByID(int FinalCommentID) { FinalComments finalComments = fr.GetFinalCommentByID(FinalCommentID); FinalCommentViewModel fcvm = null; if (finalComments != null) { var Config = new MapperConfiguration(cfg => { cfg.CreateMap <FinalComments, FinalCommentViewModel>(); cfg.CreateMap <Users, UserViewModel>(); cfg.CreateMap <Projects, ProjectViewModel>(); }); IMapper mapper = Config.CreateMapper(); fcvm = mapper.Map <FinalComments, FinalCommentViewModel>(finalComments); return(fcvm); } else { return(fcvm); } }
public void InsertFinalComment(FinalComments Task) { db.finalComments.Add(Task); db.SaveChanges(); }
public FinalComments GetFinalCommentByID(int FinalCommentID) { FinalComments ExistingFinalComment = db.finalComments.Where(temp => temp.FinalCommentID == FinalCommentID).FirstOrDefault(); return(ExistingFinalComment); }