public bool ChangePassword() { //Validamos que no haya errores en el UserControl if (!dxErrorProvider1.HasErrors && ValidateUC()) { using (WaitCursorHelper waitn = new WaitCursorHelper(this)) { //Cambiamos el Password try { SecurityController.UserChangePassword(UserName, txtOldPassword.Text, txtNewPassword.Text); MessageViewer.Show("Su contraseña fue cambiada exitosamente"); } catch (Exception ex) { this.ExceptionViewer.Show(ex); return(false); } } return(true); } else { return(false); } }
private void commonEnumComboBox1_SelectedIndexChanged(object sender, EventArgs e) { if (cmdAuthMode.EditValue == null) { return; } //Seteamos la contraseña en blanco txtPassword.Text = string.Empty; //Validamos el tipo de Enumeración seleccionada switch ((AuthenticationModeEnum)Convert.ToInt32(cmdAuthMode.EditValue)) { case AuthenticationModeEnum.WindowsIntegrated: EnableDisableFieldsByAuthenticationMode(true); txtUserName.Text = Environment.UserName; txtUserName.Enabled = false; _IsEnvironmentUser = true; cmbDominios.Enabled = false; EnableDisablePassword(); btnChangePassword.Enabled = false; break; case AuthenticationModeEnum.Mixed: EnableDisableFieldsByAuthenticationMode(true); cmbDominios.Enabled = false; txtPassword.Enabled = true; btnChangePassword.Enabled = true; break; case AuthenticationModeEnum.LDAP: EnableDisableFieldsByAuthenticationMode(true); cmbDominios.Enabled = true; txtPassword.Enabled = true; btnChangePassword.Enabled = false; break; default: MessageViewer.Show("El modo de autenticación seleccionado no se encuentra configurado aún."); EnableDisableFieldsByAuthenticationMode(false); txtUserName.Enabled = false; txtPassword.Enabled = false; cmbDominios.Enabled = false; btnChangePassword.Enabled = false; break; } //Seteamos en blanco los ErrorProviders dxErrorProvider1.SetError(txtUserName, string.Empty); dxErrorProvider1.SetError(txtPassword, string.Empty); txtUserName.Focus(); //Guardamos el Modo de autenticación seleccionado _AuthenticationMode = (AuthenticationModeEnum)Enum.Parse(typeof(AuthenticationModeEnum), cmdAuthMode.EditValue.ToString()); }
private void simpleButton2_Click(object sender, EventArgs e) { if (CheckCierreExist()) { CreateCierreProfecional(list_Propietarios); CreateCierreProfecional(list_Externos); CreateCierreResetas(); } MessageViewer.Show("Cierre de caja realizado con éxito"); }
public bool LoadAuthenticationModes() { Boolean wOutBool = false; ImageComboBoxItem wImageComboBoxItem; string wDescription; //Obtenemos una lista de las Keys en el grupo "AuthenticationMode" del Configuration Manager Fwk.Configuration.Common.Group wGroup = Fwk.Configuration.ConfigurationManager.GetGroup("AuthenticationMode"); List <Fwk.Configuration.Common.Key> wKeyList = null; if (wGroup != null) { wKeyList = wGroup.Keys.Where(p => (!String.IsNullOrEmpty(p.Value.Text) && Boolean.TryParse(p.Value.Text, out wOutBool) && wOutBool == true)).ToList(); } if (wKeyList.Count <= 0) { MessageViewer.Show("No se encuentran modos de autenticación configurados con Value = true en el archivo de configuración. Por favor verifique."); return(false); } cmdAuthMode.Properties.Items.Clear(); //Por cada Key obtenida la agregamos al Combo de modos de autenticación foreach (Fwk.Configuration.Common.Key wItem in wKeyList) { wDescription = Fwk.UI.Common.HelperFunctions.Enumerations.GetDescription(Enum.Parse(typeof(AuthenticationModeEnum), wItem.Name)); wImageComboBoxItem = new ImageComboBoxItem(wDescription, wItem.Name); cmdAuthMode.Properties.Items.Add(wImageComboBoxItem); if (Enum.Parse(typeof(AuthenticationModeEnum), wItem.Name).Equals(AuthenticationModeEnum.WindowsIntegrated)) { _HasWindowsAuthenticationMode = true; } } //Validamos si el combo tiene Modo de autenticación de Windows y cargamos los Dominios if (_HasWindowsAuthenticationMode) { cmdAuthMode.EditValue = Convert.ToInt32(AuthenticationModeEnum.WindowsIntegrated).ToString(); LoadDomains(); } else { cmdAuthMode.SelectedIndex = 0; cmbDominios.ItemIndex = 0; } return(true); }
private void aceptCancelButtonBar1_ClickOkCancelEvent(object sender, DialogResult result) { SelectedProfesionalBE = uc_Profesionales_Grid1.SelectedProfesionalBE; if (result == System.Windows.Forms.DialogResult.OK) { if (uc_Profesionales_Grid1.SelectedProfesionalBE == null) { MessageViewer.Show("Seleccione algun profesional o precione ESC"); return; } this.DialogResult = System.Windows.Forms.DialogResult.OK; } this.Close(); }
private void Main_Load(object sender, EventArgs e) { try { this.AddContronToPannel(PanelEnum.LeftPanel_1, "Epiron.Front.Gestion.Sample1.UserControl1,Epiron.Front.Gestion.Sample1", Epiron.Gestion.Properties.Resources.Fotos_1); this.AddContronToPannel(PanelEnum.FootherPanel, "Meucci.Front.Alerts.MarqueeUC,Meucci.Front.Alerts", null); this.AdjustCulture(); //ExceptionView.Show(new Exception("ASLDASJDASJDASÑJD "), "<SDFSASAD"); } catch (Exception es) { MessageViewer.Show(es.Message); } DialogResult dr = Show("", "", ""); //if (dr == System.Windows.Forms.DialogResult.Cancel) // this.Close(); }
private void Main_Load(object sender, EventArgs e) { try { storage.Load(); if (storage.StorageObject == null) { storage.StorageObject = new UsersBE(); storage.Save(); } ShowAuthenticationForm(storage.StorageObject.UserNameLogin, storage.StorageObject.Password); this.AddContronToPannel(PanelEnum.LeftPanel_1, "Epiron.Front.Gestion.Sample1.UserControl1,Epiron.Front.Gestion.Sample1", 10); this.AddContronToPannel(PanelEnum.FootherPanel, "Meucci.Front.Alerts.MarqueeUC,Meucci.Front.Alerts", null); this.AdjustCulture(); } catch (Exception es) { MessageViewer.Show(es.Message); } }
/// <summary> /// /// </summary> /// <returns></returns> public bool HasErrors() { dxErrorProvider1.ClearErrors(); if (String.IsNullOrEmpty(txtMatricula.Text)) { dxErrorProvider1.SetError(txtMatricula, "Ingerse matrícula"); xtraTabControl1.SelectedTabPage = xtraTabPage1; return(dxErrorProvider1.HasErrors); } if (cmbEspecialidad.EditValue == null) { dxErrorProvider1.SetError(cmbEspecialidad, "Debe seleccionar especialidad"); xtraTabControl1.SelectedTabPage = xtraTabPage1; return(dxErrorProvider1.HasErrors); } #region Inicio sesion if (this.State == EntityUpdateEnum.NEW) { try { bool exist = SecurityServiceCalls.ValidateUserExist(txtUsername.Text.Trim()); if (exist) { dxErrorProvider1.SetError(txtUsername, "El nombre de usuario ya se encuentra registrado \r\n por favor elija otro", DevExpress.XtraEditors.DXErrorProvider.ErrorType.Critical); txtUsername.SelectAll(); xtraTabControl1.SelectedTabPage = xtraTabPage_Sesion; btnCheckUserName.Image = global::Health.Front.Base.Properties.Resource.User_3_Stop; return(dxErrorProvider1.HasErrors); } } catch (Exception ex) { this.ExceptionViewer.Show(ex); } if (String.IsNullOrEmpty(txtPassword.Text)) { dxErrorProvider1.SetError(txtConfrirmPassword, "La clave de usuario no puede estar enblanco", DevExpress.XtraEditors.DXErrorProvider.ErrorType.Critical); xtraTabControl1.SelectedTabPage = xtraTabPage_Sesion; MessageViewer.Show(dxErrorProvider1.GetError(txtConfrirmPassword)); txtConfrirmPassword.SelectAll(); return(true); } if (!txtConfrirmPassword.Text.Equals(txtPassword.Text)) { dxErrorProvider1.SetError(txtConfrirmPassword, "La clave y confirmación de la misma deben ser iguales", DevExpress.XtraEditors.DXErrorProvider.ErrorType.Critical); xtraTabControl1.SelectedTabPage = xtraTabPage_Sesion; txtConfrirmPassword.SelectAll(); MessageViewer.Show(dxErrorProvider1.GetError(txtConfrirmPassword)); return(true); } } #endregion //Si tiene permitido modificar seguridad if (FormBase.CheckRule("admin_users_change_security") == true) { if (GetCheckedRolList().Count == 0) { dxErrorProvider1.SetError(lblSelRol, "Debe seleccionar al menos un rol para el usuario"); xtraTabControl1.SelectedTabPage = xtraTabPage_Sesion;; return(true); } } //Si no tiene permitido modificar admin_professional_sheduling if (btnCrearResourceScheduling.Enabled) // -> admin_professional_sheduling { if (resourceSchedulingList == null || resourceSchedulingList.Count == 0) { xtraTabControl1.SelectedTabPage = xtraTabPage2;; MessageViewer.Show("No ah definido la programación de turnos del profesional"); return(true); } } return(false); }