コード例 #1
0
        /// <inheritdoc />
        public string PostTimeEntry(string json)
        {
            var repo   = DefaultContainer.FethInstance <ITimeEntryRepository>();
            var detail = json.SerializeObject <TimeEntry>();

            return(ExecuteFuncInTry(repo.Create, detail));
        }
コード例 #2
0
        /// <inheritdoc />
        public string UpdateTimeEntry(string json)
        {
            var timeEntryRepository = DefaultContainer.FethInstance <ITimeEntryRepository>();
            var entry = json.SerializeObject <TimeEntry>();

            return(ExecuteActionInTry(timeEntryRepository.Update, entry));
        }
コード例 #3
0
        /// <inheritdoc />
        public string PostProjects(string json)
        {
            var repo     = DefaultContainer.FethInstance <IProjectRepository>();
            var projects = json.SerializeObjectCollection <Project>();

            return(ExecuteActionInTry(repo.CreateMany, projects));
        }
コード例 #4
0
        /// <inheritdoc />
        public string GetProjectsByCompany(int id)
        {
            var projectDetailRepository = DefaultContainer.FethInstance <IProjectDetailRepository>();

            return(ExecuteGenericFuncInTry <ProjectDetail>(projectDetailRepository.Where, detail => detail.CompanyId == id,
                                                           JSON.ToJSON));
        }
コード例 #5
0
        /// <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());
        }
コード例 #6
0
        /// <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));
        }
コード例 #7
0
        /// <inheritdoc />
        public string GetProjectDetail(int id)
        {
            var detailRepository = DefaultContainer.FethInstance <IProjectDetailRepository>();

            return(ExecuteFuncInTry(detailRepository.FetchById, id, JSON.ToJSON));
        }
コード例 #8
0
        /// <inheritdoc />
        public string UpdateDetial(string json)
        {
            var detailRepository = DefaultContainer.FethInstance <IProjectDetailRepository>();

            return(ExecuteActionInTry(detailRepository.Update, json.SerializeObject <ProjectDetail>()));
        }
コード例 #9
0
        /// <inheritdoc />
        public string UpdateProject(string json)
        {
            var projectRepository = DefaultContainer.FethInstance <IProjectRepository>();

            return(ExecuteActionInTry(projectRepository.UpdateProjectWithDetails, json.SerializeObject <Project>()));
        }