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 } }
protected virtual void SetHiddenDateFieldPair(EformHidden hiddenDateTextField, EformHidden hiddenDateField, string SurgeryDate) { if (string.IsNullOrEmpty(hiddenDateTextField.Value)) { hiddenDateTextField.Value = SurgeryDate; } if (string.IsNullOrEmpty(hiddenDateField.Value)) { hiddenDateField.Value = SurgeryDate; hiddenDateField.Disabled = true; } }
private void DisableEformHiddenControls(ControlCollection controls) { foreach (Control c in controls) { if (c is EformHidden) { EformHidden h = c as EformHidden; h.Disabled = true; } else { DisableEformHiddenControls(c.Controls); } } }
private void SetHiddenFields(EformComboBox stageSystem, EformComboBox stageT, EformComboBox stageN, EformComboBox stageM, EformHidden disease) { stageSystem.Attributes.Add("OnBlur", "setPathStageHiddenFields(" + stageT.ClientID + "," + stageN.ClientID + ", " + stageM.ClientID + "," + disease.ClientID + ", " + stageSystem.ClientID + ");"); stageT.Attributes.Add("OnBlur", "setPathStageHiddenFields(" + stageT.ClientID + "," + stageN.ClientID + ", " + stageM.ClientID + "," + disease.ClientID + ", " + stageSystem.ClientID + ");"); stageN.Attributes.Add("OnBlur", "setPathStageHiddenFields(" + stageT.ClientID + "," + stageN.ClientID + ", " + stageM.ClientID + "," + disease.ClientID + ", " + stageSystem.ClientID + ");"); stageM.Attributes.Add("OnBlur", "setPathStageHiddenFields(" + stageT.ClientID + "," + stageN.ClientID + ", " + stageM.ClientID + "," + disease.ClientID + ", " + stageSystem.ClientID + ");"); }
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 + "');"); }
/// <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; } } }