示例#1
0
        public async Task <ProjectMasterViewModel> GetProjectDetailsProjectId(int projectId)
        {
            var projectSchedules = await _projectMasterRepository.GetByIdAsync(projectId);

            return(projectSchedules != null ? new ProjectMasterViewModel
            {
                ProjectID = projectSchedules.Project_ID,
                City = projectSchedules.City,
                ContractPrice = projectSchedules.Contract_Price,
                InternalNotes = projectSchedules.Internal_Notes,
                JobsitePrefix = projectSchedules.Project_Prefix,
                LotInfo = projectSchedules.Lot_Info,
                Permit = projectSchedules.Permit_No,
                ProjectGroupID = projectSchedules.Project_Group_ID?.Split(","),
                ProjectManagerID = projectSchedules.Project_Manager_id?.Split(","),
                ProjectName = projectSchedules.Project_Name,
                ProjectStatusID = projectSchedules.Status_ID?.Split(","),
                ProjectTypeID = projectSchedules.Project_Type_ID?.Split(","),
                State = projectSchedules.State,
                StreetAddress = projectSchedules.Address,
                SubNotes = projectSchedules.Sub_Notes,
                UserID = projectSchedules.User_ID,
                Zip = projectSchedules.Zip,
                Latitude = projectSchedules.Latitude,
                Longitude = projectSchedules.Longitude,
                ProjectScheduleMasterModel = await _projectScheduleMasterHelper.GetProjectScheduleByProjectID(projectSchedules.Project_ID),
                OwnerMasterModel = await _ownerMasterHelper.GetOwnerInfoByInfo(projectSchedules.Project_ID),
                OrgID = Convert.ToInt32(projectSchedules.Org_ID)
            } : new ProjectMasterViewModel());
        }
示例#2
0
        public async Task <object> GetById(long id)
        {
            try
            {
                var data = await repository.GetByIdAsync(id);

                _response.Result = data;
            }
            catch (Exception ex)
            {
                _response.IsSuccess     = false;
                _response.ErrorMessages = new List <ErrorMessageDTO>()
                {
                    new ErrorMessageDTO()
                    {
                        Message = ex.ToString()
                    }
                };
            }
            return(_response);
        }