/// <summary> /// 修改供货明细事件 /// </summary> private void btnDDSave_Click(object sender, EventArgs e) { try { if (!FrmMainDAO.QueryUserButtonPower(this.Name, this.Text, sender, true)) { return; } if (dataSet_StnModule.Tables[0].Rows.Count == 0 || bindingSource_StnModule.Current == null) { return; } DataRow focusedRow = gridViewDeliveryDetail.GetFocusedDataRow(); if (focusedRow == null) { return; } string smNoStr = DataTypeConvert.GetString(gridViewStnModule.GetFocusedDataRow()["SMNo"]); int autoIdInt = DataTypeConvert.GetInt(focusedRow["AutoId"]); FrmDeliveryDetail ddForm = new FrmDeliveryDetail(); FrmDeliveryDetail.querySMNo = smNoStr; FrmDeliveryDetail.queryAutoIdInt = autoIdInt; ddForm.ShowDialog(); QueryDeliveryDetail(smNoStr); } catch (Exception ex) { ExceptionHandler.HandleException(this.Text + "--修改供货明细事件错误。", ex); } }
/// <summary> /// 新增供货明细事件 /// </summary> private void btnDDNew_Click(object sender, EventArgs e) { try { if (dataSet_StnModule.Tables[0].Rows.Count == 0 || bindingSource_StnModule.Current == null) { return; } string smNoStr = DataTypeConvert.GetString(gridViewStnModule.GetFocusedDataRow()["SMNo"]); FrmDeliveryDetail ddForm = new FrmDeliveryDetail(); FrmDeliveryDetail.querySMNo = smNoStr; FrmDeliveryDetail.queryAutoIdInt = -1; ddForm.ShowDialog(); QueryDeliveryDetail(smNoStr); } catch (Exception ex) { ExceptionHandler.HandleException(this.Text + "--新增供货明细事件错误。", ex); } }