Ejemplo n.º 1
0
        protected void ShowROSComments(Object Sender, RepeaterItemEventArgs e)
        {
            HtmlTableRow priorToxCommentsRow;

            priorToxCommentsRow = (HtmlTableRow)e.Item.FindControl("priorToxCommentsRow");

            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                string comments = ((DataRowView)e.Item.DataItem)["ToxNotes"].ToString();
                if (comments.Length > 0)
                {
                    priorToxCommentsRow.Visible = true;
                }

                // RELATED RECORDS (get a list of realted records for this Toxicity)
                EformRelatedRecordWidget relatedWidget = e.Item.FindControl("RelatedRecordWidget") as EformRelatedRecordWidget;
                var relatableTables = relatedWidget.RelatableTables;
                int toxicityId      = (int)((DataRowView)e.Item.DataItem)[Toxicity.ToxicityId];
                // get a list of related records restricted to relatable table
                DataView toxicityRelatedRecords = rc.GetRelatedRecordsByTableAndKey(base._patientId, "Toxicities", toxicityId, relatableTables);
                Repeater relatedRptr            = e.Item.FindControl("RelatedRptr") as Repeater;
                relatedRptr.DataSource = toxicityRelatedRecords;
                relatedRptr.DataBind();
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// If page is invoked from a POSTed AJAX request (methodName), build output list
        /// </summary>
        /// <returns></returns>
        private bool ProcessAjaxRequest()
        {
            string method         = Request.Form["methodName"];
            string destTableName  = Request.Form["destTableName"];
            string destPrimaryKey = Request.Form["destTablePrimaryKey"];

            switch (method)
            {
            case ("GetRelatedRecords"):
                if (!string.IsNullOrEmpty(destTableName) && !string.IsNullOrEmpty(destPrimaryKey))
                {
                    SessionHandler sh              = new SessionHandler(Session);
                    int            patientId       = sh.GetPatientId();
                    int            destTablePriKey = int.Parse(destPrimaryKey);
                    DataView       relatedRecords  = rc.GetRelatedRecordsByTableAndKey(patientId, destTableName, destTablePriKey);
                    relatedRecords.Sort = "SrcTableSortField ASC";

                    RelatedRecordsRptr.DataSource = relatedRecords;
                    RelatedRecordsRptr.DataBind();
                    return(true);
                }
                break;

            default:
                break;
            }
            return(false);
        }