//报名参加 public ActionResult SaveJoin() { string key = HCRequest.GetString("key"); string username = HCRequest.GetString("username"); string telphone = HCRequest.GetString("telphone"); string message = HCRequest.GetString("message"); string themeid = HCRequest.GetString("themeid"); string uwx = ""; if (key.Contains('@')) { uwx = key.Split('@')[1]; } bool hasSignIn = TravelThemeLogic.HasSignIn(uwx, themeid); if (hasSignIn) { return(Json(new { success = false, msg = "已经报名过" })); } else { int rows = TravelThemeLogic.SaveJoin(username, telphone, message, uwx, themeid); return(Json(new { success = rows > 0, msg = rows > 0?"报名成功":"报名失败" })); } }
public ActionResult GetThemeList(int id) { string key = HCRequest.GetString("key"); string weixinid = "";//酒店微信id if (!key.Equals("") && key.Contains("@")) { weixinid = key.Split('@')[0];//酒店微信id } int curpage = HCRequest.getInt("page"); // int pagesize = HCRequest.getInt("pagesize"); int sort = HCRequest.getInt("sort"); //距离,价格高低 排序 string themetype = HCRequest.GetString("type"); //多个类型逗号隔开 string endcity = HCRequest.GetString("cityname"); string keyworks = HCRequest.GetString("keyworks"); List <LXS_ThemeView> listTheme = TravelThemeLogic.GetThemeList(weixinid, curpage, pagesize, sort, themetype, endcity, keyworks); Newtonsoft.Json.Converters.IsoDateTimeConverter timeFormat = new Newtonsoft.Json.Converters.IsoDateTimeConverter(); timeFormat.DateTimeFormat = "yyyy-MM-dd HH:mm:ss"; string strJson = Newtonsoft.Json.JsonConvert.SerializeObject(listTheme, timeFormat); return(Json( new { success = true, msg = strJson, nextpage = listTheme.Count == pagesize ? curpage + 1 : curpage } )); }
//主题内容 public ActionResult ThemeDetail(int id) { string themeid = HCRequest.GetString("themeid"); string key = HCRequest.GetString("key"); string uwx = ""; if (!key.Equals("") && key.Contains("@")) { uwx = key.Split('@')[1]; } LXS_ThemeView model = TravelThemeLogic.GetThemeModel(themeid); ViewData["model"] = model; ViewData["uwx"] = uwx; List <LXS_JoinTheme> listJoin = TravelThemeLogic.GetJoinList(themeid); ViewData["listJoin"] = listJoin; bool hasSignIn = TravelThemeLogic.HasSignIn(uwx, themeid); ViewData["hasSignIn"] = hasSignIn; ViewData["hId"] = id; ViewData["key"] = key; return(View()); }
/// <summary> /// 免费WIFI页获取门店下所有WIFI /// </summary> /// <returns></returns> public JsonResult GetWiFiForFreeWifiPage() { int shopId = HCRequest.GetInt("shopId", 0); var wifis = wifiService.GetValidWifis(shopId); return(Json(wifis, JsonRequestBehavior.AllowGet)); }
public ActionResult GetMyThemeList(int id) { string key = HCRequest.GetString("key"); string weixinid = "";//酒店微信id string uwx = ""; if (!key.Equals("") && key.Contains("@")) { weixinid = key.Split('@')[0];//酒店微信id uwx = key.Split('@')[1]; } int curpage = HCRequest.getInt("page");// int pagesize = HCRequest.getInt("pagesize"); List <LXS_ThemeView> listTheme = TravelThemeLogic.GetMyThemeList(uwx, curpage, pagesize); Newtonsoft.Json.Converters.IsoDateTimeConverter timeFormat = new Newtonsoft.Json.Converters.IsoDateTimeConverter(); timeFormat.DateTimeFormat = "yyyy-MM-dd";//"yyyy-MM-dd HH:mm:ss"; string strJson = Newtonsoft.Json.JsonConvert.SerializeObject(listTheme, timeFormat); return(Json( new { success = true, msg = strJson, nextpage = listTheme.Count == pagesize ? curpage + 1 : curpage } )); }
/// <summary> /// 酒店评价列表 /// </summary> /// <returns></returns> public ActionResult CommentList() { int qFlag = HCRequest.getInt("qFlag", 0); //0全部1有图 int hotelID = Convert.ToInt32(RouteData.Values["Id"]); //HCRequest.getInt("hotelID", 0); int page = HCRequest.getInt("page", 1); int pageSize = HCRequest.getInt("pageSize", 10); var cBaseInfo = commentService.GetBaseInfo(hotelID); if (qFlag == 1) { ViewData["models"] = cBaseInfo.Comments.Where(c => !string.IsNullOrWhiteSpace(c.Imgs)).Skip((page - 1) * pageSize).Take(pageSize).ToList(); } else { ViewData["models"] = cBaseInfo.Comments.Skip((page - 1) * pageSize).Take(pageSize).ToList(); } ViewData["hssAvg"] = cBaseInfo.HSSAvg;//综合卫生评分 ViewData["fssAvg"] = cBaseInfo.FSSAvg; ViewData["nssAvg"] = cBaseInfo.NSSAvg; ViewData["assAvg"] = cBaseInfo.ASSAvg; ViewData["allAvg"] = cBaseInfo.AllAvg; //综合评分 ViewData["allcount"] = cBaseInfo.CommentAllCount; ViewData["hasPicCount"] = cBaseInfo.HasPicCount; //有图片评价数量 ViewData["hotelID"] = hotelID; ViewData["qFlag"] = qFlag; ViewData["page"] = page; return(View()); }
//酒店详细新闻 public ActionResult Newsinfo(string id) { string weixinid = HotelCloud.Common.HCRequest.GetString("weixinID"); int error = 0; string nid = HCRequest.GetString("nid"); string userWeiXinID = HotelCloud.Common.HCRequest.GetString("key"); if (!userWeiXinID.Equals("")) { weixinid = userWeiXinID.Split('@')[0]; hotel3g.Models.Cookies.SetCookies("userWeixinNO", userWeiXinID.Split('@')[1], 30, userWeiXinID.Split('@')[0]); } if (string.IsNullOrEmpty(nid) || !int.TryParse(nid, out error)) { return(base.RedirectToAction("NewsinfoList", "Hotel", new { id = id, key = userWeiXinID })); } int preid, nextid; ViewData["HotelNewsinfo"] = HotelHelper.GetNewsDetails(nid, out preid, out nextid, id); ViewData["HotelNewsID"] = nid; ViewData["preid"] = nextid; ViewData["nextid"] = preid; Hotel hotel = Cache.GetHotel(Convert.ToInt32(id)); ViewData["hotel"] = hotel; ViewData["userWeiXinID"] = hotel3g.Models.Cookies.GetCookies("userWeixinNO", weixinid); string s = hotel3g.Models.HotelHelper.getTemp(weixinid); return(View()); }
public ActionResult AddFaPiao() { int Id = HCRequest.getInt("Id"); if (Id > 0) { string uId = HCRequest.GetString("uId"); DataTable db = HotelCloud.SqlServer.SQLHelper.Get_DataTable("select * from fapiaoManager with(Nolock) where Id=@Id and userweixinid=@userweixinid", HotelCloud.SqlServer.SQLHelper.GetCon(), new Dictionary <string, HotelCloud.SqlServer.DBParam> { { "Id", new HotelCloud.SqlServer.DBParam { ParamValue = Id.ToString() } }, { "userweixinid", new HotelCloud.SqlServer.DBParam { ParamValue = uId.ToString() } }, }); ViewData["name"] = db.Rows[0]["name"].ToString(); ViewData["taxnum"] = db.Rows[0]["taxnum"].ToString(); ViewData["linktel"] = db.Rows[0]["linktel"].ToString(); } return(View()); }
public ActionResult roomlistindex(string id) { int hid = HCRequest.getInt("hid"); DateTime indate = HCRequest.getDate("indate"); DateTime outdate = HCRequest.getDate("outdate"); string hotelweixinid = HCRequest.GetString("hotelweixinid"); double graderate = WeiXinPublic.ConvertHelper.ToDouble(HCRequest.GetClearStr("graderate")); double reduce = WeiXinPublic.ConvertHelper.ToDouble(HCRequest.GetString("reduce")); int couponType = WeiXinPublic.ConvertHelper.ToInt(HCRequest.GetString("coupontype")); string gradename = HCRequest.GetString("gradename"); string membershow = HCRequest.GetString("membershow"); string dingfangmember = HCRequest.GetString("dingfangmember"); int ismember = WeiXinPublic.ConvertHelper.ToInt(HCRequest.GetString("ismember"));; var memberCardCustomList = new List <Models.Home.MemberCardCustom>(); var memberinfo = new Repository.MemberInfo(); if (membershow == "1") { memberinfo = hotel3g.Repository.MemberHelper.GetMemberInfo(hotelweixinid); if (memberinfo == null) { memberinfo = new Repository.MemberInfo(); } } if (ismember == 0 || membershow == "1") { int customcount = 0; DataTable db_CardCustom = MemberCardCustom.GetMemberCardCustomList(hotelweixinid, out customcount, 1, 50, "", ""); memberCardCustomList = DataTableToEntity.GetEntities <Models.Home.MemberCardCustom>(db_CardCustom).ToList(); } ViewData["customlist"] = memberCardCustomList; ViewData["memberinfo"] = memberinfo; ViewData["membershow"] = membershow; string ratejson = ActionController.getratejson(hid, indate, outdate, hotelweixinid, graderate, reduce, couponType); ViewData["ratejson"] = ratejson; ViewData["graderate"] = graderate; ViewData["reduce"] = reduce; ViewData["coupontype"] = couponType; ViewData["gradename"] = gradename; ViewData["dingfangmember"] = dingfangmember; ViewData["ismember"] = ismember; return(View()); }
public ActionResult ThemeIndex(int id) { string key = HCRequest.GetString("key"); ViewData["key"] = key; ViewData["hId"] = id; return(View()); }
public ActionResult EditPayPassword() { int status = -1; string errmsg = "保存失败"; string key = HotelCloud.Common.HCRequest.GetString("key"); string hotelweixinId = key.Split('@')[0]; string userweixinId = key.Split('@')[1]; string ypassword = HCRequest.GetString("ypaypassword").Trim(); string newpassword = HCRequest.GetString("newpaypassword").Trim(); DataTable db_member = RechargeCard.GetRechargeMemberPayPassword(hotelweixinId, userweixinId); if (ypassword != db_member.Rows[0]["pwd"].ToString()) { errmsg = "原密码错误"; return Json(new { Status = status, Mess = errmsg }, JsonRequestBehavior.AllowGet); } int row = RechargeCard.UpdateRechargeMemberPayPassword(hotelweixinId, userweixinId, newpassword); if (row > 0) { status = 0; errmsg = "修改成功"; } else { errmsg = "修改失败"; } if (ypassword == string.Empty) { errmsg = errmsg.Replace("修改", "设置"); } return Json(new { Status = status, Mess = errmsg }, JsonRequestBehavior.AllowGet); }
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()); }
/// <summary> /// 获取认证地址 /// </summary> /// <returns></returns> public JsonResult GetPassUrl() { string passUrl = string.Empty; var wifi = wifiService.GetWifiById(HCRequest.GetInt("wifiId", 0)); if (wifi.ProtocolType == 31 && !string.IsNullOrWhiteSpace(wifi.PassPwd)) { passUrl = "http://192.168.1.1/cgi-bin/i_free.cgic?module=portal&op=change&passwd=" + MD5Encrypt32(wifi.PassPwd); } return(Json(passUrl, JsonRequestBehavior.AllowGet)); }
public ActionResult SendMsg() { int status = -1; string errmsg = "发送失败"; string key = HotelCloud.Common.HCRequest.GetString("key"); string hotelweixinId = key.Split('@')[0]; string userweixinId = key.Split('@')[1]; string mobile = HCRequest.GetString("mobile").Trim(); string Code = new Random().Next(100000, 999999).ToString(); string MsgContent = string.Format("忘记支付密码验证码为:{0},5分钟内有效【微可牛】", Code); HotelCloud.SMS.SmsMD20140117 sms = new HotelCloud.SMS.SmsMD20140117(); sms.ReceiveMobileNo = mobile; sms.Content = MsgContent; string res = sms.Send(); if (res == "0") { int row = HotelCloud.SqlServer.SQLHelper.Run_SQL(@"insert into wkn_smssend(Mobile,SMSContent,SMSCode,Channel,Ip,WeiXinID) values(@Mobile,@SMSContent,@SMSCode,@Channel,@Ip,@WeiXinID);", HotelCloud.SqlServer.SQLHelper.GetCon(), new Dictionary <string, HotelCloud.SqlServer.DBParam> { { "Mobile", new HotelCloud.SqlServer.DBParam { ParamValue = mobile } }, { "SMSContent", new HotelCloud.SqlServer.DBParam { ParamValue = MsgContent } }, { "SMSCode", new HotelCloud.SqlServer.DBParam { ParamValue = Code } }, { "Channel", new HotelCloud.SqlServer.DBParam { ParamValue = "用户忘记支付密码" } }, { "Ip", new HotelCloud.SqlServer.DBParam { ParamValue = GetIPAddress() } }, { "WeiXinID", new HotelCloud.SqlServer.DBParam { ParamValue = userweixinId } }, }); status = 0; errmsg = "发送成功"; } return(Json(new { Status = status, Mess = errmsg }, JsonRequestBehavior.AllowGet)); }
/// <summary> /// 领取红包 /// </summary> /// <returns></returns> public JsonResult GetCoupon() { string tel = HCRequest.GetString("tel"); int hid = HCRequest.getInt("hid"); int memberid = HCRequest.getInt("memberid"); string weixinid = HCRequest.GetString("weixinid"); bool status = false; string msg = PromoterDAL.SendCustomCoupon(weixinid, tel, memberid, hid, out status); return(Json(new { status = status ? 1 : 0, msg = msg })); }
public ActionResult QuitOut() { string themeid = HCRequest.GetString("themeid"); string uwx = HCRequest.GetString("uwx"); int rows = TravelThemeLogic.QuitOut(uwx, themeid); return(Json(new { success = rows > 0 })); }
public JsonResult CurHotel() { int hid = HCRequest.getInt("hid"); string weixinid = HCRequest.GetString("weixinid"); if (hid > 0 && !string.IsNullOrEmpty(weixinid)) { string CookieName = "CurBranchHotel"; hotel3g.Models.DAL.BranchHelper.BuildCookie(CookieName, hid.ToString(), weixinid); } return(null); }
public ActionResult PicInfo(string id) { ViewData["HotelPictures"] = HotelHelper.GetHotelPictures(id); string url = HCRequest.GetString("surl").Split('@')[0]; string weixinid = HCRequest.GetString("surl").Split('@')[1]; Hotel hotel = Cache.GetHotel(Convert.ToInt32(id)); ViewData["hotel"] = hotel; ViewData["url"] = url; ViewData["weixinid"] = weixinid; return(View()); }
//订单提交界面显示 public ActionResult Fillorder(string id) { ViewData["hid"] = id; string orderjson = HCRequest.GetString("orderjson"); string key = HotelCloud.Common.HCRequest.GetString("key"); if (string.IsNullOrEmpty(orderjson)) { return(Redirect(string.Format("/hotel/index/{0}?key={1}", id, key))); } return(View()); }
// // GET: /Branch/ public ActionResult Index(string id) { //获取信息 string key = HCRequest.GetString("key"); if (!string.IsNullOrEmpty(key) && key.Split('@').Length == 2) { string weixinid = key.Split('@')[0]; string userweixinid = key.Split('@')[1]; ViewData["weixinid"] = weixinid; ViewData["userweixinid"] = userweixinid; if (string.IsNullOrEmpty(weixinid) || string.IsNullOrEmpty(userweixinid)) { return(RedirectToAction("Home", "Default")); } string fromurl = HCRequest.GetString("fromurl"); if (fromurl.ToLower().IndexOf("newsinfo") > -1) { fromurl = "/Hotel/NewsinfoList"; } if (!string.IsNullOrEmpty(fromurl)) { ViewData["fromurl"] = fromurl; string CookieName = "CurBranchHotel"; string hid = hotel3g.Models.DAL.BranchHelper.GetCookie(CookieName, weixinid); int CurHotel = string.IsNullOrEmpty(hid) ? 0 : int.Parse(hid); bool isBranch = hotel3g.Models.DAL.BranchHelper.IsBranch(weixinid); if (CurHotel > 0) { //fromurl = string.Format("http://www.weikeniu.com{0}/{1}?{2}", fromurl, CurHotel, key,Server.MapPath("~")); //Uri Url=new Uri(HttpUtility.HtmlDecode(fromurl)); //return RedirectToAction(Url.Segments[2], Url.Segments[1], new { id = CurHotel, key = key }); } } else { ViewData["fromurl"] = "/Home/Main"; } List <hotel3g.Common.Branch.HotelResponse> BranchHotel = hotel3g.Models.DAL.BranchHelper.HotelList(weixinid); ViewData["BranchHotel"] = BranchHotel; } return(View()); }
public ActionResult GetThemeLocat(string id) { string key = HCRequest.GetString("key"); string weixinid = ""; if (!key.Equals("") && key.Contains("@")) { weixinid = key.Split('@')[0];//酒店微信id } DataTable dt = TravelThemeLogic.GetThemeLocat(weixinid); return(Json(new { data = DishOrderController.SerializeDataTable(dt) }, JsonRequestBehavior.AllowGet)); }
//回复 public ActionResult SaveReply() { string key = HCRequest.GetString("key"); string replymsg = HCRequest.GetString("replymsg"); string joinid = HCRequest.GetString("joinid"); string joinname = HCRequest.GetString("joinname"); string themeid = HCRequest.GetString("themeid"); string uwx = ""; if (key.Contains('@')) { uwx = key.Split('@')[1]; } LXS_JoinTheme joinmodel = TravelThemeLogic.GetJoinModel(joinid); if (joinmodel != null) { if (joinmodel.state == 0) { int rows = TravelThemeLogic.SaveReply(replymsg, joinid, joinname, uwx, themeid); return(Json(new { success = rows > 0, msg = rows > 0 ? "回复成功" : "回复失败" })); } else { return(Json(new { success = false, msg = "该报名已经退出" })); } } else { return(Json(new { success = false, msg = "不存在该报名人" })); } }
/// <summary> /// 滑动加载评价信息 /// </summary> /// <returns></returns> public JsonResult GetComments() { int hotelID = HCRequest.getInt("hotelID", 0); int qFlag = HCRequest.getInt("qFlag", 0); int page = HCRequest.getInt("page", 1); int pageSize = HCRequest.getInt("pageSize", 10); var comments = new List <Comment>(); if (qFlag == 1) { comments = commentService.GetListByHotelID(hotelID).Where(c => !string.IsNullOrWhiteSpace(c.Imgs)).Skip((page - 1) * pageSize).Take(pageSize).ToList(); } else { comments = commentService.GetListByHotelID(hotelID).OrderByDescending(c => c.CreateTime).Skip((page - 1) * pageSize).Take(pageSize).ToList(); } return(Json(comments, JsonRequestBehavior.AllowGet)); }
public string GetNewsList(string id) { try { string hid = id, res = ""; int page = Convert.ToInt32(HCRequest.GetString("page", "1")); int temPage = 0, pageCount = 0; List <hotel3g.Models.HotelNews> hotelnews = hotel3g.Models.HotelHelper.PageNewList(10, page, hid, "id", out temPage, out pageCount); ListChangeToJson.ListChangeToJson classJson = new ListChangeToJson.ListChangeToJson(); if (temPage == 0) { return("{" + "\"ok\":" + "\"false\"}"); } res = classJson.ArrayToJsonAll(hotelnews, "data"); return("{" + "\"count\":" + temPage.ToString() + "," + res.Substring(1));; } catch { return("{" + "\"ok\":" + "\"false\"}"); } }
//清理缓存 public string ClearCache() { string hotelID = HCRequest.GetString("hotelid"); string roomID = HCRequest.GetString("roomid"); string type = HCRequest.GetString("clearType"); if (type.Equals("hotel")) { string cacheKey = string.Format("s{0}", Cache.GetCacheName(Convert.ToInt32(hotelID))); Cache.SetCache(cacheKey, new Hotel(), -1); } if (type.Equals("room")) { Cache.SetRoomsCache(string.Format("rooms_{0}", hotelID), string.Empty, -1); Cache.RemoveCache(string.Format("simpleroom_{0}", roomID)); } return(string.Empty); }
public ActionResult ValidateMsgCode() { int status = -1; string errmsg = "验证码错误"; string key = HotelCloud.Common.HCRequest.GetString("key"); string hotelweixinId = key.Split('@')[0]; string userweixinId = key.Split('@')[1]; string mobile = HCRequest.GetString("mobile").Trim(); string Code = HCRequest.GetString("code").Trim(); string smsCode = HotelCloud.SqlServer.SQLHelper.Get_Value("select SmsCode from wkn_smssend with(nolock) where weixinId=@weixinId and mobile=@mobile and addTime>@addTime and channel=@channel order by addtime desc", HotelCloud.SqlServer.SQLHelper.GetCon(), new Dictionary <string, HotelCloud.SqlServer.DBParam> { { "Mobile", new HotelCloud.SqlServer.DBParam { ParamValue = mobile } }, { "WeiXinID", new HotelCloud.SqlServer.DBParam { ParamValue = userweixinId } }, { "addTime", new HotelCloud.SqlServer.DBParam { ParamValue = DateTime.Now.AddMinutes(-5).ToString() } }, { "channel", new HotelCloud.SqlServer.DBParam { ParamValue = "用户忘记支付密码" } } }); if (!string.IsNullOrEmpty(smsCode) && Code == smsCode) { status = 0; errmsg = "验证成功"; } return(Json(new { Status = status, Mess = errmsg }, JsonRequestBehavior.AllowGet)); }
public ActionResult MyTheme(int id) { string key = HCRequest.GetString("key"); string weixinid = "";//酒店微信id string uwx = ""; if (!key.Equals("") && key.Contains("@")) { weixinid = key.Split('@')[0];//酒店微信id uwx = key.Split('@')[1]; } DataTable myinfo = TravelThemeLogic.GetMyMemberInfo(weixinid, uwx); ViewData["myinfo"] = myinfo; ViewData["hId"] = id; ViewData["key"] = key; ViewData["uwx"] = uwx; return(View()); }
public ActionResult Comment() { string key = HotelCloud.Common.HCRequest.GetString("key"); string hotelweixinId = key.Split('@')[0]; string userweixinId = key.Split('@')[1]; int hotelID = Convert.ToInt32(RouteData.Values["Id"]); int orderID = HCRequest.getInt("orderID", 0); if (commentService.CurrUserIsComment(hotelID, orderID)) { return(RedirectToAction("CommentList/" + hotelID)); } else { ViewData["hotelID"] = hotelID; ViewData["userWeixinID"] = userweixinId; ViewData["hotelWeixinID"] = hotelweixinId; ViewData["roomType"] = HCRequest.GetString("RoomType", ""); ViewData["orderID"] = orderID; return(View()); } }
public ActionResult UseTuanCode() { int status = -1; string errmsg = "操作失败"; string key = HotelCloud.Common.HCRequest.GetString("key"); string hotelweixinId = key.Split('@')[0]; string userweixinId = key.Split('@')[1]; string tuancode = HotelCloud.Common.HCRequest.GetString("tuancode").Trim(); int orderId = HCRequest.getInt("orderId"); string sql = @"update SaleProducts_OrdersTuan set Status=@Status where OrderId=@OrderId and TuanCode=@TuanCode "; int row = HotelCloud.SqlServer.SQLHelper.Run_SQL(sql, HotelCloud.SqlServer.SQLHelper.GetCon(), new Dictionary <string, HotelCloud.SqlServer.DBParam> { { "OrderId", new HotelCloud.SqlServer.DBParam { ParamValue = orderId.ToString() } }, { "TuanCode", new HotelCloud.SqlServer.DBParam { ParamValue = tuancode } }, { "Status", new HotelCloud.SqlServer.DBParam { ParamValue = ((int)ProductSaleOrderTuanStatus.已使用).ToString() } }, }); if (row > 0) { status = 0; errmsg = "操作成功"; } return(Json(new { Status = status, Mess = errmsg }, JsonRequestBehavior.AllowGet)); }
public ActionResult AddEditFaPiao() { int status = -1; string errmsg = "保存失败"; string key = HotelCloud.Common.HCRequest.GetString("key"); string hotelweixinId = key.Split('@')[0]; string userweixinId = key.Split('@')[1]; int hotelId = HotelCloud.Common.HCRequest.getInt("hotelId"); string f_name = HCRequest.GetString("f_name").Trim(); string f_no = HCRequest.GetString("f_no").Trim(); string phonenumber = HCRequest.GetString("phonenumber").Trim(); int Id = HCRequest.getInt("Id"); string uId = HCRequest.GetString("uId"); string type = HCRequest.GetString("type"); string usermobile = string.Empty; DataTable dbmember = WeiXin.Models.Home.RechargeCard.GetRechargeMemberInfo(hotelweixinId, userweixinId); if (dbmember.Rows.Count > 0) { usermobile = dbmember.Rows[0]["mobile"].ToString(); } if (type == "del") { int rows = HotelCloud.SqlServer.SQLHelper.Run_SQL("delete from FapiaoManager where Id=@Id and userweixinId=@userweixinid ", HotelCloud.SqlServer.SQLHelper.GetCon(), new Dictionary <string, HotelCloud.SqlServer.DBParam> { { "Id", new HotelCloud.SqlServer.DBParam { ParamValue = Id.ToString() } }, { "userweixinid", new HotelCloud.SqlServer.DBParam { ParamValue = uId } } }); if (rows > 0) { status = 0; errmsg = "删除成功"; } } else if (type == "default") { string sql = "update fapiaoManager set IsDefault=0 where userweixinid=@userweixinid "; if (!string.IsNullOrEmpty(usermobile)) { sql = "update fapiaoManager set IsDefault=0 where usermobile=@usermobile or userweixinid=@userweixinid "; } sql += " update fapiaoManager set IsDefault=1 where Id=@Id and userweixinId=@uId "; int rows = HotelCloud.SqlServer.SQLHelper.Run_SQL(sql, HotelCloud.SqlServer.SQLHelper.GetCon(), new Dictionary <string, HotelCloud.SqlServer.DBParam> { { "Id", new HotelCloud.SqlServer.DBParam { ParamValue = Id.ToString() } }, { "userweixinid", new HotelCloud.SqlServer.DBParam { ParamValue = userweixinId } }, { "uId", new HotelCloud.SqlServer.DBParam { ParamValue = uId } }, { "usermobile", new HotelCloud.SqlServer.DBParam { ParamValue = usermobile } } }); if (rows > 0) { status = 0; errmsg = "设置成功"; } } else { if (Id == 0) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into FapiaoManager("); strSql.Append("HotelId,weixinId,userweixinId,UserMobile,Name,TaxNum,LinkTel"); strSql.Append(") values ("); strSql.Append("@HotelId,@weixinId,@userweixinId,@UserMobile,@Name,@TaxNum,@LinkTel"); 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> { { "HotelId", new HotelCloud.SqlServer.DBParam { ParamValue = hotelId.ToString() } }, { "weixinId", new HotelCloud.SqlServer.DBParam { ParamValue = hotelweixinId } }, { "userweixinId", new HotelCloud.SqlServer.DBParam { ParamValue = userweixinId } }, { "Name", new HotelCloud.SqlServer.DBParam { ParamValue = f_name } }, { "TaxNum", new HotelCloud.SqlServer.DBParam { ParamValue = f_no } }, { "LinkTel", new HotelCloud.SqlServer.DBParam { ParamValue = phonenumber } }, { "UserMobile", new HotelCloud.SqlServer.DBParam { ParamValue = usermobile } }, }); if (Convert.ToInt32(obj) > 0) { status = 0; errmsg = "添加成功"; } } else { StringBuilder strSql = new StringBuilder(); strSql.Append("update FapiaoManager set "); strSql.Append("UserMobile=@UserMobile ,"); strSql.Append("Name=@Name ,"); strSql.Append("TaxNum=@TaxNum ,"); strSql.Append("LinkTel=@LinkTel "); strSql.Append(" where Id=@Id and userweixinId=@userweixinId"); int rows = HotelCloud.SqlServer.SQLHelper.Run_SQL(strSql.ToString(), HotelCloud.SqlServer.SQLHelper.GetCon(), new Dictionary <string, HotelCloud.SqlServer.DBParam> { { "Name", new HotelCloud.SqlServer.DBParam { ParamValue = f_name } }, { "TaxNum", new HotelCloud.SqlServer.DBParam { ParamValue = f_no } }, { "LinkTel", new HotelCloud.SqlServer.DBParam { ParamValue = phonenumber } }, { "UserMobile", new HotelCloud.SqlServer.DBParam { ParamValue = usermobile } }, { "Id", new HotelCloud.SqlServer.DBParam { ParamValue = Id.ToString() } }, { "userweixinId", new HotelCloud.SqlServer.DBParam { ParamValue = uId } }, }); if (rows > 0) { status = 0; errmsg = "保存成功"; } } } return(Json(new { Status = status, Mess = errmsg }, JsonRequestBehavior.AllowGet)); }