Exemplo n.º 1
0
        private void UpdateTeam(CommonResponseData commonResponse)
        {
            TeamData data = new TeamData
            {
                id               = teamData.id,
                teamName         = team_name_textBox.Text.Trim(),
                projectCode      = projectInfo.projectCode,
                organizationCode = loginUser.OrganizationCode
            };

            TeamRequestService.RequestUpdateAction(data, loginUser, ref commonResponse);
            log.Debug(JsonConvert.SerializeObject(commonResponse, Formatting.Indented));
            if (null != commonResponse)
            {
                if (commonResponse.success)
                {
                    Common.SuccessAlert("修改操作成功!");
                    DialogResult = DialogResult.OK;
                    Close();
                }
                else
                {
                    Common.ErrAlert("修改操作发生数据解析错误!");
                    DialogResult = DialogResult.Cancel;
                }
            }
            else
            {
                Common.ErrAlert("修改操作异常,请检查网络连接或联系管理员!");
                DialogResult = DialogResult.Cancel;
            }
        }
Exemplo n.º 2
0
        private void AddTeam(CommonResponseData commonResponse)
        {
            TeamData data = new TeamData
            {
                teamName         = team_name_textBox.Text.Trim(),
                projectCode      = projectInfo.projectCode,
                organizationCode = loginUser.OrganizationCode
            };

            TeamRequestService.RequestAddAction(data, loginUser, ref commonResponse);
            if (null != commonResponse)
            {
                if (commonResponse.success)
                {
                    Common.SuccessAlert("新增成功!");
                    DialogResult = DialogResult.OK;
                    Close();
                }
                else
                {
                    Common.ErrAlert("新增操作发生数据解析错误!");
                    DialogResult = DialogResult.Cancel;
                }
            }
            else
            {
                Common.ErrAlert("新增操作异常,请检查网络连接或联系管理员!");
                DialogResult = DialogResult.Cancel;
            }
        }
Exemplo n.º 3
0
 private void TeamDataGridViewLoad()
 {
     try
     {
         TeamDataResponse teamDataResponse = new TeamDataResponse();
         TeamRequestService.Response(loginUser, GroupProjectCode, ref teamDataResponse);
         if (null == teamDataResponse)
         {
             return;
         }
         if (null == teamDataResponse.data)
         {
             return;
         }
         if (0 >= teamDataResponse.data.Count)
         {
             return;
         }
         if (IsHandleCreated)
         {
             Invoke(new Action(() =>
             {
                 team_dataGridView.DataBindings.Clear();
                 teamDatas = teamDataResponse.data;
                 if (teamDatas.Count() <= 0)
                 {
                     Common.ErrAlert("当前项目下暂无班组信息!");
                     return;
                 }
                 string teamSearchKeyword = groupname_search_textBox.Text.Trim();
                 if (!string.Empty.Equals(teamSearchKeyword))
                 {
                     teamDatas = from w in teamDatas
                                 where (w.teamName.Contains(teamSearchKeyword))
                                 select w;
                 }
                 var tplist = from tp in teamDatas
                              select new
                 {
                     班组名称  = tp.teamName,
                     班组总人数 = tp.count
                 };
                 team_dataGridView.DataSource = tplist.ToList();
             }));
         }
     }
     catch (Exception ex)
     {
         log.Error(ex.Message);
     }
 }
Exemplo n.º 4
0
        private void del_team_button_Click(object sender, EventArgs e)
        {
            if (null == TeamProjectInfo)
            {
                Common.ErrAlert("请选择项目后再操作!");
                return;
            }
            if (team_dataGridView.SelectedRows.Count == 0)
            {
                Common.ErrAlert("请选择一行再修改!");
                return;
            }
            TeamData teamData = teamDatas.ToList()[team_dataGridView.SelectedRows[0].Index];

            if (null == teamData)
            {
                Common.ErrAlert("加载选择的班组数据发生错误!");
                return;
            }
            if (MessageBox.Show(string.Format("真的要删除班组 {0} 吗?", teamData.teamName), "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) != DialogResult.OK)
            {
                return;
            }
            CommonResponseData commonResponse = new CommonResponseData();

            TeamRequestService.RequestDelAction(teamData, loginUser, ref commonResponse);
            if (null != commonResponse)
            {
                if (commonResponse.success)
                {
                    Common.SuccessAlert("删除操作成功!");
                    TeamDataGridViewLoad();
                }
                else
                {
                    Common.ErrAlert("删除失败!\n" + commonResponse.message);
                }
            }
            else
            {
                Common.ErrAlert("删除操作异常,请检查网络连接或联系管理员!");
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// 班组下拉数据加载
        /// </summary>
        private void TeamComboBoxDataInit()
        {
            TeamDataResponse teamDataResponse = new TeamDataResponse();

            TeamRequestService.Response(loginUser, workerProjectInfo.projectCode, ref teamDataResponse);
            if (null == teamDataResponse)
            {
                return;
            }
            if (null == teamDataResponse.data)
            {
                return;
            }
            if (0 >= teamDataResponse.data.Count)
            {
                return;
            }
            teamDatas = teamDataResponse.data;
            team_comboBox.DataSource    = teamDataResponse.data;
            team_comboBox.ValueMember   = "teamSysNo";
            team_comboBox.DisplayMember = "teamName";
        }