Exemplo n.º 1
0
 private void dataGridView2_CellLeave(object sender, DataGridViewCellEventArgs e)
 {
     try
     {
         if (_isBusy)
         {
             return;
         }
         this.Cursor = Cursors.WaitCursor;
         dataGridView2.EndEdit();
         List <PointProxy> pointList = (pointProxyBindingSource.DataSource as List <PointProxy>);
         if (pointList.Count <= 0)
         {
             return;
         }
         PointProxy point = pointList[e.RowIndex];
         if (point.X <= 0 || point.Y <= 0 || point.PointListId <= 0)
         {
             return;
         }
         point.Id = PointAdapter.SaveItem(point).PointId;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.StackTrace, ex.Message);
     }
     finally
     {
         this.Cursor = Cursors.Arrow;
     }
 }
 public void SaveItem()
 {
     PointAdapter.SaveItem(this.Card);
 }