示例#1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            hotelid = MyCommFun.RequestInt("hotelid");
            openid  = MyCommFun.QueryString("openid");

            if (!Page.IsPostBack)
            {
                BLL.wx_hotel_dingdan dingdanbll = new BLL.wx_hotel_dingdan();
                DataSet dr = dingdanbll.GetList(openid, hotelid);
                if (dr.Tables[0].Rows.Count > 0)
                {
                    dingdannum  = dr.Tables[0].Rows.Count;
                    numdingdan  = "  <ul class=\"round\">";
                    numdingdan += "<li><a href=\"hotel_order.aspx?openid=" + openid + "&hotelid=" + hotelid + "\">  ";
                    numdingdan += "<span>我的订单<em class=\"ok\">" + dr.Tables[0].Rows.Count + "</em></span></a></li>";
                    numdingdan += " </ul>";
                }
                else
                {
                    numdingdan = "";
                }


                if (hotelid != 0)
                {
                    hoteList(hotelid);
                }
            }
        }
示例#2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            hotelid   = MyCommFun.RequestInt("hotelid");
            openid    = MyCommFun.QueryString("openid");
            dingdanid = MyCommFun.QueryString("dingdanid");
            roomid    = MyCommFun.RequestInt("roomid");

            if (!IsPostBack)
            {
                BLL.wx_hotels_info   infobll = new BLL.wx_hotels_info();
                Model.wx_hotels_info info    = new Model.wx_hotels_info();
                info  = infobll.GetModel(hotelid);
                image = info.topPic;

                BLL.wx_hotel_dingdan dingdanbll = new BLL.wx_hotel_dingdan();
                DataSet dr = dingdanbll.GetList(openid, hotelid);
                if (dr.Tables[0].Rows.Count > 0)
                {
                    numdingdan = dr.Tables[0].Rows.Count;
                }
                else
                {
                    numdingdan = 0;
                }
                this.dingdanidnum.Value = dingdanid;


                getdingdan(dingdanid);
            }
        }
示例#3
0
        public void List(int ids)
        {
            //订单
            Dingdanlist = "";
            dingdanren  = "";

            var identifyingCodeDetails = IdentifyingCodeService.GetIdentifyingCodeDetailById(cid, "hotel");

            if (identifyingCodeDetails != null && identifyingCodeDetails.Any())
            {
                decimal amount = 0;


                if (identifyingCodeDetails.FirstOrDefault().Status == 2)
                {
                    save_groupbase.Text        = "已验证";
                    save_groupbase.Enabled     = false;
                    save_groupbase.Style.Value = "";
                }
                Dingdanlist += "<tr><th>商品名称</th><th class=\"cc\">购买数量</th><th class=\"cc\">单价</th><th class=\"cc\">入住时间</th><th class=\"cc\">离店时间</th></tr>";
                foreach (var item in identifyingCodeDetails)
                {
                    Dingdanlist += " <tr><td class=\"cc\">" + item.ProductName + "</td>";
                    Dingdanlist += "<td class=\"cc\">" + item.Number + "</td>";
                    Dingdanlist += "<td class=\"cc\">" + item.Price + "</td>";
                    Dingdanlist += "<td class=\"cc\">" + item.ArriveTime + "</td>";
                    Dingdanlist += "<td class=\"cc\">" + item.LeaveTime + "</td></tr>";
                    amount      += Convert.ToDecimal(item.TotelPrice);
                }
                Dingdanlist += "<tr><td></td><td ></td><td ></td><td ></td><td class=\"rr\" style=\"color: red; font-weight:bold;\">支付总计:¥" + amount + "</td></tr>";
            }

            var hotelOrder = new BLL.wx_hotel_dingdan().GetModel(int.Parse(id));

            //订单信息
            if (hotelOrder != null)
            {
                dingdanren += "<tr><td width=\"70\">订单编号: " + hotelOrder.OrderNumber + "</td></tr>";
                dingdanren += "<tr> <td>交易日期:" + hotelOrder.orderTime + "</td></tr>";
                dingdanren += "<tr><td>预定人:" + hotelOrder.oderName + "</td></tr>";
                dingdanren += "<tr><td>电话:" + hotelOrder.tel + "</td></tr>";
            }
            else
            {
                dingdanren += "<tr><td width=\"70\">订单编号:</td></tr>";
                dingdanren += "<tr> <td>交易日期:</td></tr>";
                dingdanren += "<tr><td>预定人:</td></tr>";
                dingdanren += "<tr><td>电话:</td></tr>";
            }
        }
