public ActionResult OpenEvent()
        {
            ViewModelCalendar Model = new ViewModelCalendar();

            ViewBag.RoomtypeListVB = db.RoomTypes.Where(x => x.IsActive == true && x.Status == 1).ToList();
            ViewBag.FloorListVB    = db.Floors.Where(x => x.IsActive == true && x.Status == 1).ToList();
            // Model = CM.GetCalAddDetails();
            return(PartialView("_CalendarAddEditViewModel", Model));
        }
        public JsonResult GetEvents()
        {
            ViewModelCalendar model = new ViewModelCalendar();

            using (RoomMeetingManagementDbEntities dc = new RoomMeetingManagementDbEntities())
            {
                var caldetail = CM.calendardetailtomodel();
                var rows2     = caldetail.ToList();
                return(new JsonResult {
                    Data = rows2, JsonRequestBehavior = JsonRequestBehavior.AllowGet
                });
            }
        }
Beispiel #3
0
        public List <ViewModelCalendar> GetAllEventList()
        {
            List <ViewModelCalendar> Model = new List <ViewModelCalendar>();

            var data = _Db.BookRooms.Where(x => x.IsActive == true).OrderByDescending(x => x.DId).ToList();

            if (data.Count > 0)
            {
                var count = 0;
                foreach (var item in data)
                {
                    ViewModelCalendar model = new ViewModelCalendar();
                    count++;
                    var floordetails    = getfloor_ListValueById((Guid)item.FloorId);
                    var Roomtypedetails = getRoomtype_ListValueById((Guid)item.RoomTypeId);
                    var Roomdetails     = getRoom_ListValueById((Guid)item.RoomId);
                    model.BookRoomId = item.BookRoomId;
                    // model.Count = count;
                    model.Start       = item.StartDate;
                    model.End         = item.EndDate;
                    model.Description = item.Description;
                    model.Capacity    = (int)item.Capacity;
                    //model.MinCapacity = (int)item.Capacity;
                    //model.MaxCapacity = (int)item.Capacity;
                    if (floordetails != null)
                    {
                        model.Floor = floordetails.FloorName;
                    }
                    if (Roomdetails != null)
                    {
                        model.Room = Roomdetails.RoomName;
                    }
                    if (Roomtypedetails != null)
                    {
                        model.RoomType = Roomtypedetails.RoomtypeName;
                    }

                    Model.Add(model);
                }
            }
            return(Model);
        }