示例#1
0
            public override void Execute(object parameter)
            {
                if (parameter is VMPersonas)
                {
                    VMPersonas Elemento = parameter as VMPersonas;
                    ListadoGuardar = new List <dtoPersonas>();
                    ListadoGuardar.Add(new dtoPersonas
                    {
                        ApellidoPaterno   = Elemento.ApellidoPaterno,
                        ApellidoMaterno   = Elemento.ApellidoMaterno,
                        Nombres           = Elemento.Nombres,
                        Calle             = Elemento.Calle,
                        CodigoPostal      = Elemento.CodigoPostal,
                        Colonia           = Elemento.Colonia,
                        EntidadFederativa = Elemento.EntidadFederativa,
                        IdPersona         = 0,
                        Localidad         = Elemento.Localidad,
                        NumeroExterior    = Elemento.NumeroExterior,
                        NumeroInterior    = Elemento.NumeroInterior,
                        Telefono          = Elemento.Telefono
                    });

                    BackgroundWorker worker = new BackgroundWorker();
                    worker.DoWork             += new DoWorkEventHandler(this.GuardaPersonaDoWork);
                    worker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(this.GuardaPersonaCompleted);
                    worker.RunWorkerAsync();
                }
            }
示例#2
0
 public CommandPersonas(VMPersonas instancia)
 {
     viewModelPadre = instancia;
 }