Exemplo n.º 1
0
        public IHttpActionResult Get(int id)
        {
            string accessType = "SOWIssue_ViewAll";

            ThrowIfUserHasNoRole(accessType);
            using (SOWIssueQuery sowIssueQuery = new SOWIssueQuery(Db))
            {
                var data = sowIssueQuery.GetByPrimaryKey(id);
                SaveLog("SOWIssue", "Get", JsonConvert.SerializeObject(new { primaryKey = id }));
                return(Ok(new SuccessResponse(data)));
            }
        }
        private SOWIssueEntryModel GetUpdateStateModel(int sowIssuePK)
        {
            SOWIssueEntryFormData formData     = new SOWIssueEntryFormData();
            List <Control>        formControls = CreateFormControls(sowIssuePK);
            SOWIssueDTO           sowIssueDTO  = sowIssueQuery.GetByPrimaryKey(sowIssuePK);

            if (sowIssueDTO == null)
            {
                throw new KairosException($"Record with primary key '{sowIssueDTO.SOWIssue_PK}' is not found.");
            }

            return(new SOWIssueEntryModel()
            {
                FormData = formData,
                FormControls = formControls,
                Model = sowIssueDTO,
            });
        }