private void toolStripDelete_Click(object sender, EventArgs e) { if (this._autoNo == 0) { DialogBox.ShowInfo("无此单号"); } else if (MessageBox.Show("是否删除?", "系统询问", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.No) { string errorMessage = ""; if (!this.CanDelete(ref errorMessage)) { DialogBox.ShowInfo(errorMessage); } else { if (this.BillDelete()) { DialogBox.ShowInfo("删除成功!"); this._BillState = State.None; this._AutoNo = 0; this.ClearControls(); } else { DialogBox.ShowInfo("删除失败"); this._BillState = State.Query; } this.RefreshTool(); } } }
private void toolStripButtonDelete_Click(object sender, EventArgs e) { DataGridViewRow currentRow = this.dgvHasRowNumDetl.CurrentRow; if (currentRow == null) { DialogBox.ShowError("请选择要删除的行!"); } else { string str = ""; str = currentRow.Cells[0].Value.ToString(); if (DialogBox.ShowQuestion("你真的要删除当前记录!") == DialogResult.Yes) { if (this._iDelete.Delete(Convert.ToInt32(str))) { DialogBox.ShowInfo("删除成功!"); this.dgvHasRowNumDetl.Rows.Remove(currentRow); } else { DialogBox.ShowError("删除失败!"); } } } }
private void toolStripButtonTop_Click(object sender, EventArgs e) { string billNo = this.navigation.GetMinBill(); if (billNo == "") { DialogBox.ShowInfo("没有找到首记录!"); return; } if (BillState == State.New || BillState == State.Edit) { if (!SaveCurrentOk()) { return; } } this.BindData(billNo); }
private void toolStripDelete_Click(object sender, EventArgs e) { if (billNo == string.Empty) { DialogBox.ShowInfo("无此单号"); return; } if (MessageBox.Show("是否删除?", "系统询问", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) { return; } string errorMessage = ""; if (!CanDelete(ref errorMessage)) { DialogBox.ShowInfo(errorMessage); return; } if (BillDelete()) { //保存成功 DialogBox.ShowInfo("删除成功!"); BillState = State.None; //写日志 this.BillNo = null; ClearControls(); } else { //保存失败 DialogBox.ShowError("删除失败"); BillState = State.Query; } RefreshTool(); }
private void toolStripEdit_Click(object sender, EventArgs e) { if (((this._BillState != State.New) && (this._BillState != State.Edit)) || this.SaveCurrentOk()) { if (this._AutoNo == 0) { DialogBox.ShowInfo("无单号"); } else { string errorMessage = ""; if (!this.CanEdit(ref errorMessage)) { DialogBox.ShowError(errorMessage); } else { this._BillState = State.Edit; this.RefreshTool(); } } } }