示例#4
0
        protected void save_groupbase_Click(object sender, EventArgs e)
        {
            Guid identifyingCodeId;

            if (Guid.TryParse(this.cid, out identifyingCodeId))
            {
                var identifyingCodeObject = IdentifyingCodeService.GetIdentifyingCodeInfoByIdentifyingCodeId(identifyingCodeId, ModuleName, this.wid);

                if (identifyingCodeObject != null)
                {
                    var order = new BLL.wx_hotel_dingdan().GetModel(int.Parse(identifyingCodeObject.OrderId));

                    if (order != null)
                    {
                        if (order.orderStatus.Value.Equals(HotelStatusManager.OrderStatus.Refunded.StatusId) ||
                            order.orderStatus.Value.Equals(HotelStatusManager.OrderStatus.Refunding.StatusId) ||
                            order.orderStatus.Value.Equals(HotelStatusManager.OrderStatus.Completed))
                        {
                            this.Response.Write(
                                "<script language='javascript' type='text/javascript'>alert('该订单已完成或进行退单处理,不能进行验证!')</script>");
                        }
                        else if (identifyingCodeObject.ShopId.Equals(this.hotelid.ToString(CultureInfo.InvariantCulture)))
                        {
                            identifyingCodeObject.Status     = 2;
                            identifyingCodeObject.ModifyTime = DateTime.Now;

                            IdentifyingCodeService.ModifyIdentifyingCodeInfo(identifyingCodeObject);

                            AddAdminLog(MXEnums.ActionEnum.Edit.ToString(), "修改支付状态,主键为" + id); //记录日志
                                                                                                //JscriptMsg("修改成功!", "dingdan_confirm.aspx?shopid=" + shopid + "", "Success");
                                                                                                //Response.Redirect("dingdan_confirm.aspx?shopid=" + shopid + "");
                            Response.Write("<script language='javascript' type='text/javascript'>alert('核销成功!');location.href = 'dingdan_confirm.aspx?shopid=" + hotelid + "';</script>");
                        }
                        else
                        {
                            this.Response.Write("<script language='javascript' type='text/javascript'>alert('核销失败。')</script>");
                        }
                    }
                    else
                    {
                        this.Response.Write("<script language='javascript' type='text/javascript'>alert('该订单不存在或未付款,请确认!')</script>");
                    }
                }
                else
                {
                    this.Response.Write("<script language='javascript' type='text/javascript'>alert('该订单不存在或未付款,请确认!')</script>");
                }
            }
        }
示例#5
0
        protected void confirm_dingdan_Click(object sender, EventArgs e)
        {
            var number = this.confirmnumber.Text.Trim();

            var identifyingCode = IdentifyingCodeService.GetConfirmIdentifyingCodeInfo(this.hotelid, number, ModuleName, wid);

            if (identifyingCode != null)
            {
                var order = new BLL.wx_hotel_dingdan().GetModel(int.Parse(identifyingCode.OrderId));

                if (order != null)
                {
                    if (order.orderStatus.Value.Equals(HotelStatusManager.OrderStatus.Refunded.StatusId) ||
                        order.orderStatus.Value.Equals(HotelStatusManager.OrderStatus.Refunding.StatusId) ||
                        order.orderStatus.Value.Equals(HotelStatusManager.OrderStatus.Completed))
                    {
                        this.Response.Write(
                            "<script language='javascript' type='text/javascript'>alert('该订单已完成或进行退单处理,不能进行验证!')</script>");
                    }
                    else
                    {
                        if (identifyingCode.Status != 1)
                        {
                            if (identifyingCode.Status == 0)
                            {
                                this.Response.Write("<script language='javascript' type='text/javascript'>alert('该商品未付款!')</script>");
                            }
                            else
                            {
                                this.Response.Write("<script language='javascript' type='text/javascript'>alert('该商品已消费或者退单,请确认!')</script>");
                            }
                        }
                        else
                        {
                            this.Response.Redirect("commodity_detail.aspx?cid=" + identifyingCode.IdentifyingCodeId + "&shopid=" + identifyingCode.ShopId + "&id=" + identifyingCode.OrderId);
                        }
                    }
                }
                else
                {
                    this.Response.Write("<script language='javascript' type='text/javascript'>alert('该订单不存在或未付款,请确认!')</script>");
                }
            }
            else
            {
                this.Response.Write("<script language='javascript' type='text/javascript'>alert('该订单不存在或未付款,请确认!')</script>");
            }
        }
