Exemplo n.º 1
0
 public async Task <IActionResult> search([FromBody] filterRoute objFilter)
 {
     try
     {
         return(Ok(await _objModule.search(objFilter)));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message.ConvertExceptionToErrorInfo()));
     }
 }
Exemplo n.º 2
0
        public async Task <IQueryable <vwRouteModel> > search(filterRoute objFilter)
        {
            try
            {
                string sql = string.Format("exec mas_route_search {0} , '{1}' , '{2}' ", objFilter.route_id == null ? "null" : objFilter.route_id.ToString(), objFilter.route_name == null ? "" : objFilter.route_name.ToString(), string.IsNullOrEmpty(objFilter.Status) ? "" : objFilter.Status);

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