示例#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>()));
        }