public void AddToolDetails(Tool_Details obj) { ToolContext t_obj = new ToolContext(); t_obj.Tool_detail.Add(obj); t_obj.SaveChanges(); }
public List <Tool_Details> GetToolDetails() { List <Tool_Details> li = new List <Tool_Details>(); ToolContext t_obj = new ToolContext(); li = t_obj.Tool_detail.ToList(); return(li); }
public void DeleteToolDetails(Tool_Details obj) { ToolContext t_obj = new ToolContext(); var t = (from tool in t_obj.Tool_detail where tool.tool_id == obj.tool_id select tool).First(); t_obj.Tool_detail.Remove(t); t_obj.SaveChanges(); }
public void UpdateToolDetails(Tool_Details obj) { ToolContext t_obj = new ToolContext(); var t = (from tool in t_obj.Tool_detail where tool.tool_id == obj.tool_id select tool).First(); t.tool_name = obj.tool_name; t.tool_size = obj.tool_size; t.tool_type = obj.tool_type; t.tool_desc = obj.tool_desc; t_obj.SaveChanges(); }