Пример #1
0
        private void FillTree()
        {
            Infragistics.Win.UltraWinTree.UltraTreeNode anode = null;
            Infragistics.Win.UltraWinTree.UltraTreeNode bnode = null;
            this.ultraTree1.ViewStyle = Infragistics.Win.UltraWinTree.ViewStyle.OutlookExpress;
             //   UltraTreeColumnSet commonColumnSet = ultraTree1.ColumnSettings.ColumnSets["ErgaColumnSet"];

            //Data Retrieval
            List<tblProject> listOfProjects = new List<tblProject>();
            tblProjectDap newDap = new tblProjectDap();
            listOfProjects = newDap.GetAllOrderByfldProjectTreeID();
            ultraTree1.Nodes.Clear();
            foreach (var Projectitem in listOfProjects)
            {
                int keyLength = 0;
                string parentKey = "";
                keyLength = Projectitem.fldProjectTreeID.Length;
                if (keyLength == 5)
                {
                    anode = ultraTree1.Nodes.Add(Projectitem.fldProjectTreeID, Projectitem.fldProjectName);
                    anode.Cells["fldProjectID"].Value = Projectitem.fldProjectID;
                    anode.Cells["fldProjectTreeCode"].Value = Projectitem.fldProjectTreeCode;
                    anode.Cells["fldProjectName"].Value = Projectitem.fldProjectName;
                    anode.Cells["fldDateStart"].Value = Projectitem.fldDateStart;
                    anode.Cells["fldIsCompleted"].Value = Projectitem.fldIsCompleted;
                }
                else
                {

                    parentKey = Projectitem.fldProjectTreeID.Left(keyLength - 5);
                    anode = ultraTree1.GetNodeByKey(parentKey);
                    bnode = anode.Nodes.Add(Projectitem.fldProjectTreeID, Projectitem.fldProjectName);
                    bnode.Cells["fldProjectID"].Value = Projectitem.fldProjectID;
                    bnode.Cells["fldProjectTreeCode"].Value = Projectitem.fldProjectTreeCode;
                    bnode.Cells["fldProjectName"].Value = Projectitem.fldProjectName;
                    bnode.Cells["fldDateStart"].Value = Projectitem.fldDateStart;
                    bnode.Cells["fldIsCompleted"].Value = Projectitem.fldIsCompleted;
                }
            }
        }
Пример #2
0
 //
 // GET: /Projects/
 public ActionResult Index2()
 {
     List<tblProject> listOfProjects = new List<tblProject>();
     tblProjectDap newDap = new tblProjectDap();
     listOfProjects = newDap.GetAllOrderByfldProjectTreeID();
     return View(listOfProjects);
 }
Пример #3
0
 public JsonResult getJSONProjects()
 {
     List<tblProject> listOfProjects = new List<tblProject>();
     tblProjectDap newDap = new tblProjectDap();
     listOfProjects = newDap.GetAllOrderByfldProjectTreeID();
     return Json(listOfProjects, JsonRequestBehavior.AllowGet);
 }