Beispiel #1
0
        private void butDetachClaim_Click(object sender, EventArgs e)
        {
            if (gridClaimDetails.SelectedIndices.Length == 0)
            {
                MsgBox.Show(this, "Please select a claim from the claims paid grid and try again.");
                return;
            }
            List <Hx835_Claim> listSelectedEraClaims = gridClaimDetails.SelectedTags <Hx835_Claim>(); //See SetClaimDetailRows(...)

            listSelectedEraClaims.RemoveAll(x => !x.IsAttachedToClaim || x.ClaimNum == 0);            //Limit to era claims that were attached to internal claim.
            List <Claim>       listAttachedClaims    = _x835.RefreshClaims();
            List <Hx835_Claim> listRecievedEraClaims = listSelectedEraClaims.FindAll(x => listAttachedClaims.Any(y => y.ClaimNum == x.ClaimNum && y.ClaimStatus == "R"));
            StringBuilder      sbWarnings            = new StringBuilder();

            if (listRecievedEraClaims.Count > 0)
            {
                sbWarnings.AppendLine(Lan.g(this, "You have selected some claims which are already recieved."));
                sbWarnings.AppendLine(Lan.g(this, "Detaching these will not reverse any payment information."));
            }
            if (gridClaimDetails.SelectedIndices.Length > 1)
            {
                sbWarnings.AppendLine(Lan.g(this, "All selected claims will be immediately detached from this ERA even if you click Cancel when you leave the ERA window."));
            }
            if (sbWarnings.Length > 0)
            {
                sbWarnings.AppendLine(Lan.g(this, "Click OK to continue, or click Cancel to leave claims attached."));
                if (MessageBox.Show(this, sbWarnings.ToString(), "", MessageBoxButtons.OKCancel) != DialogResult.OK)
                {
                    return;
                }
            }
            DetachClaimHelper(gridClaimDetails.SelectedIndices.ToList());
        }