コード例 #1
0
        // GET api/<controller>
        public List <Checklist> GetChecklists()
        {
            try
            {
                return(ProtocolsData.GetChecklists());
            }
            catch (Exception ex)
            {
                var resp = new HttpResponseMessage(HttpStatusCode.ExpectationFailed)

                {
                    ReasonPhrase = ex.Message
                };

                throw new HttpResponseException(resp);
            }
        }
コード例 #2
0
        // GET api/<controller>/5
        public List <Checklist> Get(string ProtocolCKey)
        {
            try
            {
                if (ProtocolCKey != null)
                {
                    return(ProtocolsData.GetChecklists(decimal.Parse(ProtocolCKey)));
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception ex)
            {
                var resp = new HttpResponseMessage(HttpStatusCode.ExpectationFailed)

                {
                    ReasonPhrase = ex.Message
                };

                throw new HttpResponseException(resp);
            }
        }
コード例 #3
0
        protected void LoadHtmlData(System.Web.UI.HtmlControls.HtmlGenericControl ctl, string version)
        {
            string ProtocolVersion = Request.QueryString["ProtocolVersionCKey"];

            string section = ddSection.SelectedItem.Text;

            ctl.InnerHtml = "";

            if (version != "" && section == "Notes and References")
            {
                //string html = new SSPWebUI.Data.Note().GetMergedNotes(decimal.Parse(ProtocolVersion), decimal.Parse(version));
                string html = new HTMLHelper().GetNotes(ProtocolVersion, version, true, 1);
                ctl.InnerHtml = html;
            }
            else if (version != "" && section == "Title")
            {
                ProtocolHeader hdr = new SSPWebUI.Data.ProtocolHeaderData().Get(decimal.Parse(ProtocolVersion), 0, decimal.Parse(version));

                ctl.InnerHtml = "<p><b>Title:</b>" + hdr.Title + "</p>";
                ctl.InnerHtml = ctl.InnerHtml + "<p><b>Subtitle:</b>" + hdr.Subtitle + "</p>";
                ctl.InnerHtml = ctl.InnerHtml + "<p><b>Base Versions:</b><p><ul>";
                string[]           baseversions     = hdr.BaseVersions.Split(';');
                List <BaseVersion> baseversionslist = new BaseVersion().getAllVersions();
                foreach (string b in baseversions)
                {
                    foreach (BaseVersion basever in baseversionslist)
                    {
                        if (basever.Code == int.Parse(b))
                        {
                            ctl.InnerHtml = ctl.InnerHtml + "<li>" + basever.Label + "</li>";
                        }
                    }
                }
                ctl.InnerHtml = ctl.InnerHtml + "</ul>";
            }
            else if (version != "" && section == "Cover Page")
            {
                ctl.InnerHtml = new SSPWebUI.Data.CoverPage().GetProcedure(decimal.Parse(ProtocolVersion), 0, decimal.Parse(version)).ProcedureDetails;
            }
            else if (version != "" && section == "Authors")
            {
                string        html    = "<table>";
                List <Author> authors = new SSPWebUI.Data.Author().getAuthors(decimal.Parse(ProtocolVersion), 0, decimal.Parse(version));
                html = html + "<tr><thead><th>Author</th><th>Role</th></thead><tbody>";
                foreach (Author author in authors)
                {
                    html = html + "<tr>";
                    html = html + "<td>" + author.Name + "</td>" + "<td>" + author.Role + "</td>";
                    html = html + "</tr>";
                }
                html          = html + "</tbody></table>";
                ctl.InnerHtml = html;
            }
            else if (version != "" && section == "Case Summary")
            {
                List <Checklist> checklists = ProtocolsData.GetChecklists(decimal.Parse(ProtocolVersion));
                foreach (Checklist c in checklists)
                {
                    //ctl.InnerHtml = ctl.InnerHtml + "<h2>" + c.Name + "</h2>";
                    HTMLHelper html = new HTMLHelper();
                    ctl.InnerHtml = ctl.InnerHtml + html.GetCaseSummary(c.ChecklistCKey.ToString(), version);
                }
            }
        }
コード例 #4
0
        public void LoadChecklists()
        {
            List <Checklist> checklists = ProtocolsData.GetChecklists(decimal.Parse(txtProtocolVersion.Text));

            Session.Add("checklists", checklists);
        }