protected void PopulateLargeFields()
        {
            ProjectLetterOfIntent biz = new ProjectLetterOfIntent();

            biz.Get(Int32.Parse(LetterOfIntentId));
            CICHelper.SetFieldValues(this.Controls, biz);
            List <ICaisisInputControl> cicList = PageUtil.GetCaisisInputControlsInContainer(this);

            foreach (ICaisisInputControl cic in cicList)
            {
                if (cic is CaisisTextArea)
                {
                    string jsDesc = "showFieldDescription(this,'" + cic.Field + "');";

                    CaisisTextArea cicTA = cic as CaisisTextArea;
                    cicTA.Attributes.Add("onfocus", jsDesc);
                    // Locate helper HTML node used for displaying HTML content contained
                    // in TextArea node
                    string             helperHTMLDivId = cicTA.ID + "HTML";
                    HtmlGenericControl helperDIV       = this.FindControl(helperHTMLDivId) as HtmlGenericControl;
                    if (helperDIV != null)
                    {
                        helperDIV.InnerHtml = cic.Value;
                    }
                }
            }
        }
Exemple #2
0
        /// <summary>
        /// Populates fields based on biz object
        /// </summary>
        /// <param name="projectApprovalId"></param>
        protected void PopulateForm(int projectApprovalId)
        {
            ProjectLetterOfIntent biz = new ProjectLetterOfIntent();

            biz.Get(projectApprovalId);
            CICHelper.SetFieldValues(this.Controls, biz);
            List <ICaisisInputControl> cicList = PageUtil.GetCaisisInputControlsInContainer(this.Page);

            foreach (ICaisisInputControl cic in cicList)
            {
                string jsDesc = "showFieldDescription(this,'" + cic.Field + "');";
                if (cic is CaisisTextBox)
                {
                    (cic as CaisisTextBox).Attributes.Add("onfocus", jsDesc);
                }
                else if (cic is CaisisSelect)
                {
                    (cic as CaisisSelect).Attributes.Add("onfocus", jsDesc);
                }
                else if (cic is CaisisTextArea)
                {
                    CaisisTextArea cicTA = cic as CaisisTextArea;
                    cicTA.Attributes.Add("onfocus", jsDesc);
                    // Locate helper HTML node used for displaying HTML content contained
                    // in TextArea node
                    string             helperHTMLDivId = cicTA.ID + "HTML";
                    HtmlGenericControl helperDIV       = this.FindControl(helperHTMLDivId) as HtmlGenericControl;
                    if (helperDIV != null)
                    {
                        helperDIV.InnerHtml = cic.Value;
                    }
                }
                else if (cic is CaisisCheckBox)
                {
                    (cic as CaisisCheckBox).Attributes.Add("onchange", jsDesc);
                }
            }

            //if (biz.RecordCount > 0)
            if (!biz.IsEmpty)
            {
                string strDiseaseState = biz[ProjectLetterOfIntent.PopulationDiseaseState].ToString();
                diseaseStates = new List <string>(strDiseaseState.Split(','));
                PopulateDiseaseState();
            }
        }
        private void RestoreLargeFieldsFromHidden()
        {
            List <ICaisisInputControl> cicList = PageUtil.GetCaisisInputControlsInContainer(this.Page);

            foreach (ICaisisInputControl cic in cicList)
            {
                string jsDesc = "showFieldDescription(this,'" + cic.Field + "');";
                if (cic is CaisisTextArea)
                {
                    CaisisTextArea cicTA = cic as CaisisTextArea;
                    cicTA.Attributes.Add("onfocus", jsDesc);
                    // Locate helper HTML node used for displaying HTML content contained
                    // in TextArea node
                    string             helperHTMLDivId = cicTA.ID + "HTML";
                    HtmlGenericControl helperDIV       = this.FindControl(helperHTMLDivId) as HtmlGenericControl;
                    if (helperDIV != null)
                    {
                        helperDIV.InnerHtml = cic.Value;
                    }
                }
            }
        }