private void mView_View(object sender, EventArgs e) { this.mView.IsSuccessful = false; this.mActual = this.mUsuarioService.ObtenerPorId(this.mView.SelectId); if (this.mActual != null) { this.mView.AsignacionModulo = mAccesoUsuarioService.ObtenerAccesoModulo(this.mActual); var lista = new DataSourceContainer(typeof(Modulo), true).DataSource as List <KeyValuePair <string, int> >; var otro = lista.Where(a => !this.mView.AsignacionModulo.Any(m => (int)m.Modulo == (int)a.Value)).ToList().Select(x => x.Key).ToList(); this.mView.ModuloDisponible = otro; this.mView.AsignacionMenu = this.mAccesoUsuarioService.ObtenerAccesoMenu(this.mActual); this.mView.MenuDisponible = this.mMenuSistemaService.ObtenerMenu().Where(c => !this.mView.AsignacionMenu.Any(m => m.Menu.Id == c.Id) && c.TieneFormulario == true).ToList(); this.mView.AsignacionArea = this.mAccesoUsuarioService.ObtenerAccesoArea(this.mActual); this.mView.AreaDisponible = this.mAreaService.ObtenerTodo().Where(c => !this.mView.AsignacionArea.Any(m => m.Area.Id == c.Id)).ToList(); this.mView.AsignacionSucursal = this.mAccesoUsuarioService.ObtenerAccesoSucursal(this.mActual); this.mView.SucursalDisponible = this.mSucursalService.ObtenerTodo().Where(c => !this.mView.AsignacionSucursal.Any(m => m.Sucursal.Id == c.Id)).ToList(); } this.mOld = GenericEntityAction <Usuario> .Clone(this.mActual); SetData(); }
private void mView_View(object sender, EventArgs e) { this.mView.IsSuccessful = false; this.mActual = this.mPeriodoService.ObtenerPorId(this.mView.SelectId); this.mOld = GenericEntityAction <Periodo> .Clone(this.mActual); SetData(); }
protected override void OnSortAction() { KeyValuePair <string, string> value = ((KeyValuePair <string, string>)cboLista.SelectedItem); TipoOrden sortType = rbAsc.Checked ? TipoOrden.Ascendente : TipoOrden.Descendente; var list = (List <Persona>) this.Source; GenericEntityAction <Persona> .Sort(ref list, sortType, value.Key); this.Source = list; dgvListado.DataSource = null; dgvListado.DataSource = this.Source; }
private void mView_View(object sender, EventArgs e) { this.mView.IsSuccessful = false; this.mActual = this.mAreaService.ObtenerPorId(this.mView.SelectId); if (this.mActual != null) { this.mView.Asignacion = mPersonaAreaService.ObtenerTodo(this.mActual); } this.mOld = GenericEntityAction <Area> .Clone(this.mActual); SetData(); }
private void mView_View(object sender, EventArgs e) { this.mView.IsSuccessful = false; this.mActual = this.mPlanillaService.ObtenerPorId(this.mView.SelectId); if (this.mActual != null) { this.mActual.Detalle = mPlanillaService.ObtenerDetalle(this.mActual).Where(c => c.EstaActivo == true).ToList(); } this.mOld = GenericEntityAction <Planilla> .Clone(this.mActual); SetData(); }
private void mView_View(object sender, EventArgs e) { this.mView.IsSuccessful = false; this.mCurrent = this.mOrdenProduccionService.ObtenerPorId(this.mView.SelectId); if (this.mCurrent != null) { this.mView.ActividadDataSource = this.mActividadService.ObtenerTodoPorOrden(this.mCurrent, true).Where(c => c.EstaActivo == true).ToList(); this.mView.Asignacion = mOrdenProduccionActividadService.ObtenerTodo(this.mCurrent); } this.mOld = GenericEntityAction <OrdenProduccion> .Clone(this.mCurrent); SetData(); }
private void mView_View(object sender, EventArgs e) { this.mView.IsSuccessful = false; this.mActual = this.mPersonaService.ObtenerPorId(this.mView.SelectId); if (this.mActual != null) { this.mActual.TipoDocumento = this.mDocumentoPersonaService.ObtenerPorId(this.mActual.TipoDocumento.Id); if (mActual.CentroCosto != null) { this.mActual.CentroCosto = this.mCentroCostoService.ObtenerPorId(this.mActual.CentroCosto.Id); } } this.mOld = GenericEntityAction <Persona> .Clone(this.mActual); SetData(); }
private void mView_View(object sender, EventArgs e) { this.mView.IsSuccessful = false; this.mCurrent = this.mAreaService.ObtenerPorId(this.mView.SelectId); if (this.mCurrent != null) { var n = mNumeracionService.ObtenerPorId(this.mCurrent); if (n != null) { this.mView.Numero = n.NumeroCorrelativo; } else { this.mView.Numero = string.Empty; } } this.mOld = GenericEntityAction <Area> .Clone(this.mCurrent); SetData(); }
protected override void OnFilterAction() { KeyValuePair <string, string> value = ((KeyValuePair <string, string>)cboLista.SelectedItem); TipoFiltro filterType = TipoFiltro.Contiene; if (rbEmpieza.Checked) { filterType = TipoFiltro.Empieza; } else if (rbTermina.Checked) { filterType = TipoFiltro.Termina; } this.Source = mPersonaService.ObtenerTodo().Where(c => c.EstaActivo == true).ToList(); var list = (List <Persona>) this.Source; GenericEntityAction <Persona> .Filter(ref list, value.Key, txtBuscar.Text, filterType); this.Source = list; dgvListado.DataSource = null; dgvListado.DataSource = this.Source; }
private void mView_View(object sender, EventArgs e) { this.mView.IsSuccessful = false; this.mActual = this.mConfiguracionService.ObtenerPorId(this.mView.SelectId); this.mOld = GenericEntityAction <Configuracion> .Clone(this.mActual); }