예제 #1
0
        /// <summary>
        /// 新增按钮事件
        /// </summary>
        private void btnNew_Click(object sender, EventArgs e)
        {
            try
            {
                if (!FrmMainDAO.QueryUserButtonPower(this.Name, this.Text, sender, true))
                {
                    return;
                }

                TableDeliveryDetail.Rows.Clear();
                DataRow deliveryRow = TableDeliveryDetail.NewRow();
                TableDeliveryDetail.Rows.Add(deliveryRow);
                bindingSource_DeliveryDetail.MoveLast();

                TableMaterialDetail.Clear();
                //gridViewMaterialDetail.AddNewRow();
                DataRow materialRow = TableMaterialDetail.NewRow();
                TableMaterialDetail.Rows.Add(materialRow);
                FocusedListView(false, "MaterialName", gridViewMaterialDetail.GetFocusedDataSourceRowIndex());
                gridViewMaterialDetail.RefreshData();
                Set_ButtonEditGrid_State(false);
                spinDeliveryQty.Focus();
            }
            catch (Exception ex)
            {
                ExceptionHandler.HandleException(this.Text + "--新增按钮事件错误。", ex);
            }
        }
예제 #2
0
        /// <summary>
        /// 查询下一条信息事件
        /// </summary>
        private void btnDown_Click(object sender, EventArgs e)
        {
            try
            {
                if (!FrmMainDAO.QueryUserButtonPower(this.Name, this.Text, sender, true))
                {
                    return;
                }

                DataTable tmpTable = new DataTable();
                ddDAO.QueryDeliveryDetail_DownOne(tmpTable, currentAutoIdInt, querySMNo);
                if (tmpTable.Rows.Count > 0)
                {
                    TableDeliveryDetail.Rows.Clear();
                    TableDeliveryDetail.ImportRow(tmpTable.Rows[0]);
                    currentAutoIdInt = DataTypeConvert.GetInt(tmpTable.Rows[0]["AutoId"]);
                    TableMaterialDetail.Rows.Clear();
                    ddDAO.QueryMaterialDetail(TableMaterialDetail, currentAutoIdInt);
                }
            }
            catch (Exception ex)
            {
                ExceptionHandler.HandleException(this.Text + "--查询下一条信息事件错误。", ex);
            }
        }
예제 #3
0
 /// <summary>
 /// 查询上一条信息事件
 /// </summary>
 private void btnUp_Click(object sender, EventArgs e)
 {
     try
     {
         DataTable tmpTable = new DataTable();
         ddDAO.QueryDeliveryDetail_UpOne(tmpTable, currentAutoIdInt, querySMNo);
         if (tmpTable.Rows.Count > 0)
         {
             TableDeliveryDetail.Rows.Clear();
             TableDeliveryDetail.ImportRow(tmpTable.Rows[0]);
             currentAutoIdInt = DataTypeConvert.GetInt(tmpTable.Rows[0]["AutoId"]);
             TableMaterialDetail.Rows.Clear();
             ddDAO.QueryMaterialDetail(TableMaterialDetail, currentAutoIdInt);
         }
     }
     catch (Exception ex)
     {
         ExceptionHandler.HandleException(this.Text + "--查询上一条信息事件错误。", ex);
     }
 }