示例#1
0
 public void Insert(Categoria categoria)
 {
     try
     {
         dCategoria            = new DCategoria();
         categoria.IdCategoria = dCategoria.Get().Max(x => x.IdCategoria) + 1;
         dCategoria.Insert(categoria);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
示例#2
0
 public bool Insert(Categoria categoria)
 {
     try
     {
         dCategoria            = new DCategoria();
         categoria.IdCategoria = dCategoria.Get().Max(x => x.IdCategoria) + 1;
         dCategoria.Insert(categoria);
     }
     catch (Exception ex)
     {
         throw ex;
     }
     return(true);
 }
示例#3
0
        public List <Categoria> Get(int idcategoria)
        {
            List <Categoria> categoriaList = null;

            try
            {
                dCategoria    = new DCategoria();
                categoriaList = dCategoria.Get();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(categoriaList);
        }