Exemplo n.º 1
0
 private void butDelete_Click(object sender, EventArgs e)
 {
     if (CreditCardCur.IsNew)
     {
         DialogResult = DialogResult.Cancel;
     }
     if (!MsgBox.Show(this, MsgBoxButtons.OKCancel, "Are you sure you want to delete this credit card?"))
     {
         return;
     }
     #region X-Charge
     //Delete the archived X-Charge token
     if (_isXChargeEnabled && CreditCardCur.XChargeToken != "")
     {
         if (CreditCardCur.IsXWeb())
         {
             OpenDentBusiness.WebTypes.Shared.XWeb.XWebs.DeleteCreditCard(PatCur.PatNum, CreditCardCur.CreditCardNum);                   //Also deletes cc from db
         }
         else
         {
             DeleteXChargeAlias();
         }
     }
     #endregion
     CreditCards.Delete(CreditCardCur.CreditCardNum);
     List <CreditCard> creditCards = CreditCards.Refresh(PatCur.PatNum);
     for (int i = 0; i < creditCards.Count; i++)
     {
         creditCards[i].ItemOrder = creditCards.Count - (i + 1);
         CreditCards.Update(creditCards[i]);                //Resets ItemOrder.
     }
     DialogResult = DialogResult.OK;
 }
Exemplo n.º 2
0
            ///<summary>Performs base XWebInputDTGForPayment behavior and deletes CreditCard row.</summary>
            protected override void PostProcessOutput(XWebResponse response)
            {
                //Verify result and set response.PayNote.
                base.PostProcessOutput(response);
                response.Alias = _cc.XChargeToken;
                try { response.PayNote = "Deleted CreditCard: " + JsonConvert.SerializeObject(_cc); } catch { }
                CreditCards.Delete(_cc.CreditCardNum);
                List <CreditCard> creditCards = CreditCards.Refresh(_patNum);

                for (int i = 0; i < creditCards.Count; i++)
                {
                    creditCards[i].ItemOrder = creditCards.Count - (i + 1);
                    CreditCards.Update(creditCards[i]);                    //Resets ItemOrder.
                }
            }
Exemplo n.º 3
0
        private void butDelete_Click(object sender, EventArgs e)
        {
            if (CreditCardCur.IsNew)
            {
                DialogResult = DialogResult.Cancel;
            }
            CreditCards.Delete(CreditCardCur.CreditCardNum);
            List <CreditCard> creditCards = CreditCards.Refresh(PatCur.PatNum);

            for (int i = 0; i < creditCards.Count; i++)
            {
                creditCards[i].ItemOrder = creditCards.Count - (i + 1);
                CreditCards.Update(creditCards[i]);                //Resets ItemOrder.
            }
            DialogResult = DialogResult.OK;
        }