Пример #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                string ProtocolVersion = Request.QueryString["ProtocolVersionCKey"];

                DataTable dt = ProtocolsData.GetDraftVersions(decimal.Parse(ProtocolVersion));
                ddVersionLeft.Items.Add("");
                ddVersionRight.Items.Add("");
                foreach (DataRow dr in dt.Rows)
                {
                    ddVersionLeft.Items.Add(dr["DraftVersion"].ToString());
                    ddVersionRight.Items.Add(dr["DraftVersion"].ToString());
                }

                ddSection.Items.Add("Title");
                ddSection.Items.Add("Cover Page");
                ddSection.Items.Add("Authors");
                ddSection.Items.Add("Case Summary");
                ddSection.Items.Add("Notes and References");
            }

            if (ddVersionLeft.SelectedIndex == 0 || ddVersionRight.SelectedIndex == 0)
            {
                btnCompare.Visible = false;
            }
            else
            {
                btnCompare.Visible = true;
            }
        }
Пример #2
0
        public List <DraftVersion> GetDraftVersions(string ProtocolVersion)
        {
            List <DraftVersion> versions = new List <DraftVersion>();
            DataTable           dt       = ProtocolsData.GetDraftVersions(decimal.Parse(ProtocolVersion));

            foreach (DataRow dr in dt.Rows)
            {
                DraftVersion obj = new DraftVersion();
                obj.Version = dr["DraftVersion"].ToString();
                versions.Add(obj);
            }
            return(versions);
        }
Пример #3
0
        // GET api/<controller>
        public List <ProtocolGroup> Get()
        {
            DataTable            dt        = ProtocolsData.GetProtocolGroups();
            List <ProtocolGroup> protocols = new List <ProtocolGroup>();

            foreach (DataRow dr in dt.Rows)
            {
                ProtocolGroup p = new ProtocolGroup();
                p.code  = dr["ProtocolGroupCKey"].ToString();
                p.label = dr["ProtocolGroup"].ToString();
                protocols.Add(p);
            }
            return(protocols);
        }
Пример #4
0
        // GET api/<controller>
        public List <SubmitRequest> Get()
        {
            DataTable            dt        = ProtocolsData.GetProtocols();
            List <SubmitRequest> protocols = new List <SubmitRequest>();

            foreach (DataRow dr in dt.Rows)
            {
                SubmitRequest p = new SubmitRequest();
                p.ProtocolCKey = dr["protocolckey"].ToString();
                p.ProtocolName = dr["protocolname"].ToString();
                protocols.Add(p);
            }
            return(protocols);
        }
Пример #5
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);
            }
        }
Пример #6
0
        public List <SubmitRequest> GetProtocolsByGroup(string ProtocolGroup)
        {
            DataTable            dt        = ProtocolsData.GetProtocolsTableData(decimal.Parse(ProtocolGroup));;
            List <SubmitRequest> protocols = new List <SubmitRequest>();
            SubmitRequest        p         = new SubmitRequest();

            foreach (DataRow dr in dt.Rows)
            {
                p = new SubmitRequest();
                p.ProtocolCKey = dr["protocolckey"].ToString();
                p.ProtocolName = dr["protocolname"].ToString();
                protocols.Add(p);
            }
            p = new SubmitRequest();
            p.ProtocolName = "--New Protocol--";
            p.ProtocolCKey = "0";
            protocols.Add(p);
            return(protocols);
        }
Пример #7
0
        public List <ProtocolVersion> GetProtocolVersions(string ProtocolCKey)
        {
            DataTable dt = ProtocolsData.GetProtocolVersions(decimal.Parse(ProtocolCKey));
            List <ProtocolVersion> versions = new List <ProtocolVersion>();
            ProtocolVersion        obj;

            foreach (DataRow dr in dt.Rows)
            {
                obj = new ProtocolVersion();
                obj.ProtocolVersionLabel = dr["ProtocolVersion"].ToString();
                obj.ProtocolVersionCKey  = dr["ProtocolVersionCKey"].ToString();
                obj.ProtocolCKey         = ProtocolCKey;
                versions.Add(obj);
            }

            obj = new ProtocolVersion();
            obj.ProtocolCKey         = ProtocolCKey;
            obj.ProtocolVersionCKey  = "0";
            obj.ProtocolVersionLabel = "--New Version--";
            versions.Add(obj);
            return(versions);
        }
Пример #8
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);
            }
        }
