public JsonResult BookStatus(Models.BookStatus bookstatus) { Models.BookServices bookService = new Models.BookServices(); var result = bookService.GetBookStatus(bookstatus); return(Json(result)); }
public List <Models.BookStatus> GetBookStatus(Models.BookStatus BookStatus) { DataTable dt = new DataTable(); string sql = @"Select * From [dbo].[BOOK_CODE] "; using (SqlConnection conn = new SqlConnection(this.GetDBConnectionString())) { conn.Open(); SqlCommand cmd = new SqlCommand(sql, conn); SqlDataAdapter sqlAdapter = new SqlDataAdapter(cmd); sqlAdapter.Fill(dt); conn.Close(); } return(this.MapBookStatusDataToList(dt)); }