/// <inheritdoc /> public string PostTimeEntry(string json) { var repo = DefaultContainer.FethInstance <ITimeEntryRepository>(); var detail = json.SerializeObject <TimeEntry>(); return(ExecuteFuncInTry(repo.Create, detail)); }
/// <inheritdoc /> public string UpdateTimeEntry(string json) { var timeEntryRepository = DefaultContainer.FethInstance <ITimeEntryRepository>(); var entry = json.SerializeObject <TimeEntry>(); return(ExecuteActionInTry(timeEntryRepository.Update, entry)); }
/// <inheritdoc /> public string PostProjects(string json) { var repo = DefaultContainer.FethInstance <IProjectRepository>(); var projects = json.SerializeObjectCollection <Project>(); return(ExecuteActionInTry(repo.CreateMany, projects)); }
/// <inheritdoc /> public string GetProjectsByCompany(int id) { var projectDetailRepository = DefaultContainer.FethInstance <IProjectDetailRepository>(); return(ExecuteGenericFuncInTry <ProjectDetail>(projectDetailRepository.Where, detail => detail.CompanyId == id, JSON.ToJSON)); }
/// <inheritdoc /> public string GetNewProjects() { var projectRepository = DefaultContainer.FethInstance <IProjectRepository>(); var results = ExecuteGenericFuncInTry <Project>(projectRepository.Where, p => p.ProjectStatusTy == ProjectStatusTy.NewSubmittion, JSON.ToJSON); return(results.ToJson()); }
/// <inheritdoc /> public string PostDetail(string json) { var projectDetailRepository = DefaultContainer.FethInstance <IProjectDetailRepository>(); var detail = json.SerializeObject <ProjectDetail>(); var timeEntryRepository = DefaultContainer.FethInstance <ITimeEntryRepository>(); timeEntryRepository.CreateMany(detail.TimeEntries); return(ExecuteFuncInTry(projectDetailRepository.Create, detail)); }
/// <inheritdoc /> public string GetProjectDetail(int id) { var detailRepository = DefaultContainer.FethInstance <IProjectDetailRepository>(); return(ExecuteFuncInTry(detailRepository.FetchById, id, JSON.ToJSON)); }
/// <inheritdoc /> public string UpdateDetial(string json) { var detailRepository = DefaultContainer.FethInstance <IProjectDetailRepository>(); return(ExecuteActionInTry(detailRepository.Update, json.SerializeObject <ProjectDetail>())); }
/// <inheritdoc /> public string UpdateProject(string json) { var projectRepository = DefaultContainer.FethInstance <IProjectRepository>(); return(ExecuteActionInTry(projectRepository.UpdateProjectWithDetails, json.SerializeObject <Project>())); }