예제 #1
0
        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());
        }
예제 #2
0
        public ActionResult Index(string id)
        {
            string key           = HotelCloud.Common.HCRequest.GetString("key");
            string hotelWeixinid = string.Empty;
            string userWeixinid  = string.Empty;

            if (!string.IsNullOrEmpty(key) && key.Contains("@"))
            {
                List <string> list = key.Split('@').ToList();
                hotelWeixinid = list[0];
                userWeixinid  = list[1];
                hotel3g.Models.Cookies.SetCookies("userWeixinNO", userWeixinid, 30, hotelWeixinid);
                ViewData["hotelWeixinid"] = hotelWeixinid;
                ViewData["userWeixinid"]  = userWeixinid;
                ViewData["generatesign"]  = WeiXin.Common.ValidateSignProduct.GenerateSign(hotelWeixinid, userWeixinid);
            }
            int hid = Convert.ToInt32(id);

            ViewData["hid"] = hid;
            string firstimgurl        = null;
            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;

            double reduce = WeiXinPublic.ConvertHelper.ToDouble(ruletable["Reduce"]);

            ViewData["reduce"] = reduce;

            int couponType = WeiXinPublic.ConvertHelper.ToInt(ruletable["CouponType"]);

            ViewData["couponType"] = couponType;

            string gradeName = WeiXinPublic.ConvertHelper.ToString(ruletable["GradeName"]);

            ViewData["gradeName"] = gradeName;

            DateTime indate  = DateTime.Now.Date;
            DateTime outdate = DateTime.Now.AddDays(1).Date;

            if (!string.IsNullOrEmpty(HCRequest.GetString("indate")) && !string.IsNullOrEmpty(HCRequest.GetString("outdate")))
            {
                if (HCRequest.getDate("outdate").Date <= DateTime.Now.Date.AddMonths(2))
                {
                    indate  = HCRequest.getDate("indate");
                    outdate = HCRequest.getDate("outdate");
                }
            }


            ViewData["indate"]  = indate;
            ViewData["outdate"] = outdate;


            ViewData["ratejson"] = ActionController.getratejson(hid, indate, outdate, hotelWeixinid, graderate, out firstimgurl, reduce, couponType);
            Models.Hotel hotel = ActionController.gethotelinfo(hid, hotelWeixinid);
            ViewData["hotel"]       = hotel;
            ViewData["firstimgurl"] = firstimgurl;


            //string commentopen = string.Empty;
            //string membershow = string.Empty;
            //string dingfangmember = string.Empty;

            //string sql = "select comment,showmemberprice,dingfang_MemberOnly from WeiXinNO with (nolock) where weixinId=@weixinId  ";
            //DataTable db_open = SQLHelper.Get_DataTable(sql, SQLHelper.GetCon(), new Dictionary<string, DBParam>()
            //        {{"weixinId",new DBParam(){ParamValue=hotelWeixinid}},

            //    });

            //if (db_open.Rows.Count > 0)
            //{
            //    commentopen = db_open.Rows[0]["comment"].ToString();
            //    membershow = db_open.Rows[0]["showmemberprice"].ToString();
            //    dingfangmember = db_open.Rows[0]["dingfang_MemberOnly"].ToString();
            //}

            //ViewData["commentopen"] = commentopen;
            //ViewData["membershow"] = membershow;
            //ViewData["dingfangmember"] = dingfangmember;


            ModuleAuthorityResponse ModuleAuthority = hotel3g.Models.DAL.AuthorityHelper.ModuleAuthority(hotelWeixinid);

            ViewData["commentopen"]    = ModuleAuthority.comment;
            ViewData["membershow"]     = ModuleAuthority.membership_price;
            ViewData["dingfangmember"] = ModuleAuthority.membership_room;

            //控制弹窗
            ViewData["memberbasics"] = ModuleAuthority.module_memberbasics;

            BaseHotelCommentInfo baseHotelCommentInfo = new BaseHotelCommentInfo();

            if (ModuleAuthority.comment == 1)
            {
                Comment comment = new Comment();
                baseHotelCommentInfo = comment.GetBaseInfo(hid);
            }
            ViewData["baseHotelCommentInfo"] = baseHotelCommentInfo;



            var memberCardCustomList = new List <Models.Home.MemberCardCustom>();
            var memberinfo           = new Repository.MemberInfo();

            if (ModuleAuthority.membership_price == 1)
            {
                memberinfo = hotel3g.Repository.MemberHelper.GetMemberInfo(hotelWeixinid);
                if (memberinfo == null)
                {
                    memberinfo = new Repository.MemberInfo();
                }
            }

            int ismember = Convert.ToBoolean(MemberCardRuleJsonobj["becomeMember"].ToString()) ? 0 : 1;

            if (ismember == 0 || ModuleAuthority.membership_price == 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;



            return(View());
        }