Exemplo n.º 1
0
        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;
            }
        }
Exemplo n.º 2
0
        private void GenerateAnswerControlsForIndependant()
        {
            try
            {
                DateTime dateTime;
                Table tbl = new Table();
                TableCell cell = new TableCell();
                TableRow row = new TableRow();
                SPWeb web = SPContext.Current.Web;

                ListItem realListItem = null;

                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);

                pnlAnswer1.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);

                pnlAnswer2.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);
                pnlAnswer3.Controls.Add(ddlTel);

                DropDownList ddlMemberDate = new DropDownList();
                ddlMemberDate.ID = "ddlMemberDate";
                ddlMemberDate.CssClass = "form_Select";
                ddlMemberDate.DataSource = GetFakeDateList();
                ddlMemberDate.DataTextField = "Text";
                ddlMemberDate.DataValueField = "Date";
                ddlMemberDate.Enabled = false;
                ddlMemberDate.DataBind();

                pnlAnswer4.Controls.Add(ddlMemberDate);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }