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()); }
public static int AddModel(MeetingRates model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into MeetingRates("); strSql.Append("MeetingId,HotelId,AmPrice,PmPrice,NightPrice,DayPrice,Date,Status"); strSql.Append(") values ("); strSql.Append("@MeetingId,@HotelId,@AmPrice,@PmPrice,@NightPrice,@DayPrice,@Date,@Status"); strSql.Append(") "); strSql.Append(";select @@IDENTITY"); string obj = HotelCloud.SqlServer.SQLHelper.Get_Value(strSql.ToString(), HotelCloud.SqlServer.SQLHelper.GetCon(), new Dictionary <string, HotelCloud.SqlServer.DBParam> { { "MeetingId", new HotelCloud.SqlServer.DBParam { ParamValue = model.MeetingId.ToString() } }, { "HotelId", new HotelCloud.SqlServer.DBParam { ParamValue = model.HotelId.ToString() } }, { "AmPrice", new HotelCloud.SqlServer.DBParam { ParamValue = model.AmPrice.ToString() } }, { "PmPrice", new HotelCloud.SqlServer.DBParam { ParamValue = model.PmPrice.ToString() } }, { "NightPrice", new HotelCloud.SqlServer.DBParam { ParamValue = model.NightPrice.ToString() } }, { "DayPrice", new HotelCloud.SqlServer.DBParam { ParamValue = model.DayPrice.ToString() } }, { "Date", new HotelCloud.SqlServer.DBParam { ParamValue = model.Date.ToString() } }, { "Status", new HotelCloud.SqlServer.DBParam { ParamValue = model.Status.ToString() } } }); if (!string.IsNullOrEmpty(obj)) { return(Convert.ToInt32(obj)); } return(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)); }