Пример #1
0
 public static CustomerInfo getNetAmount(CustomerInfo oCustomerInfo)
 {
     oCustomerInfo.TotalAmount = oCustomerInfo.GrocAmount + (oCustomerInfo.NonGrocAmount - (oCustomerInfo.NonGrocAmount * oCustomerInfo.PercDiscount) / 100);
     if (oCustomerInfo.PercDiscount == 0)
     {
         oCustomerInfo.TotalAmount = oCustomerInfo.GrocAmount + oCustomerInfo.NonGrocAmount;
     }
     oCustomerInfo.NetAmount = oCustomerInfo.TotalAmount - Convert.ToDouble((Math.DivRem(Convert.ToInt32(oCustomerInfo.TotalAmount), 100, out remainder) * 5));
     oCustomerInfo.CashDiscount = Convert.ToDouble((Math.DivRem(Convert.ToInt32(oCustomerInfo.TotalAmount), 100, out remainder) * 5));
     return oCustomerInfo;
 }
Пример #2
0
        private void btnMakePayment_Click(object sender, EventArgs e)
        {
            oCustomerInfo.GrocAmount = Convert.ToDouble(txtGrocAmount.Text);
            oCustomerInfo.NonGrocAmount = Convert.ToDouble(txtNonGrocAmount.Text);
            oCustomerInfo.PercDiscount = 0;

            if (txtCustomerID.Text != "")
            {
                oCustomerInfo.CustomerId = Convert.ToInt32(txtCustomerID.Text);
                oCustomerInfo.PercDiscount = objcalDiscount.GetPercentageDiscount(txtCustomerID.Text);
                oCustomerInfo = calculateDiscount.getNetAmount(oCustomerInfo);
            }
            lblTotDiscount.Text = "Total discount in %: " + oCustomerInfo.PercDiscount;
            lblNetPayAmount.Text = "Net Payable Amount: " + oCustomerInfo.NetAmount;
            lblCashDiscount.Text = "Total Cash Discount:" + oCustomerInfo.CashDiscount;
        }