예제 #1
0
파일: BOProducto.cs 프로젝트: omespef1/API
 public TOTransaction <List <TOProducto> > GetProductos(int Cla_cont, short emp_codi)
 {
     try
     {
         List <TOProducto> result = new List <TOProducto>(daoProducto.GetProductos(emp_codi, Cla_cont));
         if (result == null || !result.Any())
         {
             throw new Exception("No se encontraron productos");
         }
         return(new TOTransaction <List <TOProducto> >()
         {
             ObjTransaction = result, Retorno = 0, TxtError = ""
         });
     }
     catch (Exception ex)
     {
         return(new TOTransaction <List <TOProducto> >()
         {
             ObjTransaction = null, Retorno = 1, TxtError = ex.Message
         });
     }
 }