示例#6
0
        private void RptBind(string _strWhere, string _orderby)
        {
            Model.wx_userweixin weixin = GetWeiXinCode();

            //判断是否已经设置了微留言基本信息
            BLL.wx_hotel_dingdan sbll = new BLL.wx_hotel_dingdan();

            _strWhere = " hotelid=" + hotelid + " " + _strWhere;

            this.page        = MXRequest.GetQueryInt("page", 1);
            txtKeywords.Text = this.keywords;
            DataSet ds = gbll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount);

            // DataSet ds = gbll.GetList( _strWhere);
            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                DataRow dr;

                int count = ds.Tables[0].Rows.Count;
                for (int i = 0; i < count; i++)
                {
                    dr = ds.Tables[0].Rows[i];
                    if (dr["orderStatus"].ToString() == "0")
                    {
                        dr["payStatusStr"] = "未处理";
                    }
                    else if (dr["orderStatus"].ToString() == "1")
                    {
                        dr["payStatusStr"] = "已确认";
                    }
                    else
                    {
                        dr["payStatusStr"] = "已拒绝";
                    }
                }
                ds.AcceptChanges();
            }
            this.rptList.DataSource = ds;
            this.rptList.DataBind();

            //绑定页码
            txtPageNum.Text = this.pageSize.ToString();
            string pageUrl = Utils.CombUrlTxt("hotel_list.aspx", "keywords={0}&page={1}", this.keywords, "__id__");

            PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
        }
示例#7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            hotelid = MyCommFun.RequestInt("hotelid");
            openid  = MyCommFun.QueryString("openid");
            if (!this.Page.IsPostBack)
            {
                BLL.wx_hotel_dingdan dingdanbll = new BLL.wx_hotel_dingdan();
                DataSet dr = dingdanbll.GetList(openid, hotelid);
                if (dr.Tables[0].Rows.Count > 0)
                {
                    numdingdan = dr.Tables[0].Rows.Count;
                }
                else
                {
                    numdingdan = 0;
                }

                List(hotelid);
            }
        }
示例#8
0
        protected void Page_Load(object sender, EventArgs e)
        {
//            hotelid = MyCommFun.RequestInt("hotelid");
            openid = MyCommFun.QueryString("openid");
            roomid = MyCommFun.RequestInt("roomid");
            wid    = MyCommFun.RequestInt("wid");
            if (!string.IsNullOrEmpty(MyCommFun.QueryString("type")))
            {
                type = MyCommFun.QueryString("type");
            }
            var userbll = new BLL.wx_userweixin();

            Model.wx_userweixin uWeiXinModel = userbll.GetModel(wid);
            OAuth2BaseProc(uWeiXinModel, "hotel_userOrder", Request.Url.AbsoluteUri);

            if (!Page.IsPostBack)
            {
                menuStr = GetMenuStr(openid, wid, type);
                BLL.wx_hotels_info   infobll = new BLL.wx_hotels_info();
                Model.wx_hotels_info info    = new Model.wx_hotels_info();



                BLL.wx_hotel_dingdan dingdanbll = new BLL.wx_hotel_dingdan();
                DataSet dr = dingdanbll.GetUserOrderList(openid, wid, type);
                if (dr.Tables[0].Rows.Count > 0)
                {
                    numdingdan = dr.Tables[0].Rows.Count;
                }
                else
                {
                    numdingdan = 0;
                }


                List(openid, wid);
            }
        }
