public List <FormaPago> GetFormaPago() { List <FormaPago> listaFormaPago = new List <FormaPago>(); string find = "EXECUTE traeFormaPago"; try { comando = new SqlCommand(find, objConexionDB.getCon()); objConexionDB.getCon().Open(); reader = comando.ExecuteReader(); while (reader.Read()) { FormaPago objFormaPago = new FormaPago(); objFormaPago.IdFormaPago = Convert.ToInt16(reader[0].ToString()); objFormaPago.NombreFormaPago = reader[1].ToString(); //objFormaPago.FechaHoraFormaPago = Convert.ToDateTime(reader[2].ToString()); listaFormaPago.Add(objFormaPago); } } catch (Exception) { throw; } finally { objConexionDB.getCon().Close(); objConexionDB.closeDB(); } return(listaFormaPago); }
public List <Unidad> GetUnidad() { List <Unidad> listaUnidad = new List <Unidad>(); string find = "EXECUTE traeUnidad"; try { comando = new SqlCommand(find, objConexionDB.getCon()); objConexionDB.getCon().Open(); reader = comando.ExecuteReader(); while (reader.Read()) { Unidad objUnidad = new Unidad(); objUnidad.IdUnidad = Convert.ToInt16(reader[0].ToString()); objUnidad.NombreUnidad = reader[1].ToString(); //objUnidad.FechaHoraUnidad = Convert.ToDateTime(reader[2].ToString()); listaUnidad.Add(objUnidad); } } catch (Exception) { throw; } finally { objConexionDB.getCon().Close(); objConexionDB.closeDB(); } return(listaUnidad); }
public List <DetalleIngreso> TraeDetalleIngreso(DetalleIngreso objDetalleIngresos) { List <DetalleIngreso> listaDetalleIngreso = new List <DetalleIngreso>(); //Ingreso objDetalleIngreso = new Ingreso(); string find = "EXECUTE TraeDetalleIngreso " + objDetalleIngresos.FolioIngreso; try { comando = new SqlCommand(find, objConexionDB.getCon()); objConexionDB.getCon().Open(); reader = comando.ExecuteReader(); while (reader.Read()) { DetalleIngreso objDetalleIngreso = new DetalleIngreso(); objDetalleIngreso.IdDetalleIngreso = Convert.ToInt64(reader[0].ToString()); objDetalleIngreso.FolioIngreso = Convert.ToInt64(reader[1].ToString()); objDetalleIngreso.RutMiembro = (reader[2].ToString()); objDetalleIngreso.NombreCompletoMiembro = (reader[3].ToString()); objDetalleIngreso.IdUnidad = Convert.ToInt64(reader[4].ToString()); objDetalleIngreso.NombreUnidad = (reader[5].ToString()); objDetalleIngreso.IdEvento = Convert.ToInt64(reader[6].ToString()); objDetalleIngreso.NombreEvento = (reader[7].ToString()); objDetalleIngreso.ObservacionesIngreso = (reader[8].ToString()); objDetalleIngreso.MontoIngreso = Convert.ToInt64(reader[9].ToString()); listaDetalleIngreso.Add(objDetalleIngreso); } } catch (Exception) { throw; } finally { objConexionDB.getCon().Close(); objConexionDB.closeDB(); } return(listaDetalleIngreso); }
public List <Miembro> FindAllTop50Miembro() { List <Miembro> listaMiembro = new List <Miembro>(); string find = "EXECUTE FindAllTop50Miembro"; try { comando = new SqlCommand(find, objConexionDB.getCon()); objConexionDB.getCon().Open(); reader = comando.ExecuteReader(); while (reader.Read()) { Miembro objMiembro = new Miembro(); objMiembro.RutMiembro = (reader[0].ToString()); objMiembro.NombresMiembro = reader[1].ToString(); objMiembro.PaternoMiembro = reader[2].ToString(); objMiembro.MaternoMiembro = reader[3].ToString(); objMiembro.NombreCompletoMiembro = reader[4].ToString(); objMiembro.UnidadMiembro = reader[5].ToString(); objMiembro.TipoMiembro = reader[6].ToString(); listaMiembro.Add(objMiembro); } } catch (Exception) { throw; } finally { objConexionDB.getCon().Close(); objConexionDB.closeDB(); } return(listaMiembro); }
public List <Ingreso> GenerarFolioIngreso(Ingreso objIngreso) { List <Ingreso> listaIngreso = new List <Ingreso>(); string find = "EXECUTE GenerarFolioIngreso 'lruiz'"; try { comando = new SqlCommand(find, objConexionDB.getCon()); objConexionDB.getCon().Open(); reader = comando.ExecuteReader(); while (reader.Read()) { objIngreso.FolioIngreso = Convert.ToInt64(reader[0].ToString()); /* objIngreso.NombreHabilitado = (reader[1].ToString()); * objIngreso.DireccionFocalizado = (reader[2].ToString()); * objIngreso.CiudadFocalizado = (reader[3].ToString()); * objIngreso.TelefonoFocalizado = (reader[4].ToString()); * objContactoHabilitado.EmailFocalizado = (reader[5].ToString()); */ listaIngreso.Add(objIngreso); } } catch (Exception) { throw; } finally { objConexionDB.getCon().Close(); objConexionDB.closeDB(); } return(listaIngreso); }
public void create(Plato objPlato) { string create = "insert into plato values('" + objPlato.nombrep + "','" + objPlato.descrip + "','" + objPlato.nivel + "','" + objPlato.foto + "','" + objPlato.precio + "','" + objPlato.idCategoria + "')"; try { comando = new SqlCommand(create, objConexionDB.getCon()); objConexionDB.getCon().Open(); comando.ExecuteNonQuery(); } catch (Exception error) { throw new Exception(error.Message); } finally { objConexionDB.getCon().Close(); objConexionDB.closeDB(); } }
public void create(Ingred objIngred) { string create = "insert into ingred values('" + objIngred.nombreI + "','" + objIngred.unidades + "','" + objIngred.almacen + "')"; try { comando = new SqlCommand(create, objConexionDB.getCon()); objConexionDB.getCon().Open(); comando.ExecuteNonQuery(); } catch (Exception error) { throw new Exception(error.Message); } finally { objConexionDB.getCon().Close(); objConexionDB.closeDB(); } }
public void create(Categoria objCategoria) { string create = "insert into categoria values('" + objCategoria.nombrec + "','" + objCategoria.descrip + "','" + objCategoria.encarg + "')"; try { comando = new SqlCommand(create, objConexionDB.getCon()); objConexionDB.getCon().Open(); comando.ExecuteNonQuery(); } catch (Exception error) { throw new Exception(error.Message); } finally { objConexionDB.getCon().Close(); objConexionDB.closeDB(); } }