Ejemplo n.º 1
0
        public ActionResult DoImportStaticData(string type)
        {
            JsResultObject re      = new JsResultObject();
            DataBiz        dataBiz = DataBiz.GetInstant();
            int            num     = 0;

            if (type == "Hotel")
            {
                dataBiz.ImportHotelList();
                num = 1;
            }
            else if (type == "Geo")
            {
                dataBiz.ImportGeoList();
                dataBiz.ImportGeoLocationList();
                num = 1;
            }
            else if (type == "Brand")
            {
                dataBiz.ImportBrandList();
                num = 1;
            }
            else if (type == "Dict")
            {
                dataBiz.ImportDictList();
                num = 1;
            }
            re.code = JsResultObject.CODE_SUCCESS;
            re.msg  = string.Format("{0}:成功导入", DateTime.Now.ToLongTimeString());
            return(JsonText(re, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 2
0
        public ActionResult DoCancelRebate(string remark)
        {
            MemberModel member  = BaseZdBiz.Load <MemberModel>(this.getAuthMember().id);
            DataBiz     dataBiz = DataBiz.GetInstant();

            /*
             * MemberRewardLogModel rewardLog = new MemberRewardLogModel();
             * rewardLog.memberFk = member.id;
             * rewardLog.remark = remark;
             * rewardLog.moblie = moblie;
             * rewardLog.exchangeType = exchangeType;
             * rewardLog.exchangeStatus = MemberRewardLogModel.EXCHANGE_STATUS_UNEXCHANGE;
             * rewardLog.setPk(rewardLog.createPk());
             * rewardLog.amount = dataBiz.getMemberCurAmount(member);
             * rewardLog.createDate = DateTime.Now;
             * */
            member.rebateInd = BaseModel.IND_N;
            JsResultObject re = BaseZdBiz.Update(member, "");


            if (re.code == JsResultObject.CODE_SUCCESS)
            {
                this.SetResult(JsResultObject.CODE_ALERT, "兑换请求已取消,欢迎随时申请兑换", true);
            }
            else
            {
                this.SetResult(JsResultObject.CODE_ALERT, "兑换取消失败", true);
            }

            return(Redirect(this.getPreUrl()));
        }
Ejemplo n.º 3
0
        public ActionResult DoDeal(int id)
        {
            OrderModel order   = BaseZdBiz.Load <OrderModel>(id);
            DataBiz    dataBiz = DataBiz.GetInstant();

            JsResultObject re = new JsResultObject();

            if (StringUtil.IsIn(order.orderStatus, new string[] { OrderModel.ORDER_STATUS_COMMENTED, OrderModel.ORDER_STATUS_DEAL, OrderModel.ORDER_STATUS_CANCEL }))
            {
                re.code = JsResultObject.CODE_ERROR;
                re.msg  = string.Format("订单{0} 状态为 {1},不能取消"
                                        , order.id
                                        , OrderModel.GetDictOrderStatus()[order.orderStatus]
                                        );
            }
            else
            {
                order.orderStatus = OrderModel.ORDER_STATUS_DEAL;
                re = BaseZdBiz.Update(order, "");
                if (re.code == JsResultObject.CODE_SUCCESS)
                {
                    re.title = "订单处理成功";
                    re.msg   = string.Format("订单:{0} 成交完成", id);
                }
                else
                {
                    re.title = "订单处理失败";
                }
            }
            return(JsonText(re, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 4
0
        public void startImageLocal()
        {
            string basePath = tbRootPath.Text.Trim();

            if (string.IsNullOrEmpty(basePath))
            {
                MessageBox.Show("请先设置图片路径");
                return;
            }
            DataBiz   dataBiz = DataBiz.GetInstant();
            ICriteria icr     = BaseZdBiz.CreateCriteria <HotelImageModel>();
            IList <HotelImageModel> images = icr.List <HotelImageModel>();
            JsResultObject          re     = new JsResultObject();

            foreach (HotelImageModel image in images)
            {
                if (isStop)
                {
                    break;
                }
                JsResultObject tempRe = dataBiz.LocalHotelImage(basePath, image, false);
                re.rowNum += tempRe.rowNum;
                if (image.title.Contains("外观"))
                {
                    tempRe     = dataBiz.LocalHotelImage(basePath, image, true);
                    re.rowNum += tempRe.rowNum;
                }
                this.tsslResult.Text = string.Format("({0}/{1}){2}:{3}", re.rowNum, images.Count, image.title, tempRe.msg);
            }
        }
Ejemplo n.º 5
0
        public ActionResult DoRecommend(string hotelId)
        {
            HotelModel     hotel   = BaseZdBiz.Load <HotelModel>(hotelId);
            DataBiz        dataBiz = DataBiz.GetInstant();
            JsResultObject result  = dataBiz.recommendHotel(hotel, 0, "");

            return(JsonText(result, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 6
0
        public ActionResult DoSetHotBrand(string brandId)
        {
            BrandModel     e       = BaseZdBiz.Load <BrandModel>(brandId);
            DataBiz        dataBiz = DataBiz.GetInstant();
            JsResultObject result  = dataBiz.setHotBrand(e, 0, "");

            return(JsonText(result, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string  path    = Server.MapPath("");
            DataBiz dataBiz = DataBiz.GetInstant();

            //dataBiz.ImportBrandList();
            CacheBiz cacheBiz = CacheBiz.GetInstant(path);

            cacheBiz.reflashDictCache();
            //cacheBiz.reflashHotelCache();
            //cacheBiz.reflashBrandCache();
        }
Ejemplo n.º 8
0
        public ActionResult DoCancel(int orderId)
        {
            MemberModel    member  = this.getAuthMember();
            DataBiz        dataBiz = DataBiz.GetInstant();
            OrderModel     order   = BaseZdBiz.Load <OrderModel>(orderId);
            JsResultObject re      = dataBiz.cancelOrder(order, "", "");

            this.SetResult(re, true);
            IList <OrderModel> orders = BaseZdBiz.List <OrderModel>(Restrictions.Eq("memberFk", member.id));

            ViewData[typeof(OrderModel).Name] = orders;
            return(View("Index"));
        }
Ejemplo n.º 9
0
        public ActionResult DoRebate(string memberId, int rebateAmount, string remark)
        {
            JsResultObject re      = new JsResultObject();
            MemberModel    member  = BaseZdBiz.Load <MemberModel>(memberId);
            DataBiz        dataBiz = DataBiz.GetInstant();

            re = dataBiz.rebateReward(member, rebateAmount, remark);
            if (re.code == JsResultObject.CODE_SUCCESS)
            {
                member.rebateInd = BaseModel.IND_N;
                re = BaseZdBiz.Update(member, "会员");
            }
            return(JsonText(re, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 10
0
        public ActionResult DoSubmitMemberComment()
        {
            MemberModel        member  = this.getAuthMember();
            MemberCommentModel comment = new MemberCommentModel();

            comment          = WebUtil.Eval <MemberCommentModel>(comment, "", "");
            comment.memberFk = member.id;
            DataBiz        dataBiz = DataBiz.GetInstant();
            JsResultObject re      = dataBiz.submitComment(comment);

            this.SetResult(re, true);
            IList <OrderModel> orders = BaseZdBiz.List <OrderModel>(Restrictions.Eq("memberFk", member.id));

            ViewData[typeof(OrderModel).Name] = orders;
            return(View("Index"));
        }
Ejemplo n.º 11
0
        public ActionResult DoSubmit()
        {
            MemberModel member = new MemberModel();

            member = WebUtil.Eval <MemberModel>(member, "", "");

            ViewData[typeof(MemberModel).Name] = member;
            DataBiz        dataBiz = DataBiz.GetInstant();
            JsResultObject re      = dataBiz.checkMemberRegInfo(member);

            if (re.code == JsResultObject.CODE_SUCCESS)
            {
                re = dataBiz.submitMemberRegInfo(member);
                if (re.code == JsResultObject.CODE_SUCCESS)
                {
                    /*
                     * MemberRewardModel reward = new MemberRewardModel();
                     * reward.busType = MemberRewardModel.BUS_TYPE_NEW_MEMBER;
                     * reward.amount = 10;
                     * reward.remark = string.Format("{0}新会员注册成功",DateTime.Now.ToShortDateString());
                     * reward.memberFk = member.id;
                     * reward.createDate = DateTime.Now;
                     * reward.setPk(reward.createPk());
                     * reward.rebateStatus = MemberRewardModel.REBATE_STATUS_UNREBATED;
                     * re= BaseZdBiz.Save(reward);
                     */
                    member.pwd = "";
                    WebUtil.SetSessionAttr(typeof(MemberModel).Name, member);
                    OrderModel order = WebUtil.GetSessionAttr <OrderModel>(typeof(OrderModel).Name);
                    if (order != null)
                    {
                        order          = BaseZdBiz.Load <OrderModel>(order.id);
                        order.memberFk = member.id;
                        BaseZdBiz.Update(order, "");
                        WebUtil.SetSessionAttr(typeof(OrderModel).Name, null);
                    }
                    return(View("RequestVaildate"));
                }
                else
                {
                    return(View("Error"));
                }
            }
            ViewData[typeof(JsResultObject).Name] = re;
            return(View("Index"));
        }
Ejemplo n.º 12
0
        private void startImportHotelDetail()
        {
            DataBiz        dataBiz = DataBiz.GetInstant();
            JsResultObject re      = new JsResultObject();

            int i = 1;

            foreach (HotelModel hotel in _hotels)
            {
                if (isStop)
                {
                    break;
                }

                if (this.lvImportHotels.Items.Count > 200)
                {
                    this.lvImportHotels.Items.Clear();
                }

                this.Update();

                ListViewItem lvi = null;
                try
                {
                    re.rowNum           += dataBiz.ImportHotelDetail(hotel.hotelId, this.cbSubInfo.Checked).rowNum;
                    this.tsslResult.Text = string.Format("({0}/{1}){2}:{3}导入中....", i++, _hotels.Count(), hotel.hotelId, hotel.hotelName);
                    if (re.rowNum > 0)
                    {
                        lvi = new ListViewItem(new string[] { hotel.hotelId, hotel.hotelName, DateTime.Now.ToShortTimeString(), re.rowNum.ToString() });
                    }
                    else
                    {
                        lvi = new ListViewItem(new string[] { hotel.hotelId, hotel.hotelName, DateTime.Now.ToShortTimeString(), "0" });
                    }
                }
                catch (Exception ex)
                {
                    lvi = new ListViewItem(new string[] { hotel.hotelId, hotel.hotelName, DateTime.Now.ToShortTimeString(), "0", ex.Message });
                }
                finally
                {
                    this.lvImportHotels.Items.Add(lvi);
                }
            }
        }
Ejemplo n.º 13
0
        public ActionResult DoImportFromElong(string hotelId)
        {
            JsResultObject re      = new JsResultObject();
            DataBiz        dataBiz = DataBiz.GetInstant();

            re = dataBiz.ImportHotelDetail(hotelId, true);
            if (re.rowNum >= 1)
            {
                re.title = "操作成功";
                re.msg   = string.Format("成功从eLong导入酒店:{0}", hotelId);
            }
            else
            {
                re.title = "操作失败";
                re.code  = JsResultObject.CODE_ERROR;
            }
            return(JsonText(re, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 14
0
        public ActionResult DoSubmitOrder(string arraivalLastTimeType)
        {
            JsResultObject re     = new JsResultObject();
            MemberModel    member = this.getAuthMember();


            OrderModel order = new OrderModel();

            DateTimeUtil.FixMSSQLNullDateTime(ref order);
            order.createDate = DateTime.Now;

            order = WebUtil.Eval(order, "", "");

            if (member != null)
            {
                order.memberFk = member.id;
                // re.code = JsResultObject.CODE_ALERT;
                // re.msg = "未登录用户不能进行酒店预定";

                // WebUtil.SetSessionAttr(typeof(JsResultObject).Name,re);
                // return RedirectToAction("Login","Home");
                //WebUtil.SetSessionAttr(typeof(OrderModel).Name, order);
            }
            if (arraivalLastTimeType == "a")
            {
                order.arraivalLateTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 18, 0, 0);
            }
            else if (arraivalLastTimeType == "b")
            {
                DateTime dt = DateTime.Now.AddDays(1);
                order.arraivalLateTime = new DateTime(dt.Year, dt.Month, dt.Day, 6, 0, 0);
            }

            DataBiz dataBiz = DataBiz.GetInstant();

            re = dataBiz.createNewOrder(order);
            re.attrs.Add(typeof(OrderModel).Name, order);
            ViewData[typeof(JsResultObject).Name] = re;

            HotelRoomModel room = BaseZdBiz.Load <HotelRoomModel>(Restrictions.Eq("hotelFk", order.hotelId), Restrictions.Eq("roomTypeId", order.roomTypeId));

            ViewData[typeof(HotelRoomModel).Name] = room;
            return(View("OrderFeedback"));
        }
Ejemplo n.º 15
0
        private void btnImport_Click(object sender, EventArgs e)
        {
            this.tsslResult.Text = "开始导入。。。";
            this.lvImportHotels.Items.Clear();
            string    keyword = tbKeyword.Text.Trim();
            ICriteria icr     = BaseZdBiz.CreateCriteria <HotelModel>();

            icr.SetFirstResult(Convert.ToInt32(this.nudMin.Value));
            icr.SetMaxResults(Convert.ToInt32(this.nudMax.Value));
            icr.Add(Restrictions.Like("hotelName", "%" + keyword + "%"));
            _hotels = icr.List <HotelModel>();
            DataBiz dataBiz = DataBiz.GetInstant();

            isStop = false;

            Thread t = new Thread(new ThreadStart(startImportHotelDetail));

            t.Start();
        }
Ejemplo n.º 16
0
        public ActionResult DoCancelOrder(int cancelOrderId, string cancelCode, string cancelReason)
        {
            DataBiz        dataBiz = DataBiz.GetInstant();
            OrderModel     order   = BaseZdBiz.Load <OrderModel>(cancelOrderId);
            JsResultObject re      = new JsResultObject();

            if (StringUtil.IsIn(order.orderStatus, new string[] { OrderModel.ORDER_STATUS_COMMENTED, OrderModel.ORDER_STATUS_DEAL }))
            {
                re.code = JsResultObject.CODE_ERROR;
                re.msg  = string.Format("订单{0} 状态为 {1},不能取消"
                                        , order.id
                                        , OrderModel.GetDictOrderStatus()[order.orderStatus]
                                        );
            }
            else
            {
                re = dataBiz.cancelOrder(order, cancelCode, cancelReason);
            }
            return(JsonText(re, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 17
0
        public ActionResult DoSubmitToElong(int id)
        {
            OrderModel order = BaseZdBiz.Load <OrderModel>(id);
            //order = WebUtil.Eval(order, "", "");
            JsResultObject re      = new JsResultObject();
            DataBiz        dataBiz = DataBiz.GetInstant();

            if (StringUtil.IsIn(order.orderStatus, new string[] { OrderModel.ORDER_STATUS_COMMENTED, OrderModel.ORDER_STATUS_DEAL }))
            {
                re.code = JsResultObject.CODE_ERROR;
                re.msg  = string.Format("订单{0} 状态为 {1},不能再处理"
                                        , order.id
                                        , OrderModel.GetDictOrderStatus()[order.orderStatus]
                                        );
            }
            else
            {
                re = dataBiz.submitOrder(order, true);
            }
            return(JsonText(re, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 18
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string  path    = Server.MapPath("");
            DataBiz dataBiz = DataBiz.GetInstant();

            //dataBiz.ImportBrandList();
            AdminBiz adminBiz = AdminBiz.GetInstant();

            if (!adminBiz.isAuthority())
            {
                Response.Redirect(WebUtil.GetWebRootPath() + "/Admin/System/Login");
            }

            CacheBiz cacheBiz = CacheBiz.GetInstant(path);

            cacheBiz.reflashDictCache();
            cacheBiz.reflashGeoCache();
            //cacheBiz.reflashRoleCache();
            //cacheBiz.reflashHotelCache();
            System.Configuration.ConfigurationManager.AppSettings["ZDSL.Biz.auto.order"] = "Y";
        }
Ejemplo n.º 19
0
        protected void VdCityTopHotel(int rows, string[] cityNames)
        {
            Dictionary <string, IList <HotelDetailModel> >           dictCityHotels = new Dictionary <string, IList <HotelDetailModel> >();
            Dictionary <string, IList <GeoCommercialLocationModel> > dictCityGeoCls = new Dictionary <string, IList <GeoCommercialLocationModel> >();
            ICriteria icr     = null;
            GeoBiz    geoBiz  = GeoBiz.GetInstant();
            DataBiz   dataBiz = DataBiz.GetInstant();

            IList <HotelDetailModel> hotelDetails = dataBiz.getHotHotelDetail();

            foreach (string cityName in cityNames)
            {
                IList <HotelDetailModel> tempHotelDetails = new List <HotelDetailModel>();
                GeoModel geo    = geoBiz.GetGeoByCityName(cityName);
                string   cityId = geo.cityCode;

                foreach (HotelDetailModel hotelDetail in hotelDetails)
                {
                    if (tempHotelDetails.Count == rows)
                    {
                        break;
                    }
                    if (hotelDetail.city == cityId)
                    {
                        tempHotelDetails.Add(hotelDetail);
                    }
                }

                dictCityHotels.Add(cityName, tempHotelDetails);
                IList <GeoCommercialLocationModel> geoCls = geoBiz.GetGeoCls(geo.id);
                dictCityGeoCls.Add(cityName, geoCls);
            }

            ViewData[VD_KEY_CITY_HOT_HOTEL_DICT]   = dictCityHotels;
            ViewData[VD_KEY_CITY_HOT_GEO_CLS_DICT] = dictCityGeoCls;
        }