Beispiel #1
0
 private void ConfigDataTableOrderDetail()
 {
     DataTableHelpers.AddCol(dataTableOrderDetail, "ProductName", "System.String");
     DataTableHelpers.AddCol(dataTableOrderDetail, "Quantity", "System.Int32");
     DataTableHelpers.AddCol(dataTableOrderDetail, "Note", "System.String");
     DataTableHelpers.AddCol(dataTableOrderDetail, "Price", "System.Int32");
     DataTableHelpers.AddCol(dataTableOrderDetail, "ProductID", "System.Int32");
 }
Beispiel #2
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            if (dgvCategory.CurrentRow != null)
            {
                if (MyMessageBox.Question("Bạn có chắn xóa bản ghi đã chọn không?"))
                {
                    int curRowIdx = dgvCategory.CurrentRow.Index;
                    int idNeedDel = Convert.ToInt32(dgvCategory.Rows[curRowIdx].Cells["CategoryID"].Value.ToString());

                    DataTableHelpers.RemoveRow(dataTable, "CategoryID", idNeedDel);

                    sqlHelper.Update(dataTable);
                }
            }
        }