Esempio n. 1
0
 public int PutTabActions(int id, [FromBody] TabActions value)
 {
     try
     {
         EFTabActions ef_act = new EFTabActions(new EFDbContext());
         ef_act.Update(value);
         return(ef_act.Save());
     }
     catch (Exception e)
     {
         return(-1);
     }
 }
Esempio n. 2
0
 public int DeleteTabActions(int id)
 {
     try
     {
         EFTabActions ef_act = new EFTabActions(new EFDbContext());
         ef_act.Delete(id);
         return(ef_act.Save());
     }
     catch (Exception e)
     {
         return(-1);
     }
 }
Esempio n. 3
0
 public int PostTabActions([FromBody] TabActions value)
 {
     try
     {
         EFTabActions ef_act = new EFTabActions(new EFDbContext());
         ef_act.Add(value);
         return(ef_act.Save());
     }
     catch (Exception e)
     {
         return(-1);
     }
 }
Esempio n. 4
0
 public IHttpActionResult GetTabActions()
 {
     try
     {
         EFTabActions      ef_act = new EFTabActions(new EFDbContext());
         List <TabActions> list   = ef_act
                                    .Context
                                    .ToList()
                                    .Select(m => m.GetTabActions())
                                    .ToList();
         return(Ok(list));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }
Esempio n. 5
0
 public IHttpActionResult GetTabActionsOfID(int id)
 {
     try
     {
         EFTabActions ef_act = new EFTabActions(new EFDbContext());
         TabActions   action = ef_act
                               .Context
                               .Where(a => a.idAction == id)
                               .ToList()
                               .Select(m => m.GetTabActions())
                               .FirstOrDefault();
         return(Ok(action));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }