/// <summary> /// 修改 /// </summary> public override void SetModifyInit() { base.SetModifyInit(); try { if (this.GetSelectList().Length <= 0) { XtraMsgBox.Show("未勾选任何数据!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information); return; } frmTeamShow_TeamSetAdd frm = new frmTeamShow_TeamSetAdd(); frm.ScanMode = Common.DataModifyMode.upd; //选择所有选择的数据 frm.drs = this.GetSelectList(); string myTeamNm = frm.drs[0]["myTeamName"].ToString(); for (int i = 0; i < frm.drs.Length; i++) { if (myTeamNm != frm.drs[i]["myTeamName"].ToString()) { XtraMsgBox.Show("请选择相同向别-班别加班数据,才可以修改!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information); return; } } if (frm.ShowDialog() == DialogResult.OK) { this.ScanMode = Common.DataModifyMode.dsp; GetDspDataList(); } } catch (Exception ex) { log.Error(ex); XtraMsgBox.Show("修改数据失败!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error, ex, this.GetType()); } }
/// <summary> /// 新增 /// </summary> /// <param name="isClear"></param> protected override void SetInsertInit(bool isClear) { base.SetInsertInit(isClear); try { frmTeamShow_TeamSetAdd frm = new frmTeamShow_TeamSetAdd(); frm.ScanMode = Common.DataModifyMode.add; if (frm.ShowDialog() == DialogResult.OK) { this.ScanMode = Common.DataModifyMode.dsp; GetDspDataList(); } } catch (Exception ex) { log.Error(ex); XtraMsgBox.Show("新增数据失败!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error, ex, this.GetType()); } }