コード例 #1
0
        public ActionResult ManageRoomType(int draw, int start, int length)
        {
            try
            {
                IList <Roomtype> roomtypes = _hotelReservationService.LoadAllRoomType(draw, start, length);
                int count = _hotelReservationService.CountRoomType();

                var data = new List <object>();
                int sl   = start + 1;
                foreach (var roomType in roomtypes)
                {
                    var str = new List <string>();
                    str.Add(sl.ToString());
                    var employeeStatus = "";
                    str.Add(roomType.Name);
                    str.Add(Convert.ToInt32(roomType.Ratepernight).ToString());

                    str.Add(LinkGenerator.GetGeneratedDetailsEditLink("Details", "Edit", "HotelRoom", roomType.Id)
                            + LinkGenerator.GetDeleteLink("Delete", "HotelRoom", roomType.Id));
                    data.Add(str);
                    sl++;
                }
                return(Json(new
                {
                    draw = draw,
                    recordsTotal = count,
                    recordsFiltered = count,
                    start = start,
                    length = length,
                    data = data
                }));
            }
            catch (Exception)
            {
                throw;
            }
        }