I've run into a frustrating issue while working on an accounting project. When I input values into text boxes and click the Add Person button, the values are successfully added. However, when I attempt to save these values to the database by clicking the Save to Database button, the multiple entries do not display back onto my UI as expected.
In my SQL server table, there are multiple entries with the same first name. My goal is to retrieve all values with the same first name and populate them in the $scope.arr variable defined in my angular code.
While calling the $scope.GetPerson() method with an integer value (CustomerCode), the array ($scope.arr) gets populated correctly. But when passing a string value such as FirstName, the array does not populate with the matching entries from the database. I need assistance from experts to identify where I may be making a mistake.
Below are details of my Model, Angular JS script, C# controller, and HTML structure:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace TestProj.Models
{
public class TestModel
{
public int ID { get; set; }
public int CustomerCode { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public decimal Debit { get; set; }
public decimal Credit { get; set; }
}
}
If you're experiencing the same issue or have expertise in this area, your insights would be greatly appreciated!