public static void CreateTreeElement(string name, int parentId) { string sql = @"exec dbo.AddBranch " + name + ", " + parentId.ToString() + ";"; SqlDataAccess.ExecuteData(sql); }
public static void ChangePosition(int Id, int Pos) { string sql = "exec ChangeOrder " + Id.ToString() + "," + Pos.ToString() + ";"; SqlDataAccess.ExecuteData(sql); }
public static void SetLastPosition(int Id) { string sql = "exec dbo.SetPositionToEnd " + Id.ToString(); SqlDataAccess.ExecuteData(sql); }
public static void ChangeParent(int id, int parent_id) { string sql = "update dbo.TreeElements set Parent_Id = " + parent_id.ToString() + " WHERE Id = " + id; SqlDataAccess.ExecuteData(sql); }
public static void ChangeName(string name, int id) { string sql = "update dbo.TreeElements set Name = '" + name + "' WHERE Id = " + id.ToString() + ";"; SqlDataAccess.ExecuteData(sql); }
public static void DeleteTreeElement(int id) { string sql = "exec dbo.DeleteTree " + id.ToString(); SqlDataAccess.ExecuteData(sql); }