suman goud

suman goud

  • NA
  • 176
  • 54k

how to save multiple rows data in database using mvc and Ang

Sep 16 2016 4:26 AM
i have a table grid in my view,
i have 1 dropdown, and text boxes in table grid
on dropdow change am adding new row.
now if i have entered 5 rows and click save i want to save 5 records with row id
how to do that
my view
<table class="tableData" >
<tr>
<th>Customer</th>
<th>Pendings</th>
<th>Pending Value</th>
<th>Amount</th>
<th>Account Name</th>
</tr>
<tr ng-repeat="r in rvm">
<td>
<select ng-model="ID" ng-options="c.ID as c.Name for c in customer" ng-change="GetAccountBalance()" style="width:150px;height:22px;" name=" tCustomer">
<option value="">Select Customer</option>
</select>
<td>
<span id="spAmount" >{{ReceiptsViewModel.PendingAmount}}</span>
</td>
<td>
<input type="text" ng-value="0.00" ng-model="ReceiptsViewModel.AdjustAmount" ng-model-onblur ng-change="GetTotalAmount()" class="input-large" name="tAmount" />
</td>
<td>
<select ng-model="ReceiptsViewModel.AccountId" ng-options="a.ID as a.Name for a in account" style="width:150px;height:22px;">
<option value="">Select Account</option>
</select>
</td>
</tr>
</table>
angular
$scope.rvm = [{}];
// $scope.getProductDetails = function (row) {
$scope.GetAccountBalance = function () {
alert($scope.ID);
$scope.rvm.push({
});
});

Answers (2)