public List <ServicosBE> Select(ServicosBE obj, bool subitem = false) { if (!subitem) { return(new ServicosDao().Select <ServicosBE>(obj).ToList()); } else { var servico = CarregaSubItem(new ServicosDao().Select <ServicosBE>(obj).ToList()); return(servico); } }
List <ServicosBE> CarregaSubItem(List <ServicosBE> obj) { if (obj.Count > 0) { ServicosBE sub = new ServicosBE { conf_id = obj[0].conf_id }; foreach (var item in obj) { sub.serv_idsub = item.serv_id; item.SubMenu = new ServicosBLL().Select(sub); } } return(obj); }
public bool Delete(ServicosBE obj) { return(new ServicosDao().Delete(new { serv_id = obj.serv_id }).Value); }
public bool Update(ServicosBE obj) { return(new ServicosDao().Update(obj).Value); }
public ServicosBE Insert(ServicosBE obj) { obj.serv_id = new ServicosDao().Insert(obj); return(obj); }
public ServicosBE SelectId(ServicosBE obj) { return(new ServicosDao().SelectId <ServicosBE>(obj)); }