public int offset = 5; //# columnas que no se debe replicar porque son fijas.

        public AdministradorDTVPresenter(IUnityContainer container, IAdministradorDTVView view)
        {
            View = view;
            this.container = container;
            this.service = new WMSServiceClient();
            View.Model = this.container.Resolve<AdministradorDTVModel>();


            #region Metodos

            //View.ConfirmBasicData += new EventHandler<EventArgs>(this.OnConfirmBasicData);
            //View.EvaluarTipoProducto += new EventHandler<DataEventArgs<Product>>(this.OnEvaluarTipoProducto);
            View.AddLine += new EventHandler<EventArgs>(this.OnAddLine);
            View.CargarDatosAdministradorDTV += new EventHandler<EventArgs>(this.CargarDatosAdministradorDTV);
            view.CargaMasiva += new EventHandler<DataEventArgs<DataTable>>(this.OnCargaMasiva);
            View.ReplicateDetails += new EventHandler<EventArgs>(this.OnReplicateDetails);
            View.SaveDetails += new EventHandler<EventArgs>(this.OnSaveDetails);
            View.ConfirmarMovimiento += new EventHandler<EventArgs>(this.OnConfirmarMovimiento);

            //Recibo
            View.BuscarRegistrosRecibo += this.OnBuscarRegistrosRecibo;
            View.ActualizarRegistrosRecibo += this.OnActualizarRegistrosRecibo;
            View.ConfirmarRecibo += this.OnConfirmarRecibo;

            View.ConsultarMovimientos += new EventHandler<EventArgs>(this.OnConsultarMovimientos);
            View.BuscarEquipoTracking += new EventHandler<EventArgs>(this.OnBuscarEquipoTracking);
            View.ReiniciarCapacitacion += new EventHandler<EventArgs>(this.OnReiniciarCapacitacion);

            //ConfirmarMovimiento
            #endregion

            #region Datos

            View.Model.HeaderDocument = new Document();
            View.Model.RecordCliente = service.GetLocation(new Location { LocationID = App.curLocation.LocationID }).First();
            View.Model.ListBinEntradaAlmacen = service.GetBin(new Bin { BinID = 4 });

            try { Local = service.GetConnection(new Connection { Name = "LOCAL" }).First(); }
            catch { }


            View.Model.ListadoEstatusLogPro = service.GetMMaster(new MMaster { MetaType = new MType { Code = "LOGPROSTAT" } });
            View.Model.ListadoPosiciones = service.GetMMaster(new MMaster { MetaType = new MType { Code = "POSICION1" } });
            View.Model.ListadoModelos = service.GetMMaster(new MMaster { MetaType = new MType { Code = "DRIRECMODE" } });
            View.Model.ListadoOrigen = service.GetMMaster(new MMaster { MetaType = new MType { Code = "TIPOORIGEND" } });
            View.Model.ListadoCiudades = service.GetMMaster(new MMaster { MetaType = new MType { Code = "CIUDAD" } });
            View.Model.ListadoTipoDev = service.GetMMaster(new MMaster { MetaType = new MType { Code = "TIPODEVDTV" } });
            View.Model.ListadoEstMaterial = service.GetMMaster(new MMaster { MetaType = new MType { Code = "ESTADOMAT" } });
            View.Model.ListadoFallas = service.GetMMaster(new MMaster { MetaType = new MType { Code = "DTVCFALLAR" } });
            View.Model.ListadoMotScrap = service.GetMMaster(new MMaster { MetaType = new MType { Code = "MOTSCRAP" } });
            View.Model.ListadoSINO = service.GetMMaster(new MMaster { MetaType = new MType { Code = "SI _NO" } });

            View.Model.ListadoEquipos = service.DirectSQLQuery("exec sp_GetProcesosDIRECTV2 'HISTORICOSERIAL'", "", "dbo.movimientoDIRECTV", Local);

            #endregion
        }
