public bool AgregarPer(string rut, string username, int edad, char sex, bool ex_pre, String nomPc) { try { Cl_Persona per = new Cl_Persona(); per.Rut = rut; per.UserName = username; per.Edad = edad; per.Sexo = sex; per.Exp_prev = ex_pre; per.Computador = new Cl_Computador(nomPc); return per.Agregar(); } catch (Exception) { return false; } }
public bool EliminarPer(string rut) { try { Cl_Persona per = new Cl_Persona(); per.Rut = rut; return per.Eliminar(); } catch (Exception) { return false; } }
public bool BuscarPer(string rut) { Cl_Persona per = new Cl_Persona(); per.Rut = rut; return per.Buscar(); }
public List<Cl_Persona> ListadoNovatos() { try { List<Persona> pers = cone.Entidades.Persona.Where(x => x.exp_prev == false).ToList(); List<Cl_Persona> lista = new List<Cl_Persona>(); foreach (Persona item in pers) { Cl_Persona per = new Cl_Persona(); per.Edad = item.edad; per.Exp_prev = item.exp_prev; per.Rut = item.rut; per.Sexo = char.Parse(item.sexo.Trim()); per.UserName = item.username; lista.Add(per); } return lista; } catch (Exception) { return null; } }