Ejemplo n.º 1
0
        public int InsertarDesarrolladora(Desarrolladora entidad, int Accion)
        {
            int respuesta = 0;
			try
			{
				//Obtener DbCommand para ejcutar el Store Procedure
                using (DbCommand com = db.GetStoredProcCommand("AhorroVoluntario.ACBDesarrolladora"))
				{
					//Parametros
                    db.AddInParameter(com, "@Accion", DbType.Int32, Accion);
                    db.AddInParameter(com, "@NombreCorto", DbType.String, entidad.NombreCorto);
                    db.AddInParameter(com, "@RazonSocial", DbType.String, entidad.RazonSocial);
                    db.AddInParameter(com, "@RFC", DbType.String, entidad.RFC);
                    db.AddInParameter(com, "@Contacto", DbType.String, entidad.Contacto);
                    db.AddInParameter(com, "@email", DbType.String, entidad.Email);
                    db.AddInParameter(com, "@direccion", DbType.String, entidad.Direccion);
                    db.AddInParameter(com, "@NumExterior", DbType.String, entidad.NumExterior);
                    db.AddInParameter(com, "@NumInterior", DbType.String, entidad.NumInterior);
                    db.AddInParameter(com, "@idColonia", DbType.Int32, entidad.IdColonia);
                    db.AddInParameter(com, "@Telefono", DbType.String, entidad.Telefono);
                    db.AddInParameter(com, "@IdDesarrolladora", DbType.Int32, entidad.IdDesarrolladora);

                    //Ejecucion de la Consulta
                    using (IDataReader reader = db.ExecuteReader(com))
                    {
                        if (reader != null)
                        {

                            

                            //Lectura de los datos del ResultSet
                            while (reader.Read())
                            {


                                if (!reader.IsDBNull(0)) respuesta = Convert.ToInt32(reader[0]);


                            }
                        }
                        reader.Close();
                        reader.Dispose();
                    }

					//Cierre de la conexion y liberacion de memoria
					com.Dispose();
				}
			}
			catch (Exception ex)
			{
				throw ex;
			}
            return respuesta;
        }
Ejemplo n.º 2
0
        public static string InsertarDesarrolladora(Desarrolladora entidad, int Accion)
        {
            int Bandera = 0;
             Bandera = dal.InsertarDesarrolladora(entidad, Accion);
             string Mensaje = "";
             if (Bandera == 1)
             {
                 Mensaje =  "Desarrolladora insertada con éxito";
             }
             else
             {
                 Mensaje = "Error al insertar desarrolladora";
             }
             return Mensaje;

        }
Ejemplo n.º 3
0
        public void InsertarDesarrolladora(Desarrolladora 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;
			}
        }
Ejemplo n.º 4
0
        public Desarrolladora ObtenerDesarrolladora()
        {
			Desarrolladora 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 Desarrolladora();
							//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;
        }
Ejemplo n.º 5
0
 public static void InsertarDesarrolladora(Desarrolladora entidad)
 {
     dal.InsertarDesarrolladora(entidad);			
 }
Ejemplo n.º 6
0
 public string InsertaDesarrolladora(Desarrolladora entidad, int Accion)
 {
     return DesarrolladoraBll.InsertarDesarrolladora(entidad, Accion);
 }