public void AssignDataToControls(string profile)
        {
            try
            {
                SPWeb web = SPContext.Current.Web;

                BLL.UserBLL userBLL = new CAFAM.WebPortal.BLL.UserBLL(web);
                UserEntity = userBLL.GetUser(profile);

                lblFirstName.Text = UserEntity.FirstName;
                lblSecondName.Text = UserEntity.SecondName;
                lblFirstSurname.Text = UserEntity.FirstSurname;
                lblSecondSurname.Text = UserEntity.SecondSurname;
                lblPosition.Text = UserEntity.Position;
                txtCompanyEmail.Text = UserEntity.CompanyEmail;
                WebUI.TelephoneControl telCompany = (WebUI.TelephoneControl)pnlCompanyTel.FindControl("telCompany");
                telCompany.Tel = UserEntity.CompanyTel;
                txtTelExtension.Text = UserEntity.TelExtension;
                WebUI.TelephoneControl telCompanyMobile = (WebUI.TelephoneControl)pnlCompanyMobile.FindControl("telCompanyMobile");
                telCompanyMobile.Tel = UserEntity.CompanyMobile;
                txtAuthorizedBy.Text = UserEntity.AuthorizedBy;
                WebUI.DateTimeCustomControl dateTimeCustomControl = (WebUI.DateTimeCustomControl)this.pnlAuthorizationDate.FindControl("dateTimeCustomControl");
                if (dateTimeCustomControl != null)
                {
                    dateTimeCustomControl.Date = UserEntity.BirthDate;
                }
                chkAuthorizedToGetBasicData.Checked = UserEntity.AuthorizedToGetBasicData;
                chkAuthorizedToGetContibutionData.Checked = UserEntity.AuthorizedToGetContibutionData;
                chkAuthorizedToGetMemberData.Checked = UserEntity.AuthorizedToGetMemberData;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public void AssignDataToControls(string profile)
        {
            try
            {
                SPWeb web = SPContext.Current.Web;

                BLL.UserBLL userBLL = new CAFAM.WebPortal.BLL.UserBLL(web);
                UserEntity = userBLL.GetUser(profile);

                lblFirstName.Text = UserEntity.FirstName;
                lblSecondName.Text = UserEntity.SecondName;
                lblFirstSurname.Text = UserEntity.FirstSurname;
                lblSecondSurname.Text = UserEntity.SecondSurname;
                lblIdentificationType.Text = UserEntity.IdentificationType;
                lblIdentificationNumber.Text = UserEntity.IdentificationNumber;
                WebUI.DateTimeCustomControl dateTimeCustomControl = (WebUI.DateTimeCustomControl)this.pnlBirthDate.FindControl("dateTimeCustomControl");
                if (dateTimeCustomControl != null)
                {
                    dateTimeCustomControl.Date = UserEntity.BirthDate;
                }
                if(!string.IsNullOrEmpty(UserEntity.MaritalState))
                {
                    rdlMaritalState.SelectedValue = UserEntity.MaritalState;
                }
                ddlOccupation.SelectedValue = UserEntity.Ocupattion;
                if (!string.IsNullOrEmpty(UserEntity.CompensationFund))
                {
                    ddlCompensationFund.SelectedValue = UserEntity.CompensationFund;
                }
                txtCompany.Text = UserEntity.Company;
                txtPosition.Text = UserEntity.Position;
                txtPrivateEmail.Text = UserEntity.PrivateEmail;
                txtCompanyEmail.Text = UserEntity.CompanyEmail;
                WebUI.TelephoneControl telPrivate = (WebUI.TelephoneControl)pnlPrivateTel.FindControl("telPrivate");
                telPrivate.Tel = UserEntity.PrivateTel;
                WebUI.TelephoneControl telPrivateMobile = (WebUI.TelephoneControl)pnlPrivateMobile.FindControl("telPrivateMobile");
                telPrivateMobile.Tel = UserEntity.PrivateMobile;
                WebUI.TelephoneControl telCompany = (WebUI.TelephoneControl)pnlCompanyTel.FindControl("telCompany");
                telCompany.Tel = UserEntity.CompanyTel;
                txtTelExtension.Text = UserEntity.TelExtension;
                WebUI.AddressControl address = (WebUI.AddressControl)pnlAddress.FindControl("address");
                address.Address = UserEntity.Address;
                if (!string.IsNullOrEmpty(UserEntity.EPS))
                {
                    ddlEPS.SelectedValue = UserEntity.EPS;
                }
                if (UserEntity.ChildrenQuantity.HasValue)
                {
                    txtChildrenQuantity.Text = UserEntity.ChildrenQuantity.ToString();
                }
                if (!string.IsNullOrEmpty(UserEntity.IncomeLevel))
                {
                    ddlIncomeLevel.SelectedValue = UserEntity.IncomeLevel;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        protected void ibtnCheckEMail_Click(object sender, EventArgs e)
        {
            try
            {
                string sEMail = txtEMail.Text.Trim().ToLower();

                BLL.UserBLL userBLL = new CAFAM.WebPortal.BLL.UserBLL(SPContext.Current.Web);

                Entities.User FoundUser = userBLL.GetUserByPrivateEmail(sEMail);

                if (FoundUser != null)
                {
                    UserEntity = FoundUser;

                    pnlSecretQuestion.Visible = true;
                    lblSecretQuestion.Text = FoundUser.SecurityQuestion;
                    lblMessage.Text = "Ingrese la respuesta";

                    txtEMail.Enabled = false;
                    ibtnCheckEMail.Enabled = false;
                }
                else
                {
                    lblMessage.Text = "El correo electrónico ingresado no se encuentra en el sistema";
                }
            }
            catch (Exception Ex)
            {
                CAFAM.WebPortal.ErrorLogger.ErrorLogger.Log(Ex, ref lblMessage, ConfigurationSettings.AppSettings["LogInEventViewer"]);
            }
        }
 public Entities.User GetProfile(string profile)
 {
     Entities.User entitiesUser = new Entities.User();
     if (!string.IsNullOrEmpty(profile))
     {
         SPSite site = new SPSite(ConfigurationManager.AppSettings["MOSSSite"]);
         BLL.UserBLL userBBL = new CAFAM.WebPortal.BLL.UserBLL(site.OpenWeb());
         entitiesUser = userBBL.GetUser(profile);
     }
     return entitiesUser;
 }
示例#5
0
        public void AssignDataToControls(string profile)
        {
            try
            {
                SPWeb web = SPContext.Current.Web;

                BLL.UserBLL userBLL = new CAFAM.WebPortal.BLL.UserBLL(web);

                UserEntity = userBLL.GetUser(profile);

                lblFirstName.Text = UserEntity.FirstName;
                lblSecondName.Text = UserEntity.SecondName;
                lblFirstSurname.Text = UserEntity.FirstSurname;
                lblSecondSurname.Text = UserEntity.SecondSurname;
                lblIdentificationType.Text = UserEntity.IdentificationType;
                lblIdentificationNumber.Text = UserEntity.IdentificationNumber;
                lblOccupation.Text = UserEntity.Ocupattion;
                lblCompensationFund.Text = UserEntity.CompensationFund;
                lblCompany.Text = UserEntity.Company;
                txtPrivateEmail.Text = UserEntity.PrivateEmail;
                txtCompanyEmail.Text = UserEntity.CompanyEmail;
                WebUI.TelephoneControl telPrivate = (WebUI.TelephoneControl)pnlPrivateTel.FindControl("telPrivate");
                telPrivate.Tel = UserEntity.PrivateTel;
                WebUI.TelephoneControl telPrivateMobile = (WebUI.TelephoneControl)pnlPrivateMobile.FindControl("telPrivateMobile");
                telPrivateMobile.Tel = UserEntity.PrivateMobile;
                WebUI.TelephoneControl telCompany = (WebUI.TelephoneControl)pnlCompanyTel.FindControl("telCompany");
                telCompany.Tel = UserEntity.CompanyTel;
                txtTelExtension.Text = UserEntity.TelExtension;
                WebUI.AddressControl address = (WebUI.AddressControl)pnlAddress.FindControl("address");
                address.Address = UserEntity.Address;
                lblEPS.Text = UserEntity.EPS;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#6
0
        protected void btnVerify_Click(object sender, EventArgs e)
        {
            try
            {
                int outInt;

                SPWeb web = SPContext.Current.Web;

                BLL.UserBLL userBLL = new CAFAM.WebPortal.BLL.UserBLL(web);

                Entities.User userSP = userBLL.GetUserByIdentificationNotCompany(rdIdentificationType.SelectedItem.Text, txtIdentificationNumber.Text);

                if (userSP == null)
                {
                    tblIdentification.Visible = false;

                    SubsidiosWS.UserRequest userInfo = new CAFAM.WebPortal.User.SubsidiosWS.UserRequest();
                    outInt = int.Parse(rdIdentificationType.SelectedValue);
                    userInfo.TipoDocumento = outInt;
                    userInfo.NroDocumento = txtIdentificationNumber.Text;

                    SubsidiosWS.WebService_Globant_PortalWeb_BiztalkSubsidios webService = new CAFAM.WebPortal.User.SubsidiosWS.WebService_Globant_PortalWeb_BiztalkSubsidios();

                    webService.Url = ConfigurationManager.AppSettings["WSSubsidiosURL"];

                    UserSubsdy = webService.GetAffiliatedUser(userInfo); ;

                    if (string.IsNullOrEmpty(UserSubsdy.ClaseAfiliado))
                    {
                        lblError.Visible = true;
                        lblError.Text = "Usted no está registrado como usuario Afiliado a Cafam. Si desea afiliarse por favor diríjase ";
                        lnkCommon.Visible = true;
                        lnkCommon.Text = "aquí";
                        lnkCommon.NavigateUrl = string.Format("UserNotMemberNew.aspx?IT={0}&IN={1}", Server.UrlEncode(Commons.CryptographicService.Encrypt(rdIdentificationType.SelectedItem.Text))
                            , Server.UrlEncode(Commons.CryptographicService.Encrypt(txtIdentificationNumber.Text)));
                    }
                    else
                    {
                        tblQuestions.Visible = true;

            #if DEBUG
                        lblError.Visible = true;
                        lblError.Text = "Tipo de Usuario: " + UserSubsdy.TipoAfiliado + "<br />";
                        lblError.Text += "Fecha De Nacimiento: " + UserSubsdy.FechaNacimiento + "<br />";
                        lblError.Text += "Numero Telefonico: " + UserSubsdy.Telefono + "<br />";
                        lblError.Text += "Monto de Ingresos: " + UserSubsdy.CategoriaSalarial + "<br />";
                        lblError.Text += "Nombre de Afiliado: " + UserSubsdy.PrimerNombre.ToUpper() + UserSubsdy.PrimerApellido.ToUpper() + "<br />";
                        lblError.Text += "Numero de Afiliacion Principal: " + UserSubsdy.IdentificacionPrincipal.Nro;
            #endif

                        if (UserSubsdy.ClaseAfiliado == "1")
                        {
                            switch (UserSubsdy.TipoAfiliado)
                            {
                                case "D":
                                    lblQuestion1.Text = "¿Cuál de los siguientes nombres corresponde a la última empresa donde labora?";
                                    lblQuestion2.Text = "¿Cuál es su fecha de nacimiento?";
                                    lblQuestion3.Text = "¿Con cuál de estas direcciones tiene o ha tenido relación?";
                                    lblQuestion4.Text = "¿Con cuál de estos teléfonos tiene o ha tenido relación?";
                                    lblQuestion5.Text = "¿Cuál de las siguientes es su Fecha de ingreso a su empresa?";
                                    GenerateAnswerControlsForDependant();
                                    break;
                                case "P":
                                    lblQuestion1.Text = "¿Cuál de los siguientes nombres corresponde a la última empresa donde laboró?";
                                    lblQuestion2.Text = "¿Cuál es su fecha de nacimiento?";
                                    lblQuestion3.Text = "¿Con cuál de estas direcciones tiene o ha tenido relación?";
                                    lblQuestion4.Text = "¿Con cuál de estos teléfonos tiene o ha tenido relación?";
                                    lblQuestion5.Text = "¿Cuál es la fecha en la cual se pensionó?";
                                    GenerateAnswerControlsForPensioner();
                                    break;
                                case "I":
                                    lblQuestion1.Text = "¿Cuál es su fecha de nacimiento?";
                                    lblQuestion2.Text = "¿Con cuál de estas direcciones tiene o ha tenido relación?";
                                    lblQuestion3.Text = "¿Con cuál de estos teléfonos tiene o ha tenido relación?";
                                    lblQuestion4.Text = "¿Cuál es la fecha en que se afilió?";
                                    trQuestion5.Visible = false;
                                    GenerateAnswerControlsForIndependant();
                                    break;
                            }
                        }
                        else
                        {
                            lblQuestion1.Text = "¿Cuál es la empresa donde labora el afiliado?";
                            lblQuestion2.Text = "¿Cuál es el número de identificación del afiliado?";
                            lblQuestion3.Text = "¿Cuál es la fecha de nacimiento del Afiliado Principal o  Cotizante?";
                            lblQuestion4.Text = "¿Con cuál de estas direcciones tiene o ha tenido relación?";
                            lblQuestion5.Text = "¿Con cuál de estos teléfonos tiene o ha tenido relación?";

                            GenerateAnswerControlsForSpouse();
                        }
                    }
                }
                else
                {
                    lblError.Text = "Ya existe un usuario registrado para el documento ingresado. Si olvidó su contraseña puede solicitarla ";
                    lnkCommon.Visible = true;
                    lnkCommon.Text = "aqui";
                    lnkCommon.NavigateUrl = "~/_layouts/RestorePassword.aspx";
                    lblError.Visible = true;
                }
            }
            catch (Exception ex)
            {
                CAFAM.WebPortal.ErrorLogger.ErrorLogger.Log(ex, ref lblError, ConfigurationSettings.AppSettings["LogInEventViewer"]);
            }
        }
示例#7
0
        private void setGrid(int? index)
        {
            try
            {
                SPWeb web = SPContext.Current.Web;

                BLL.UserBLL userBLL = new CAFAM.WebPortal.BLL.UserBLL(web);

                DateTime date1 = DateTime.MinValue;
                DateTime date2 = DateTime.MinValue;

                if (!string.IsNullOrEmpty(txtAgeSearch.Text))
                {

                    DateTime Now = DateTime.Today;
                    int intOut = 0;

                    if (!int.TryParse("-" + txtAgeSearch.Text, out intOut))
                    {
                        throw new Exception("Edad Invalida");
                    }

                    date1 = Now.AddYears(intOut);
                    date2 = date1.AddYears( - 1);
                }

                DateTime? creationDate = ((WebUI.DateTimeCustomControl)pnlCreationDateSearch.FindControl("dateTimeCustomControl")).Date;

                List<Entities.User> userSPList = userBLL.GetFilterListUsers(txtUserNameSearch.Text, txtUserSurenameSearch.Text, ddlIdType.SelectedValue,
                    txtIdNumSearch.Text, txtAudienceSearch.Text, date1, date2, txtAccountName.Text, txtNitSearch.Text, txtSubNitSearch.Text,
                    txtCompanySearch.Text, ddlUserType.SelectedValue, (creationDate != null)? creationDate.ToString(): string.Empty);

                grUserdList.DataSource = userSPList;

                if (index.HasValue)
                {
                    int i = int.Parse(index.ToString());
                    grUserdList.PageIndex = i;
                }
                else
                {
                    grUserdList.PageIndex = 0;
                }

                grUserdList.DataBind();

            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#8
0
        protected void btnSi_Command(object sender, CommandEventArgs e)
        {
            try
            {
                SPWeb web = SPContext.Current.Web;

                BLL.UserBLL userBLL = new CAFAM.WebPortal.BLL.UserBLL(web);

                userBLL.DeleteUser(e.CommandArgument.ToString());

                lblError.Text = "El usuario se elimino con exito";
                tblEliminacion.Visible = false;

                setGrid(null);
            }
            catch (Exception ex)
            {
                CAFAM.WebPortal.ErrorLogger.ErrorLogger.Log(ex, ref lblError, ConfigurationSettings.AppSettings["LogInEventViewer"]);
            }
        }
        private void AutoCompleteUserData()
        {
            SPWeb web = SPContext.Current.Web;
            if (web.Url.Equals("http://glb-vm:71"))
            {
                txtNit.Text = "123456789";
                txtSubNit.Text = "2";
                txtNombreORazonSocial.Text = "Lagarto Juancho";
            }
            else
            {
                BLL.UserBLL userBBL = new CAFAM.WebPortal.BLL.UserBLL(web);
                Entities.User Usuario = userBBL.GetUser(web.CurrentUser.LoginName);

                txtNit.Text = Usuario.NIT;
                txtSubNit.Text = Usuario.SubNIT;
                txtNombreORazonSocial.Text =
                    Usuario.FirstName + " " + Usuario.SecondName + " " +
                    Usuario.FirstSurname + " " + Usuario.SecondSurname;
            }
        }
示例#10
0
        protected void btnValidateQuestions_Click(object sender, EventArgs e)
        {
            try
            {
                bool valid = true;

                tblQuestions.Visible = false;
                if (txtQuestion1.Text.ToUpper().Replace(" ", "") != CompanySubsidy.NombreJefePersonal.ToUpper().Replace(" ", ""))
                {
                    valid = false;
                }
                if (txtQuestion2.Text != CompanySubsidy.NIT)
                {
                    valid = false;
                }
                /*El objeto no tiene el siguiente dato
                if (txtQuestion3.Text != CompanySubsdy.)
                {
                    valid = false;
                }*/
                /* El objeto UserSubsidy no tiene dato para comparar
                if (txtQuestion4.Text != UserSubsdy.ActividadEconomica)
                {
                    valid = false;
                }*/
                /*  El objeto UserSubsidy no tiene dato para comparar
                if (txtQuestion5.Text != UserSubsdy.MesAfilicacion)
                {
                    valid = false;
                }*/

                if (valid)
                {
                    BLL.UserCompanyNewBLL userCompanyNewBLL = new CAFAM.WebPortal.BLL.UserCompanyNewBLL(SPContext.Current.Web);
                    BLL.UserBLL userBLL = new CAFAM.WebPortal.BLL.UserBLL(SPContext.Current.Web);

                    if (!userCompanyNewBLL.ExistsIdentificationInList(rdIdentificationType.SelectedItem.Text, txtIdNum.Text) &&
                        userBLL.GetUserByIdentificationtAndCompanyCompanyUser(rdIdentificationType.SelectedItem.Text, txtIdNum.Text, txtNit.Text, txtSubNit.Text) == null)
                    {
                        tblPrincipal.Visible = true;
                        lblNit.Text = CompanySubsidy.NIT;
                        lblSubNIT.Text = CompanySubsidy.SubNIT;
                        lblCompanyName.Text = CompanySubsidy.RazonSocial;
                        lblIdentificationType.Text = rdIdentificationType.SelectedItem.Text;
                        lblIdentificatioNumber.Text = txtIdNum.Text;
                    }
                    else
                    {
                        lblError.Visible = true;
                        lblError.Text = "Ya existe un usuario registrado para esta empresa. Si olvido su contraseña puede restablecerla ";
                        lnkCommon.NavigateUrl = "~/_layouts/restorepassword.aspx";
                        lnkCommon.Text = "aqui.";
                        lnkCommon.Visible = true;
                    }
                }
                else
                {
                    lblError.Visible = true;
                    lblError.Text = "Sus respuestas a las preguntas de identificación difieren con la información que tenemos. Si desea contactarse con Cafam por favor esriba un mensaje debajo y envíelo";
                    tblContact.Visible = true;
                }
            }
            catch(Exception ex)
            {
                CAFAM.WebPortal.ErrorLogger.ErrorLogger.Log(ex, ref lblError, ConfigurationSettings.AppSettings["LogInEventViewer"]);
            }
        }