Exemple #1
0
 public PresentadorABMDocumentoCompra()
 {
     this.Servicio      = FabricaClienteServicio.Instancia.CrearCliente <IServicioABM <DocumentoCompra> >();
     this.Buscador      = FabricaPresentadores._Resolver <IPresentadorBuscador <DocumentoCompra> >();
     this.VistaTemplate = FabricaVistas.Instancia.BuscaVista(typeof(DocumentoCompra));
     this.VistaABM      = new Window();
 }
 public void AbrirEntidad(TEntidad entidad, bool soloLectura = false)
 {
     try
     {
         if (entidad != null)
         {
             if (EntidadesAbiertas.Count > 2)
             {
                 Mensajes.Error("Máximo de pestañas abiertas alcanzado.\n\nCierre las pestañas abiertas e intente nuevamente.");
             }
             else
             {
                 var vm = (TVistaModelo)Activator.CreateInstance(typeof(TVistaModelo), entidad);
                 vm.SoloLectura = soloLectura;
                 vm.Editable    = !vm.SoloLectura;
                 this.EntidadesAbiertas.Add(vm);
                 this.vistaABM.TabControlDerecho.SelectedIndex = this.EntidadesAbiertas.Count - 1;
                 this.vistaABM.TabControlDerecho.Focus();
             }
         }
     }
     catch (Exception ex)
     {
         Mensajes.Error(ex);
         this.Servicio = FabricaClienteServicio.Instancia.CrearCliente <IServicioABM <TEntidad> >();
     }
 }
 public void SetServicios( )
 {
     servicioArea       = FabricaClienteServicio.Instancia.CrearCliente <IServicioABM <Area> >();
     servicioSector     = FabricaClienteServicio.Instancia.CrearCliente <IServicioABM <Sector> >();
     servicioSubSector  = FabricaClienteServicio.Instancia.CrearCliente <IServicioABM <Subsector> >();
     servicioFamilia    = FabricaClienteServicio.Instancia.CrearCliente <IServicioABM <Familia> >();
     servicioSubFamilia = FabricaClienteServicio.Instancia.CrearCliente <IServicioABM <Subfamilia> >();
 }
Exemple #4
0
 public PresentadorDomicilio( )
 {
     try
     {
         servicioCalle = FabricaClienteServicio.Instancia.CrearCliente <IServicioABM <Calle> >();
         Calles        = servicioCalle.ObtenerLista(1, CargarRelaciones.NoCargarNada, Sistema.Instancia.EmpresaActual.Codigo).ToList();
     }
     catch (Exception exc)
     {
         Mensajes.Error(exc);
     }
 }
Exemple #5
0
        public PresentadorGrillaServidor()
        {
            this.CmdAgregar  = new RelayCommand(p => this.AgregarItem());
            this.CmdEditar   = new RelayCommand(p => this.Editar(), q => this.PuedeEditar());
            this.CmdBorrar   = new RelayCommand(p => this.BorrarItem(), q => this.PuedeEliminar());
            this.CmdAceptar  = new RelayCommand(p => this.Aceptar());
            this.CmdCancelar = new RelayCommand(p => this.Cancelar());
            //tengo que instanciar al servicio aca de alguna forma.
            this.servicio = new ServicioABM <TDto, TEntidad>();
            this.mapeador = FabricaNegocios._Resolver <IMapeadorGenerico <TEntidad, TDto> >();
            var dett = this.servicio.ObtenerLista(1, Inteldev.Core.CargarRelaciones.NoCargarNada, "");

            this.Detalle = new ObservableCollection <TDto>();
            foreach (var item in dett)
            {
                this.Detalle.Add(item);
            }
            this.Objeto = this.Detalle.FirstOrDefault();
        }
        public void Inicializador(IServicioABM <TEntidad> servicio, IPresentadorBuscador buscador)
        {
            this.EtiquetaBotonNuevo = "Nuevo";
            this.Servicio           = servicio;
            this.Buscador           = buscador;
            //this.VistaModeloListado = FabricaPresentadores.Instancia.Resolver<VistaModeloLista<TEntidad>>();

            this.Entidades         = new System.Collections.ObjectModel.ObservableCollection <TEntidad>();
            this.EntidadesAbiertas = new ObservableCollection <TVistaModelo>();
            this.Configurar();
            if (Sistema.Instancia.EmpresaActual == null)
            {
                Sistema.Instancia.EmpresaActual = new DTO.Organizacion.Empresa()
                {
                    Codigo = ""
                };
            }
            var parametros = new ListaParametrosDeBusqueda();

            this.Servicio.ObtenerPorCodigo("xxxxxxxxxxxxxxxxx", CargarRelaciones.NoCargarNada, "01", parametros);
        }
