protected void btnSave_Click(object sender, EventArgs e) { try { SPWeb web = SPContext.Current.Web; BLL.UserBLL userBLL = new BLL.UserBLL(web); string message; Entities.User userEntity = AssignDataToEntity(); if (userBLL.GetUserByIdentificationtAndCompanyCompanyUser(userEntity.IdentificationType, userEntity.IdentificationNumber, userEntity.NIT, userEntity.SubNIT) == null) { if (!userBLL.CreateUser(userEntity, out message)) { lblError.Text = message; } else { lblError.Text = "El proceso de registro ha finalizado exitosamente. "; lblError.Visible = true; lnkGoHome.Visible = true; tblPrincipal.Visible = false; Commons.EmailHelper emailHelper = new CAFAM.WebPortal.Commons.EmailHelper(SPContext.Current.Web); //emailHelper.SendMailNewCompanyUserData(ConfigurationSettings.AppSettings["ContactNewUserCompanyFrom"], ConfigurationSettings.AppSettings["SMTPServer"], userEntity); emailHelper.SendMailNewCompanyUserData(ConfigurationSettings.AppSettings["ContactNewUserCompanyFrom"], userEntity); } } else { lblError.Text = "Ya existe un usuario registrado para esta empresa. "; } lblError.Visible = true; } catch (Exception ex) { CAFAM.WebPortal.ErrorLogger.ErrorLogger.Log(ex, ref lblError, ConfigurationSettings.AppSettings["LogInEventViewer"]); } }
protected void btnSave_Click(object sender, EventArgs e) { try { WebUI.CaptchaValidator captchaControl = (WebUI.CaptchaValidator)pnlCaptcha.FindControl("captchaControl"); if (captchaControl != null) { captchaControl.Validate(); if (captchaControl.IsValid) { SPWeb web = SPContext.Current.Web; string message; BLL.UserBLL userBLL = new BLL.UserBLL(web); AssignDataToEntity(); if (!userBLL.CreateUser(UserEntity, out message)) { lblError.Text = message; } else { lblError.Text = "El proceso de registro ha finalizado exitosamente. "; lnkGoHome.Visible = true; tblPrincipal.Visible = false; } lblError.Visible = true; } } } catch (Exception ex) { CAFAM.WebPortal.ErrorLogger.ErrorLogger.Log(ex, ref lblError, ConfigurationSettings.AppSettings["LogInEventViewer"]); } }