public void InsertarPromesaPago(PromesaPago entidad)
        {
			try
			{
				//Obtener DbCommand para ejcutar el Store Procedure
                using (DbCommand com = db.GetStoredProcCommand("Gestiones.InsertaPromesaPago"))
				{
					//Parametros
                    db.AddInParameter(com, "@IdGestion", DbType.Int32, entidad.IdGestion);
                    db.AddInParameter(com, "@IdCuenta", DbType.Int32, entidad.IdCuenta);
                    db.AddInParameter(com, "@fch_promoesa", DbType.DateTime, entidad.FchPromesa);
                    db.AddInParameter(com, "@Monto", DbType.Decimal, entidad.MontoPromesa);
                    db.AddInParameter(com, "@TipoCobro", DbType.Int32, entidad.idTipoCobro);
				
					//Ejecucion de la Consulta
					db.ExecuteNonQuery(com);

					//Cierre de la conexion y liberacion de memoria
					com.Dispose();
				}
			}
			catch (Exception ex)
			{
				throw ex;
			}
        }
        public void InsertarPromesaPago(PromesaPago entidad)
        {
			try
			{
				//Obtener DbCommand para ejcutar el Store Procedure
				using (DbCommand com = db.GetStoredProcCommand("NombreDelStrore"))
				{
					//Parametros
					//db.AddInParameter(com, "@Parametro", DbType.Tipo, entidad.Atributo);
				
					//Ejecucion de la Consulta
					db.ExecuteNonQuery(com);

					//Cierre de la conexion y liberacion de memoria
					com.Dispose();
				}
			}
			catch (Exception ex)
			{
				throw ex;
			}
        }
 public static void InsertarPromesaPago(PromesaPago entidad)
 {
     dal.InsertarPromesaPago(entidad);			
 }
        public PromesaPago ObtenerPromesaPago()
        {
			PromesaPago resultado = null;
			try
			{
				//Obtener DbCommand para ejcutar el Store Procedure
				using (DbCommand com = db.GetStoredProcCommand("NombreDelStrore"))
				{
					//Parametros
					//db.AddInParameter(com, "@Parametro", DbType.Tipo, entidad.Atributo);
				
					//Ejecucion de la Consulta
					using (IDataReader reader = db.ExecuteReader(com))
					{
						if (reader != null)
						{
							resultado = new PromesaPago();
							//Lectura de los datos del ResultSet
						}

						reader.Dispose();
					}

					//Cierre de la conexion y liberacion de memoria
					com.Dispose();
				}
			}
			catch (Exception ex)
			{
				throw ex;
			}
			return resultado;
        }
        public List<PromesaPago> ObtenerPromesaPago(int idCuenta)
        {
			List<PromesaPago> resultado = null;
			try
			{
				//Obtener DbCommand para ejcutar el Store Procedure
                using (DbCommand com = db.GetStoredProcCommand("Gestiones.Sel_PromesaPago"))
				{
					//Parametros
                    db.AddInParameter(com, "@IdCuenta", DbType.Int32, idCuenta);
				
					//Ejecucion de la Consulta
					using (IDataReader reader = db.ExecuteReader(com))
					{
						if (reader != null)
						{
							resultado = new List<PromesaPago>();
                            while (reader.Read())
                            {
                                PromesaPago promesa = new PromesaPago();
                                if (!reader.IsDBNull(0)) promesa.FchPromesa = Convert.ToDateTime(reader[0]);
                                if (!reader.IsDBNull(1)) promesa.MontoPromesa = Convert.ToDecimal(reader[1]);
                                if (!reader.IsDBNull(2)) promesa.TipoCobro = reader[2].ToString();
                                resultado.Add(promesa);
                            }
						}
                        reader.Close();
						reader.Dispose();
					}

					//Cierre de la conexion y liberacion de memoria
					com.Dispose();
				}
			}
			catch (Exception ex)
			{
				throw ex;
			}
			return resultado;
        }
Exemple #6
0
 public void insertarPromesaPago(PromesaPago promesa)
 {
     PromesaPagoBll.InsertarPromesaPago(promesa);
 }