Ejemplo n.º 1
0
        protected void SetProcedureCheckbox(EformCheckBox ProcedureCheckBox, EformComboBox ProcedureSurgeon, EformSelect ProcedureSurgeonType, EformComboBox ProcedureAssistant, EformSelect ProcedureAssistantType)
        {
            string CheckboxOnclickString = "copyProcedureInputValues(this, '" + OpSurgeon.ClientID + "', '" + ProcedureSurgeon.ClientID + "'); ";

            CheckboxOnclickString += "copyProcedureInputValues(this, '" + OpSurgeonType.ClientID + "', '" + ProcedureSurgeonType.ClientID + "'); ";
            CheckboxOnclickString += "copyProcedureInputValues(this, '" + OpAssistant.ClientID + "', '" + ProcedureAssistant.ClientID + "'); ";
            CheckboxOnclickString += "copyProcedureInputValues(this, '" + OpAssistantType.ClientID + "', '" + ProcedureAssistantType.ClientID + "'); ";

            ProcedureCheckBox.Attributes.Add("onclick", CheckboxOnclickString);
        }
Ejemplo n.º 2
0
        protected void BuildStatusRow(EformTextBox StatusDateText, EformCheckBox CurrentStatusCheckBox)
        {
            CurrentStatusCheckBox.Attributes.Add("onclick", "SetDiseaseStateDate(this, '" + StatusDateText.ClientID + "', '" + System.DateTime.Now.ToShortDateString() + "');");



            //    StatusDa sDa = new StatusDa();
            //    DataSet sDs = sDa.FormGetLastStatusByStatus(this._patientId, this._eformName, "Dynamic", Status);


            //    if (sDs.Tables.Count > 0 && sDs.Tables[0].Rows.Count > 0)
            //    {
            //        if (sDs.Tables[0].Rows[0]["StatusDateText"].ToString().Length > 0)
            //        {
            //            StatusDateLabel.Text = sDs.Tables[0].Rows[0]["StatusDateText"].ToString();
            //            StatusDateText.Visible = false;
            //            CurrentStatusCheckBox.Visible = false;
            //            ActivatePopulatedStatusRow(StatusRow, sDs.Tables[0].Rows[0]["StatusId"].ToString());
            //        }
            //        else if (sDs.Tables[0].Rows[0]["StatusDate"].ToString().Length > 0)
            //        {
            //            StatusDateLabel.Text = sDs.Tables[0].Rows[0]["StatusDate"].ToString();
            //            StatusDateText.Visible = false;
            //            CurrentStatusCheckBox.Visible = false;
            //            ActivatePopulatedStatusRow(StatusRow, sDs.Tables[0].Rows[0]["StatusId"].ToString());
            //        }
            //        else
            //        {
            //            CurrentStatusCheckBox.Attributes.Add("onclick", "SetDiseaseStateDate(this, '" + StatusDateText.ClientID + "', '" + System.DateTime.Now.ToShortDateString() + "');");
            //            StatusDateLabel.Visible = false;   // prob not necessary -jf
            //        }
            //    }
            //    else
            //    {
            //        CurrentStatusCheckBox.Attributes.Add("onclick", "SetDiseaseStateDate(this, '" + StatusDateText.ClientID + "', '" + System.DateTime.Now.ToShortDateString() + "');");
            //        StatusDateLabel.Visible = false;   // prob not necessary -jf
            //    }
        }
