public void ObtenerConsecutivos_HappyPath() { System.Diagnostics.Stopwatch timer = new System.Diagnostics.Stopwatch(); TableroControlNEG objecto = new TableroControlNEG(); Entidades.ConsecutivoPOCO consecutivo = new ConsecutivoPOCO(); bool resultado = false; consecutivo.EmpresaSIRCEID = 1; consecutivo.ConsecutivoURID = 1; timer.Start(); try { resultado = objecto.obtenerConsecutivo(consecutivo); Debug.WriteLine("ConsecutivoLista :: " + consecutivo.ConsecutivoEmpresa + " | ConsecutivoDC4 :: " + consecutivo.ConsecutivoDC4); } catch (Exception ex) { Assert.Fail(ex.Message); } timer.Stop(); Debug.WriteLine("CreaTrabajador :: Minutes: " + timer.Elapsed.Minutes + " | Seconds: " + timer.Elapsed.Seconds + " | Milliseconds: " + timer.Elapsed.Milliseconds); Assert.IsTrue(resultado, "Registro exitoso"); }
public bool obtenerConsecutivo(ConsecutivoPOCO entidad) { TableroControlDAT objTableroControlDAT = new TableroControlDAT(contextoSIRCE); objTableroControlDAT.obtenerConsecutivo(entidad); Dispose(); return(true); }
public bool postLista() { TableroControlNEG objTableroControlNeg = new TableroControlNEG(); ConsecutivoPOCO consecutivos = new ConsecutivoPOCO(); bool success = true; Listas lista = new Listas(); if (this.accion != (from a in acciones where a.catalogoDescripcion.Equals("Crear") select a.catalogoID).FirstOrDefault()) { lista = objTableroControlNeg.consultarLista(this.listaID); } if (this.accion != (from a in acciones where a.catalogoDescripcion.Equals("Eliminar") select a.catalogoID).FirstOrDefault()) { lista.Nombre = this.nombreLista; lista.NombreRepresentante = this.nombreRepresentante; lista.NumeroConstancias = this.numeroConstancias; lista.Hombres = byte.Parse(this.numeroHombres.ToString()); lista.Mujeres = byte.Parse(this.numeroMujeres.ToString()); lista.FechaPresentacion = Utilidades.ConvertirFecha(this.fechaPresentacion); } if (this.accion == (from a in acciones where a.catalogoDescripcion.Equals("Crear") select a.catalogoID).FirstOrDefault()) { lista.FechaCreacion = DateTime.Now; lista.Estatus = (byte)Enumeradores.EstatusLista.Enproceso; lista.Eliminado = false; consecutivos.EmpresaSIRCEID = this.empresaSIRCEID; consecutivos.ConsecutivoURID = this.unidadResponsableID; lista.CentroTrabajoSIRCEID = this.centroTrabajoSIRCEID; success = new TableroControlNEG().obtenerConsecutivo(consecutivos); lista.FolioEmpresa = int.Parse(consecutivos.ConsecutivoEmpresa); lista.Origen = (int)Enumeradores.OrigenSIRCE.Ventanilla; lista.UnidadResponsableID = this.unidadResponsableID; lista.UsuarioCreacion = this.usuarioCreacion; } if (this.accion == (from a in acciones where a.catalogoDescripcion.Equals("Eliminar") select a.catalogoID).FirstOrDefault()) { lista.Eliminado = true; } success = objTableroControlNeg.postLista(lista); if (success && this.accion == (from a in acciones where a.catalogoDescripcion.Equals("Crear") select a.catalogoID).FirstOrDefault()) { string direccion = this.centroTrabajoDNE.colonia + " " + this.centroTrabajoDNE.calleNumero + " " + this.centroTrabajoDNE.codigoPostal + " " + this.centroTrabajoDNE.entidadDescripcion + " " + this.centroTrabajoDNE.municipioDescripcion; Acuses acuse = new Acuses(); acuse.ListaID = lista.ListaID; acuse.FolioDC4 = consecutivos.ConsecutivoDC4; acuse.RFC = this.centroTrabajoDNE.rfc; acuse.RazonSocial = this.centroTrabajoDNE.centroTrabajoNombre; acuse.Direccion = direccion; success = new TableroControlNEG().postAcuse(acuse); ListaCentrosTrabajo listaCentroTrabajo = new ListaCentrosTrabajo(); listaCentroTrabajo.ListaID = lista.ListaID; listaCentroTrabajo.CentroTrabajoSIRCEID = lista.CentroTrabajoSIRCEID; success = new TableroControlNEG().postListaCentroTrabajo(listaCentroTrabajo); } return(success); }
public bool obtenerConsecutivo(ConsecutivoPOCO entidad) { var resultado = contexto.spGetConsecutivos((int)entidad.EmpresaSIRCEID, (int)entidad.ConsecutivoURID); if (resultado != null) { foreach (var item in resultado) { entidad.ConsecutivoEmpresa = item.ConsecutivoLista.ToString(); entidad.ConsecutivoDC4 = item.ConsecutivoDC4; } } return(true); }