public void init() { IList<Area> areas = new AreaBL().GetAll(); cboArea.DataSource = areas; IList<Local> locales = new LocalBL().GetAll(); cboLocal.DataSource = locales; IList<Rol> roles = new RolBL().GetAll(); cboRol.DataSource = roles; cboArea.DisplayMember = "Descripcion"; cboCargo.DisplayMember = "Descripcion"; cboLocal.DisplayMember = "Nombre"; cboRol.DisplayMember = "Descripcion"; cboEstadoCivil.DisplayMember = "Descripcion"; cboTipoDocumento.DisplayMember = "Descripcion"; cboEstadoCivil.SelectedIndex = 0; cboTipoDocumento.SelectedIndex = 0; this.txtEmail.KeyPress += new System.Windows.Forms.KeyPressEventHandler(Utils.Utils.ValidaEmail); this.txtNumeroDocumento.KeyPress += new System.Windows.Forms.KeyPressEventHandler(Utils.Utils.ValidaNumerico); this.txtTelefono.KeyPress += new System.Windows.Forms.KeyPressEventHandler(Utils.Utils.ValidaNumerico); this.txtAnexo.KeyPress += new System.Windows.Forms.KeyPressEventHandler(Utils.Utils.ValidaNumerico); this.txtApePaterno.KeyPress += new System.Windows.Forms.KeyPressEventHandler(Utils.Utils.ValidaLetras); this.txtApeMaterno.KeyPress += new System.Windows.Forms.KeyPressEventHandler(Utils.Utils.ValidaLetras); this.txtNombres.KeyPress += new System.Windows.Forms.KeyPressEventHandler(Utils.Utils.ValidaLetras); this.txtNombres.KeyUp += new System.Windows.Forms.KeyEventHandler(Utils.Utils.ValidaBlancos); this.txtNombreUsuario.KeyUp += new System.Windows.Forms.KeyEventHandler(Utils.Utils.ValidaBlancos); this.txtApeMaterno.KeyUp += new System.Windows.Forms.KeyEventHandler(Utils.Utils.ValidaBlancos); this.txtApePaterno.KeyUp += new System.Windows.Forms.KeyEventHandler(Utils.Utils.ValidaBlancos); this.txtTelefono.KeyUp += new System.Windows.Forms.KeyEventHandler(Utils.Utils.ValidaBlancos); this.txtNumeroDocumento.KeyUp += new System.Windows.Forms.KeyEventHandler(Utils.Utils.ValidaBlancos); this.txtNombres.LostFocus += new EventHandler(Utils.Utils.ValidaBlancos); this.txtNombreUsuario.LostFocus += new EventHandler(Utils.Utils.ValidaBlancos); this.txtApeMaterno.LostFocus += new EventHandler(Utils.Utils.ValidaBlancos); this.txtApePaterno.LostFocus += new EventHandler(Utils.Utils.ValidaBlancos); this.txtTelefono.LostFocus += new EventHandler(Utils.Utils.ValidaBlancos); this.txtNumeroDocumento.LostFocus += new EventHandler(Utils.Utils.ValidaBlancos); }
private void frmReporteIncidencias_Load(object sender, EventArgs e) { dtpFechaInicio.Text = (DateTime.ParseExact(dtpFechaFin.Value.Month + "/01/" + dtpFechaFin.Value.Year, "d", CultureInfo.InvariantCulture)).ToShortDateString(); IList<Local> localesOrig = new LocalBL().GetAllActivos(); Local todos = new Local(); todos.Nombre = "Todos"; localesOrig.Add(todos); cmbLocal.DataSource = localesOrig; for (int i = 0; i < cmbLocal.Items.Count; i++) if (localesOrig[i].Id==empleado.Local.Id) { cmbLocal.SelectedIndex = i; break; } if (!Permisos.getPermisos("Registrar Solicitudes para Todos los Locales")) cmbLocal.Enabled = false; else { cmbLocal.Enabled = true; cmbLocal.SelectedIndex = localesOrig.Count - 1;//Todos } if (externo == 1) { btnGenerar.Visible = false; btnSelecc.Visible = true; this.Text = "Busqueda Incidencias"; } else { btnGenerar.Visible = true; btnSelecc.Visible = false; this.Text = "Reporte Incidencias"; } }
private void frmNuevaSolicitudTransferencia_Load(object sender, EventArgs e) { IList<Local> localesOrig = new LocalBL().GetAll(); cmbLocalOrigen.DataSource = localesOrig; for (int i = 0; i < cmbLocalOrigen.Items.Count; i++) if (localesOrig[i].Id==empleado.Local.Id) { cmbLocalOrigen.SelectedIndex = i; //cmbLocalOrigen.Text = localesOrig[i].Nombre; break; } if (!(empleado.Cargo.Descripcion.Equals("Jefe Almacen"))) /*VALIDAR ROL Y VENTANA*/ { cmbLocalOrigen.Enabled = false; } IList<Local> localesDest = new LocalBL().GetAll(); cmbLocalDestino.Items.Clear(); foreach (Local local in localesDest) { if (((Local)cmbLocalOrigen.SelectedValue).Id != local.Id) { cmbLocalDestino.Items.Add(local); } } if (cmbLocalDestino.Items.Count > 0) cmbLocalDestino.SelectedIndex = 0; }
private void frmIncidenciasAlmacen_Load(object sender, EventArgs e) { txbCantidadTotal.Text = "0"; IList<Local> localesOrig = new LocalBL().GetAll(); cmbLocal.DataSource = localesOrig; for (int i = 0; i < cmbLocal.Items.Count; i++) if (localesOrig[i].Id == empleado.Local.Id) { cmbLocal.SelectedIndex = i; break; } if (!(empleado.Cargo.Descripcion.Equals("Jefe Almacen"))) /*VALIDAR ROL Y VENTANA*/ { cmbLocal.Enabled = false; } }
private void frmReporteIncidencias_Load(object sender, EventArgs e) { dtpFechaInicio.Text = (DateTime.ParseExact(dtpFechaFin.Value.Month + "/01/" + dtpFechaFin.Value.Year, "d", CultureInfo.InvariantCulture)).ToShortDateString(); IList<Local> localesOrig = new LocalBL().GetAll(); Local todos = new Local(); todos.Nombre = "Todos"; localesOrig.Add(todos); cmbLocal.DataSource = localesOrig; for (int i = 0; i < cmbLocal.Items.Count; i++) if (localesOrig[i].Id==empleado.Local.Id) { cmbLocal.SelectedIndex = i; break; } if (!(empleado.Cargo.Descripcion.Equals("Jefe Almacen"))) /*VALIDAR ROL Y VENTANA*/ { cmbLocal.Enabled = false; } else cmbLocal.SelectedIndex = localesOrig.Count - 1; }
private void cmbLocalOrigen_SelectedIndexChanged(object sender, EventArgs e) { Local localSeleccionado = (Local)cmbLocalOrigen.SelectedItem; IList<Local> localesDest = new LocalBL().GetAll(); cmbLocalDestino.Items.Clear(); foreach (Local local in localesDest) { if (localSeleccionado.Id != local.Id) { cmbLocalDestino.Items.Add(local); } } if (cmbLocalDestino.Items.Count > 0) { cmbLocalDestino.SelectedIndex = 0; } }
private void frmAjustes_Load(object sender, EventArgs e) { IList<Local> localesOrig = new LocalBL().GetAll(); Local todos = new Local(); todos.Nombre = "Todos"; localesOrig.Add(todos); cmbLocal.DataSource = localesOrig; for (int i = 0; i < cmbLocal.Items.Count; i++) if (localesOrig[i].Id==empleado.Local.Id) { cmbLocal.SelectedIndex = i; break; } llenarGrilla(); }
private void frmNuevoEmpleado_Load(object sender, EventArgs e) { IList<Area> areas = new AreaBL().GetAll(); cboArea.DataSource = areas; IList<Local> locales = new LocalBL().GetAll(); cboLocal.DataSource = locales; IList<Rol> roles = new RolBL().GetAll(); cboRol.DataSource = roles; }
private void frmAjustes_Load(object sender, EventArgs e) { IList<Local> localesOrig = new LocalBL().GetAll(); Local todos = new Local(); todos.Nombre = "Todos"; localesOrig.Add(todos); cmbLocal.DataSource = localesOrig; for (int i = 0; i < cmbLocal.Items.Count; i++) if (localesOrig[i].Id==empleado.Local.Id) { cmbLocal.SelectedIndex = i; break; } if (!(empleado.Cargo.Descripcion.Equals("Jefe Almacen"))) /*VALIDAR ROL Y VENTANA*/ cmbLocal.Enabled = false; else cmbLocal.SelectedIndex = localesOrig.Count - 1; llenarGrilla(); }
private void frmNuevaSolicitudTransferencia_Load(object sender, EventArgs e) { IList<Local> localesOrig = new LocalBL().GetAllActivos(); cmbLocalOrigen.DataSource = localesOrig; for (int i = 0; i < cmbLocalOrigen.Items.Count; i++) if (localesOrig[i].Id==empleado.Local.Id) { cmbLocalOrigen.SelectedIndex = i; //cmbLocalOrigen.Text = localesOrig[i].Nombre; break; } if (!Permisos.getPermisos("Registrar Solicitudes para Todos los Locales")) { cmbLocalOrigen.Enabled = false; } IList<Local> localesDest = new LocalBL().GetAllActivos(); cmbLocalDestino.Items.Clear(); foreach (Local local in localesDest) { if (((Local)cmbLocalOrigen.SelectedValue).Id != local.Id) { cmbLocalDestino.Items.Add(local); } } if (cmbLocalDestino.Items.Count > 0) cmbLocalDestino.SelectedIndex = 0; }
private void frmIncidenciasAlmacen_Load(object sender, EventArgs e) { txbCantidadTotal.Text = "0"; IList<Local> localesOrig = new LocalBL().GetAll(); cmbLocal.DataSource = localesOrig; for (int i = 0; i < cmbLocal.Items.Count; i++) if (localesOrig[i].Id == empleado.Local.Id) { cmbLocal.SelectedIndex = i; break; } }