Forums - C# Corner

Forum guidelines
Mandar Shinde

Mandar Shinde

  • 1.5k
  • 275
  • 3.9k

Regarding getting Extra Total Value.

Apr 12 2019 5:37 AM
Dear All,
I was developing one component using Angular 5 and ASP .Net MVC with REST API.
I am facing one problem with my dynamic table.
 
My table looks like as follows - 
 
 
When I am trying to insert any record then it looks like as follows -
 
 
 
 
To insert that record firtly I am saving that record in temporary Array. 
To  storing purpose  I am using following code - 
 
  1. this.itemToEdit.Items[index] = { "GroupID"this.itemToEdit.Items[index].GroupID"ServiceID"this.itemToEdit.Items[index].ServiceID"RateEditable"'0'"MinRate": min, "MaxRate": max, "Rate": rates, "Quantity": qty, "Discount": discount, "Total": total, "Add"false };  
  2. var rateItems = { "GroupID""""ServiceID""""RateEditable""""MinRate": 0, "MaxRate": 0, "Rate": 0, "Quantity": 1, "Discount": 0, "Total": total, "Add"true };  

  3. this.itemToEdit.Items.push(rateItems);  
 Then it looks like as follows - 
 
 
 
My issue is that if I set Total to o in rateItems dictionary then I get every Rate as 'Zero'.
If I pass any value to Total in rateItem dictionary then I am getting previously Added Rate.
I want to make it to zero but my pervious values shows me correct result.
Please let me know any easy solution. Any easy solution will be acceptable.
Thanking You in Advanced. 
 
 
 

Answers (2)