Skip to content

Instantly share code, notes, and snippets.

View jofese's full-sized avatar

Joel Fernandez jofese

  • Jooycar
  • Peru
  • 22:03 (UTC -05:00)
View GitHub Profile
@jofese
jofese / pilaconclases
Created November 19, 2014 02:57
implementacion de una pila usando clases en c++
/*
Autor: Joel Fernandez
Ejercicio: Implementacion de una Pila usando Clases
IDE: Codeblocks
Web: http://codebotic.blogspot.com
*/
#include<iostream>
#include<cstdlib>
@jofese
jofese / Comandos de github
Last active March 28, 2019 20:52
Gist con los comandos prncipales de github
// 1.- configurar variables locales
$ git config --global user.name "tu_usuario"
$ git config --global user.email tu@email.com
/*
Generar clave ssh :
ssh-keygen
@jofese
jofese / solo_float_textfield.cs
Last active July 6, 2017 14:54
Validar Textfield numeros decimales C#
private void txtNumero_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar != (char)44 && e.KeyChar != (char)46 && !Char.IsDigit(e.KeyChar) && e.KeyChar != (char)8 && e.KeyChar != (char)47)
{
e.Handled = true;
}
}
@jofese
jofese / Combobox_con_dataset.cs
Created July 6, 2017 14:54
Llenar un combobox por dataset c#
public void LlenarComboMotivos()
{
try
{
//this.cbMotivo.Items.Clear();
this.cbMotivo.DataSource = null;
OracleDataAdapter daEmp = new OracleDataAdapter("select IDMOT, MOTNUM||' : '||MOT AS MOT, MOTNUM, FECREG, USENAM, HOSTNAME from SIA_MOTIVOS order by MOTNUM asc", cls_DatosLolcli.cadenaconexion);
DataSet dsEmp = new DataSet("SIA_MOTIVOS");
daEmp.Fill(dsEmp, "SIA_MOTIVOS");
DataTable dtEmp = dsEmp.Tables["SIA_MOTIVOS"];
@jofese
jofese / generar_reporte.cs
Created July 6, 2017 21:29
generar un reporte en c#
try
{
ReportDocument objReporte = new ReportDocument();
objReporte.Load(Application.StartupPath.ToString() + "\\Crystal Report\\rptRecalculo.rpt");
OracleConnection _conexion = new OracleConnection(cls_DatosOracle.cadenaconexion);
OracleDataAdapter _comando = new OracleDataAdapter(string.Format(@"SELECT PRFNUM AS PREFACTURA,
USUARIO,
NOMBRECOMPLETO,
REGRECALCULO,
@jofese
jofese / llenarcombobox.cs
Created August 1, 2017 21:59
llenar unh combobox
public void LlenarComboConvenios()
{
//Llenar combo
//this.cbxConvenios.Items.Clear();
this.cbxConvenios.DataSource = null;
cls_ConveniosDAO oConveniosDAO = new cls_ConveniosDAO();
List<cls_Convenios> ListaConvenios = new List<cls_Convenios>();
ListaConvenios = oConveniosDAO.ListarTodos();
@jofese
jofese / singleton.cs
Created August 2, 2017 14:38
patron singleton c#
private static UIMedicos_Convenios frmConvenios;
public static UIMedicos_Convenios CreateInstante(System.Windows.Forms.Form FormParent)
{
if (frmConvenios == null || frmConvenios.IsDisposed)
{
frmConvenios = new UIMedicos_Convenios();
}
frmConvenios.BringToFront();
frmConvenios.MdiParent = FormParent;
public List<cls_Convenios_Detalle> Buscar(int idConvenio)
{
SqlConnection _conexion = new SqlConnection(cls_Datos.cadenaconexion);
SqlCommand _comando = new SqlCommand("PA_Convenios_Detalle", _conexion) { CommandType = CommandType.StoredProcedure };
_comando.Parameters.AddWithValue("@idConvenio", SqlDbType.Int).Value = idConvenio;
_comando.Parameters.AddWithValue("@Tipo", SqlDbType.Int).Value = 1;
List<cls_Convenios_Detalle> ListaConvenioDetalle = new List<cls_Convenios_Detalle>();
try
{
public Boolean Insertar(cls_Convenios_Detalle oConveniosDetalle)
{
SqlConnection _conexion = new SqlConnection(cls_Datos.cadenaconexion);
SqlCommand _comando = new SqlCommand("PA_Convenios_Detalle", _conexion) { CommandType = CommandType.StoredProcedure };
_comando.Parameters.AddWithValue("@IdConvenio", SqlDbType.VarChar).Value = oConveniosDetalle.IdConvenio;
_comando.Parameters.AddWithValue("@IdAseguradora", SqlDbType.VarChar).Value = oConveniosDetalle.IdAseguradora;
_comando.Parameters.AddWithValue("@Fecreg", SqlDbType.DateTime).Value = oConveniosDetalle.Fecreg;
_comando.Parameters.AddWithValue("@Fecmov", SqlDbType.DateTime).Value = oConveniosDetalle.Fecmov;
_comando.Parameters.AddWithValue("@Hostname", SqlDbType.VarChar).Value = oConveniosDetalle.Hostname;
_comando.Parameters.AddWithValue("@Tipo", SqlDbType.Int).Value = 2;
private void UIMenuPrincipal_Load(object sender, EventArgs e)
{
cls_Versiones oVersiones = new cls_Versiones();
oVersiones.Hostname = Environment.MachineName;
oVersiones.Sia = cls_VariablesGlobales.versionaplicativo;
oVersiones.UltimoAcceso = DateTime.Now;
oVersiones.Usuario = Environment.UserName;
oVersiones.IP = GetLocalIPv4(NetworkInterfaceType.Ethernet);
if (objVersiones.getOne(oVersiones.Hostname))