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); } }
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); } }
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); } }
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)); } }
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)); } }