Hello Team,
In my MVC C# project, I'm using Json, and Ajax to pass data to the databaase and I want to implement data search engine with 3 textbox and when I search the first name, last name and birthdate in the 3 textbox and if all this data matches then it should export the data from my Sql database as PDF or say data not found, can anyone assist me with a code for that, thank you in advance

Emmmanuel FIADUFEPosted Sep 9, 2024, 11:11 AM
Hello Naimish,
Please it is not working, let me provide you with a section for the code to see.
I'm using AdmineLite bootstrap template, and here is my code.
CONTROLLER
public JsonResult GetAllStaffInfo()
{
var dataList = objRestaurantDBEntities.tblStaffs.ToList();
var modifiedData = dataList.Select(x => new StaffViewModel
{
StaffId = x.StaffId,
StaffImage = x.StaffImage,
JoinDate = x.JoinDate,
FName = x.FName,
LName = x.LName,
BirthDate = x.BirthDate,
Phoneno = x.Phoneno,
Email = x.Email,
NextofKing = x.NextofKing,
Phone = x.Phone
}).ToList();
return Json(modifiedData, JsonRequestBehavior.AllowGet);
}
JAVASCRIPT FUNCTION
EXPORT DATA PDF PAGE
TEMPLATE PAGE FOR LOADINDG THE DATA#