示例#9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            hotelid = MyCommFun.RequestInt("hotelid");
            wid     = MyCommFun.RequestInt("wid");
            openid  = MyCommFun.QueryString("openid");

            string thisUrl = MyCommFun.getWebSite() + "/weixin/KNSHotel/index.aspx" + Request.Url.Query;
            var    bll     = new BLL.wx_userweixin();

            this.wid = MyCommFun.RequestWid();
            Model.wx_userweixin uWeiXinModel = bll.GetModel(wid);
            OAuth2BaseProc(uWeiXinModel, "index", thisUrl);

            if (!Page.IsPostBack)
            {
                BLL.wx_hotel_dingdan dingdanbll = new BLL.wx_hotel_dingdan();
                DataSet dr = dingdanbll.GetList(openid, hotelid);
                if (dr.Tables[0].Rows.Count > 0)
                {
                    dingdannum  = dr.Tables[0].Rows.Count;
                    numdingdan  = "  <ul class=\"round\">";
                    numdingdan += "<li><a href=\"hotel_order.aspx?openid=" + openid + "&hotelid=" + hotelid + "\">  ";
                    numdingdan += "<span>我的订单<em class=\"ok\">" + dr.Tables[0].Rows.Count + "</em></span></a></li>";
                    numdingdan += " </ul>";
                }
                else
                {
                    numdingdan = "";
                }


                if (hotelid != 0)
                {
                    hoteList(hotelid);
                }
            }
        }
示例#10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            hotelid    = MyCommFun.RequestInt("hotelid");
            openid     = MyCommFun.QueryString("openid");
            this.title = this.GetTitle();
            string thisUrl = MyCommFun.getWebSite() + "/weixin/KNSHotel/index.aspx" + Request.Url.Query;
            var    bll     = new BLL.wx_userweixin();

            this.wid = MyCommFun.RequestWid();
            Model.wx_userweixin uWeiXinModel = bll.GetModel(wid);
            OAuth2BaseProc(uWeiXinModel, "index", thisUrl);

            if (!Page.IsPostBack)
            {
                if (!string.IsNullOrEmpty(this.openid) && this.hotelid > 0)
                {
                    var dingdanbll = new BLL.wx_hotel_dingdan();
                    var hotelInfo  = new BLL.wx_hotels_info().GetModel(this.hotelid);

                    if (hotelInfo != null)
                    {
                        this.wid = hotelInfo.wid.Value;
                    }

                    DataSet dr = dingdanbll.GetList(this.openid, this.hotelid);
                    if (dr.Tables[0].Rows.Count > 0)
                    {
                        this.dingdannum = dr.Tables[0].Rows.Count;
                    }
                    else
                    {
                        this.dingdannum = 0;
                    }
                }
            }
        }
