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