Esempio n. 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);
        }
Esempio n. 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);
        }