示例#11
0
        public void ProcessRequest(HttpContext context)
        {
            Dictionary <string, string> jsonDict = new Dictionary <string, string>();

            context.Response.ContentType = "text/json";
            string _action = MyCommFun.QueryString("myact");

            BLL.wx_hotel_dingdan   dingdanbll = new BLL.wx_hotel_dingdan();
            Model.wx_hotel_dingdan dingdan    = new Model.wx_hotel_dingdan();
            string hotelid  = MyCommFun.QueryString("hotelid");
            string roomid   = MyCommFun.QueryString("roomid");
            string openid   = MyCommFun.QueryString("openid");
            string oderName = MyCommFun.QueryString("oderName");
            string tel      = MyCommFun.QueryString("tel");


            if (_action == "dingdan")
            {
                dingdan.hotelid     = Convert.ToInt32(hotelid);
                dingdan.roomid      = Convert.ToInt32(roomid);
                dingdan.openid      = openid;
                dingdan.oderName    = oderName;
                dingdan.tel         = tel;
                dingdan.orderStatus = 0;


                if (Convert.ToDateTime(MyCommFun.QueryString("arriveTime")) < DateTime.Now.AddDays(-1))
                {
                    jsonDict.Add("ret", "faile");
                    jsonDict.Add("content", "入住时间不能小于今天时间!");
                    context.Response.Write(MyCommFun.getJsonStr(jsonDict));
                    return;
                }

                if (Convert.ToDateTime(MyCommFun.QueryString("arriveTime")) > Convert.ToDateTime(MyCommFun.QueryString("leaveTime")))
                {
                    jsonDict.Add("ret", "faile");
                    jsonDict.Add("content", "入住时间必须小于离店时间!");
                    context.Response.Write(MyCommFun.getJsonStr(jsonDict));
                    return;
                }

                if (MyCommFun.QueryString("arriveTime") != "")
                {
                    dingdan.arriveTime = Convert.ToDateTime(MyCommFun.QueryString("arriveTime"));
                }
                if (MyCommFun.QueryString("leaveTime") != "")
                {
                    dingdan.leaveTime = Convert.ToDateTime(MyCommFun.QueryString("leaveTime"));
                }
                dingdan.roomType  = MyCommFun.QueryString("roomType");
                dingdan.orderTime = DateTime.Now;
                dingdan.orderNum  = MyCommFun.RequestInt("orderNum");
                dingdan.isDelete  = 0;
                dingdan.price     = MyCommFun.Str2Decimal(MyCommFun.QueryString("price"));
                dingdan.yuanjia   = MyCommFun.Str2Decimal(MyCommFun.QueryString("yuanjia"));
                dingdan.remark    = MyCommFun.QueryString("remark");
                dingdanbll.Add(dingdan);

                jsonDict.Add("ret", "ok");
                jsonDict.Add("content", "提交成功!");
                context.Response.Write(MyCommFun.getJsonStr(jsonDict));
                return;
            }

            if (_action == "dingdanedite")
            {
                dingdan.id       = MyCommFun.RequestInt("dingdanidnum");
                dingdan.oderName = MyCommFun.QueryString("truename");
                dingdan.tel      = MyCommFun.QueryString("tel");

                if (Convert.ToDateTime(MyCommFun.QueryString("dateline")) < DateTime.Now.AddDays(-1))
                {
                    jsonDict.Add("ret", "faile");
                    jsonDict.Add("content", "入住时间不能小于今天时间!");
                    context.Response.Write(MyCommFun.getJsonStr(jsonDict));
                    return;
                }

                if (MyCommFun.QueryString("dateline") != "")
                {
                    dingdan.arriveTime = Convert.ToDateTime(MyCommFun.QueryString("dateline"));
                }



                dingdan.orderNum = MyCommFun.RequestInt("nums");
                dingdan.price    = Convert.ToDecimal(MyCommFun.QueryString("xianjianum"));
                dingdan.yuanjia  = Convert.ToDecimal(MyCommFun.QueryString("yuanjianum"));
                dingdan.remark   = MyCommFun.QueryString("info");
                dingdanbll.Updatehotel(dingdan);

                jsonDict.Add("ret", "ok");
                jsonDict.Add("content", "修改成功!");
                context.Response.Write(MyCommFun.getJsonStr(jsonDict));
                return;
            }

            if (_action == "dingdandelete")
            {
                int ddid = MyCommFun.RequestInt("dingdanidnum");
                dingdanbll.Update(ddid);
                jsonDict.Add("ret", "ok");
                jsonDict.Add("content", "删除成功!");
                context.Response.Write(MyCommFun.getJsonStr(jsonDict));
                return;
            }
        }
