public Tbl_TravelAgencyOrder Add(OrderAddModel model)
        {
            var business = _otaBusinessService.Get(model.OtaBusinessId);
            var order    = new Tbl_TravelAgencyOrder
            {
                OrderNo           = OrderHelper.GenerateOrderNo(),
                OTABusinessId     = model.OtaBusinessId,
                OTABusinessName   = business.FullName,
                ValidityDateStart = model.ValidityDate,
                ValidityDateEnd   = model.ValidityDate,
                BookCount         = model.TicketItem.Sum(a => a.BookCount),
                TotalAmount       = model.TicketItem.Sum(a => a.BookCount * a.Price),
                IdCard            = model.IdCard,
                Linkman           = model.Linkman,
                Mobile            = model.Mobile,
                Remark            = model.Remark,
                CreateTime        = DateTime.Now,
                PayType           = (int)TraveAgencyPayType.UnderLine,
                PlaceOrderType    = (int)TraveAgencyPlaceOrderType.TraveAgency,
                AuditStatus       = (int)TraveAgencyAuditStatus.WaitAudit,
                OrderStatus       = (int)TraveAgencyOrderStatus.NoPay
            };

            _travelAgencyOrderRepository.Add(order);
            return(order);
        }
Example #2
0
        /// <summary>
        /// 验证数据是否被篡改,进行认证
        /// </summary>
        /// <param name="request"></param>
        /// <param name="data"></param>
        /// <param name="sign"></param>
        /// <returns></returns>
        public Tbl_OTABusiness CheckData(HeadRequest request, string data, string sign)
        {
            var business = _otaBusinessService.Get(request.InvokeUser);

            if (business == null)
            {
                return(null);
            }
            data = data.Replace(" ", "+");
            var    context = business.Saltcode.ToString().ToUpper() + data;
            string mySign  = Md5Helper.Md5Encrypt32(context);

            if (sign.ToUpper() != mySign.ToUpper())
            {
                return(null);
            }
            return(business);
        }