Beispiel #1
0
        private List <Models.Project> GetDefaultList(string text, int level = 1, string parentProjectId = null)
        {
            BLL.ProjectBLL bll   = new BLL.ProjectBLL();
            string         Where = " ProjectLevel=@ProjectLevel ";

            List <OleDbParameter> Paralist = new List <OleDbParameter>();

            Paralist.Add(new OleDbParameter("ProjectLevel", level));
            if (!Utils.IsEmptyOrNull(parentProjectId))
            {
                Where += " and parentProjectId=@parentProjectId";
                Paralist.Add(new OleDbParameter("@parentProjectId", parentProjectId));
            }
            Where += " order by  ProjectId";
            DataTable             table = bll.GetData(Where, Paralist.ToArray());
            List <Models.Project> list  = new List <Models.Project>()
            {
                new Models.Project()
                {
                    ProjectId   = "",
                    ProjectName = text
                }
            };

            list.AddRange(ListSupport.ToList <Models.Project>(table));
            return(list);
        }
Beispiel #2
0
        private List <Models.ProjectDetails> GetDefaultDetailsList(string text, string projectId)
        {
            BLL.ProjectDetailsBLL bll   = new BLL.ProjectDetailsBLL();
            DataTable             table = null;

            //if (!Utils.IsEmptyOrNull(projectId))
            //{
            //    table = bll.GetData(" ProjectId=@ProjectId  ", new System.Data.OleDb.OleDbParameter("@parentProjectId", projectId));
            //}
            //else {
            //    table = bll.GetData();
            //}
            table = bll.GetDataByProjectId(this.comboBox1.SelectedValue.ToString(), this.comboBox2.SelectedValue.ToString(), this.comboBox3.SelectedValue.ToString());
            List <Models.ProjectDetails> list = new List <Models.ProjectDetails>()
            {
                new Models.ProjectDetails()
                {
                    DetailsId    = "",
                    ProjectId    = "",
                    DetailsTilte = text
                }
            };

            list.AddRange(ListSupport.ToList <Models.ProjectDetails>(table));
            return(list);
        }
 public void Execute(CommandCall commandCall, IEvaluator evaluator, IResultRecorder resultRecorder)
 {
     increaseLevel(evaluator);
     ListSupport listSupport = new ListSupport(commandCall);
     foreach (ListEntry listEntry in listSupport.GetListEntries())
     {
         commandCall.Element = listEntry.Element;
         if (listEntry.IsItem)
         {
             commandCall.Execute(evaluator, resultRecorder);
         }
         if (listEntry.IsList)
         {
             Execute(commandCall, evaluator, resultRecorder);
         }
     }
     decreaseLevel(evaluator);
 }
Beispiel #4
0
        public void Execute(CommandCall commandCall, IEvaluator evaluator, IResultRecorder resultRecorder)
        {
            increaseLevel(evaluator);
            ListSupport listSupport = new ListSupport(commandCall);

            foreach (ListEntry listEntry in listSupport.GetListEntries())
            {
                commandCall.Element = listEntry.Element;
                if (listEntry.IsItem)
                {
                    commandCall.Execute(evaluator, resultRecorder);
                }
                if (listEntry.IsList)
                {
                    Execute(commandCall, evaluator, resultRecorder);
                }
            }
            decreaseLevel(evaluator);
        }
 public void ListSupportsKnowsTheLengthOfAnyList()
 {
     var listSupport = new ListSupport();
     var list = new SimpleList<int> { 1, 2, 3, 4, 5, 6, 7 };
     Assert.AreEqual(list.Count, listSupport.GetLength(list));
 }
        public void ListSupportShouldGetAndSetItems()
        {
            var list = new SimpleList<int>();
            var test = new SimpleList<int>();

            for (var i = 0; i < 30; i++)
                list.Add(i);

            var listSupport = new ListSupport();
            var items = listSupport.GetItems(list);
            listSupport.SetItems(test, items);

            var matches = true;
            for (var i = 0; i < list.Count; i++)
            {
                if (list[i].Equals(test[i])) continue;
                matches = false;
                break;
            }

            Assert.IsTrue(matches);
        }
 public void ListSupportKnowsTheEnumerableMarkOfItself()
 {
     var listSupport = new ListSupport();
     Assert.AreEqual(ComplexTypeMark.List, listSupport.ComplexTypeMark);
 }