Searching using the last 4 digits

  • Thread starter Thread starter One_World
  • Start date Start date
O

One_World

Guest
Just needed a tip for additional search functionality. I can search using the full 9 digit ItemID (123456789) but unable to add searching capability using the last 4 digits of ItemID (6789) on top of full digit search?

public ActionResult Search(SearchEmployeeModel searchEmployeeModel)
{
searchEmployeeModel.ItemID = searchEmployeeModel.ItemID != null ? searchEmployeeModel.ItemID.Replace("'", "''") : searchEmployeeModel.ItemID;
searchEmployeeModel.First_Name = searchEmployeeModel.First_Name != null ? searchEmployeeModel.First_Name.Replace("'", "''") : searchEmployeeModel.First_Name;


List<SearchEmployeeModel> searchResult = repository.GetSearchItem(searchEmployeeModel.ItemID, searchEmployeeModel.First_Name);

Session["SearchEmployeeModelHome"] = searchEmployeeModel;
Session["searchResultHome"] = searchResult;

return RedirectToAction("Index");

}

public List<SearchEmployeeModel> GetSearchItem(string ItemID, string First_Name)
{
var searchItem = _db.Query<SearchEmployeeModel>("usp_SearchItem", new
{
@ItemID = ItemID
@First_Name = First_Name,

}, null, true, 300, CommandType.StoredProcedure).ToList();

return searchItem;
}

Continue reading...
 
Back
Top