Пример #1
0
 /// <summary>
 /// Handles the Click event of the btnStockDelete control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
 /// 整理人:桂书丛
 /// 整理时间:2013-02-02
 private void btnStockDelete_Click(object sender, EventArgs e)
 {
     if (this.gvStockMain.SelectedRowsCount <= 0)
     {
         XtraMessageBox.Show("请选择要删除(&D)的项目", "违规操作", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         return;
     }
     else
     {
         string       StockID          = this.gvStockMain.GetFocusedRowCellDisplayText(gcStockID).ToString();
         DialogResult tempDialogResult = XtraMessageBox.Show("编号为" + StockID + "的数据", "确定删除(&D)?", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
         if (DialogResult.Yes == tempDialogResult)
         {
             VariedEnum.OperatorStatus EnOperatorStatus;
             try
             {
                 EnOperatorStatus = myBUCMS_Stock.Delete(StockID);
                 if (CommonOperator.HandleOperatorEnum("删除(&D)入库信息", EnOperatorStatus))
                 {
                     BUT_SysLog.InsertSysLog(VariedEnum.LogType.数据操作, frmAssist.frmLogin.SysUser.UserID, "成功删除(&D)了编号为" + StockID + "的入库信息");
                     BindGridStock();
                 }
             }
             catch (Exception ex)
             {
                 XtraMessageBox.Show(ex.Message);
             }
         }
     }
 }