示例#1
0
        public void AgregarProv(ProveedorDAL objprov)
        {
            try
            {
                using (OracleConnection con = new Conexion().conexion())
                {
                    OracleCommand objCmd = new OracleCommand();
                    objCmd.Connection  = con;
                    objCmd.CommandText = "InsertarProveedor";
                    objCmd.CommandType = CommandType.StoredProcedure;
                    objCmd.Parameters.Add("p_nom", OracleDbType.Varchar2).Value         = nombre_proveedor;
                    objCmd.Parameters.Add("p_fono", OracleDbType.Int32).Value           = fono_proveedor;
                    objCmd.Parameters.Add("p_mail", OracleDbType.Varchar2).Value        = mail_proveedor;
                    objCmd.Parameters.Add("p_direccion", OracleDbType.Varchar2).Value   = direccion_proveedor;
                    objCmd.Parameters.Add("p_descripcion", OracleDbType.Varchar2).Value = descripcion;


                    con.Open();
                    objCmd.ExecuteNonQuery();
                    con.Close();
                }
            }
            catch (Exception ex)
            {
                System.Console.WriteLine("Exception: {0}", ex.ToString());
            }
        }
示例#2
0
 public void AlterInfoProv(ProveedorDAL objProv)
 {
     try
     {
         using (OracleConnection con = new Conexion().conexion())
         {
             OracleDataAdapter da = new OracleDataAdapter();
             OracleCommand     cm = new OracleCommand("alter_prov", con);
             cm.BindByName  = true;
             cm.CommandType = System.Data.CommandType.StoredProcedure;
             cm.Parameters.Add("p_nom", OracleDbType.Varchar2).Value  = nombre_proveedor;
             cm.Parameters.Add("p_fono", OracleDbType.Int32).Value    = fono_proveedor;
             cm.Parameters.Add("p_mail", OracleDbType.Varchar2).Value = mail_proveedor;
             cm.Parameters.Add("p_dir", OracleDbType.Varchar2).Value  = direccion_proveedor;
             cm.Parameters.Add("p_desc", OracleDbType.Varchar2).Value = descripcion;
             cm.Parameters.Add("id_", OracleDbType.Int32).Value       = id_proveedor;
             con.Open();
             int num = cm.ExecuteNonQuery();
             con.Close();
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine("" + ex);
     }
 }
示例#3
0
 public static ProveedorDAL Getinstancia()
 {
     if (instance == null)
     {
         instance = new ProveedorDAL();
     }
     return(instance);
 }