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 bool work(BackgroundWorker bk)
        {
            DataTable t = ProjectBLL.GetData(" ProjectLevel = " + Models.ProjectLevels.项目工程);

            this.Invoke(new EventHandler((a, b) =>
            {
                this.comboBox1.DisplayMember = "ProjectName";
                this.comboBox1.ValueMember   = "ProjectId";
                this.comboBox1.DataSource    = t;
                this.Instar.SelectedIndex    = 4;
                this.yangsheng.SelectedIndex = 0;
                this.GroupInfo.SelectedIndex = 0;
            }));
            DataTable table = this.deviceBLL.GetData(" ifUpload = 0 ");

            if (table.Rows.Count > 0)
            {
                foreach (DataRow row in table.Rows)
                {
                    Models.DeviceData detail = deviceBLL.GetModelByRow(row);
                    this.DetailsForUpload.Enqueue(detail);
                }
            }

            setProcess();
            upload();
            return(true);
        }