Exemple #1
0
        public void AddToolDetails(Tool_Details obj)
        {
            ToolContext t_obj = new ToolContext();

            t_obj.Tool_detail.Add(obj);
            t_obj.SaveChanges();
        }
Exemple #2
0
        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();
        }
Exemple #3
0
        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();
        }