Example #1
0
        public static void CreateTreeElement(string name, int parentId)
        {
            string sql = @"exec dbo.AddBranch " + name + ", " + parentId.ToString() + ";";


            SqlDataAccess.ExecuteData(sql);
        }
Example #2
0
        public static void ChangePosition(int Id, int Pos)
        {
            string sql = "exec ChangeOrder " + Id.ToString() + "," + Pos.ToString() + ";";

            SqlDataAccess.ExecuteData(sql);
        }
Example #3
0
        public static void SetLastPosition(int Id)
        {
            string sql = "exec dbo.SetPositionToEnd " + Id.ToString();

            SqlDataAccess.ExecuteData(sql);
        }
Example #4
0
        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);
        }
Example #5
0
        public static void ChangeName(string name, int id)
        {
            string sql = "update dbo.TreeElements set Name = '" + name + "' WHERE Id = " + id.ToString() + ";";

            SqlDataAccess.ExecuteData(sql);
        }
Example #6
0
        public static void DeleteTreeElement(int id)
        {
            string sql = "exec dbo.DeleteTree " + id.ToString();

            SqlDataAccess.ExecuteData(sql);
        }