private void GenerateAnswerControlsForSpouse() { try { DateTime dateTime; Table tbl = new Table(); TableCell cell = new TableCell(); TableRow row = new TableRow(); SPWeb web = SPContext.Current.Web; ListItem realListItem = null; BLL.FalseCompanyBLL falseCompanyBLL = new CAFAM.WebPortal.BLL.FalseCompanyBLL(web); DropDownList ddlMemberCompany = new DropDownList(); ddlMemberCompany.ID = "ddlMemberCompany"; ddlMemberCompany.CssClass = "form_select"; ddlMemberCompany.DataSource = falseCompanyBLL.GetFalseCompanyList(); ddlMemberCompany.DataTextField = "Title"; ddlMemberCompany.DataValueField = "Title"; ddlMemberCompany.DataBind(); realListItem = new ListItem(); realListItem.Text = UserSubsdy.NombreORazonSocial; realListItem.Value = UserSubsdy.NombreORazonSocial; InsertRealValueInDropDownList(realListItem, ddlMemberCompany); pnlAnswer1.Controls.Add(ddlMemberCompany); TextBox txtMemberIdentificationNumber = new TextBox(); txtMemberIdentificationNumber.CssClass = "form_text"; txtMemberIdentificationNumber.ID = "txtMemberIdentificationNumber"; cell.Controls.Add(txtMemberIdentificationNumber); row.Cells.Add(cell); tbl.Rows.Add(row); row = new TableRow(); cell = new TableCell(); cell.Controls.Add(CreateRegExpValidator("regExpMemberIdentificationNumber", txtMemberIdentificationNumber.ID)); row.Cells.Add(cell); tbl.Rows.Add(row); row = new TableRow(); cell = new TableCell(); cell.Controls.Add(CreateRequiredField("reqMemberIdentificationNumber", txtMemberIdentificationNumber.ID)); row.Cells.Add(cell); tbl.Rows.Add(row); pnlAnswer2.Controls.Add(tbl); DropDownList ddlBirthDate = new DropDownList(); ddlBirthDate.ID = "ddlBirthDate"; ddlBirthDate.CssClass = "form_Select"; ddlBirthDate.DataSource = GetFakeDateList(); ddlBirthDate.DataTextField = "Text"; ddlBirthDate.DataValueField = "Date"; ddlBirthDate.DataBind(); realListItem = new ListItem(); if (!string.IsNullOrEmpty(UserSubsdy.FechaNacimiento)) { realListItem.Text = DateTime.Parse(GetDate(UserSubsdy.FechaNacimiento).ToString()).ToString("dd/MM/yyyy"); ; realListItem.Value = UserSubsdy.FechaNacimiento; } InsertRealValueInDropDownList(realListItem, ddlBirthDate); pnlAnswer3.Controls.Add(ddlBirthDate); BLL.FalseAddressBLL falseAddressBLL = new CAFAM.WebPortal.BLL.FalseAddressBLL(web); DropDownList ddlAddress = new DropDownList(); ddlAddress.ID = "ddlAddress"; ddlAddress.CssClass = "form_select"; ddlAddress.DataSource = falseAddressBLL.GetFalseAddressList(); ddlAddress.DataTextField = "Title"; ddlAddress.DataValueField = "Title"; ddlAddress.DataBind(); realListItem = new ListItem(); realListItem.Text = UserSubsdy.DomicilioTrabajador; realListItem.Value = UserSubsdy.DomicilioTrabajador; InsertRealValueInDropDownList(realListItem, ddlAddress); pnlAnswer4.Controls.Add(ddlAddress); DropDownList ddlTel = new DropDownList(); ddlTel.ID = "ddlTel"; ddlTel.CssClass = "form_select"; ddlTel.DataSource = GetFakeTelList(); ddlTel.DataBind(); realListItem = new ListItem(); realListItem.Text = UserSubsdy.Telefono; realListItem.Value = UserSubsdy.Telefono; InsertRealValueInDropDownList(realListItem, ddlTel); pnlAnswer5.Controls.Add(ddlTel); } catch (Exception ex) { throw ex; } }
private void GenerateAnswerControlsForDependant() { try { DateTime dateTime; Table tbl = new Table(); TableCell cell = new TableCell(); TableRow row = new TableRow(); SPWeb web = SPContext.Current.Web; ListItem realListItem = null; BLL.FalseCompanyBLL falseCompanyBLL = new CAFAM.WebPortal.BLL.FalseCompanyBLL(web); DropDownList ddlCompany = new DropDownList(); ddlCompany.ID = "ddlCompany"; ddlCompany.CssClass = "form_Select"; ddlCompany.DataSource = falseCompanyBLL.GetFalseCompanyList(); ddlCompany.DataTextField = "Title"; ddlCompany.DataValueField = "Title"; ddlCompany.DataBind(); realListItem = new ListItem(); realListItem.Text = UserSubsdy.NombreORazonSocial; realListItem.Value = UserSubsdy.NombreORazonSocial; InsertRealValueInDropDownList(realListItem, ddlCompany); pnlAnswer1.Controls.Add(ddlCompany); DropDownList ddlBirthDate = new DropDownList(); ddlBirthDate.ID = "ddlBirthDate"; ddlBirthDate.CssClass = "form_Select"; ddlBirthDate.DataSource = GetFakeDateList(); ddlBirthDate.DataTextField = "Text"; ddlBirthDate.DataValueField = "Date"; ddlBirthDate.DataBind(); realListItem = new ListItem(); if (!string.IsNullOrEmpty(UserSubsdy.FechaNacimiento)) { realListItem.Text = DateTime.Parse(GetDate(UserSubsdy.FechaNacimiento).ToString()).ToString("dd/MM/yyyy"); ; realListItem.Value = UserSubsdy.FechaNacimiento; } InsertRealValueInDropDownList(realListItem, ddlBirthDate); pnlAnswer2.Controls.Add(ddlBirthDate); BLL.FalseAddressBLL falseAddressBLL = new CAFAM.WebPortal.BLL.FalseAddressBLL(web); DropDownList ddlAddress = new DropDownList(); ddlAddress.ID = "ddlAddress"; ddlAddress.CssClass = "form_select"; ddlAddress.DataSource = falseAddressBLL.GetFalseAddressList(); ddlAddress.DataTextField = "Title"; ddlAddress.DataValueField = "Title"; ddlAddress.DataBind(); realListItem = new ListItem(); realListItem.Text = UserSubsdy.DomicilioTrabajador; realListItem.Value = UserSubsdy.DomicilioTrabajador; InsertRealValueInDropDownList(realListItem, ddlAddress); pnlAnswer3.Controls.Add(ddlAddress); DropDownList ddlTel = new DropDownList(); ddlTel.ID = "ddlTel"; ddlTel.CssClass = "form_select"; ddlTel.DataSource = GetFakeTelList(); ddlTel.DataBind(); realListItem = new ListItem(); realListItem.Text = UserSubsdy.Telefono; realListItem.Value = UserSubsdy.Telefono; InsertRealValueInDropDownList(realListItem, ddlTel); pnlAnswer4.Controls.Add(ddlTel); DropDownList ddlStartWorking= new DropDownList(); ddlStartWorking.ID = "ddlStartWorking"; ddlStartWorking.CssClass = "form_Select"; ddlStartWorking.DataSource = GetFakeDateList(); ddlStartWorking.DataTextField = "Text"; ddlStartWorking.DataValueField = "Date"; ddlStartWorking.Enabled = false; ddlStartWorking.DataBind(); pnlAnswer5.Controls.Add(ddlStartWorking); } catch (Exception ex) { throw ex; } }