public ENSaludContratoPlan ObtenerUno(DateTime FechaInicioContratoPlan) { DbCommand oCommand = null; ENSaludContratoPlan oENSaludContratoPlan = new ENSaludContratoPlan(); try { oCommand = GenericDataAccess.CreateCommand(dataProviderName, connectionString, "usp_GenSaludContratoPlan_sel"); GenericDataAccess.AgregarParametro(oCommand, "@argFechaInicioContratoPlan", oENSaludContratoPlan.FechaInicioContratoPlan, TipoParametro.DT, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@argErrorCode ", 1, TipoParametro.INT, Direccion.OUTPUT); DbDataReader oDataReader = GenericDataAccess.ExecuteReader(oCommand); if (oDataReader.Read()) { oENSaludContratoPlan.CodigoContrato = oDataReader["CodigoContrato"].ToString(); oENSaludContratoPlan.CodigoPlanSC = oDataReader["CodigoPlan"].ToString(); oENSaludContratoPlan.FechaFinContratoPlan = DateTime.Parse(oDataReader["FechaFinContratoPlan"].ToString()); oENSaludContratoPlan.FechaInicioContratoPlan = DateTime.Parse(oDataReader["FechaInicioContratoPlan"].ToString()); } return(oENSaludContratoPlan); } catch (Exception ex) { throw new Exception(); } finally { GenericDataAccess.CerrarConexion(oCommand, null); } }
public List <ENSaludContratoPlan> ObtenerTodos(string CodigoCliente, string CodigoContrato) { DbCommand oCommand = null; List <ENSaludContratoPlan> oListaSaludContratoPlan = new List <ENSaludContratoPlan>(); try { oCommand = GenericDataAccess.CreateCommand(dataProviderName, connectionString, "usp_GenSaludContratoPlan_sel"); GenericDataAccess.AgregarParametro(oCommand, "@argCodigoCliente ", CodigoCliente, TipoParametro.STR, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@argCodigoContrato", CodigoContrato, TipoParametro.STR, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@argErrorCode ", 1, TipoParametro.INT, Direccion.OUTPUT); DbDataReader oDataReader = GenericDataAccess.ExecuteReader(oCommand); while (oDataReader.Read()) { ENSaludContratoPlan oEnListaSaludContratoPlan = new ENSaludContratoPlan(); oEnListaSaludContratoPlan.CodigoContrato = oDataReader["CodigoContrato"].ToString(); oEnListaSaludContratoPlan.CodigoPlanSC = oDataReader["CodigoPlan"].ToString(); oEnListaSaludContratoPlan.FechaFinContratoPlan = DateTime.Parse(oDataReader["FechaFinContratoPlan"].ToString()); oEnListaSaludContratoPlan.FechaInicioContratoPlan = DateTime.Parse(oDataReader["FechaInicioContratoPlan"].ToString()); oEnListaSaludContratoPlan.CodigoCliente = oDataReader["CodigoCliente"].ToString(); oEnListaSaludContratoPlan.DescripcionPlanSC = oDataReader["DescripcionPlan"].ToString(); oListaSaludContratoPlan.Add(oEnListaSaludContratoPlan); } return(oListaSaludContratoPlan); } catch (Exception ex) { throw new Exception(); } finally { GenericDataAccess.CerrarConexion(oCommand, null); } }
public bool Actualizar(ENUsuario oENSociedad) { DbCommand oCommand = null /* TODO Change to default(_) if this is not a reference type */; try { oCommand = GenericDataAccess.CreateCommand(dataProviderName, connectionString, "USP_Usuario_Actualizar"); GenericDataAccess.AgregarParametro(oCommand, "@int_IdUsuario", oENSociedad.int_IdUsuario, TipoParametro.INT, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@var_Nombre", oENSociedad.var_Nombre, TipoParametro.STR, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@var_Apellidos", oENSociedad.var_Apellidos, TipoParametro.STR, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@var_Mail", oENSociedad.var_Mail, TipoParametro.STR, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@bit_Sexo", oENSociedad.bit_Sexo, TipoParametro.BIT, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@int_Estado", oENSociedad.int_Estado, TipoParametro.INT, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@var_Password", oENSociedad.var_Password, TipoParametro.STR, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@dtm_FechaNacimiento", oENSociedad.dtm_FechaNacimiento, TipoParametro.DT, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@var_DNI", oENSociedad.var_DNI, TipoParametro.STR, Direccion.INPUT); if (GenericDataAccess.ExecuteNonQuery(oCommand) > 0) { return(true); } else { return(false); } } catch (Exception ex) { throw new ManejoExcepciones(ex); } finally { GenericDataAccess.CerrarConexion(oCommand, null /* TODO Change to default(_) if this is not a reference type */); } }
public bool Insertar(ENSCTREjecutivos oENSCTREjecutivos) { DbCommand oCommand = null; try { oCommand = GenericDataAccess.CreateCommand(dataProviderName, connectionString, "usp_GenSCTREjecutivos_ins"); GenericDataAccess.AgregarParametro(oCommand, "@argCodigoEjecutivo", oENSCTREjecutivos.CodigoEjecutivo, TipoParametro.STR, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@argCodigoVendedor", oENSCTREjecutivos.CodigoVendedor, TipoParametro.STR, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@argDestino", oENSCTREjecutivos.Destino, TipoParametro.STR, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@argNombreEjecutivo", oENSCTREjecutivos.NombreEjecutivo, TipoParametro.STR, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@argErrorCode", 1, TipoParametro.INT, Direccion.OUTPUT); if (GenericDataAccess.ExecuteNonQuery(oCommand) > 0) { return(true); } else { return(false); } } catch (Exception ex) { throw new Excepciones.ManejoExcepciones(ex); } finally { GenericDataAccess.CerrarConexion(oCommand, null); } }
public ENSaludCentroCostos ObtenerUnoCotizacion(string CodigoCliente, string CodigoCotizacion, string CodigoCentroCosto) { DbCommand oCommand = null; ENSaludCentroCostos oENSaludCentroCostos = new ENSaludCentroCostos(); try { oCommand = GenericDataAccess.CreateCommand(dataProviderName, connectionString, "usp_GenSaludCentroCostos_sel_uno"); GenericDataAccess.AgregarParametro(oCommand, "@argCodigoCliente", CodigoCliente, TipoParametro.STR, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@argCodigoCentroCosto", CodigoCentroCosto, TipoParametro.STR, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@argCodigoCotizacion", CodigoCotizacion, TipoParametro.STR, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@argErrorCode ", 1, TipoParametro.INT, Direccion.OUTPUT); DbDataReader oDataReader = GenericDataAccess.ExecuteReader(oCommand); if (oDataReader.Read()) { oENSaludCentroCostos.CodigoCentroCosto = oDataReader["CodigoCentroCosto"].ToString(); oENSaludCentroCostos.CodigoCliente = oDataReader["CodigoCliente"].ToString(); oENSaludCentroCostos.DescripcionCentroCosto = oDataReader["DescripcionCentroCosto"].ToString(); oENSaludCentroCostos.RazonSocial = oDataReader["RazonSocial"].ToString(); oENSaludCentroCostos.RUC = oDataReader["RUC"].ToString(); } return(oENSaludCentroCostos); } catch (Exception ex) { throw new Exception(); } finally { GenericDataAccess.CerrarConexion(oCommand, null); } }
public ENCanales ObtenerUno(int id) { DbCommand oCommand = null; ENCanales oENCanales = new ENCanales(); try { oCommand = GenericDataAccess.CreateCommand(dataProviderName, connectionString, "usp_GenCanales_Sel_uno"); GenericDataAccess.AgregarParametro(oCommand, "@argIDCanal", id, TipoParametro.INT, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@argErrorCode", 1, TipoParametro.INT, Direccion.OUTPUT); DbDataReader oDataReader = GenericDataAccess.ExecuteReader(oCommand); if (oDataReader.Read()) { //ENCanales oEnListaCanales = new ENCanales(); oENCanales.DescripcionCanal = oDataReader["DescripcionCanal"].ToString(); oENCanales.IDCanal = Convert.ToInt32(oDataReader["IDCanal"]); oENCanales.IdSociedad = Convert.ToInt32(oDataReader["IdSociedad"]); oENCanales.IdPersona = Convert.ToInt32(oDataReader["IdPersona"]); oENCanales.RazonSocial = oDataReader["RazonSocial"].ToString(); } return(oENCanales); } catch (Exception ex) { throw new Exception(); } finally { GenericDataAccess.CerrarConexion(oCommand, null); } }
public bool Actualizar(ENSaludContratoPlan oENSaludContratoPlan) { DbCommand oCommand = null; try { oCommand = GenericDataAccess.CreateCommand(dataProviderName, connectionString, "usp_GenSaludContratoPlan_upd"); GenericDataAccess.AgregarParametro(oCommand, "@argCodigoContrato", oENSaludContratoPlan.CodigoContrato, TipoParametro.STR, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@argCodigoPlan", oENSaludContratoPlan.CodigoPlanSC, TipoParametro.STR, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@argFechaFinContratoPlan", oENSaludContratoPlan.FechaFinContratoPlan, TipoParametro.DT, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@argFechaInicioContratoPlan", oENSaludContratoPlan.FechaInicioContratoPlan, TipoParametro.DT, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@argErrorCode", 1, TipoParametro.INT, Direccion.OUTPUT); if (GenericDataAccess.ExecuteNonQuery(oCommand) > 0) { return(true); } else { return(false); } } catch (Exception ex) { throw new Excepciones.ManejoExcepciones(ex); } finally { GenericDataAccess.CerrarConexion(oCommand, null); } }
public bool Eliminar(int Id) { DbCommand oCommand = null /* TODO Change to default(_) if this is not a reference type */; try { oCommand = GenericDataAccess.CreateCommand(dataProviderName, connectionString, "USP_Usuario_Eliminar"); GenericDataAccess.AgregarParametro(oCommand, "@int_IdUsuario", Id, TipoParametro.INT, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@int_Estado", 2, TipoParametro.INT, Direccion.INPUT); if (GenericDataAccess.ExecuteNonQuery(oCommand) > 0) { return(true); } else { return(false); } } catch (Exception ex) { throw new ManejoExcepciones(ex); } finally { GenericDataAccess.CerrarConexion(oCommand, null /* TODO Change to default(_) if this is not a reference type */); } }
public ENUbigeoDpto ObtenerDptoUno(string CodigoDpto) { DbCommand oCommand = null; ENUbigeoDpto oENUbigeoDpto = new ENUbigeoDpto(); try { oCommand = GenericDataAccess.CreateCommand(dataProviderName, connectionString, "usp_SCTR_Ubigeo_sel_uno"); GenericDataAccess.AgregarParametro(oCommand, "@argCodDpto", CodigoDpto, TipoParametro.STR, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@argCodProv", "", TipoParametro.STR, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@argCodDist", "", TipoParametro.STR, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@argErrorCode", 1, TipoParametro.INT, Direccion.OUTPUT); DbDataReader oDataReader = GenericDataAccess.ExecuteReader(oCommand); while (oDataReader.Read()) { oENUbigeoDpto.CodigoDpto = oDataReader["CodigoDpto"].ToString(); oENUbigeoDpto.DescripcionDpto = oDataReader["Nombre"].ToString(); } return(oENUbigeoDpto); } catch (Exception ex) { throw new Exception(); } finally { GenericDataAccess.CerrarConexion(oCommand, null); } }
public List <ENUbigeoProv> ObtenerProv(string codDpto) { DbCommand oCommand = null /* TODO Change to default(_) if this is not a reference type */; List <ENUbigeoProv> oListaProv = new List <ENUbigeoProv>(); try { oCommand = GenericDataAccess.CreateCommand(dataProviderName, connectionString, "usp_SCTR_Ubigeo_sel"); GenericDataAccess.AgregarParametro(oCommand, "@argCodDpto", codDpto, TipoParametro.STR, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@argCodProv", "", TipoParametro.STR, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@argErrorCode", 1, TipoParametro.INT, Direccion.OUTPUT); DbDataReader oDataReader = GenericDataAccess.ExecuteReader(oCommand); while (oDataReader.Read()) { ENUbigeoProv oENListaProv = new ENUbigeoProv(); oENListaProv.CodigoProv = oDataReader["CodProv"].ToString(); oENListaProv.DescripcionProv = oDataReader["Nombre"].ToString(); oListaProv.Add(oENListaProv); } return(oListaProv); } catch (Exception ex) { throw new Exception(); } finally { GenericDataAccess.CerrarConexion(oCommand, null /* TODO Change to default(_) if this is not a reference type */); } }
public List <ENSociedades> ObtenerTodos() { DbCommand oCommand = null; List <ENSociedades> oListaSociedades = new List <ENSociedades>(); try { oCommand = GenericDataAccess.CreateCommand(dataProviderName, connectionString, "usp_GenSociedades_sel"); GenericDataAccess.AgregarParametro(oCommand, "@argErrorCode ", 1, TipoParametro.INT, Direccion.OUTPUT); DbDataReader oDataReader = GenericDataAccess.ExecuteReader(oCommand); while (oDataReader.Read()) { ENSociedades oEnListaSociedades = new ENSociedades(); oEnListaSociedades.IdSociedad = Convert.ToInt32(oDataReader["IdSociedad"]); oEnListaSociedades.IdPersona = Convert.ToInt32(oDataReader["IdPersona"]); oEnListaSociedades.CodigoIAFAS = oDataReader["CodigoIAFAS"].ToString(); oEnListaSociedades.RazonSocial = oDataReader["RazonSocial"].ToString(); oListaSociedades.Add(oEnListaSociedades); } return(oListaSociedades); } catch (Exception ex) { throw new Exception(); } finally { GenericDataAccess.CerrarConexion(oCommand, null); } }
public bool Actualizar(ENSCTRCorredor oENSCTRCorredor) { DbCommand oCommand = null; try { oCommand = GenericDataAccess.CreateCommand(dataProviderName, connectionString, "usp_GenSCTRCorredor_upd"); GenericDataAccess.AgregarParametro(oCommand, "@argCodigoCorredor", oENSCTRCorredor.CodigoCorredor, TipoParametro.STR, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@argDescripcionCorredor", oENSCTRCorredor.DescripcionCorredor, TipoParametro.STR, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@argErrorCode", 1, TipoParametro.INT, Direccion.OUTPUT); if (GenericDataAccess.ExecuteNonQuery(oCommand) > 0) { return(true); } else { return(false); } } catch (Exception ex) { throw new Excepciones.ManejoExcepciones(ex); } finally { GenericDataAccess.CerrarConexion(oCommand, null); } }
public List <ENCIIUEspecifica> ObtenerTodosEspecifica(string codGrupo) { DbCommand oCommand = null /* TODO Change to default(_) if this is not a reference type */; List <ENCIIUEspecifica> oLista = new List <ENCIIUEspecifica>(); try { oCommand = GenericDataAccess.CreateCommand(dataProviderName, connectionString, "usp_SCTR_CIIU_sel"); GenericDataAccess.AgregarParametro(oCommand, "@argTipo", "2", TipoParametro.STR, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@argCodGrupo", codGrupo, TipoParametro.STR, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@argErrorCode", 1, TipoParametro.INT, Direccion.OUTPUT); DbDataReader oDataReader = GenericDataAccess.ExecuteReader(oCommand); while (oDataReader.Read()) { ENCIIUEspecifica oENLista = new ENCIIUEspecifica(); oENLista.CodigoCIIU = oDataReader["CodigoCIIU"].ToString(); oENLista.DescripcionCIIU = oDataReader["DescripcionCIIU"].ToString(); oLista.Add(oENLista); } return(oLista); } catch (Exception ex) { throw new Exception(); } finally { GenericDataAccess.CerrarConexion(oCommand, null /* TODO Change to default(_) if this is not a reference type */); } }
public bool Eliminar(int IdSociedad) { DbCommand oCommand = null /* TODO Change to default(_) if this is not a reference type */; try { oCommand = GenericDataAccess.CreateCommand(dataProviderName, connectionString, "usp_GenSociedades_upd"); GenericDataAccess.AgregarParametro(oCommand, "@IdSociedad", IdSociedad, TipoParametro.INT, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@ErrorCode", 1, TipoParametro.INT, Direccion.OUTPUT); if (GenericDataAccess.ExecuteNonQuery(oCommand) > 0) { return(true); } else { return(false); } } catch (Exception ex) { throw new Excepciones.ManejoExcepciones(ex); } finally { GenericDataAccess.CerrarConexion(oCommand, null /* TODO Change to default(_) if this is not a reference type */); } }
public ENCIIUPrincipal ObtenerPrincipalUno(string CodigoGrupoCIUU) { DbCommand oCommand = null; ENCIIUPrincipal oENCIIUPrincipal = new ENCIIUPrincipal(); try { oCommand = GenericDataAccess.CreateCommand(dataProviderName, connectionString, "usp_SCTR_Ubigeo_sel_uno"); GenericDataAccess.AgregarParametro(oCommand, "@argTipo", "1", TipoParametro.STR, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@argCodGrupo", CodigoGrupoCIUU, TipoParametro.STR, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@argCodCIIU", "", TipoParametro.STR, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@argErrorCode", 1, TipoParametro.INT, Direccion.OUTPUT); DbDataReader oDataReader = GenericDataAccess.ExecuteReader(oCommand); while (oDataReader.Read()) { oENCIIUPrincipal.CodigoCIIU = oDataReader["CodigoCIIU"].ToString(); oENCIIUPrincipal.DescripcionCIIU = oDataReader["DescripcionCIIU"].ToString(); } return(oENCIIUPrincipal); } catch (Exception ex) { throw new Exception(); } finally { GenericDataAccess.CerrarConexion(oCommand, null); } }
public ENTipoCliente ObtenerUno(string CodigoTipoCliente) { DbCommand oCommand = null; ENTipoCliente oENTipoCliente = new ENTipoCliente(); try { oCommand = GenericDataAccess.CreateCommand(dataProviderName, connectionString, "usp_GenTipoCliente_sel"); GenericDataAccess.AgregarParametro(oCommand, "@argCodigoTipoCliente", oENTipoCliente.CodigoTipoCliente, TipoParametro.STR, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@argErrorCode ", 1, TipoParametro.INT, Direccion.OUTPUT); DbDataReader oDataReader = GenericDataAccess.ExecuteReader(oCommand); if (oDataReader.Read()) { oENTipoCliente.CampoClave = oDataReader["CampoClave"].ToString(); oENTipoCliente.CodigoTipoCliente = oDataReader["CodigoTipoCliente"].ToString(); oENTipoCliente.DescripcionTipoCliente = oDataReader["DescripcionTipoCliente"].ToString(); oENTipoCliente.MostrarLogin = oDataReader["MostrarLogin"].ToString(); oENTipoCliente.NombreTabla = oDataReader["NombreTabla"].ToString(); } return(oENTipoCliente); } catch (Exception ex) { throw new Exception(); } finally { GenericDataAccess.CerrarConexion(oCommand, null); } }
public bool Actualizar(ENTipoCliente oENTipoCliente) { DbCommand oCommand = null; try { oCommand = GenericDataAccess.CreateCommand(dataProviderName, connectionString, "usp_GenTipoCliente_upd"); GenericDataAccess.AgregarParametro(oCommand, "@argCampoClave", oENTipoCliente.CampoClave, TipoParametro.STR, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@argCodigoTipoCliente", oENTipoCliente.CodigoTipoCliente, TipoParametro.STR, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@argDescripcionTipoCliente", oENTipoCliente.DescripcionTipoCliente, TipoParametro.STR, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@argMostrarLogin", oENTipoCliente.MostrarLogin, TipoParametro.STR, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@argNombreTabla", oENTipoCliente.NombreTabla, TipoParametro.STR, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@argErrorCode", 1, TipoParametro.INT, Direccion.OUTPUT); if (GenericDataAccess.ExecuteNonQuery(oCommand) > 0) { return(true); } else { return(false); } } catch (Exception ex) { throw new Excepciones.ManejoExcepciones(ex); } finally { GenericDataAccess.CerrarConexion(oCommand, null); } }
public bool Insertar(ENCanales oENCanal) { DbCommand oCommand = null /* TODO Change to default(_) if this is not a reference type */; try { oCommand = GenericDataAccess.CreateCommand(dataProviderName, connectionString, "usp_GenCanales_ins"); GenericDataAccess.AgregarParametro(oCommand, "@argDescripcionCanal", oENCanal.DescripcionCanal, TipoParametro.STR, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@argIDSociedad", oENCanal.IdSociedad, TipoParametro.INT, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@argErrorCode", 1, TipoParametro.INT, Direccion.OUTPUT); if (GenericDataAccess.ExecuteNonQuery(oCommand) > 0) { return(true); } else { return(false); } } catch (Exception ex) { throw new Excepciones.ManejoExcepciones(ex); } finally { GenericDataAccess.CerrarConexion(oCommand, null /* TODO Change to default(_) if this is not a reference type */); } }
public ENUsuario ObtenerUno(int id) { DbCommand oCommand = null; ENUsuario oENUsuario = new ENUsuario(); try { oCommand = GenericDataAccess.CreateCommand(dataProviderName, connectionString, "USP_Usuario_ObtenerUnoJP"); GenericDataAccess.AgregarParametro(oCommand, "@int_IdUsuario", id, TipoParametro.INT, Direccion.INPUT); DbDataReader oDataReader = GenericDataAccess.ExecuteReader(oCommand); if (oDataReader.Read()) { oENUsuario.int_IdUsuario = Convert.ToInt32(oDataReader["int_IdUsuario"]); oENUsuario.var_Nombre = oDataReader["var_Nombre"].ToString(); oENUsuario.var_Apellidos = oDataReader["var_Apellidos"].ToString(); oENUsuario.var_Mail = oDataReader["var_Mail"].ToString(); oENUsuario.bit_Sexo = Convert.ToBoolean(oDataReader["bit_Sexo"]); oENUsuario.int_Estado = Convert.ToInt32(oDataReader["int_Estado"]); oENUsuario.var_Password = oDataReader["var_Password"].ToString(); oENUsuario.dtm_FechaNacimiento = Convert.ToDateTime(oDataReader["dtm_FechaNacimiento"]); oENUsuario.var_DNI = oDataReader["var_DNI"].ToString(); } return(oENUsuario); } catch (Exception ex) { throw new Exception(); } finally { GenericDataAccess.CerrarConexion(oCommand, null); } }
public bool Actualizar(ENSaludContratos oENSaludContratos) { DbCommand oCommand = null; string sCodigoCotizacion = ""; try { oCommand = GenericDataAccess.CreateCommand(dataProviderName, connectionString, "sp_Cli_ContratoGrabarContrato"); GenericDataAccess.AgregarParametro(oCommand, "@CodigoCliente", oENSaludContratos.CodigoCliente, TipoParametro.STR, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@CodigoContrato", oENSaludContratos.CodigoContrato, TipoParametro.STR, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@CodigoCotizacion", sCodigoCotizacion, TipoParametro.STR, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@CodigoTipoContrato", oENSaludContratos.CodigoTipoContrato, TipoParametro.STR, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@InicioVigencia", oENSaludContratos.InicioVigencia.ToString("dd/MM/yyyy"), TipoParametro.STR, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@FinalVigencia", oENSaludContratos.FinVigencia.ToString("dd/MM/yyyy"), TipoParametro.STR, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@CodigoCorredor", oENSaludContratos.CodigoCorredor, TipoParametro.STR, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@CodigoEjecutivo", oENSaludContratos.CodigoEjecutivo, TipoParametro.STR, Direccion.INPUT); //GenericDataAccess.AgregarParametro(oCommand,"@argErrorCode", 1, TipoParametro.INT, Direccion.OUTPUT); if (GenericDataAccess.ExecuteNonQuery(oCommand) > 0) { return(true); } else { return(false); } } catch (Exception ex) { throw new Excepciones.ManejoExcepciones(ex); } finally { GenericDataAccess.CerrarConexion(oCommand, null); } }
public List <ENSaludPlanesConsulta> ObtenerTodos() { DbCommand oCommand = null /* TODO Change to default(_) if this is not a reference type */; List <ENSaludPlanesConsulta> oListaSaludPlanesConsulta = new List <ENSaludPlanesConsulta>(); try { oCommand = GenericDataAccess.CreateCommand(dataProviderName, connectionString, "sp_TipoPlan_ObtenerTodos"); GenericDataAccess.AgregarParametro(oCommand, "@ErrorCode", 1, TipoParametro.INT, Direccion.OUTPUT); DbDataReader oDataReader = GenericDataAccess.ExecuteReader(oCommand); while (oDataReader.Read()) { ENSaludPlanesConsulta oEnListaSaludPlanesConsulta = new ENSaludPlanesConsulta(); oEnListaSaludPlanesConsulta.CodigoPlan = oDataReader["IdTipoPlan"].ToString(); oEnListaSaludPlanesConsulta.DescripcionPlan = oDataReader["DescripcionTipo"].ToString(); oEnListaSaludPlanesConsulta.InicioVigencia = DateTime.Parse(oDataReader["InicioVigencia"].ToString()); oEnListaSaludPlanesConsulta.FinVigencia = DateTime.Parse(oDataReader["FinVigencia"].ToString()); oListaSaludPlanesConsulta.Add(oEnListaSaludPlanesConsulta); } return(oListaSaludPlanesConsulta); } catch (Exception ex) { throw new Exception(); } finally { GenericDataAccess.CerrarConexion(oCommand, null /* TODO Change to default(_) if this is not a reference type */); } }
public ENSCTREjecutivos ObtenerUno(string CodigoEjecutivo) { DbCommand oCommand = null; ENSCTREjecutivos oENSCTREjecutivos = new ENSCTREjecutivos(); try { oCommand = GenericDataAccess.CreateCommand(dataProviderName, connectionString, "usp_GenSCTREjecutivos_sel"); GenericDataAccess.AgregarParametro(oCommand, "@argCodigoEjecutivo", oENSCTREjecutivos.CodigoEjecutivo, TipoParametro.STR, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@argErrorCode ", 1, TipoParametro.INT, Direccion.OUTPUT); DbDataReader oDataReader = GenericDataAccess.ExecuteReader(oCommand); if (oDataReader.Read()) { oENSCTREjecutivos.CodigoEjecutivo = oDataReader["CodigoEjecutivo"].ToString(); oENSCTREjecutivos.CodigoVendedor = oDataReader["CodigoVendedor"].ToString(); oENSCTREjecutivos.Destino = oDataReader["Destino"].ToString(); oENSCTREjecutivos.NombreEjecutivo = oDataReader["NombreEjecutivo"].ToString(); } return(oENSCTREjecutivos); } catch (Exception ex) { throw new Exception(); } finally { GenericDataAccess.CerrarConexion(oCommand, null); } }
public bool Eliminar(string CodigoSexo) { DbCommand oCommand = null; try { oCommand = GenericDataAccess.CreateCommand(dataProviderName, connectionString, "usp_GenSaludSexo_del"); GenericDataAccess.AgregarParametro(oCommand, "@argCodigoSexo", CodigoSexo, TipoParametro.STR, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@argErrorCode", 1, TipoParametro.INT, Direccion.OUTPUT); if (GenericDataAccess.ExecuteNonQuery(oCommand) > 0) { return(true); } else { return(false); } } catch (Exception ex) { throw new Excepciones.ManejoExcepciones(ex); } finally { GenericDataAccess.CerrarConexion(oCommand, null); } }
public ENSaludSexo ObtenerUno(string CodigoSexo) { DbCommand oCommand = null; ENSaludSexo oENSaludSexo = new ENSaludSexo(); try { oCommand = GenericDataAccess.CreateCommand(dataProviderName, connectionString, "usp_GenSaludSexo_sel"); GenericDataAccess.AgregarParametro(oCommand, "@argCodigoSexo", oENSaludSexo.CodigoSexo, TipoParametro.STR, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@argErrorCode ", 1, TipoParametro.INT, Direccion.OUTPUT); DbDataReader oDataReader = GenericDataAccess.ExecuteReader(oCommand); if (oDataReader.Read()) { oENSaludSexo.CodigoSexo = oDataReader["CodigoSexo"].ToString(); oENSaludSexo.DescripcionSexo = oDataReader["DescripcionSexo"].ToString(); } return(oENSaludSexo); } catch (Exception ex) { throw new Exception(); } finally { GenericDataAccess.CerrarConexion(oCommand, null); } }
public List <ENSaludSexo> ObtenerTodos() { DbCommand oCommand = null; List <ENSaludSexo> oListaSaludSexo = new List <ENSaludSexo>(); try { oCommand = GenericDataAccess.CreateCommand(dataProviderName, connectionString, "usp_GenSaludSexo_sel"); GenericDataAccess.AgregarParametro(oCommand, "@argErrorCode ", 1, TipoParametro.INT, Direccion.OUTPUT); DbDataReader oDataReader = GenericDataAccess.ExecuteReader(oCommand); while (oDataReader.Read()) { ENSaludSexo oEnListaSaludSexo = new ENSaludSexo(); oEnListaSaludSexo.CodigoSexo = oDataReader["CodigoSexo"].ToString(); oEnListaSaludSexo.DescripcionSexo = oDataReader["DescripcionSexo"].ToString(); oListaSaludSexo.Add(oEnListaSaludSexo); } return(oListaSaludSexo); } catch (Exception ex) { throw new Exception(); } finally { GenericDataAccess.CerrarConexion(oCommand, null); } }
public bool Insertar(ENTipoContrato oENTipoContrato) { DbCommand oCommand = null; try { oCommand = GenericDataAccess.CreateCommand(dataProviderName, connectionString, "usp_GenTipoContrato_ins"); GenericDataAccess.AgregarParametro(oCommand, "@argCodigoTipoContrato", oENTipoContrato.CodigoTipoContrato, TipoParametro.STR, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@argDescripcionTipoContrato", oENTipoContrato.DescripcionTipoContrato, TipoParametro.STR, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@argErrorCode", 1, TipoParametro.INT, Direccion.OUTPUT); if (GenericDataAccess.ExecuteNonQuery(oCommand) > 0) { return(true); } else { return(false); } } catch (Exception ex) { throw new Excepciones.ManejoExcepciones(ex); } finally { GenericDataAccess.CerrarConexion(oCommand, null); } }
public bool Insertar(ENClientes oENClientes) { DbCommand oCommand = null; string sUbicubi = ""; string sCodigoUsuario = "grojas"; //oENClientes.Materno = ""; try { if (oENClientes.Ubicubi is null) { sUbicubi = oENClientes.CodigoDpto + oENClientes.CodigoProv + oENClientes.CodigoDist; } else { sUbicubi = oENClientes.Ubicubi; } oCommand = GenericDataAccess.CreateCommand(dataProviderName, connectionString, "usp_GenClientes_ins"); GenericDataAccess.AgregarParametro(oCommand, "@argCodigoCorredor", oENClientes.CodigoCorredor, TipoParametro.STR, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@argCodigoEjecutivo", oENClientes.CodigoEjecutivo, TipoParametro.STR, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@argCodigoTipoCliente", oENClientes.CodigoTipoCliente, TipoParametro.STR, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@argCodigoUsuario", sCodigoUsuario, TipoParametro.STR, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@argCorredorAgenciado", oENClientes.CorredorAgenciado, TipoParametro.STR, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@argDireccion", oENClientes.Direccion, TipoParametro.STR, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@argEmail", oENClientes.Email, TipoParametro.STR, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@argMaterno", oENClientes.Materno, TipoParametro.STR, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@argNombreCorto", oENClientes.NombreCorto, TipoParametro.STR, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@argNombres", oENClientes.Nombres, TipoParametro.STR, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@argPaginaWeb", oENClientes.PaginaWeb, TipoParametro.STR, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@argPaterno", oENClientes.Paterno, TipoParametro.STR, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@argPersonaContacto", oENClientes.PersonaContacto, TipoParametro.STR, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@argPersonaContactoCobranza", oENClientes.PersonaContactoCobranza, TipoParametro.STR, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@argRazonSocial", oENClientes.RazonSocial, TipoParametro.STR, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@argRucDni", oENClientes.RucDni, TipoParametro.STR, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@argTelefono1", oENClientes.Telefono1, TipoParametro.STR, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@argTelefono2", oENClientes.Telefono2, TipoParametro.STR, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@argUbicubi", sUbicubi, TipoParametro.STR, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@argErrorCode", 1, TipoParametro.INT, Direccion.OUTPUT); if (GenericDataAccess.ExecuteNonQuery(oCommand) > 0) { return(true); } else { return(false); } } catch (Exception ex) { throw new Excepciones.ManejoExcepciones(ex); } finally { GenericDataAccess.CerrarConexion(oCommand, null); } }
public ENClientes ObtenerUno(string CodigoCliente) { DbCommand oCommand = null; ENClientes oENClientes = new ENClientes(); try { oCommand = GenericDataAccess.CreateCommand(dataProviderName, connectionString, "usp_GenClientes_sel_uno"); GenericDataAccess.AgregarParametro(oCommand, "@argCodigoCliente", CodigoCliente, TipoParametro.STR, Direccion.INPUT); GenericDataAccess.AgregarParametro(oCommand, "@argErrorCode ", 1, TipoParametro.INT, Direccion.OUTPUT); DbDataReader oDataReader = GenericDataAccess.ExecuteReader(oCommand); if (oDataReader.Read()) { oENClientes.CodigoCliente = oDataReader["CodigoCliente"].ToString(); oENClientes.CodigoCorredor = oDataReader["CodigoCorredor"].ToString(); oENClientes.CodigoEjecutivo = oDataReader["CodigoEjecutivo"].ToString(); oENClientes.CodigoTipoCliente = oDataReader["CodigoTipoCliente"].ToString(); oENClientes.CodigoUsuario = oDataReader["CodigoUsuario"].ToString(); oENClientes.CorredorAgenciado = oDataReader["CorredorAgenciado"].ToString(); oENClientes.Direccion = oDataReader["Direccion"].ToString(); oENClientes.Email = oDataReader["Email"].ToString(); //oENClientes.FechaMovimiento = DateTime.Parse(oDataReader["FechaMovimiento"].ToString()); oENClientes.FechaMovimiento = oDataReader["FechaMovimiento"] == DBNull.Value ? DateTime.Now : Convert.ToDateTime(oDataReader["FechaMovimiento"]); oENClientes.Materno = oDataReader["Materno"].ToString(); oENClientes.NombreCorto = oDataReader["NombreCorto"].ToString(); oENClientes.Nombres = oDataReader["Nombres"].ToString(); oENClientes.PaginaWeb = oDataReader["PaginaWeb"].ToString(); oENClientes.Paterno = oDataReader["Paterno"].ToString(); oENClientes.PersonaContacto = oDataReader["PersonaContacto"].ToString(); oENClientes.PersonaContactoCobranza = oDataReader["PersonaContactoCobranza"].ToString(); oENClientes.RazonSocial = oDataReader["RazonSocial"].ToString(); oENClientes.RucDni = oDataReader["RucDni"].ToString(); oENClientes.Telefono1 = oDataReader["Telefono1"].ToString(); oENClientes.Telefono2 = oDataReader["Telefono2"].ToString(); oENClientes.Ubicubi = oDataReader["Ubicubi"].ToString(); if (oENClientes.Ubicubi.Length == 0) { oENClientes.Ubicubi = "150101"; } oENClientes.CodigoDpto = oENClientes.Ubicubi.Substring(0, 2); oENClientes.CodigoProv = oENClientes.Ubicubi.Substring(2, 2); oENClientes.CodigoDist = oENClientes.Ubicubi.Substring(4, 2); } return(oENClientes); } catch (Exception ex) { throw new Exception(); } finally { GenericDataAccess.CerrarConexion(oCommand, null); } }
public List <ENClientes> ObtenerTodos() { DbCommand oCommand = null; List <ENClientes> oListaClientes = new List <ENClientes>(); try { oCommand = GenericDataAccess.CreateCommand(dataProviderName, connectionString, "usp_GenClientes_sel"); GenericDataAccess.AgregarParametro(oCommand, "@argErrorCode ", 1, TipoParametro.INT, Direccion.OUTPUT); DbDataReader oDataReader = GenericDataAccess.ExecuteReader(oCommand); while (oDataReader.Read()) { ENClientes oEnListaClientes = new ENClientes(); oEnListaClientes.CodigoCliente = oDataReader["CodigoCliente"].ToString(); oEnListaClientes.CodigoCorredor = oDataReader["CodigoCorredor"].ToString(); oEnListaClientes.CodigoEjecutivo = oDataReader["CodigoEjecutivo"].ToString(); oEnListaClientes.CodigoTipoCliente = oDataReader["CodigoTipoCliente"].ToString(); oEnListaClientes.CodigoUsuario = oDataReader["CodigoUsuario"].ToString(); oEnListaClientes.CorredorAgenciado = oDataReader["CorredorAgenciado"].ToString(); oEnListaClientes.Direccion = oDataReader["Direccion"].ToString(); oEnListaClientes.Email = oDataReader["Email"].ToString(); //oEnListaClientes.FechaMovimiento = DateTime.Parse(oDataReader["FechaMovimiento"].ToString()); oEnListaClientes.FechaMovimiento = oDataReader["FechaMovimiento"] == DBNull.Value ? DateTime.Now : Convert.ToDateTime(oDataReader["FechaMovimiento"]); oEnListaClientes.Materno = oDataReader["Materno"].ToString(); oEnListaClientes.NombreCorto = oDataReader["NombreCorto"].ToString(); oEnListaClientes.Nombres = oDataReader["Nombres"].ToString(); oEnListaClientes.PaginaWeb = oDataReader["PaginaWeb"].ToString(); oEnListaClientes.Paterno = oDataReader["Paterno"].ToString(); oEnListaClientes.PersonaContacto = oDataReader["PersonaContacto"].ToString(); oEnListaClientes.PersonaContactoCobranza = oDataReader["PersonaContactoCobranza"].ToString(); oEnListaClientes.RazonSocial = oDataReader["RazonSocial"].ToString(); oEnListaClientes.RucDni = oDataReader["RucDni"].ToString(); oEnListaClientes.Telefono1 = oDataReader["Telefono1"].ToString(); oEnListaClientes.Telefono2 = oDataReader["Telefono2"].ToString(); oEnListaClientes.Ubicubi = oDataReader["Ubicubi"].ToString(); oListaClientes.Add(oEnListaClientes); } return(oListaClientes); } catch (Exception ex) { throw new Exception(); } finally { GenericDataAccess.CerrarConexion(oCommand, null); } }
public List <ENSaludPlanes> ObtenerTodos() { DbCommand oCommand = null; List <ENSaludPlanes> oListaSaludPlanes = new List <ENSaludPlanes>(); try { oCommand = GenericDataAccess.CreateCommand(dataProviderName, connectionString, "usp_GenSaludPlanes_sel"); GenericDataAccess.AgregarParametro(oCommand, "@argErrorCode ", 1, TipoParametro.INT, Direccion.OUTPUT); DbDataReader oDataReader = GenericDataAccess.ExecuteReader(oCommand); while (oDataReader.Read()) { ENSaludPlanes oEnListaSaludPlanes = new ENSaludPlanes(); oEnListaSaludPlanes.Capa = oDataReader["Capa"].ToString(); oEnListaSaludPlanes.Clase = oDataReader["Clase"].ToString(); oEnListaSaludPlanes.CodigoPlan = oDataReader["CodigoPlan"].ToString(); oEnListaSaludPlanes.CreadoPor = oDataReader["CreadoPor"].ToString(); oEnListaSaludPlanes.DescripcionPlan = oDataReader["DescripcionPlan"].ToString(); //oEnListaSaludPlanes.FechaCreacion=DateTime.Parse(oDataReader["FechaCreacion"].ToString()); oEnListaSaludPlanes.FechaCreacion = oDataReader["FechaCreacion"] == DBNull.Value ? DateTime.Now : Convert.ToDateTime(oDataReader["FechaCreacion"]); oEnListaSaludPlanes.FechaModificacion = oDataReader["FechaModificacion"] == DBNull.Value ? DateTime.Now : Convert.ToDateTime(oDataReader["FechaModificacion"]); //oEnListaSaludPlanes.FechaModificacion=DateTime.Parse(oDataReader["FechaModificacion"].ToString()); oEnListaSaludPlanes.FinVigencia = DateTime.Parse(oDataReader["FinVigencia"].ToString()); oEnListaSaludPlanes.InicioVigencia = DateTime.Parse(oDataReader["InicioVigencia"].ToString()); oEnListaSaludPlanes.ModificadoPor = oDataReader["ModificadoPor"].ToString(); oEnListaSaludPlanes.Mostrar = oDataReader["Mostrar"].ToString(); oEnListaSaludPlanes.Observaciones = oDataReader["Observaciones"].ToString(); oEnListaSaludPlanes.Oncologico = oDataReader["Oncologico"].ToString(); oEnListaSaludPlanes.TipoPlan = oDataReader["TipoPlan"].ToString(); oListaSaludPlanes.Add(oEnListaSaludPlanes); } return(oListaSaludPlanes); } catch (Exception ex) { throw new Exception(); } finally { GenericDataAccess.CerrarConexion(oCommand, null); } }