private void manager_modify_button_Click(object sender, EventArgs e) { if (string.Empty.Equals(ManagerProjectCode)) { Common.ErrAlert("请选择项目后再操作!"); return; } if (manager_dataGridView.SelectedRows.Count == 0) { Common.ErrAlert("请选择一行再修改!"); return; } ManagerListData manager = managerListData.ToList()[manager_dataGridView.SelectedRows[0].Index]; if (null == manager) { Common.ErrAlert("加载选择的管理人员数据发生错误,请重试!"); return; } ManagerInfoForm managerInfoForm = new ManagerInfoForm(db, manager, ManagerProjectInfo, loginUser, nations); if (managerInfoForm.ShowDialog() == DialogResult.OK) { LoadManagersData(manager_comboBox); } }
public ManagerInfoForm(SQLiteConnection db, ManagerListData manager, ProjectInfo workerProjectInfo, LoginUser loginUser, List <Nation> nations) { InitializeComponent(); this.db = db; this.manager = manager; this.workerProjectInfo = workerProjectInfo; this.loginUser = loginUser; this.nations = nations; }
public static void RequestDelAction(ManagerListData manager, LoginUser loginUser, ref CommonResponseData commonResponse) { object data = new { manager.projectCode, idCardType = 1, manager.idCardNumber }; Common.PostRequest(data, ConfigurationManager.AppSettings["baseURL"].ToString(), Properties.Resources.DeleteWorker, loginUser.LoginToken, "application/json", ref commonResponse); }
private void manager_del_button_Click(object sender, EventArgs e) { if (manager_dataGridView.SelectedRows.Count == 0) { Common.ErrAlert("请选择一行再删除!"); return; } ManagerListData manager = managerListData.ToList()[manager_dataGridView.SelectedRows[0].Index]; if (null == manager) { Common.ErrAlert("加载选择的管理人员数据发生错误,请重试!"); return; } if (null == ManagerProjectInfo) { Common.ErrAlert("请选择项目后再操作!"); return; } if (MessageBox.Show(string.Format("真的要删除管理人员 {0} 吗?", manager.workerName), "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) != DialogResult.OK) { return; } CommonResponseData commonResponseData = new CommonResponseData(); ManagerRequestService.RequestDelAction(manager, loginUser, ref commonResponseData); if (null != commonResponseData) { if (commonResponseData.success) { Common.SuccessAlert("删除成功!"); LoadManagersData(manager_comboBox); } else { Common.ErrAlert("删除失败!\n" + commonResponseData.message); } } else { Common.ErrAlert("网络或服务异常,请联系管理员!"); } }