예제 #1
0
        protected void SetNewAgentLookupCode(EformDropDownList agent, DataTable lookupcodeDt, EformDropDownList type, DataTable lookupcodeDt2)
        {
            DataView dv = new DataView(lookupcodeDt);

            dv.AllowNew = true;
            DataRowView drv = dv.AddNew();

            drv[LookupCode.LkpDescription] = "";
            drv[LookupCode.LkpCode]        = "";
            drv.EndEdit();
            dv.RowFilter = LookupCode.LkpDescription + " LIKE '%CHEMO%' OR " + LookupCode.LkpDescription + " = '' ";
            dv.Sort      = LookupCode.LkpCode + " ASC ";

            agent.DataSource     = dv;
            agent.DataTextField  = LookupCode.LkpCode;
            agent.DataValueField = LookupCode.LkpCode;
            agent.DataBind();

            DataView dv2 = new DataView(lookupcodeDt2);

            dv2.AllowNew = true;
            DataRowView drv2 = dv2.AddNew();

            drv2[LookupCode.LkpDescription] = "";
            drv2[LookupCode.LkpCode]        = "";
            drv2.EndEdit();
            dv2.RowFilter = LookupCode.LkpCode + " LIKE '%CHEMO%' OR " + LookupCode.LkpDescription + " = '' ";
            dv2.Sort      = LookupCode.LkpCode + " ASC ";

            type.DataSource     = dv2;
            type.DataTextField  = LookupCode.LkpCode;
            type.DataValueField = LookupCode.LkpCode;
            type.DataBind();
        }
예제 #2
0
 protected void SetImgSite(CheckBox OutResultChkBox, EformTextBox DxImgSiteTxt, EformDropDownList DxImgSideDD, EformTextBox DxImgsubSiteTxt, EformTextBox DxImgResultTxt, EformTextBox DxImgFindSUV_Txt)
 {
     OutResultChkBox.Attributes.Add("onclick", "OutResultCheck(this,'" + OutResultChkBox.Text + "','" + DxImgSiteTxt.ClientID + "','" + DxImgSideDD.ClientID + "','" + DxImgsubSiteTxt.ClientID + "','" + DxImgResultTxt.ClientID + "','" + DxImgFindSUV_Txt.ClientID + "');");
 }
예제 #3
0
 protected void GetRadtxTarget(EformDropDownList RadType, EformTextBox RadTargetTxt, EformTextBox RadQltyTxt)
 {
     RadType.Attributes.Add("onblur", "updateRadTxTarget('" + RadTargetTxt.ClientID + "','" + RadQltyTxt.ClientID + "');");
 }
예제 #4
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;
                }
            }
        }