I want When CashDisc=0 when total-cashDisc

38 views Asked by At

enter image description here

    public void Cashdis() {
      decimal t = Convert.ToDecimal(TxtToatal.Text);
      if (TxtcashDisc.Text == String.Empty) {
        CashDisc = 0;
        index = lstvItems.FocusedItem.Index;
        removetotal = Convert.ToDecimal(this.lstvItems.Items[index].SubItems[6].Text);
      } else {
        CashDisc = Convert.ToDecimal(TxtcashDisc.Text);
      }
      bal = t - CashDisc;
      TxtToatal.Text = bal.ToString();
      TxtPaid.Text = bal.ToString();
    }

I want When CashDisc=0 that time total-cashDisc but that time error is ocured "Additional information: Object reference not set to an instance of an object."

0

There are 0 answers