Пример #9
0
        protected void grdDashboard_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            //if ((e.Row.RowState & DataControlRowState.Edit) > 0)
            {
                string protocolversionckey = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "ProtocolVersionCKey"));
                if (protocolversionckey != "")
                {
                    DropDownList ddlReviewStatus = (DropDownList)e.Row.FindControl("ddlReviewStatus");

                    DropDownList ddlVersions = (DropDownList)e.Row.FindControl("ddlVersions");
                    DataTable    dt          = ProtocolsData.GetDraftVersions(decimal.Parse(protocolversionckey));
                    ddlVersions.DataSource     = dt;
                    ddlVersions.DataTextField  = "DraftVersion";
                    ddlVersions.DataValueField = "DraftVersion";
                    ddlVersions.DataBind();
                    ddlVersions.SelectedIndex = 0;

                    string DraftVersion = ddlVersions.SelectedValue.ToString();

                    List <ReviewStatus> reviewstatuses = new List <ReviewStatus>();
                    if (DraftVersion != "")
                    {
                        reviewstatuses = new Workflow().GetWorkflowProtocolReviewStatus(decimal.Parse(protocolversionckey), decimal.Parse(ddlVersions.SelectedValue.ToString()));
                    }
                    //ddlReviewStatus.ForeColor = System.Drawing.Color.Black;
                    List <Author> authors = new Author().getAuthors(decimal.Parse(protocolversionckey), 0, 999);  //get the work version


                    if (reviewstatuses.Count > 0)
                    {
                        foreach (Author reviewer in authors)
                        {
                            ReviewStatus status = reviewstatuses.Where(x => x.ReviewerCKey == reviewer.AuthorCKey && reviewer.RoleCKey == (decimal)3.100004300).FirstOrDefault();
                            if (status != null)
                            {
                                if (status.Status != "3.100004300")
                                {
                                    reviewer.Name = reviewer.Name + " - Pending";
                                }
                                else
                                {
                                    reviewer.Name = reviewer.Name + " - Done";
                                }
                            }
                            else
                            {
                                //must have been addeded after draft was released

                                //reviewer.Name = reviewer.Name + " - Pending";
                                //new Workflow().AddProtocolReviewer(decimal.Parse(protocolversionckey), ((SSPUser)Session["user"]).CKey);
                                //if ((int)reviewer.RoleCKey == 3)
                                //{
                                //    reviewer.Name = reviewer.Name + " - Pending";
                                //}
                            }
                        }
                    }
                    else
                    {
                    }


                    var reviewers = authors.Where(x => x.RoleCKey == (decimal)3.100004300).OrderBy(x => x.Name);

                    ddlReviewStatus.DataSource     = reviewers;
                    ddlReviewStatus.DataTextField  = "Name";
                    ddlReviewStatus.DataValueField = "AuthorCKey";
                    ddlReviewStatus.DataBind();


                    DropDownList          ddlEditStatus = (DropDownList)e.Row.FindControl("ddlEditStatus");
                    List <ProtocolStatus> editstatuses  = new List <ProtocolStatus>();
                    if (DraftVersion != "")
                    {
                        editstatuses = new Workflow().GetWorkflowProtocolEditStatus(decimal.Parse(protocolversionckey), decimal.Parse(ddlVersions.SelectedValue.ToString()));
                    }


                    if (editstatuses.Count > 0)
                    {
                        foreach (Author editor in authors)
                        {
                            ProtocolStatus status = editstatuses.Where((x => x.EditorCKey == editor.AuthorCKey && ((int)editor.RoleCKey == 1 || (int)editor.RoleCKey == 2))).FirstOrDefault();
                            //ProtocolStatus status = editstatuses.Where(x => x.EditorCKey == editor.AuthorCKey).FirstOrDefault();
                            if (status != null)
                            {
                                if (status.Status != "4.100004300")
                                {
                                    editor.Name = editor.Name + " - Pending review";
                                }
                                else
                                {
                                    editor.Name = editor.Name + " - Done";
                                }
                            }

                            else  //author has not submitted draft yet
                            {
                                // if ((int)editor.RoleCKey == 1 || (int)editor.RoleCKey == 2)
                                //     editor.Name = editor.Name + " - Pending";
                                //new Workflow().AddProtocolAuthor(decimal.Parse(protocolversionckey), ((SSPUser)Session["user"]).CKey);
                            }
                        }
                    }
                    else
                    {
                        /*
                         * foreach (Author editor in authors)
                         * {
                         *  editor.Name = editor.Name + " - Pending";
                         * }*/
                    }

                    var editors = authors.Where(x => x.RoleCKey == (decimal)1.100004300 || x.RoleCKey == (decimal)2.100004300).OrderBy(x => x.Name);
                    ddlEditStatus.DataSource     = editors;
                    ddlEditStatus.DataTextField  = "Name";
                    ddlEditStatus.DataValueField = "AuthorCKey";
                    ddlEditStatus.DataBind();


                    DropDownList ddleCCStatus         = (DropDownList)e.Row.FindControl("ddleCCStatus");
                    DropDownList ddlPublicationStatus = (DropDownList)e.Row.FindControl("ddlPublicationStatus");
                    ddleCCStatus.Items.Add("Not Available");
                    ddlPublicationStatus.Items.Add("Not Available");
                }
            }
        }
Пример #10
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);
                }
            }
        }
Пример #11
0
        public void LoadChecklists()
        {
            List <Checklist> checklists = ProtocolsData.GetChecklists(decimal.Parse(txtProtocolVersion.Text));

            Session.Add("checklists", checklists);
        }
Пример #12
0
        public string GetProtocolName(string ProtocolVersionCKey)
        {
            string name = ProtocolsData.GetProtocolName(decimal.Parse(ProtocolVersionCKey));

            return(name);
        }