Ejemplo n.º 1
0
        public ActionResult Detail()
        {
            string key           = HotelCloud.Common.HCRequest.GetString("key");
            string hotelweixinId = key.Split('@')[0];
            string userweixinId  = key.Split('@')[1];

            int hid       = Convert.ToInt32(RouteData.Values["Id"]);
            int meetingId = Convert.ToInt32(HCRequest.GetString("meetingId"));


            var dbMeeting = Meeting.GeteMeeting(hid, meetingId);
            var meeting   = DataTableToEntity.GetEntity <Meeting>(dbMeeting);

            meeting.listMeetingTypeCapacity = new List <MeetingTypeCapacity>();
            if (!string.IsNullOrEmpty(meeting.TypeAndHoldInfo) && meeting.TypeAndHoldInfo.Contains("{"))
            {
                meeting.listMeetingTypeCapacity = Newtonsoft.Json.JsonConvert.DeserializeObject <List <MeetingTypeCapacity> >(meeting.TypeAndHoldInfo);
            }


            ViewData["meeting"] = meeting;


            var date = Convert.ToDateTime(Request.QueryString["date"]);
            List <MeetingRates> rateList = new List <MeetingRates>();

            if (meeting.PayType == 0)
            {
                DataTable dbRates = MeetingRates.GeteMeetingRatesList(hid, meetingId, date);
                rateList = DataTableToEntity.GetEntities <MeetingRates>(dbRates).ToList();
            }
            ViewData["rateList"] = rateList;

            DataTable db_pics = Meeting.GetMeetingPics(hid);
            var       picList = DataTableToEntity.GetEntities <RoomTypeImgEntity>(db_pics);

            picList             = picList.Where(c => c.RoomId == meetingId).ToList();
            ViewData["picList"] = picList;



            string MemberCardRuleJson = ActionController.getMemberCardIntegralRule(userweixinId, hotelweixinId);

            ViewData["MemberCardRuleJson"] = MemberCardRuleJson;
            Hashtable MemberCardRuleJsonobj = Newtonsoft.Json.JsonConvert.DeserializeObject <Hashtable>(MemberCardRuleJson);
            Hashtable ruletable             = Newtonsoft.Json.JsonConvert.DeserializeObject <Hashtable>(MemberCardRuleJsonobj["rule"].ToString());
            double    graderate             = WeiXinPublic.ConvertHelper.ToDouble(ruletable["GradeRate"]);

            ViewData["graderate"] = graderate;

            Hotel hotel = HotelHelper.GetMainIndexHotel(hid);

            ViewData["hotelName"] = hotel.SubName;

            return(View());
        }
Ejemplo n.º 2
0
        public ActionResult GetRateList(string id)
        {
            string key       = HotelCloud.Common.HCRequest.GetString("key");
            int    meetingId = HotelCloud.Common.HCRequest.getInt("meetingId");

            List <MeetingRates> rateList = new List <MeetingRates>();


            DataTable dbRates = MeetingRates.GeteMeetingRatesList(Convert.ToInt32(id), meetingId);

            rateList = DataTableToEntity.GetEntities <MeetingRates>(dbRates).ToList();

            Newtonsoft.Json.Converters.IsoDateTimeConverter timeFormat = new Newtonsoft.Json.Converters.IsoDateTimeConverter();
            timeFormat.DateTimeFormat = "yyyy-M-d";
            string rateJson = Newtonsoft.Json.JsonConvert.SerializeObject(rateList, timeFormat);

            return(Json(new
            {
                Data = rateJson
            }, JsonRequestBehavior.AllowGet));
        }