Ejemplo n.º 1
0
 private void RefreshRequests()
 {
     _reqBLL = new RequestBusiness(_user);
     dgvRequests.DataSource = null;
     try
     {
         dgvRequests.DataSource = _reqBLL.GetAll();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Ejemplo n.º 2
0
 public Request[] GetAll()
 {
     try
     {
         using (var c = new RequestBusiness())
         {
             return(c.GetAll().ToArray());
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex);
         return(null);
     }
 }
Ejemplo n.º 3
0
 public IHttpActionResult Get(int id)
 {
     try
     {
         using (var c = new RequestBusiness())
         {
             var temp = c.GetAll().Where(s => s.Id == id).FirstOrDefault();
             if (temp == null)
             {
                 return(NotFound());
             }
             return(Ok(temp));
         }
     }
     catch (Exception ex)
     {
         return(BadRequest($"{ex}"));
     }
 }
Ejemplo n.º 4
0
 public IHttpActionResult Get()
 {
     try
     {
         using (var c = new RequestBusiness())
         {
             var templist = c.GetAll().ToList();
             if (templist == null)
             {
                 return(NotFound());
             }
             return(Ok(templist));
         }
     }
     catch (Exception ex)
     {
         return(BadRequest($"{ex}"));
     }
 }