private void GetProjectGroupList()
        {
            int projectId = 0;

            projectId = Convert.ToInt32(comboBox1.SelectedValue.ToString());

            TokenResultEntity getToken = provide.GetToken();

            if (getToken.Code != 0)
            {
                MessageBox.Show("获取Token失败, 错误信息: " + getToken.ErrMsg);
                return;
            }

            GetProjectGroupResponse getProjectGroup = provide.GetProjectGroup(projectId);

            if (getProjectGroup.Code != 0 || getProjectGroup.ProjectGroupList.Count == 0)
            {
                MessageBox.Show("获取项目分组获取失败, 错误信息: " + getProjectGroup.ErrMsg);
                return;
            }
            else
            {
                for (int i = 1; i < getProjectGroup.ProjectGroupList.Count; i++)
                {
                    getProjectGroup.ProjectGroupList[i].Operate1 = "创建时段";
                    getProjectGroup.ProjectGroupList[i].Operate2 = "修改时段";
                    getProjectGroup.ProjectGroupList[i].Operate3 = "查看详情";
                }
                dataGridView1.AutoGenerateColumns = true;
                dataGridView1.DataSource          = getProjectGroup.ProjectGroupList;
            }
        }
        private void GetProjectGroupList(bool isSearch)
        {
            int projectId = 0;

            projectId = Convert.ToInt32(comboBox1.SelectedValue.ToString());

            TokenResultEntity getToken = provide.GetToken();

            if (getToken.Code != 0)
            {
                MessageBox.Show("获取Token失败, 错误信息: " + getToken.ErrMsg);
                return;
            }

            GetProjectGroupResponse getProjectGroup = new GetProjectGroupResponse();

            if (isSearch == false)
            {
                getProjectGroup = provide.GetProjectGroup(projectId);
            }
            else
            {
                //查询条件
            }
            if (getProjectGroup.Code != 0 || getProjectGroup.ProjectGroupList.Count == 0)
            {
                MessageBox.Show("获取项目分组信息失败, 错误信息: " + getProjectGroup.ErrMsg);
                return;
            }
            else
            {
                List <ProjectGroupSource1st> list = new List <ProjectGroupSource1st>();
                int i = 0;
                foreach (ProjectGroupEntityTemp item in getProjectGroup.ProjectGroupList)
                {
                    i++;
                    ProjectGroupSource1st obj = new ProjectGroupSource1st();
                    obj.No               = i;
                    obj.ProjectID        = item.ProjectID;
                    obj.ProjectNumber    = item.ProjectNumber;
                    obj.ProjectName      = item.ProjectName;
                    obj.ProjectGroupID   = item.ProjectGroupID;
                    obj.ProjectGroupName = item.ProjectGroupName;
                    obj.Operate          = "摇号信息详情";
                    list.Add(obj);
                }
                dataGridView1.AutoGenerateColumns = true;
                dataGridView1.DataSource          = list;
            }
        }
        public void GetProjectGroupList()
        {
            int projectId = 0;

            projectId = Convert.ToInt32(this.comboBox1.SelectedValue.ToString());

            TokenResultEntity getToken = provide.GetToken();

            if (getToken.Code != 0)
            {
                MessageBox.Show("获取Token失败, 错误信息: " + getToken.ErrMsg);
                return;
            }

            GetProjectGroupResponse getProjectGroup = provide.GetProjectGroup(projectId);

            if (getProjectGroup.Code != 0 || getProjectGroup.ProjectGroupList.Count == 0)
            {
                MessageBox.Show("获取项目分组获取失败, 错误信息: " + getProjectGroup.ErrMsg);
                return;
            }
            else
            {
                List <ProjectGroupSource2nd> list = new List <ProjectGroupSource2nd>();
                int i = 0;
                foreach (ProjectGroupEntityTemp item in getProjectGroup.ProjectGroupList)
                {
                    i++;
                    ProjectGroupSource2nd obj = new ProjectGroupSource2nd();
                    obj.ProjectID        = item.ProjectID;
                    obj.ProjectNumber    = item.ProjectNumber;
                    obj.ProjectName      = item.ProjectName;
                    obj.ProjectGroupID   = item.ProjectGroupID;
                    obj.ProjectGroupName = item.ProjectGroupName;
                    obj.Operate1         = "创建时段";
                    obj.Operate2         = "修改时段";
                    obj.Operate3         = "查看详情";
                    list.Add(obj);
                }
                dataGridView1.AutoGenerateColumns = true;
                dataGridView1.DataSource          = list;
            }
        }
Ejemplo n.º 4
0
        public GetProjectGroupResponse GetProjectGroup(int projectId)
        {
            GetProjectGroupResponse result = new GetProjectGroupResponse();

            try
            {
                var request = new GetProjectGroupRequest()
                {
                    ProjectID = projectId
                };

                result = this.Client.InvokeAPI <GetProjectGroupResponse>(request);
            }
            catch (Exception ex)
            {
                result.Code   = 9999;
                result.ErrMsg = ex.Message;
            }

            return(result);
        }
Ejemplo n.º 5
0
        private void GetProjectGroupList(bool isSearch)
        {
            int projectId = 0;

            projectId = Convert.ToInt32(comboBox1.SelectedValue.ToString());

            TokenResultEntity getToken = provide.GetToken();

            if (getToken.Code != 0)
            {
                MessageBox.Show("获取Token失败, 错误信息: " + getToken.ErrMsg);
                return;
            }

            GetProjectGroupResponse getProjectGroup = new GetProjectGroupResponse();

            if (isSearch == false)
            {
                getProjectGroup = provide.GetProjectGroup(projectId);
            }
            else
            {
                //查询条件
            }
            if (getProjectGroup.Code != 0 || getProjectGroup.ProjectGroupList.Count == 0)
            {
                MessageBox.Show("获取项目分组信息失败, 错误信息: " + getProjectGroup.ErrMsg);
                return;
            }
            else
            {
                for (int i = 1; i < getProjectGroup.ProjectGroupList.Count; i++)
                {
                    getProjectGroup.ProjectGroupList[i].No      = i;
                    getProjectGroup.ProjectGroupList[i].Operate = "摇号信息详情";
                }
                dataGridView1.AutoGenerateColumns = true;
                dataGridView1.DataSource          = getProjectGroup.ProjectGroupList;
            }
        }