private void btnDelete_ItemClick(object sender, ItemClickEventArgs e)
        {
            try
            {
                if (HeaderView.RowCount > 0 && HeaderView.FocusedRowHandle >= 0)
                {
                    BOMHeader h = bom.Get(int.Parse(HeaderView.GetRowCellValue(HeaderView.FocusedRowHandle, HeaderView.Columns[0]).ToString().Substring(3)));

                    if (IsPosted == false)
                    {
                        bom.Delete(h);
                        HeaderView.DeleteRow(HeaderView.FocusedRowHandle);
                        MessageBox.Show("Success");
                    }
                    else
                    {
                        MessageBox.Show("You Can't Delete This Bom Journal", "Stop", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
 private void btnDelete_ItemClick(object sender, ItemClickEventArgs e)
 {
     try
     {
         if (HeaderView.FocusedRowHandle >= 0)
         {
             lines.DeleteMulti(lines.GetAll().Where(l => l.transCode == TransCode));
             header.Delete(header.Get(TransCode));
             HeaderView.DeleteRow(HeaderView.FocusedRowHandle);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }