public entidad_datosi GetDatosImportantes(int codigo) { try { using (this.dt = new DataGymSisV1DataContext()) { var t = (from datosi in this.dt.datos_importantes where datosi.cod_cliente.Equals(codigo) select new { datosi }).Single(); entidad_datosi d = new entidad_datosi() { COD_DATOS = t.datosi.cod_datos, EDAD = t.datosi.edad, PESO = t.datosi.peso, TALLA = t.datosi.talla, CUELLO = t.datosi.cuello, BICEPS = t.datosi.biceps, TORAX = t.datosi.torax, CINTURA = t.datosi.cintura, ABS = t.datosi.abs, CADERA = t.datosi.cadera, PIERNA = t.datosi.pierna, PANTORRILLA = t.datosi.pantorrilla, PRESION_ARTERIAL = t.datosi.presion_arterial, COD_CLIENTE = t.datosi.cod_cliente, TIPO_SANGRE = t.datosi.tipo_sangre }; return(d); } } catch (Exception ex) { throw new Exception(ex.Message); } }
//obtener datos cliente public entidad_clientes GetDatosPersonales(int codigo) { try { using (this.dt = new DataGymSisV1DataContext()) { var t = (from cli in this.dt.cliente where cli.cod_cliente.Equals(codigo) select new { cli }).Single(); entidad_clientes c = new entidad_clientes() { CLIENTE_COD_CLIENTE = t.cli.cod_cliente, CLIENTE_NOMBRE = t.cli.nombre, CLIENTE_DIRECCION = t.cli.direccion, CLIENTE_CIUDAD = t.cli.ciudad, CLIENTE_TELEFONO = t.cli.telefono, CLIENTE_SEXO = t.cli.sexo, CLIENTE_CORREO = t.cli.correo, CLIENTE_FECHA_NAC = t.cli.fecha_nac, }; return(c); } } catch (Exception ex) { throw new Exception(ex.Message); } }
public int Insertar(entidad_antmedico ec) { try { using (this.dt = new DataGymSisV1DataContext()) { return(this.dt.PA_antecedentes_INSERT(ec.ANTECEDENTES_DESC, ec.DESCRIPCOPM_TIPO, ec.COD_CLIENTE)); } } catch (Exception ex) { throw ex; } }
//eliminar cliente public void Eliminar(int codigo) { try { using (this.dt = new DataGymSisV1DataContext()) { this.dt.PA_clientes_Delete(codigo); } } catch (Exception ex) { throw ex; } }
//editar cliente public void Editar(entidad_clientes ec) { try { using (this.dt = new DataGymSisV1DataContext()) { this.dt.PA_clientes_Update(ec.CLIENTE_NOMBRE, ec.CLIENTE_DIRECCION, ec.CLIENTE_CIUDAD, ec.CLIENTE_TELEFONO, ec.CLIENTE_SEXO, ec.CLIENTE_CORREO, ec.CLIENTE_FECHA_NAC, ec.CLIENTE_COD_CLIENTE); } } catch (Exception ex) { throw ex; } }
public int Insertar(entidad_clientes ec) { try { using (this.dt = new DataGymSisV1DataContext()) { return(this.dt.PA_clientes_Insert(ec.CLIENTE_NOMBRE, ec.CLIENTE_DIRECCION, ec.CLIENTE_CIUDAD, ec.CLIENTE_TELEFONO, ec.CLIENTE_SEXO, ec.CLIENTE_CORREO, ec.CLIENTE_FECHA_NAC, ec.HUELLA)); } } catch (Exception ex) { throw ex; } }
//eliminar cliente public void Eliminar(int id_inscripcion) { try { using (this.dt = new DataGymSisV1DataContext()) { //this.dt.PA_inscripcion_Delete(id_inscripcion); } } catch (Exception ex) { throw ex; } }
//insertar inscripcion /* public int Insertar() * { * try * { * using (this.dt = new DataGymSisV1DataContext()) * { * // return this.dt.PA_Inscripciones_Insert(); * } * } * catch (Exception ex) * { * throw ex; * } * }*/ public void Editar(int id_inscripcion, int id_cliente, string programa) { try { using (this.dt = new DataGymSisV1DataContext()) { // this.dt.PA_inscripcion_Update(id_inscripcion, id_cliente, programa); } } catch (Exception ex) { throw ex; } }
//insertar public int Insertar(entidad_membresia ec) { try { using (this.dt = new DataGymSisV1DataContext()) { return(this.dt.membresia_insert(ec.COD_CLIENTE, ec.TIPO_MEMBRESIA, ec.FECHA_INICIAL, ec.FECHA_FINAL, ec.COSTO, ec.DESCUENTO)); } } catch (Exception ex) { throw ex; } }
//editar public int Editar(entidad_datosi ec) { try { using (this.dt = new DataGymSisV1DataContext()) { return(this.dt.PA_datos_importantes_UPDATE(ec.EDAD, ec.PESO, ec.TALLA, ec.CUELLO, ec.BICEPS, ec.TORAX, ec.CINTURA, ec.ABS, ec.CADERA, ec.PIERNA, ec.PANTORRILLA, ec.PRESION_ARTERIAL, ec.TIPO_SANGRE, ec.COD_CLIENTE)); } } catch (Exception ex) { throw ex; } }
//mostrar todas las subscripciones public List <membresias> ListarMembresias() { try { using (this.dt = new DataGymSisV1DataContext()) { var t = from c in this.dt.membresias select c; return(t.ToList()); } } catch (Exception ex) { throw new Exception("Error al Listar\n " + ex.Message); } }
//biscar cliente por nombre public List <antecedentes_medicos> ListarAntecedentesMedicos(int codigo) { try { using (this.dt = new DataGymSisV1DataContext()) { var t = from c in this.dt.antecedentes_medicos where c.cod_cliente.Equals(codigo) select c; return(t.ToList()); } } catch (Exception ex) { throw new Exception("Error al Listar\n " + ex.Message); } }
//biscar cliente por nombre public List <VistaClientes> ListarClientes(String @buscar) { try { using (this.dt = new DataGymSisV1DataContext()) { var t = from c in this.dt.VistaClientes where c.NOMBRE.Contains(buscar) select c; return(t.ToList()); } } catch (Exception ex) { throw new Exception("Error al Listar\n " + ex.Message); } }
//biscar cliente por nombre public List <clientes_subscripciones> ListarSubs(DateTime inicio, DateTime fin) { try { using (this.dt = new DataGymSisV1DataContext()) { var t = from c in this.dt.clientes_subscripciones where (c.INICIO >= inicio.Date && c.TERMINA <= fin.Date) select c; return(t.ToList()); } } catch (Exception ex) { throw new Exception("Error al Listar\n " + ex.Message); } }
public List <membresia> ListarMembresia(int cliente) { try { using (this.dt = new DataGymSisV1DataContext()) { var t = from c in this.dt.membresia where c.cod_cliente.Equals(cliente) select c; return(t.ToList()); } } catch (Exception ex) { throw new Exception("Error al Listar\n " + ex.Message); } }
//obtener datos cliente public entidad_antmedico GetAntecedentesMedicos(int codigo) { try { using (this.dt = new DataGymSisV1DataContext()) { var t = (from am in this.dt.antecedentes_medicos where am.cod_cliente.Equals(codigo) select new { am }).Single(); entidad_antmedico a = new entidad_antmedico() { ANTECEDENTES_DESC = t.am.antecedente_desc, DESCRIPCOPM_TIPO = t.am.descripcion_tipos, }; return(a); } } catch (Exception ex) { throw new Exception(ex.Message); } }