示例#12
0
        public void ProcessRequest(HttpContext context)
        {
            Dictionary <string, string> jsonDict = new Dictionary <string, string>();

            context.Response.ContentType = "text/json";
            string _action = MyCommFun.QueryString("myact");

            BLL.wx_hotel_dingdan   dingdanbll = new BLL.wx_hotel_dingdan();
            Model.wx_hotel_dingdan dingdan    = new Model.wx_hotel_dingdan();

            if (_action == "dingdan")
            {
                var isSuccess = this.CreateOrderProcess();

                if (isSuccess)
                {
                    jsonDict.Add("ret", "ok");
                    jsonDict.Add("content", "提交成功!");
                }
                else
                {
                    jsonDict.Add("ret", "err");
                    jsonDict.Add("content", "创建订单失败");
                }
                context.Response.Write(MyCommFun.getJsonStr(jsonDict));
                return;
            }

            if (_action == "dingdanedite")
            {
                dingdan.id       = MyCommFun.RequestInt("dingdanidnum");
                dingdan.oderName = MyCommFun.QueryString("truename");
                dingdan.tel      = MyCommFun.QueryString("tel");

                if (Convert.ToDateTime(MyCommFun.QueryString("arriveTime")) < DateTime.Now.AddDays(-1))
                {
                    jsonDict.Add("ret", "faile");
                    jsonDict.Add("content", "入住时间不能小于今天时间!");
                    context.Response.Write(MyCommFun.getJsonStr(jsonDict));
                    return;
                }

                if (MyCommFun.QueryString("arriveTime") != "")
                {
                    dingdan.arriveTime = Convert.ToDateTime(MyCommFun.QueryString("arriveTime"));
                }

                if (Convert.ToDateTime(MyCommFun.QueryString("leaveTime")) < dingdan.arriveTime)
                {
                    jsonDict.Add("ret", "faile");
                    jsonDict.Add("content", "离店时间不能小于入住时间!");
                    context.Response.Write(MyCommFun.getJsonStr(jsonDict));
                    return;
                }

                if (MyCommFun.QueryString("leaveTime") != "")
                {
                    dingdan.leaveTime = Convert.ToDateTime(MyCommFun.QueryString("leaveTime"));
                }



                dingdan.orderNum       = MyCommFun.RequestInt("nums");
                dingdan.price          = Convert.ToDecimal(MyCommFun.QueryString("xianjianum"));
                dingdan.yuanjia        = Convert.ToDecimal(MyCommFun.QueryString("yuanjianum"));
                dingdan.remark         = MyCommFun.QueryString("info");
                dingdan.IdentityNumber = MyCommFun.QueryString("identityNumber");
                dingdanbll.Updatehotel(dingdan);

                jsonDict.Add("ret", "ok");
                jsonDict.Add("content", "修改成功!");
                context.Response.Write(MyCommFun.getJsonStr(jsonDict));
                return;
            }

            if (_action == "dingdandelete")
            {
                //                int ddid = MyCommFun.RequestInt("dingdanidnum");
                //                dingdanbll.Update(ddid);
                //                jsonDict.Add("ret", "ok");
                //                jsonDict.Add("content", "删除成功!");
                //                context.Response.Write(MyCommFun.getJsonStr(jsonDict));
                UpdateOrder(dingdanbll, jsonDict, context, HotelStatusManager.OrderStatus.Cancelled.StatusId, "订单取消成功!");
            }
            if (_action == "dingdancompleted")
            {
                //                int ddid = MyCommFun.RequestInt("dingdanidnum");
                //                dingdanbll.Update(ddid);
                //                jsonDict.Add("ret", "ok");
                //                jsonDict.Add("content", "删除成功!");
                //                context.Response.Write(MyCommFun.getJsonStr(jsonDict));
                UpdateOrder(dingdanbll, jsonDict, context, HotelStatusManager.OrderStatus.Completed.StatusId, "操作成功!");
            }
            //            if (_action == "paymentSuccess")
            //            {
            //                int ddid = MyCommFun.RequestInt("dingdanidnum");
            //                dingdanbll.Update(ddid, "3");
            //                jsonDict.Add("ret", "ok");
            //                jsonDict.Add("content", "订单支付成功!");
            //                context.Response.Write(MyCommFun.getJsonStr(jsonDict));
            //                return;
            //            }


            //            if (_action == "dingdanPayed")
            //            {
            //                UpdateOrder(dingdanbll, jsonDict, context, StatusManager.OrderStatus.Payed.StatusId, "订单支付成功!");
            //            }

            if (_action == "dingdanPaying")
            {
                GetPayUrl(dingdanbll, context);
            }
        }