示例#1
0
 private void btnQuitar_Click(object sender, EventArgs e)
 {
     try
     {
         if (MessageBox.Show("Desea eliminar este articulo del embarque?", "Profit Administrativo",
                             MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == System.Windows.Forms.DialogResult.Yes)
         {
             using (Profit_RGEntities context = new Profit_RGEntities())
             {
                 if (grdDatos.RowCount > -1 && grdDatos.CurrentCell.RowIndex > -1)
                 {
                     System.Guid?R = new Guid(grdDatos[6, grdDatos.CurrentCell.RowIndex].Value.ToString());
                     context.pEliminarReng_emb(R);
                 }
                 CargarDetalle(context, txtViaje.Value);
             }
         }
     }
     catch (DataException ex0)
     {
         MessageBox.Show(ex0.InnerException.Message, "Profit Expansion", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     catch (Exception ex1)
     {
         MessageBox.Show(ex1.Message, "Profit Expansion", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }