我正在寻找验证数据网格单元格,以便它检查以确保用户输入的值是 <> 到 100
private void InsertCostSpilt ()
{
{
try
{
string AssetNumberV = txtNumber.Text;
string DeptV = dgvAssetCost.Rows[dgvAssetCost.CurrentRow.Index].Cells["DEPT"].Value.ToString(); // Gets values of the department cell
string CCV = dgvAssetCost.Rows[dgvAssetCost.CurrentRow.Index].Cells["CC"].Value.ToString(); // Gets values of the Cost centre cell
string PerCentV = dgvAssetCost.Rows[dgvAssetCost.CurrentRow.Index].Cells["PER_CENT"].Value.ToString(); // Gets Values of the Precentage cell
SQLMETHODS.InsertCostSpilt(AssetNumberV, DeptV, CCV, PerCentV); // SQL insert methods, for insering new cost spilts
MessageBox.Show("Cost Spilt details have been successfully entered.", "Success!"); // Success Messagebox
}
catch (Exception ex)
{
MessageBox.Show(" Error submitting Cost Spilt details into entry table. processed with error:" + ex.Message); // Error Messagebox
}
}
}