//private DatosCOVE InsertarArchivo(DatosCOVE digitalizacion) //{ // var archivo = digitalizacion.ArchivoFisico; // var req = new Template.Modelo.Dominio.Entidades.ExpedienteDigital.ExpedienteDigital() // { // IdEmpresa = archivo.IdEmpresa, // NombreOrigen = archivo.NombreArchivo, // NombreDestino = archivo.NuevoNombreArchivo, // Path = archivo.PathDestino, // IdUsuario = 0,//pendiente // IdTipoDocumento = 2 // }; // var io = FactoryEngine<IExpedienteDigitalDominio>.GetInstance("IExpedienteDigitalDominioConfig"); // req = io.InsertarExpedienteDigital(req); // bool ok = false; // if (req.IdExpedienteDigital != 0) // { // if (iDigitalizacionVUCEMRepositorio.InsertaGrupoArchivo(digitalizacion.IdPedimento, // req.IdExpedienteDigital, // archivo.IdEmpresa)) // if (iDigitalizacionVUCEMRepositorio.CierraEdocument(archivo.IdEmpresa, // digitalizacion.IdBitacoraEdocumentVUCEM, digitalizacion.IdPedimento)) // return digitalizacion; // } // return null; //} private string SubirArchivoXMLaFTP(int idEmpresa, int idPatente, byte[] archivoBytes, string edocument) { //var xmlBytes = Util.GetXmlBytes(response.Entidad.ResponseEdocument); var iEmpresa = new OperacionEmpresaDominio(); var req = new EntidadEmpresa() { DatosEmpresa = new Empresa() { IdEmpresaVw = idEmpresa } }; var datosEmpresa = iEmpresa.OperacionEmpresaItem(req); var reqPatente = new EntidadEmpresa() { OperacionEspecifica = OperacionEmpresaItem.DameDatosPatenteXId, DatosPatente = new Patente() { IdPatente = idPatente } }; var datosPatente = iEmpresa.OperacionEmpresaItem(reqPatente); var file = GuardarArchivoFTP(datosEmpresa.DatosEmpresa.IdClienteVw, idEmpresa, datosPatente.DatosPatente.NumeroPatente, edocument, archivoBytes); //Inserta en expedienteDigital el Archivo fĂsico. InsertarArchivo(file); return(file.PathDestino + file.NuevoNombreArchivo); }
/// <summary> /// Valida que el Idsea distinto de 0 /// </summary> /// <param name="request"></param> private void ValidaDatosRequestId(EntidadEmpresa request) { if (request.DatosEmpresa.IdEmpresaVw == 0) { throw new IdEmpresaException(); } }
public EntidadEmpresa OperacionEmpresaItem(EntidadEmpresa entidad) { using (TransactionScope transaction = new TransactionScope(TransactionScopeOption.Required)) { switch (entidad.OperacionEspecifica) { //case Modelo.Compartido.OperacionEmpresaItem.DameBDXIdEmpresa: // response = operacionEmpresaRepositorio.DameBaseDatosEmpresaXId(entidad); // break; case Modelo.Compartido.OperacionEmpresaItem.DameDatosPatenteXId: entidad = operacionEmpresaRepositorio.DameDatosPatenteXId(entidad); break; case Modelo.Compartido.OperacionEmpresaItem.DameDatosEmpresaXId: ValidaDatosRequestId(entidad); entidad.DatosEmpresa = operacionEmpresaRepositorio.DameDatosEmpresaXId(entidad.DatosEmpresa); break; case Modelo.Compartido.OperacionEmpresaItem.DameDatosPatenteXNoPatente: entidad = operacionEmpresaRepositorio.DameDatosPatenteXNoPatente(entidad); break; } transaction.Complete(); return(entidad); } }
public EntidadEmpresa DameDatosPatenteXNoPatente(EntidadEmpresa request) { var empresa = new EntidadEmpresa(); //empresa.DatosEmpresa = new List<Empresa>(); var parametros = new List <SqlParameterItem>(); parametros.Add(new SqlParameterItem("@pNumeroPatente", SqlDbType.VarChar, 4, request.DatosPatente.NumeroPatente)); parametros.Add(new SqlParameterItem("@pResultado", SqlDbType.Bit, ParameterDirection.Output)); helper = new SqlHelper(Util.ConexionSqlServer(TipoBaseDatos.MainSoft)); var reader = helper.ExecuteReader("[usp_Patente_DameListaPatenteXNoPatente]", parametros); while (reader.Read()) { empresa.DatosPatente = new Patente() { IdPatente = reader.GetInt32(reader.GetOrdinal("IdPatente")), //NumeroPatente = reader.GetString(reader.GetOrdinal("NumeroPatente")), NombreAgente = reader.GetString(reader.GetOrdinal("NombreAgente")), Inactivo = reader.GetBoolean(reader.GetOrdinal("Inactivo")), CURP = reader.GetString(reader.GetOrdinal("CURP")), RFC = reader.GetString(reader.GetOrdinal("RFC")), ArchivoCer = reader.GetString(reader.GetOrdinal("ArchivoCer")), ArchivoKey = reader.GetString(reader.GetOrdinal("ArchivoKey")), PasswordKey = reader.GetString(reader.GetOrdinal("PasswordKey")), InicioVigenciaCer = reader.GetDateTime(reader.GetOrdinal("InicioVigenciaCer")), FinVigenciaCer = reader.GetDateTime(reader.GetOrdinal("FinVigenciaCer")), WebKeyVUCEM = reader.GetString(reader.GetOrdinal("WebKeyVUCEM")), }; } helper.CloseConnection(); return(empresa); }
/// <summary> /// Funcion que devuelve la BD de la Empresa consultada en el request /// </summary> /// <param name="request"></param> /// <returns></returns> private string DameBaseDatosEmpresaXIdBD(EntidadEmpresa request) { var empresa = string.Empty; //empresa.DatosEmpresa = new List<Empresa>(); List <SqlParameterItem> parametros = new List <SqlParameterItem>(); parametros.Add(new SqlParameterItem("@pID", SqlDbType.SmallInt, request.DatosEmpresa.IdEmpresaVw)); parametros.Add(new SqlParameterItem("@pBD", SqlDbType.VarChar, 50, "", ParameterDirection.Output)); helper = new SqlHelper(Util.ConexionSqlServer(TipoBaseDatos.MainSoft)); helper.ExecuteNonQuery("usp_Empresa_DameBDXID", parametros); empresa = Convert.ToString(helper.GetParameterOutput("@pBD")); helper.CloseConnection(); return(empresa); }
private Modelo.Dominio.Entidades.DigitalizacionVUCEM GenerarLlamadoEspecifico(Modelo.Dominio.Entidades.DigitalizacionVUCEM documento, ConsultaDigitalizacionVUCEMPor consultaPor) { //var vucem = Util.ServicioVUCEM(); var io = FactoryEngine <IOperacionEmpresaDominio> .GetInstance("IOperacionEmpresaDominioConfig"); var entidad = new Modelo.Dominio.Entidades.DigitalizacionVUCEM(); switch (consultaPor) { case ConsultaDigitalizacionVUCEMPor.Empresa: var req = new EntidadEmpresa() { OperacionEspecifica = OperacionEmpresaItem.DameDatosEmpresaXId, DatosEmpresa = new Empresa() { IdEmpresaVw = documento.IdEmpresa }, DatosPatente = new Patente() { IdPatente = documento.IdPatente } }; var response = io.OperacionEmpresaItem(req); documento.Documento.RFC = response.DatosEmpresa.RFC; documento.Documento.PasswordWSVucem = response.DatosEmpresa.WebKeyVUCEM; break; case ConsultaDigitalizacionVUCEMPor.Patente: req = new EntidadEmpresa() { OperacionEspecifica = OperacionEmpresaItem.DameDatosPatenteXId, DatosEmpresa = new Empresa() { IdEmpresaVw = documento.IdEmpresa }, DatosPatente = new Patente() { IdPatente = documento.IdPatente } }; response = io.OperacionEmpresaItem(req); documento.Documento.RFC = response.DatosPatente.RFC; documento.Documento.PasswordWSVucem = response.DatosPatente.WebKeyVUCEM; break; } return(documento); //var response = vucem.ConsultaEdocumentVucem(new ConsultaEdocumentVUCEMRequest()); }
public static string DameBDxIdEmpresa(int idEmpresa) { var x = new OperacionEmpresaRepositorio(); var request = new EntidadEmpresa() { DatosEmpresa = new Empresa() { IdEmpresaVw = idEmpresa }, //OperacionEspecifica = OperacionEmpresaItem.DameBDXIdEmpresa }; var response = x.DameBaseDatosEmpresaXId(request); x.Dispose(); return(response); }
private Modelo.Dominio.Entidades.DigitalizacionVUCEM GetDataParaFTP( Modelo.Dominio.Entidades.DigitalizacionVUCEM item) { var io = FactoryEngine <IOperacionEmpresaDominio> .GetInstance("IOperacionEmpresaDominioConfig"); var req = new EntidadEmpresa() { OperacionEspecifica = OperacionEmpresaItem.DameDatosEmpresaXId, DatosEmpresa = new Empresa() { IdEmpresaVw = item.IdEmpresa }, DatosPatente = new Patente() { IdPatente = item.IdPatente } }; var response = io.OperacionEmpresaItem(req); item.IdCliente = response.DatosEmpresa.IdClienteVw; req = new EntidadEmpresa() { OperacionEspecifica = OperacionEmpresaItem.DameDatosPatenteXId, DatosEmpresa = new Empresa() { IdEmpresaVw = item.IdEmpresa }, DatosPatente = new Patente() { IdPatente = item.IdPatente } }; response = io.OperacionEmpresaItem(req); item.Patente = response.DatosPatente.NumeroPatente; return(item); }
private ConsultaEdocument GenerarLlamadoEspecifico(DatosCOVE datosCOVE, ConsultaEdocumentPor consultaPor) { //var vucem = Util.ServicioVUCEM(); var io = FactoryEngine <IOperacionEmpresaDominio> .GetInstance("IOperacionEmpresaDominioConfig"); var entidad = new ConsultaEdocument(); switch (consultaPor) { case ConsultaEdocumentPor.Empresa: var req = new EntidadEmpresa() { OperacionEspecifica = OperacionEmpresaItem.DameDatosEmpresaXId, DatosEmpresa = new Empresa() { IdEmpresaVw = datosCOVE.IdEmpresa }, DatosPatente = new Patente() { IdPatente = datosCOVE.IdPatente } }; var response = io.OperacionEmpresaItem(req); entidad = new ConsultaEdocument() { ArchivoCer = GetArchivoCerKey(ConvertirEmpresaToArchivoCer(response.DatosEmpresa)), ArchivoKey = GetArchivoCerKey(ConvertirEmpresaToArchivoKey(response.DatosEmpresa)), Edocument = datosCOVE.Request.Edocument.Trim(), RFC = response.DatosEmpresa.RFC.Trim(), PasswordCerKey = response.DatosEmpresa.PasswordCertificado.Trim(), PasswordWSVucem = response.DatosEmpresa.WebKeyVUCEM.Trim() }; break; case ConsultaEdocumentPor.Patente: req = new EntidadEmpresa() { OperacionEspecifica = OperacionEmpresaItem.DameDatosPatenteXId, DatosEmpresa = new Empresa() { IdEmpresaVw = datosCOVE.IdEmpresa }, DatosPatente = new Patente() { IdPatente = datosCOVE.IdPatente } }; response = io.OperacionEmpresaItem(req); entidad = new ConsultaEdocument() { ArchivoCer = GetArchivoCerKey(ConvertirPatenteToArchivoCer(response.DatosPatente)), ArchivoKey = GetArchivoCerKey(ConvertirPatenteToArchivoKey(response.DatosPatente)), Edocument = datosCOVE.Request.Edocument.Trim(), RFC = response.DatosPatente.RFC.Trim(), PasswordCerKey = response.DatosPatente.PasswordKey.Trim(), PasswordWSVucem = response.DatosPatente.WebKeyVUCEM.Trim() }; break; } return(entidad); //var response = vucem.ConsultaEdocumentVucem(new ConsultaEdocumentVUCEMRequest()); }
public string DameBaseDatosEmpresaXId(EntidadEmpresa request) { var res = DameBaseDatosEmpresaXIdBD(request); return(res); }