Exemplo n.º 1
0
 public async Task <IActionResult> search([FromBody] filterCustomer objFilter)
 {
     try
     {
         return(Ok(await _objModule.search(objFilter)));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message.ConvertExceptionToErrorInfo()));
     }
 }
Exemplo n.º 2
0
        public async Task <IQueryable <vwCustomerModel> > search(filterCustomer objFilter)
        {
            try
            {
                string sql = string.Format("exec mas_customer_search {0} , '{1}' , '{2}' , '{3}' "
                                           , objFilter.customer_id == null ? "null" : objFilter.customer_id.ToString()
                                           , objFilter.customer_name == null ? "" : objFilter.customer_name.ToString()
                                           , objFilter.customer_surname == null ? "" : objFilter.customer_surname.ToString()
                                           , objFilter.Status);

                return(UnitOfWork.Context.Query <vwCustomerModel>().FromSql(sql));
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            finally
            {
            }
        }