Exemplo n.º 2
0
        public int offset = 5; //# columnas que no se debe replicar porque son fijas.

        public AdministradorDTVPresenter(IUnityContainer container, IAdministradorDTVView view)
        {
            View           = view;
            this.container = container;
            this.service   = new WMSServiceClient();
            View.Model     = this.container.Resolve <AdministradorDTVModel>();


            #region Metodos

            //View.ConfirmBasicData += new EventHandler<EventArgs>(this.OnConfirmBasicData);
            //View.EvaluarTipoProducto += new EventHandler<DataEventArgs<Product>>(this.OnEvaluarTipoProducto);
            View.AddLine += new EventHandler <EventArgs>(this.OnAddLine);
            View.CargarDatosAdministradorDTV += new EventHandler <EventArgs>(this.CargarDatosAdministradorDTV);
            view.CargaMasiva         += new EventHandler <DataEventArgs <DataTable> >(this.OnCargaMasiva);
            View.ReplicateDetails    += new EventHandler <EventArgs>(this.OnReplicateDetails);
            View.SaveDetails         += new EventHandler <EventArgs>(this.OnSaveDetails);
            View.ConfirmarMovimiento += new EventHandler <EventArgs>(this.OnConfirmarMovimiento);

            //Recibo
            View.BuscarRegistrosRecibo     += this.OnBuscarRegistrosRecibo;
            View.ActualizarRegistrosRecibo += this.OnActualizarRegistrosRecibo;
            View.ConfirmarRecibo           += this.OnConfirmarRecibo;

            View.ConsultarMovimientos  += new EventHandler <EventArgs>(this.OnConsultarMovimientos);
            View.BuscarEquipoTracking  += new EventHandler <EventArgs>(this.OnBuscarEquipoTracking);
            View.ReiniciarCapacitacion += new EventHandler <EventArgs>(this.OnReiniciarCapacitacion);

            //ConfirmarMovimiento
            #endregion

            #region Datos

            View.Model.HeaderDocument = new Document();
            View.Model.RecordCliente  = service.GetLocation(new Location {
                LocationID = App.curLocation.LocationID
            }).First();
            View.Model.ListBinEntradaAlmacen = service.GetBin(new Bin {
                BinID = 4
            });

            try { Local = service.GetConnection(new Connection {
                    Name = "LOCAL"
                }).First(); }
            catch { }


            View.Model.ListadoEstatusLogPro = service.GetMMaster(new MMaster {
                MetaType = new MType {
                    Code = "LOGPROSTAT"
                }
            });
            View.Model.ListadoPosiciones = service.GetMMaster(new MMaster {
                MetaType = new MType {
                    Code = "POSICION1"
                }
            });
            View.Model.ListadoModelos = service.GetMMaster(new MMaster {
                MetaType = new MType {
                    Code = "DRIRECMODE"
                }
            });
            View.Model.ListadoOrigen = service.GetMMaster(new MMaster {
                MetaType = new MType {
                    Code = "TIPOORIGEND"
                }
            });
            View.Model.ListadoCiudades = service.GetMMaster(new MMaster {
                MetaType = new MType {
                    Code = "CIUDAD"
                }
            });
            View.Model.ListadoTipoDev = service.GetMMaster(new MMaster {
                MetaType = new MType {
                    Code = "TIPODEVDTV"
                }
            });
            View.Model.ListadoEstMaterial = service.GetMMaster(new MMaster {
                MetaType = new MType {
                    Code = "ESTADOMAT"
                }
            });
            View.Model.ListadoFallas = service.GetMMaster(new MMaster {
                MetaType = new MType {
                    Code = "DTVCFALLAR"
                }
            });
            View.Model.ListadoMotScrap = service.GetMMaster(new MMaster {
                MetaType = new MType {
                    Code = "MOTSCRAP"
                }
            });
            View.Model.ListadoSINO = service.GetMMaster(new MMaster {
                MetaType = new MType {
                    Code = "SI _NO"
                }
            });

            View.Model.ListadoEquipos = service.DirectSQLQuery("exec sp_GetProcesosDIRECTV2 'HISTORICOSERIAL'", "", "dbo.movimientoDIRECTV", Local);

            #endregion
        }