private void DetallePaqueteria_Load(object sender, EventArgs e) { if (EsNuevo) { this.Text = "Nuevo"; UtilLocal.ClearTextBoxes(this); } else { if (ProveedorPaqueteria.ProveedorPaqueteriaID > 0) { this.Text = "Modificar"; var pp = Datos.GetEntity <ProveedorPaqueteria>(p => p.ProveedorPaqueteriaID.Equals(ProveedorPaqueteria.ProveedorPaqueteriaID)); if (pp != null) { this.txtNombrePaqueteria.Text = pp.NombrePaqueteria; this.txtCalle.Text = pp.Calle; this.txtColonia.Text = pp.Colonia; this.txtCiudad.Text = pp.Ciudad; this.txtEstado.Text = pp.Estado; this.txtCP.Text = pp.CP; this.txtTelefono.Text = pp.Telefono; this.chkEntregaOcurre.Checked = pp.EntregaOcurre; } } } }
private void DetallePerfil_Load(object sender, EventArgs e) { CargaInicial(); if (EsNuevo) { this.Text = "Nuevo"; UtilLocal.ClearTextBoxes(this); txtNombrePerfil.Focus(); } else { if (Perfil.PerfilID > 0) { this.Text = "Modificar"; var permisos = Datos.GetListOf <PerfilPermisosView>(p => p.PerfilID.Equals(Perfil.PerfilID)); foreach (var permiso in permisos) { for (int i = 0; i < clbPermisos.Items.Count; i++) { var x = (Permiso)clbPermisos.Items[i]; if (x.PermisoID == permiso.PermisoID) { clbPermisos.SetItemChecked(i, true); } } } txtNombrePerfil.Text = Perfil.NombrePerfil; } } }
private void DetalleProveedorGanancia_Load(object sender, EventArgs e) { CargaInicial(); if (EsNuevo) { this.Text = "Nuevo"; UtilLocal.ClearTextBoxes(this); this.cboMarcaParte.Focus(); } else { if (ProveedorGanancia.ProveedorGananciaID > 0) { this.Text = "Modificar"; var pg = Datos.GetEntity <ProveedorGanancia>(p => p.ProveedorGananciaID.Equals(ProveedorGanancia.ProveedorGananciaID)); if (pg != null) { this.cboMarcaParte.SelectedValue = pg.MarcaParteID; this.cboLinea.SelectedValue = pg.LineaID; this.txtPorcentajeUno.Text = pg.PorcentajeUno.ToString(); this.txtPorcentajeDos.Text = pg.PorcentajeDos.ToString(); this.txtPorcentajeTres.Text = pg.PorcentajeTres.ToString(); this.txtPorcentajeCuatro.Text = pg.PorcentajeCuatro.ToString(); this.txtPorcentajeCinco.Text = pg.PorcentajeCinco.ToString(); } } } }
private void DetalleProveedorContacto_Load(object sender, EventArgs e) { if (EsNuevo) { this.Text = "Nuevo"; UtilLocal.ClearTextBoxes(this); } else { if (ProveedorContacto.ProveedorContactoID > 0) { this.Text = "Modificar"; var pc = Datos.GetEntity <ProveedorContacto>(p => p.ProveedorContactoID.Equals(ProveedorContacto.ProveedorContactoID)); if (pc != null) { this.txtNombreContacto.Text = pc.NombreContacto; this.txtTelUno.Text = pc.TelUno; this.txtTelDos.Text = pc.TelDos; this.txtTelTres.Text = pc.TelTres; this.txtTelCuatro.Text = pc.TelCuatro; this.txtDepartamento.Text = pc.Departamento; this.txtCorreoE.Text = pc.CorreoElectronico; this.cbPrincipal.Checked = (pc.Principal == true) ? true : false; } } } }
private void DetalleMarcaParte_Load(object sender, EventArgs e) { CargaInicial(); if (EsNuevo) { this.Text = "Nuevo"; UtilLocal.ClearTextBoxes(this); txtNombreMarca.Focus(); } else { if (MarcaParte.MarcaParteID > 0) { this.Text = "Modificar"; var lineas = Datos.GetListOf <LineaMarcaParte>(l => l.MarcaParteID.Equals(MarcaParte.MarcaParteID)); foreach (var linea in lineas) { for (int i = 0; i < clbLineas.Items.Count; i++) { var x = (Linea)clbLineas.Items[i]; if (x.LineaID == linea.LineaID) { clbLineas.SetItemChecked(i, true); } } } txtNombreMarca.Text = MarcaParte.NombreMarcaParte; txtAbreviacion.Text = MarcaParte.Abreviacion; } } }
private void DetalleLinea_Load(object sender, EventArgs e) { // Se configura el grid de las caractarísticas this.dgvCaracteristicas.DefaultCellStyle.ForeColor = Color.Black; this.dgvCaracteristicas.Inicializar(); var oListaCaracteristicas = new List <LineasCaracteristicasView>(); if (this.Linea != null) { oListaCaracteristicas = Datos.GetListOf <LineasCaracteristicasView>(c => c.LineaID == this.Linea.LineaID); } oListaCaracteristicas.Insert(0, new LineasCaracteristicasView() { CaracteristicaID = -1, Caracteristica = "(Nueva)" }); this.colCaracteristicaID.CargarDatos("CaracteristicaID", "Caracteristica", oListaCaracteristicas); // this.CargaInicial(); if (EsNuevo) { this.Text = "Nuevo"; UtilLocal.ClearTextBoxes(this); this.txtNombreLinea.Focus(); } else { if (Linea.LineaID > 0) { this.Text = "Modificar"; txtNombreLinea.Text = Linea.NombreLinea; txtAbreviacion.Text = Linea.Abreviacion; cboSubsistema.SelectedValue = Linea.SubsistemaID; txtMachote.Text = Linea.Machote; /* chkAlto.CheckState = Linea.Alto.Equals(true) ? CheckState.Checked : CheckState.Unchecked; * chkDiametro.CheckState = Linea.Diametro.Equals(true) ? CheckState.Checked : CheckState.Unchecked; * chkLargo.CheckState = Linea.Largo.Equals(true) ? CheckState.Checked : CheckState.Unchecked; * chkDientes.CheckState = Linea.Dientes.Equals(true) ? CheckState.Checked : CheckState.Unchecked; * chkAstrias.CheckState = Linea.Astrias.Equals(true) ? CheckState.Checked : CheckState.Unchecked; * chkSistema.CheckState = Linea.Sistema.Equals(true) ? CheckState.Checked : CheckState.Unchecked; * chkCapacidad.CheckState = Linea.Capacidad.Equals(true) ? CheckState.Checked : CheckState.Unchecked; * chkAmperaje.CheckState = Linea.Amperaje.Equals(true) ? CheckState.Checked : CheckState.Unchecked; * chkVoltaje.CheckState = Linea.Voltaje.Equals(true) ? CheckState.Checked : CheckState.Unchecked; * chkWatts.CheckState = Linea.Watts.Equals(true) ? CheckState.Checked : CheckState.Unchecked; * chkUbicacion.CheckState = Linea.Ubicacion.Equals(true) ? CheckState.Checked : CheckState.Unchecked; * chkTerminales.CheckState = Linea.Terminales.Equals(true) ? CheckState.Checked : CheckState.Unchecked; * chkCilindros.CheckState = Linea.Cilindros.Equals(true) ? CheckState.Checked : CheckState.Unchecked; * chkGarantia.CheckState = Linea.Garantia.Equals(true) ? CheckState.Checked : CheckState.Unchecked; */ // Se llenan las características this.CargarCaracteristicas(); } } }
private void DetalleMotor_Load(object sender, EventArgs e) { this.CargaInicial(); if (EsNuevo) { this.Text = "Nuevo"; UtilLocal.ClearTextBoxes(this); cboMarca.Focus(); } else { if (Motor.MotorID > 0) { this.Text = "Modificar"; try { var marca = Datos.GetEntity <Modelo>(m => m.ModeloID.Equals(Motor.ModeloID)); this.cboMarca.SelectedValue = marca.MarcaID; this.cboModelo.SelectedValue = Motor.ModeloID; this.cboMotor.Text = Motor.NombreMotor; this.cboMarca.Enabled = false; this.cboModelo.Enabled = false; this.cboMotor.Enabled = false; var anios = Datos.GetListOf <MotorAnio>(m => m.MotorID == Motor.MotorID).ToList(); if (anios != null) { anios.Sort((x, y) => x.Anio.CompareTo(y.Anio)); anios.Reverse(); foreach (var anio in anios) { for (int i = 0; i < clbAnios.Items.Count; i++) { var anioMotor = Util.Entero(this.clbAnios.Items[i]); if (anioMotor == anio.Anio) { this.clbAnios.SetItemChecked(i, true); } } } } } catch (Exception ex) { Util.MensajeError(ex.Message, GlobalClass.NombreApp); } } } }
private void DetalleUsuario_Load(object sender, EventArgs e) { CargaInicial(); if (EsNuevo) { this.Text = "Nuevo"; UtilLocal.ClearTextBoxes(this); txtNombrePersona.Focus(); } else { if (Usuario.UsuarioID > 0) { this.Text = "Modificar"; var perfiles = Datos.GetListOf <UsuarioPerfilesView>(u => u.UsuarioID.Equals(Usuario.UsuarioID)); foreach (var perfil in perfiles) { for (int i = 0; i < clbPerfiles.Items.Count; i++) { var x = (Perfil)clbPerfiles.Items[i]; if (x.PerfilID == perfil.PerfilID) { clbPerfiles.SetItemChecked(i, true); } } } txtNombrePersona.Text = Usuario.NombrePersona; txtNombreUsuario.Text = Usuario.NombreUsuario; //txtContrasenia.Text = Usuario.Contrasenia; this.txtContrasenia.Text = UtilLocal.Desencriptar(Usuario.Contrasenia); cboEstatus.SelectedValue = Usuario.Activo.Equals(true) ? 1 : 0; if (Usuario.TipoUsuarioID.HasValue) { this.cmbTipoDeUsuario.SelectedValue = Usuario.TipoUsuarioID; } else { this.cmbTipoDeUsuario.SelectedIndex = -1; } //checar alertas this.clbAlertas.SetItemChecked(0, Util.Logico(Usuario.AlertaCalendarioClientes)); this.clbAlertas.SetItemChecked(1, Util.Logico(Usuario.AlertaPedidos)); this.clbAlertas.SetItemChecked(2, Util.Logico(Usuario.Alerta9500)); this.clbAlertas.SetItemChecked(3, Util.Logico(Usuario.AlertaTraspasos)); this.clbAlertas.SetItemChecked(4, Util.Logico(Usuario.AlertaDevFacturaCreditoAnt)); } } }
private void DetalleProveedorObservacion_Load(object sender, EventArgs e) { if (EsNuevo) { this.Text = "Nuevo"; UtilLocal.ClearTextBoxes(this); txtObservacion.Focus(); } else { if (ProveedorObservacion.ProveedorObservacionID > 0) { this.Text = "Modificar"; txtObservacion.Text = ProveedorObservacion.Observacion; } } }
private void DetalleSistemaCaracteristica_Load(object sender, EventArgs e) { CargaInicial(); if (EsNuevo) { this.Text = "Nuevo"; UtilLocal.ClearTextBoxes(this); txtNombreSistema.Focus(); } else { if (ParteSistema.ParteSistemaID > 0) { this.Text = "Modificar"; txtNombreSistema.Text = ParteSistema.NombreParteSistema; } } }
private void DetalleMotorExistente_Load(object sender, EventArgs e) { CargaInicial(); if (EsNuevo) { this.Text = "Nuevo"; UtilLocal.ClearTextBoxes(this); txtNombreMotor.Focus(); } else { if (MotorExistente.MotorExistenteID > 0) { this.Text = "Modificar"; txtNombreMotor.Text = MotorExistente.NombreMotorExistente; } } }
private void DetalleProveedor_Load(object sender, EventArgs e) { CargaInicial(); if (EsNuevo) { this.Text = "Nuevo"; UtilLocal.ClearTextBoxes(this); txtNombreProveedor.Focus(); } else { if (Proveedor.ProveedorID > 0) { this.Text = "Modificar"; txtNombreProveedor.Text = Proveedor.NombreProveedor; } } }
private void DetalleMarca_Load(object sender, EventArgs e) { CargaInicial(); if (EsNuevo) { this.Text = "Nuevo"; UtilLocal.ClearTextBoxes(this); txtNombreMarca.Focus(); } else { if (Marca.MarcaID > 0) { this.Text = "Modificar"; txtNombreMarca.Text = Marca.NombreMarca; } } }
private void DetalleUbicacion_Load(object sender, EventArgs e) { CargaInicial(); if (EsNuevo) { this.Text = "Nuevo"; UtilLocal.ClearTextBoxes(this); txtNombreUbicacion.Focus(); } else { if (ParteUbicacion.ParteUbicacionID > 0) { this.Text = "Modificar"; txtNombreUbicacion.Text = ParteUbicacion.NombreParteUbicacion; } } }
private void DetalleModelo_Load(object sender, EventArgs e) { CargaInicial(); if (EsNuevo) { this.Text = "Nuevo"; UtilLocal.ClearTextBoxes(this); cboMarca.Focus(); } else { if (Modelo.ModeloID > 0) { this.Text = "Modificar"; cboMarca.SelectedValue = Modelo.MarcaID; txtNombreModelo.Text = Modelo.NombreModelo; } } }
private void DetalleSubsistema_Load(object sender, EventArgs e) { CargaInicial(); if (EsNuevo) { this.Text = "Nuevo"; UtilLocal.ClearTextBoxes(this); cboSistema.Focus(); } else { if (Subsistema.SubsistemaID > 0) { this.Text = "Modificar"; cboSistema.SelectedValue = Subsistema.SistemaID; txtNombreSubsistema.Text = Subsistema.NombreSubsistema; } } }
private void DetalleCodigoAlterno_Load(object sender, EventArgs e) { CargaInicial(); this.Text = string.Format("{0}: {1}", "Codigos Alterno de", Parte.NumeroParte); if (EsNuevo) { this.Text = "Nuevo"; UtilLocal.ClearTextBoxes(this); cboMarca.Focus(); } else { //if (Modelo.ModeloID > 0) //{ // this.Text = "Modificar"; // cboMarca.SelectedValue = Modelo.MarcaID; // txtNombreModelo.Text = Modelo.NombreModelo; //} } }
private void DetalleMunicipio_Load(object sender, EventArgs e) { this.CargaInicial(); if (EsNuevo) { this.Text = "Nuevo"; UtilLocal.ClearTextBoxes(this); this.cboEstado.Enabled = true; this.cboEstado.Focus(); } else { if (Municipio.MunicipioID > 0) { this.Text = "Modificar"; this.cboEstado.SelectedValue = Municipio.EstadoID; this.cboEstado.Enabled = false; this.txtNombreMunicipio.Text = Municipio.NombreMunicipio; } } }
private void DetalleSusursal_Load(object sender, EventArgs e) { this.cmbGerente.CargarDatos("UsuarioID", "NombreUsuario", Datos.GetListOf <Usuario>(c => c.Activo && c.Estatus)); CargaInicial(); if (EsNuevo) { this.Text = "Nuevo"; UtilLocal.ClearTextBoxes(this); txtNombreSucursal.Focus(); } else { if (Sucursal.SucursalID > 0) { this.Text = "Modificar"; txtNombreSucursal.Text = Sucursal.NombreSucursal; txtIP.Text = Sucursal.DireccionIP; this.cmbGerente.SelectedValue = this.Sucursal.GerenteID; } } }
private void DetalleProveedorMarcaParte_Load(object sender, EventArgs e) { CargaInicial(); if (EsNuevo) { this.Text = "Nuevo"; UtilLocal.ClearTextBoxes(this); this.cboMarcaParte.Focus(); } else { if (ProveedorMarcaParte.ProveedorMarcaParteID > 0) { this.Text = "Modificar"; var pmp = Datos.GetEntity <ProveedorMarcaParte>(p => p.ProveedorMarcaParteID.Equals(ProveedorMarcaParte.ProveedorMarcaParteID)); if (pmp != null) { this.cboMarcaParte.SelectedValue = pmp.MarcaParteID; this.txtDescuentoUno.Text = pmp.DescuentoUno.ToString(); this.txtDescuentoDos.Text = pmp.DescuentoDos.ToString(); this.txtDescuentoTres.Text = pmp.DescuentoTres.ToString(); this.txtDescuentoCuatro.Text = pmp.DescuentoCuatro.ToString(); this.txtDescuentoCinco.Text = pmp.DescuentoCinco.ToString(); if (pmp.ImpactaFactura.Equals(true)) { this.chkImpactaFactura.Checked = true; this.chkImpactaArticulo.Checked = false; } if (pmp.ImpactaArticulo.Equals(true)) { this.chkImpactaArticulo.Checked = true; this.chkImpactaFactura.Checked = false; } } } } }
private void DetalleProveedorProntoPago_Load(object sender, EventArgs e) { if (EsNuevo) { this.Text = "Nuevo"; UtilLocal.ClearTextBoxes(this); this.nudNumeroDias.Focus(); } else { if (ProveedorProntoPago.ProveedorProntoPagoID > 0) { this.Text = "Modificar"; var pp = Datos.GetEntity <ProveedorProntoPago>(p => p.ProveedorProntoPagoID.Equals(ProveedorProntoPago.ProveedorProntoPagoID)); if (pp != null) { this.nudNumeroDias.Value = pp.NumeroDias; this.txtPorcentaje.Text = Util.Cadena(pp.PorcentajeDescuento); this.txtComentario.Text = pp.Comentario; } } } }