/// <summary> /// Get Todays Activities /// </summary> /// <param name="requestType">requestType</param> /// <param name="fromDate">fromDate</param> /// <param name="toDate">toDate</param> /// <param name="active">active</param> /// <param name="customerId">customerId</param> /// <param name="searchText">searchText</param> /// <param name="startRowIndex">startRowIndex</param> /// <param name="endRowIndex">endRowIndex</param> /// <param name="sortExpression">Sort Expression</param> /// <param name="sortDirection">Sort Direction</param> /// <param name="status">status</param> /// <returns>Return today's activities</returns> public object GetTodaysActivities(string requestType, DateTime?fromDate, DateTime?toDate, int active = 1, int?customerId = null, string searchText = null, int?startRowIndex = null, int?endRowIndex = null, string sortExpression = "", string sortDirection = "", string status = "") { object retVal = new object(); using (CustomContext service = new CustomContext()) { DataSet ds = service.GetTodaysActivities(requestType, fromDate, toDate, active, customerId, searchText, startRowIndex, endRowIndex, sortExpression, sortDirection, status); if (ds?.Tables.Count > 0) { if (ds != null && ds.Tables[0].Rows.Count > 0) { // if request type is book details if (requestType == SystemEnumList.RequestTypeTodayActivity.BookDetails.GetDescription()) { List <BorrowedBook> finalList = ConvertTo.DataTableIntoList <BorrowedBook>(ds.Tables[0]); retVal = (object)finalList; } // if request type is room bookings if (requestType == SystemEnumList.RequestTypeTodayActivity.RoomBookings.GetDescription()) { List <SpaceBooking> finalList = ConvertTo.DataTableIntoList <SpaceBooking>(ds.Tables[0]); retVal = (object)finalList; } } else { // if request type is book details if (requestType == SystemEnumList.RequestTypeTodayActivity.BookDetails.GetDescription()) { // returning blank list List <BorrowedBook> finalList = new List <BorrowedBook>(); retVal = (object)finalList; } // if request type is room bookings if (requestType == SystemEnumList.RequestTypeTodayActivity.RoomBookings.GetDescription()) { // returning blank list List <SpaceBooking> finalList = new List <SpaceBooking>(); retVal = (object)finalList; } } } return(retVal); } }
/// <summary> /// Get Space Details Complete /// </summary> /// <param name="customerId">customerId</param> /// <param name="searchText">searchText</param> /// <param name="startRowIndex">startRowIndex</param> /// <param name="endRowIndex">endRowIndex</param> /// <param name="sortExpression">Sort Expression</param> /// <param name="sortDirection">Sort Direction</param> /// <returns>Space Details</returns> public List <SpaceBooking> GetSpaceDetailsOfCustomer(int customerId, string searchText, int?startRowIndex, int?endRowIndex, string sortExpression, string sortDirection) { List <SpaceBooking> retVal = new List <SpaceBooking>(); using (CustomContext service = new CustomContext()) { DataSet ds = service.GetSpaceDetailsOfCustomer(customerId, searchText, startRowIndex, endRowIndex, sortExpression, sortDirection); if (ds?.Tables.Count > 0) { if (ds.Tables[0]?.Rows.Count > 0) { retVal = ConvertTo.DataTableIntoList <SpaceBooking>(ds.Tables[0]); } } return(retVal); } }
/// <summary> /// Get book comments /// </summary> /// <param name="bookId">bookId</param> /// <param name="searchText">searchText</param> /// <param name="startRowIndex">startRowIndex</param> /// <param name="endRowIndex">endRowIndex</param> /// <param name="sortExpression">sortExpression</param> /// <param name="sortDirection">sortDirection</param> /// <returns> return book comments</returns> public List <BookDiscussion> GetBookComments(int bookId, string searchText, int?startRowIndex, int?endRowIndex, string sortExpression, string sortDirection) { List <BookDiscussion> retVal = new List <BookDiscussion>(); using (CustomContext service = new CustomContext()) { DataSet ds = service.GetBookDiscussions(bookId, searchText, startRowIndex, endRowIndex, sortExpression, sortDirection); if (ds?.Tables.Count > 0) { if (ds.Tables[0]?.Rows.Count > 0) { retVal = ConvertTo.DataTableIntoList <BookDiscussion>(ds.Tables[0]); } } return(retVal); } }
/// <summary> /// Get Book Details Complete /// </summary> /// <param name="bookId">bookId</param> /// <param name="customerId">Customer Id</param> /// <returns>Book Details</returns> public Book GetBookDetailsComplete(int bookId, int?customerId = null) { Book retVal = new Book(); using (CustomContext service = new CustomContext()) { DataSet ds = service.GetBookDetailsComplete(bookId, customerId); if (ds?.Tables.Count > 0) { if (ds.Tables[0]?.Rows.Count > 0) { retVal = ConvertTo.DataTableIntoList <Book>(ds.Tables[0]).FirstOrDefault(); } } return(retVal); } }
/// <summary> /// Get Book Borrowed Details /// </summary> /// <param name="bookId">bookId</param> /// <param name="statusId">statusId</param> /// <param name="active">active</param> /// <param name="startRowIndex">startRowIndex</param> /// <param name="endRowIndex">endRowIndex</param> /// <param name="sortExpression">sortExpression</param> /// <param name="sortDirection">sortDirection</param> /// <param name="searchText">searchText</param> /// <returns> Book Borrowed Details</returns> public List <BorrowedBook> GetBookBorrowedDetails(int bookId, int?statusId = null, int?active = 1, int?startRowIndex = null, int?endRowIndex = null, string sortExpression = null, string sortDirection = null, string searchText = null) { List <BorrowedBook> retVal = new List <BorrowedBook>(); using (CustomContext service = new CustomContext()) { DataSet ds = service.GetBookBorrowedDetails(bookId, statusId, active, startRowIndex, endRowIndex, sortExpression, sortDirection, searchText); if (ds?.Tables.Count > 0) { if (ds.Tables[0]?.Rows.Count > 0) { retVal = ConvertTo.DataTableIntoList <BorrowedBook>(ds.Tables[0]).ToList(); } } return(retVal); } }
/// <summary> /// Get page access list /// </summary> /// <param name="roleId">roleId</param> /// <returns> return list of page access</returns> public object GetPageAccessBasedOnUserRole(int?roleId) { List <PageAccess> pageAccessesList = new List <PageAccess>(); using (CustomContext service = new CustomContext()) { DataSet ds = service.GetPageAccessBasedOnUserRole(roleId); if (ds?.Tables.Count > 0) { if (ds.Tables[0]?.Rows.Count > 0) { pageAccessesList = ConvertTo.DataTableIntoList <PageAccess>(ds.Tables[0]).ToList(); } } } return((object)pageAccessesList); }
/// <summary> /// Login method /// </summary> /// <param name="userEmail">Email Id</param> /// <returns> return login response</returns> public Login GetCustomerLoginwithEmail(string userEmail) { Login respModel = new Login(); using (CustomContext service = new CustomContext()) { DataSet ds = service.CustomerLoginwithEmail(userEmail); if (ds?.Tables.Count > 0) { if (ds.Tables[0]?.Rows.Count > 0) { respModel.Customerdata = ConvertTo.DataTableIntoList <Customer>(ds.Tables[0]).ToList().FirstOrDefault(); } } } return(respModel); }
/// <summary> /// Login method /// </summary> /// <param name="model">model</param> /// <returns> return login response</returns> public Login GetUserLogin(Login model) { Login respModel = new Login(); using (CustomContext service = new CustomContext()) { DataSet ds = service.UserLogin(model.Email, model.Password); if (ds?.Tables.Count > 0) { if (ds.Tables[0]?.Rows.Count > 0) { respModel.Userdata = ConvertTo.DataTableIntoList <User>(ds.Tables[0]).ToList().FirstOrDefault(); } } } return(respModel); }