Register
Friday, November 21, 2008
Forum
 
break on findind Column in wrong location
Last Post 13 Aug 2008 05:53 PM by Ed Reyes. 0 Replies.
Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
Ed Reyes
New Member
New Member
Posts:5


--
13 Aug 2008 05:53 PM  
This code generated code had a break in the wrong location. Made the Delete ineffective.

private void DeleteButton_Click (object sender, EventArgs e)
{
string MethodName = "DeleteButton_Click";
try
{
if (SearchResultDataGridView.SelectedRows.Count > 0)
{
System.Windows.Forms.DialogResult result = MessageBox.Show ("Do you want to delete the record?", "Delete", MessageBoxButtons.YesNo);
if (result == System.Windows.Forms.DialogResult.Yes)
{
System.Decimal Od = 0;
System.Decimal Width = 0;
PLWinCasingForm PLWinCasingForm = new PLWinCasingForm ();
if (SearchResultDataGridView.SelectedRows.Count > 0)
{

foreach (DataGridViewColumn column in SearchResultDataGridView.Columns)
{
if (column.DataPropertyName == "Od")
{
Od = (System.Decimal)SearchResultDataGridView.SelectedRows[0].Cells[column.Index].Value;
break;
}
// break; use to be here }
foreach (DataGridViewColumn column in SearchResultDataGridView.Columns)
{
if (column.DataPropertyName == "Width")
{
Width = (System.Decimal)SearchResultDataGridView.SelectedRows[0].Cells[column.Index].Value;
break;
}
// break; use to be here
}

}
BLCasing.DeleteRecord (Od,
Width);

Search ();
}
}
}
catch (System.Exception ex)
{
PublishException (ex, MethodName);
}
}
You are not authorized to post a reply.

Active Forums 4.0