Exemple #7
0
        public PresentadorEmpresaContexto()
        {
            this.servicioConfiguraEmpresa = new ServicioABM <Inteldev.Fixius.Servicios.DTO.ConfiguraEmpresa, Inteldev.Fixius.Modelo.ConfiguraEmpresa>();
            this.servicioEmpresa          = new ServicioABM <Inteldev.Core.DTO.Organizacion.Empresa, Inteldev.Core.Modelo.Organizacion.Empresa>();
            this.servicioContexto         = new ServicioABM <Inteldev.Fixius.Servicios.DTO.Contexto, Inteldev.Fixius.Modelo.Contexto>();
            this.Items = new ObservableCollection <ConfiguraEmpresa>();
            var configuraciones = this.servicioConfiguraEmpresa.ObtenerLista(1, Inteldev.Core.CargarRelaciones.CargarEntidades, "");

            foreach (var item in configuraciones)
            {
                this.Items.Add(item);
            }
            var empresas = this.servicioEmpresa.ObtenerLista(1, Inteldev.Core.CargarRelaciones.CargarEntidades, "");

            foreach (var item in empresas)
            {
                if (this.Items.FirstOrDefault(p => p.Empresa.Id == item.Id) == null)
                {
                    this.Items.Add(new ConfiguraEmpresa()
                    {
                        Empresa = item, Contexto = new Contexto()
                    });
                }
            }
            var contextos = this.servicioContexto.ObtenerLista(1, Inteldev.Core.CargarRelaciones.CargarEntidades, "");

            this.Contextos = new ObservableCollection <Contexto>();



            foreach (var item in contextos)
            {
                this.Contextos.Add(item);
            }
            foreach (var item in this.Items)
            {
                item.PropertyChanged += item_PropertyChanged;
            }
            //this.Items.CollectionChanged += Items_CollectionChanged;
        }
Exemple #8
0
        public Historial()
        {
            InitializeComponent();
            this.Vendedores = new ObservableCollection <Elemento>();

            this.servicioPreventista = FabricaClienteServicio.Instancia.CrearCliente <IServicioABM <Inteldev.Fixius.Servicios.DTO.Preventa.Preventista> >();

            GeoCoderStatusCode status;

            this.map.Position = GoogleMapGeocoder.ObtenerCordenadasPorDireccion("Mar del Plata, Buenos Aires", out status);

            this.listaDeElementos.SelectionChanged += listaDeElementos_SelectionChanged;

            this.DataContext = this;

            //this.VentanaReporte = new Reporte();
            this.CreadorDeReportes = new ReportMaker();

            this.reportes.dgPosiciones.SelectionChanged += dgPosiciones_SelectionChanged;

            //this.codigosVendedoresAlta = this.ObtenerVendedoresPorEmpresa("10");
            //this.codigosVendedoresHiller = this.ObtenerVendedoresPorEmpresa("01");
        }
 public PresentadorABM(IServicioABM <TEntidad> servicio, IPresentadorBuscador buscador)
 {
     this.Inicializador(servicio, buscador);
 }