Ejemplo n.º 1
0
        public ConfirmacionIntermediaPresenterP(IUnityContainer container, IConfirmacionIntermediaViewP view)
        {
            View           = view;
            this.container = container;
            this.service   = new WMSServiceClient();
            View.Model     = this.container.Resolve <ConfirmacionIntermediaModelP>();

            #region Metodos

            View.ConfirmBasicData += new EventHandler <EventArgs>(this.OnConfirmBasicData);

            view.CargaMasiva         += new EventHandler <DataEventArgs <DataTable> >(this.OnCargaMasiva);
            View.ReplicateDetails    += new EventHandler <EventArgs>(this.OnReplicateDetails);
            View.SaveDetails         += new EventHandler <EventArgs>(this.OnSaveDetails);
            View.EmpacarConfirmacion += new EventHandler <EventArgs>(this.OnConfirmarMovimiento);

            //Recibo
            View.BuscarRegistrosRecibo += this.OnBuscarRegistrosRecibo;
            View.FilaSeleccionada      += this.OnFilaSeleccionada;
            //View.ImprimirHablador += new EventHandler<EventArgs>(this.OnImprimirHablador);
            View.GenerarCodigo += new EventHandler <EventArgs>(this.OnGenerarCodigo);

            //View.AddLine += this.OnAddLine;
            View.AddLine += new EventHandler <EventArgs>(this.OnAddLine);

            //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 { }

            DataTable table = new DataTable();
            table.Columns.Add("UbicacionDestino", typeof(string));
            table.Rows.Add("DIAGNOSTICO");

            View.Model.ListUbicacionesDestino = table;
            View.Model.ListadoPosiciones      = service.GetMMaster(new MMaster {
                MetaType = new MType {
                    Code = "POSICION1"
                }
            });

            CargarDatosDetails();
            //ListarDatos();

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

        public ConfirmacionIntermediaPresenterP(IUnityContainer container, IConfirmacionIntermediaViewP view)
        {
            View = view;
            this.container = container;
            this.service = new WMSServiceClient();
            View.Model = this.container.Resolve<ConfirmacionIntermediaModelP>();

            #region Metodos

            View.ConfirmBasicData += new EventHandler<EventArgs>(this.OnConfirmBasicData);

            view.CargaMasiva += new EventHandler<DataEventArgs<DataTable>>(this.OnCargaMasiva);
            View.ReplicateDetails += new EventHandler<EventArgs>(this.OnReplicateDetails);
            View.SaveDetails += new EventHandler<EventArgs>(this.OnSaveDetails);
            View.EmpacarConfirmacion += new EventHandler<EventArgs>(this.OnConfirmarMovimiento);

            //Recibo
            View.BuscarRegistrosRecibo += this.OnBuscarRegistrosRecibo;
            View.FilaSeleccionada += this.OnFilaSeleccionada;
            View.ImprimirHablador += new EventHandler<EventArgs>(this.OnImprimirHablador);
            View.GenerarCodigo += new EventHandler<EventArgs>(this.OnGenerarCodigo);

            //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 { }

            DataTable table = new DataTable();
            table.Columns.Add("UbicacionDestino", typeof(string));
            table.Rows.Add("DIAGNOSTICO");
            
            View.Model.ListUbicacionesDestino = table;
            View.Model.ListadoPosiciones = service.GetMMaster(new MMaster { MetaType = new MType { Code = "POSICION1" } });

            CargarDatosDetails();
            //ListarDatos();

            #endregion
        }