Ejemplo n.º 3
0
        protected void BuildOtherStatusRow(string Status, Label StatusDateLabel, EformHidden StatusDate, EformTextBox StatusDateText, HtmlTableRow StatusRow, EformCheckBox CurrentStatusCheckBox, EformComboBox StatusValue)
        {
            StatusDa sDa = new StatusDa();
            DataSet  sDs = sDa.FormGetLastStatusByStatus(this._patientId, this._eformName, "Dynamic", Status);

            // set the number of blank rows that are added to the medications section

            if (sDs.Tables.Count > 0 && sDs.Tables[0].Rows.Count > 0)
            {
                if (sDs.Tables[0].Rows[0]["StatusDateText"].ToString().Length > 0)
                {
                    StatusDateLabel.Text          = sDs.Tables[0].Rows[0]["StatusDateText"].ToString();
                    StatusDateText.Visible        = false;
                    CurrentStatusCheckBox.Visible = false;
                    ActivatePopulatedStatusRow(StatusRow, sDs.Tables[0].Rows[0]["StatusId"].ToString());
                }
                else if (sDs.Tables[0].Rows[0]["StatusDate"].ToString().Length > 0)
                {
                    StatusDateLabel.Text          = sDs.Tables[0].Rows[0]["StatusDate"].ToString();
                    StatusDateText.Visible        = false;
                    CurrentStatusCheckBox.Visible = false;
                    ActivatePopulatedStatusRow(StatusRow, sDs.Tables[0].Rows[0]["StatusId"].ToString());
                }
                else
                {
                    CurrentStatusCheckBox.Attributes.Add("onclick", "SetDiseaseStateDate(this, '" + StatusDateText.ClientID + "', '" + System.DateTime.Now.ToShortDateString() + "', '" + StatusDate.ClientID + "');");
                    StatusDateLabel.Visible = false;   // prob not necessary -jf
                }
            }
            else
            {
                CurrentStatusCheckBox.Attributes.Add("onclick", "SetDiseaseStateDate(this, '" + StatusDateText.ClientID + "', '" + System.DateTime.Now.ToShortDateString() + "', '" + StatusDate.ClientID + "');");
                StatusDateLabel.Visible = false;   // prob not necessary -jf
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Writes value from control to matching Xml node.
        /// </summary>
        /// <param name="con"></param>
        /// <param name="xDoc"></param>
        protected void WriteControlValueToXmlNode(Control con, XmlDocument xDoc)
        {
            // TODO: give this method the parent id treatment
            if (con is EformHidden)
            {
                IEformInputField tb = (IEformInputField)con;
                this.SetXmlNodeValue(tb, xDoc);
            }
            else if (con is EformTextBox)
            {
                EformTextBox tb = (EformTextBox)con;
                this.SetXmlNodeValue(tb, xDoc);
            }

            else if (con is EformComboBox)
            {
                IEformInputField tb = (IEformInputField)con;
                this.SetXmlNodeValue(tb, xDoc);
            }

            else if (con is EformTextArea)
            {
                IEformInputField tb = (IEformInputField)con;
                this.SetXmlNodeValue(tb, xDoc);
            }

            else if (con is EformDropDownList)
            {
                IEformInputField tb = (IEformInputField)con;
                this.SetXmlNodeValue(tb, xDoc);
            }
            else if (con is EformSelect)
            {
                EformSelect es = (EformSelect)con;
                this.SetXmlNodeValue(es, xDoc);
            }
            else if (con is EformCheckBox)
            {
                EformCheckBox cb = (EformCheckBox)con;

                string recordId = cb.RecordId;
                // XmlNode node = null;

                /*
                 #region get node
                 * // use recordId to locate the node if it is set
                 * if (recordId != null && !recordId.Equals(""))
                 * {
                 *      string xPath = "//"+cb.Table+"[attribute::RecordId='"+recordId+"']";
                 *      XmlNode parentNode = xDoc.SelectSingleNode(xPath);
                 *      if (parentNode != null)
                 *      {
                 *              node = parentNode.SelectSingleNode("child::"+cb.Field);
                 *      }
                 * }
                 * else // in all other cases, find the first node that matches the table and field name.
                 * {
                 *      string xpath = "//" + cb.Table + "/" + cb.Field;
                 *
                 *      node = xDoc.SelectSingleNode(xpath);
                 * }
                 #endregion
                 */

                XmlNode node = GetXmlNode(cb.Table, cb.Field, cb.RecordId, cb.ParentRecordId, xDoc);

                if (node != null)
                {
                    string val = Request.Form[con.UniqueID];

                    if (val != null && val.Equals("on"))
                    {
                        // brandon: cb.Text is the text label (sigh. ask Microsoft)
                        // node.InnerText = cb.Text;
                        node.InnerText = cb.Value;
                    }
                    else
                    {
                        node.InnerText = "";
                    }
                }
            }
            else if (con is EformRadioButton)
            {
                EformRadioButton rb = (EformRadioButton)con;

                string recordId = rb.RecordId;

                /*
                 * XmlNode node = null;
                 *
                 #region get node
                 * // use recordId to locate the node if it is set
                 * if (recordId != null && !recordId.Equals(""))
                 * {
                 *      string xPath = "//"+rb.Table+"[attribute::RecordId='"+recordId+"']";
                 *      XmlNode parentNode = xDoc.SelectSingleNode(xPath);
                 *      if (parentNode != null)
                 *      {
                 *              node = parentNode.SelectSingleNode("child::"+rb.Field);
                 *      }
                 * }
                 * else // in all other cases, find the first node that matches the table and field name.
                 * {
                 *      string xpath = "//" + rb.Table + "/" + rb.Field;
                 *
                 *      node = xDoc.SelectSingleNode(xpath);
                 * }
                 #endregion
                 *
                 */

                XmlNode node = GetXmlNode(rb.Table, rb.Field, rb.RecordId, rb.ParentRecordId, xDoc);

                if (node != null)
                {
                    string val = Request.Form[con.UniqueID];

                    if (val != null && val.Equals("on"))
                    {
                        // brandon: cb.Text is the text label (sigh. ask Microsoft)
                        // node.InnerText = cb.Text;
                        node.InnerText = rb.Value;
                    }
                    else
                    {
                        node.InnerText = "";
                    }
                }
            }
            else if (con is EformRadioButtonList)
            {
                // EformRadioButtonList rb = (EformRadioButtonList) con;
                EformRadioButtonList rb = (EformRadioButtonList)con;

                XmlNode node = FetchNode(xDoc, rb.Table, rb.Field, rb.RecordId, rb.ParentRecordId);

                if (node != null)
                {
                    node.InnerText = rb.Value;// Request.Form[con.UniqueID];

                    if (node.InnerText != null && !"".Equals(node.InnerText))
                    {
                        // handle additional fields
                        if (rb.Field1 != null && !"".Equals(rb.Field1))
                        {
                            XmlNode node1 = FetchNode(xDoc, rb.Table, rb.Field1, rb.RecordId, rb.ParentRecordId);
                            node1.InnerText = rb.Value1;
                        }

                        if (rb.Field2 != null && !"".Equals(rb.Field2))
                        {
                            XmlNode node2 = FetchNode(xDoc, rb.Table, rb.Field2, rb.RecordId, rb.ParentRecordId);
                            node2.InnerText = rb.Value2;
                        }

                        if (rb.Field3 != null && !"".Equals(rb.Field3))
                        {
                            XmlNode node3 = FetchNode(xDoc, rb.Table, rb.Field3, rb.RecordId, rb.ParentRecordId);
                            node3.InnerText = rb.Value3;
                        }
                    }
                }
            }
            else if (con is EformRadioButtonGroup)
            {
                // save each additional field
                // may also need to deal w/ xml for child controls
                EformRadioButtonGroup rg = (EformRadioButtonGroup)con;
                string val = rg.GetSelectedValue(this.Request);
                if (val != null && !"".Equals(val))
                {
                    // DO WE NEED TO WORRY ABOUT PARENT ID HERE?
                    if (rg.Field1 != null && !"".Equals(rg.Field1))
                    {
                        XmlNode node = FetchNode(xDoc, rg.Table, rg.Field1, rg.RecordId, rg.ParentRecordId);
                        node.InnerText = rg.Value1;
                    }

                    if (rg.Field2 != null && !"".Equals(rg.Field2))
                    {
                        XmlNode node = FetchNode(xDoc, rg.Table, rg.Field2, rg.RecordId, rg.ParentRecordId);
                        node.InnerText = rg.Value2;
                    }

                    if (rg.Field3 != null && !"".Equals(rg.Field3))
                    {
                        XmlNode node = FetchNode(xDoc, rg.Table, rg.Field3, rg.RecordId, rg.ParentRecordId);
                        node.InnerText = rg.Value3;
                    }

                    // we already know our value
                    EformRadioButton rb = rg.GetCheckedButton(this.Request);
                    if (rb != null)
                    {
                        XmlNode node = GetXmlNode(rg.Table, rg.Field, rg.RecordId, rg.ParentRecordId, xDoc);

                        if (node != null)
                        {
                            node.InnerText = rb.Value;
                        }
                    }
                }
                else                 // we will have to unset values if the user "cleared" the group of radio buttons
                {
                    if (rg.Field1 != null && !"".Equals(rg.Field1))
                    {
                        XmlNode node1 = FetchNode(xDoc, rg.Table, rg.Field1, rg.RecordId, rg.ParentRecordId);
                        node1.InnerText = null;
                    }

                    if (rg.Field2 != null && !"".Equals(rg.Field2))
                    {
                        XmlNode node2 = FetchNode(xDoc, rg.Table, rg.Field2, rg.RecordId, rg.ParentRecordId);
                        node2.InnerText = null;
                    }

                    if (rg.Field3 != null && !"".Equals(rg.Field3))
                    {
                        XmlNode node3 = FetchNode(xDoc, rg.Table, rg.Field3, rg.RecordId, rg.ParentRecordId);
                        node3.InnerText = null;
                    }

                    XmlNode node = GetXmlNode(rg.Table, rg.Field, rg.RecordId, rg.ParentRecordId, xDoc);

                    if (node != null)
                    {
                        node.InnerText = null;
                    }
                }
            }
            else if (con is EformCheckBoxList || con is EformRadioButtonList)
            {
                IEformInputField eFormControl = con as IEformInputField;
                this.SetXmlNodeValue(eFormControl, xDoc);
            }
        }
Ejemplo n.º 5
0
        protected void BuildStatusRow(string ComorbidityText, Label ComorbDateLabel, EformTextBox ComorbDateText, HtmlTableRow ComorbRow, EformCheckBox CurrentComorbCheckBox, Label ComorbNoteLabel, EformTextBox ComorbNote, EformDeleteIcon ComorbDelete)
        {
            ComorbidityDa comorbDa = new ComorbidityDa();
            DataSet       comorbDs = comorbDa.FormGetSpecialRecords(this._patientId, this._eformName, "Dynamic", Comorbidity.Comorbidity_Field, "IN", String.Concat("'", ReadyStringForDB(ComorbidityText), "'"));


            if (comorbDs.Tables.Count > 0 && comorbDs.Tables[0].Rows.Count > 0)
            {
                if (comorbDs.Tables[0].Rows[0][Comorbidity.ComorbDateText].ToString().Length > 0)
                {
                    ComorbDateLabel.Text   = comorbDs.Tables[0].Rows[0][Comorbidity.ComorbDateText].ToString();
                    ComorbDateText.Visible = false;

                    ComorbNoteLabel.Text = comorbDs.Tables[0].Rows[0][Comorbidity.ComorbNotes].ToString();
                    ComorbNote.Visible   = false;

                    CurrentComorbCheckBox.Visible = false;
                    ComorbDelete.Visible          = false;

                    ActivatePopulatedStatusRow(ComorbRow, comorbDs.Tables[0].Rows[0][Comorbidity.ComorbidityId].ToString());
                }
                else if (comorbDs.Tables[0].Rows[0][Comorbidity.ComorbDate].ToString().Length > 0)
                {
                    ComorbDateLabel.Text   = comorbDs.Tables[0].Rows[0][Comorbidity.ComorbDate].ToString();
                    ComorbDateText.Visible = false;

                    ComorbNoteLabel.Text = comorbDs.Tables[0].Rows[0][Comorbidity.ComorbNotes].ToString();
                    ComorbNote.Visible   = false;

                    CurrentComorbCheckBox.Visible = false;
                    ComorbDelete.Visible          = false;

                    ActivatePopulatedStatusRow(ComorbRow, comorbDs.Tables[0].Rows[0][Comorbidity.ComorbidityId].ToString());
                }
            }
        }
Ejemplo n.º 6
0
 protected void GetComorQuality(EformCheckBox ComorChk, EformTextBox ComorQltyTxt)
 {
     ComorChk.Attributes.Add("onclick", "updateComorQlty(this,'" + ComorQltyTxt.ClientID + "');");
 }
Ejemplo n.º 7
0
 protected void GetTumorLocChk(EformCheckBox tumorChk, EformTextBox tumorLoc)
 {
     tumorChk.Attributes.Add("onclick", "tumorLocCheck(this,'" + tumorChk.Value + "','" + tumorLoc.ClientID + "');");
 }
Ejemplo n.º 8
0
 protected void SetDxSite(EformCheckBox DxResultChk, EformTextBox DxDateTxt, EformHidden DxDate, EformTextBox DxSite, EformTextBox DxType, EformTextBox DxTarget, EformTextBox DxSide, EformTextBox DxQlty, EformTextBox DxIndc, EformTextBox DxResult)
 {
     DxResultChk.Attributes.Add("onclick", "DiagResultCheck(this,'" + DxResultChk.Value + "','" + DxDateTxt.ClientID + "','" + DxDate.ClientID + "', '" + DxSite.ClientID + "', '" + DxType.ClientID + "','" + DxTarget.ClientID + "','" + DxSide.ClientID + "','" + DxQlty.ClientID + "','" + DxIndc.ClientID + "','" + DxResult.ClientID + "');");
 }
Ejemplo n.º 9
0
 protected void GetValuesOnCheck(EformCheckBox ExtCheck, EformCheckBox grossCheck, EformTextBox prfindSide)
 {
     ExtCheck.Attributes.Add("onclick", "updateValuesOnCheck(this, '" + grossCheck.ClientID + "','" + prfindSide.ClientID + "');");
     grossCheck.Attributes.Add("onclick", "updateValuesOnCheck('" + ExtCheck.ClientID + "', this, '" + prfindSide.ClientID + "');");
 }
Ejemplo n.º 10
0
 protected void FamDxValues(EformCheckBox FamMemChk, EformTextBox FamMemDx)
 {
     FamMemChk.Attributes.Add("onclick", "FamMemCheck(this,'" + FamMemChk.Value + "', '" + FamMemDx.ClientID + "', 'Thyroid Cancer');");
 }
Ejemplo n.º 11
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="con"></param>
        /// <param name="xmlDoc"></param>
        /// <param name="inputFieldValue"></param>
        protected void SetControlValue(IEformInputField con, XmlDocument xmlDoc, string inputFieldValue)
        {
            if (inputFieldValue != null)
            {
                // TODO: collapse this into a call on the IEformInputField interface
                if (con is EformTextBox)
                {
                    EformTextBox temp = (EformTextBox)con;
                    //temp.Value = inputFieldValue;
                    temp.Text = inputFieldValue;
                }

                else if (con is EformHidden)
                {
                    EformHidden temp = (EformHidden)con;
                    // let's experiment
                    string val = inputFieldValue;
                    if (temp.Field.EndsWith("Date")) // we want Dates enabled to pick up the DateText conversion
                    {
                        temp.Disabled = false;
                        // we need to propagate the value here, b/c it would be empty on the page
                        temp.Value = val;
                    }
                    else if (val == null || "".Equals(val))
                    {
                        temp.Disabled = true;
                    }
                    else
                    {
                        temp.Disabled = false;
                        // persist the value in this case
                        temp.Value = val;
                    }

                    // leave the value alone, keeping what was on the page;
                    // temp.Value = inputFieldValue;
                }

                else if (con is EformTextArea)
                {
                    EformTextArea temp = (EformTextArea)con;
                    //temp.Value = inputFieldValue;
                    temp.Text = inputFieldValue;
                }

                else if (con is EformDropDownList)
                {
                    EformDropDownList temp = (EformDropDownList)con;
                    //temp.Value = inputFieldValue;
                    temp.SelectedValue = inputFieldValue;
                }

                else if (con is EformComboBox)
                {
                    EformComboBox temp = (EformComboBox)con;
                    temp.Value = inputFieldValue;
                }

                //else if (con is EformRadioButtonList)
                //{
                //    EformRadioButtonList temp = (EformRadioButtonList)con;
                //    string val = inputFieldValue;

                //    if (val != null && !val.Equals(""))
                //        temp.SelectedValue = val;
                //}
                else if (con is EformRadioButtonGroup)
                {
                    EformRadioButtonGroup rg = (EformRadioButtonGroup)con;

                    // tell it to the child controls
                    foreach (Control c in rg.Controls)
                    {
                        if (c is EformRadioButton)
                        {
                            EformRadioButton rb = (EformRadioButton)c;

                            string nodeInnerText = GetNodeValue(rg, xmlDoc);

                            if (nodeInnerText != null && !"".Equals(nodeInnerText))
                            {
                                if (rb.Value.Equals(nodeInnerText))
                                {
                                    rb.Checked = true;
                                }
                            }
                        }
                    }
                }
                else if (con is EformRadioButton)
                {
                    EformRadioButton rb = (EformRadioButton)con;

                    string nodeInnerText = inputFieldValue;

                    if (nodeInnerText != null && nodeInnerText != "")
                    {
                        rb.Checked = true;
                    }
                }
                else if (con is EformCheckBox)
                {
                    EformCheckBox cb = (EformCheckBox)con;

                    string nodeInnerText = inputFieldValue;

                    if (nodeInnerText != null && nodeInnerText != "")
                    {
                        cb.Checked = true;
                    }
                }
                else if (con is EformSelect)
                {
                    EformSelect temp = (EformSelect)con;
                    temp.Text = inputFieldValue;
                }
                else if (con is EformCheckBoxList || con is EformRadioButtonList)
                {
                    IEformInputField eFormControl = con as IEformInputField;
                    eFormControl.Value = inputFieldValue;
                }
            }
        }