protected void Save(int letterOfIntentId, string strDiseaseState) { ProjectLetterOfIntent biz = new ProjectLetterOfIntent(); biz.Get(letterOfIntentId); // Only want to save fields that are visible, as non visible fields don't retain their original set values List <ICaisisInputControl> cicList = CICHelper.GetCaisisInputControls(this.FindControl("MainTable")); foreach (ICaisisInputControl cic in cicList) { if (cic.Visible) { if (cic is CaisisCheckBox) { if ((cic as CaisisCheckBox).Checked) { biz[cic.Field] = "1"; } else { biz[cic.Field] = "0"; } } else { biz[cic.Field] = cic.Value; } } } biz[ProjectLetterOfIntent.PopulationDiseaseState] = strDiseaseState; biz.Save(); }
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; } } } }
private void SaveLargeFields() { // Verify that projectid and loi id exist if (!string.IsNullOrEmpty(LetterOfIntentId) && !string.IsNullOrEmpty(ProjectId)) { int projectId = int.Parse(ProjectId); // Load LOI Record ProjectLetterOfIntent biz = new ProjectLetterOfIntent(); biz.Get(int.Parse(LetterOfIntentId)); // Save Updated Details CICHelper.SetBOValues(this.Controls, biz, projectId); biz.Save(); } }
/// <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 SaveLOI() { // Verify that projectid and loi id exist if (!string.IsNullOrEmpty(ProjectApprovalId) && !string.IsNullOrEmpty(ProjectId)) { int projectId = int.Parse(ProjectId); // Load LOI Record ProjectLetterOfIntent biz = new ProjectLetterOfIntent(); biz.Get(int.Parse(ProjectApprovalId)); // Save Updated Details CICHelper.SetBOValues(this.Controls, biz, projectId); DiseaseState disState = (DiseaseState)this.FindControl("DiseaseStateEditor"); if (disState != null) { biz[ProjectLetterOfIntent.PopulationDiseaseState] = disState.GetAllCheckedDiseaseStates(); } biz.Save(); } }