Exemplo n.º 1
0
        /// <summary>
        /// 退团事件
        /// </summary>
        /// <returns></returns>
        private string PageSave()
        {
            string msg = string.Empty;

            #region 获取表单
            string travellerId   = Utils.GetQueryStringValue("id");
            string travellerName = Utils.GetFormValue(this.txt_reBackName.UniqueID);
            EyouSoft.Model.EnumType.GovStructure.Gender travellerSex = Utils.GetFormValue(this.rad_Man.UniqueID) == "0" ? EyouSoft.Model.EnumType.GovStructure.Gender.男 : EyouSoft.Model.EnumType.GovStructure.Gender.女;
            DateTime leaveDate    = Utils.GetDateTime(Utils.GetFormValue(this.txt_reBackDate.UniqueID));
            decimal  reBackMoney  = Utils.GetDecimal(Utils.GetFormValue(this.txt_reBackMoney.UniqueID));
            string   reMarkMoney  = Utils.GetFormValue(this.txt_reMarkMoney.UniqueID);
            string   reBackResion = Utils.GetFormValue(this.txt_ReBackResion.UniqueID);
            string   tourId       = Utils.GetQueryStringValue("tourId");
            string   orderId      = Utils.GetQueryStringValue("orderId");
            #endregion

            #region 游客实体类
            BTourOrder          bll            = new BTourOrder();
            MTourOrderTraveller travellerModel = bll.GetTourOrderTravellerById(travellerId);
            travellerModel.TravellerId     = travellerId;
            travellerModel.TravellerStatus = EyouSoft.Model.EnumType.TourStructure.TravellerStatus.退团;
            travellerModel.RTime           = leaveDate;
            travellerModel.RAmountRemark   = reMarkMoney;
            travellerModel.RAmount         = reBackMoney;
            travellerModel.OrderId         = orderId;
            travellerModel.CnName          = travellerName;
            travellerModel.TravellerId     = travellerId;
            travellerModel.RRemark         = reBackResion;

            #endregion

            #region 订单变更表实体类
            MTourOrderChange Model_Chang = new MTourOrderChange();

            Model_Chang.CompanyId    = SiteUserInfo.CompanyId;
            Model_Chang.TourId       = tourId;
            Model_Chang.ChangePerson = 1;
            Model_Chang.ChangePrice  = reBackMoney;
            Model_Chang.IssueTime    = DateTime.Now;
            Model_Chang.Operator     = SiteUserInfo.Name;
            Model_Chang.OrderId      = travellerModel.OrderId;
            Model_Chang.Content      = "申请退团";
            #endregion

            #region 执行更改
            bool result = bll.UpdateTourOrderTraveller(travellerModel, Model_Chang);
            if (result)
            {
                msg = UtilsCommons.AjaxReturnJson("1", "退团成功!");
            }
            else
            {
                msg = UtilsCommons.AjaxReturnJson("0", "退团失败!");
            }
            return(msg);

            #endregion
        }
Exemplo n.º 2
0
        /// <summary>
        /// 根据订单游客的xml获取订单信息、订单游客信息(单项业务订单信息、游客信息)
        /// </summary>
        /// <param name="xml"></param>
        /// <param name="single"></param>
        /// <returns></returns>
        private IList <MTourOrderTraveller> GetOrderAndTravellerByXml(string xml, ref MSingleService single)
        {
            IList <MTourOrderTraveller> list = null;

            xml = xml.Replace("&lt;", "<").Replace("&gt;", ">");

            XmlDocument doc = new XmlDocument();

            doc.LoadXml(xml);
            XmlNode root = doc.SelectSingleNode("Root");

            if (root.HasChildNodes)
            {
                list = new List <MTourOrderTraveller>();
                for (int i = 0; i < root.ChildNodes.Count; i++)
                {
                    XmlNode node = root.ChildNodes[i];
                    single.OrderId   = node["OrderId"].InnerText;
                    single.OrderCode = node["OrderCode"] != null ? node["OrderCode"].InnerText : string.Empty;

                    single.BuyCompanyName  = node["BuyCompanyName"] != null ? node["BuyCompanyName"].InnerText : string.Empty;
                    single.BuyCompanyId    = node["BuyCompanyId"].InnerText;
                    single.ContactName     = node["ContactName"] != null ? node["ContactName"].InnerText : string.Empty;
                    single.ContactTel      = node["ContactTel"] != null ? node["ContactTel"].InnerText : string.Empty;
                    single.ContactDepartId = node["ContactDepartId"] != null ? node["ContactDepartId"].InnerText : string.Empty;
                    single.Adults          = node["Adults"] != null?Utils.GetInt(node["Adults"].InnerText) : 0;

                    single.TravellerFile = node["TravellerFile"] != null ? node["TravellerFile"].InnerText : string.Empty;
                    if (node["TourOrderTraveller"] != null)
                    {
                        if (node["TourOrderTraveller"].HasChildNodes)
                        {
                            for (int j = 0; j < node["TourOrderTraveller"].ChildNodes.Count; j++)
                            {
                                XmlNode             child     = node["TourOrderTraveller"].ChildNodes[j];
                                MTourOrderTraveller traveller = new MTourOrderTraveller();
                                traveller.TravellerId = child["TravellerId"].InnerText;
                                traveller.OrderId     = child["OrderId"].InnerText;
                                traveller.CnName      = child["CnName"] != null ? child["CnName"].InnerText : string.Empty;
                                traveller.VisitorType = child["VisitorType"] != null ? (VisitorType?)Utils.GetInt(child["VisitorType"].InnerText) : null;
                                traveller.CardType    = child["CardType"] != null ? (CardType?)Utils.GetInt(child["CardType"].InnerText) : null;
                                traveller.CardNumber  = child["CardNumber"] != null ? child["CardNumber"].InnerText : string.Empty;
                                traveller.Gender      = child["Gender"] != null ? (Gender?)Utils.GetInt(child["Gender"].InnerText) : null;
                                traveller.Contact     = child["Contact"] != null ? child["Contact"].InnerText : string.Empty;
                                traveller.Remark      = child["Remark"] != null ? child["Remark"].InnerText : string.Empty;
                                list.Add(traveller);
                            }
                        }
                    }

                    single.HeTongId   = node["ContractId"] != null ? node["ContractId"].InnerText : string.Empty;
                    single.HeTongCode = node["ContractCode"] != null ? node["ContractCode"].InnerText : string.Empty;
                }
            }
            return(list);
        }
Exemplo n.º 3
0
        /// <summary>
        /// 游客退团
        /// </summary>
        /// <param name="traveller">游客实体</param>
        /// <param name="change">订单修改、变更实体</param>
        /// <returns></returns>
        public bool UpdateTourOrderTraveller(MTourOrderTraveller traveller, MTourOrderChange change)
        {
            if (string.IsNullOrEmpty(traveller.TravellerId) || string.IsNullOrEmpty(traveller.OrderId))
            {
                throw new System.Exception("bll error:id为null或string.IsNullOrEmpty(id)==true。");
            }
            if (!CheckTourOrderChange(change))
            {
                throw new System.Exception("bll error:查询id为null或string.IsNullOrEmpty(id)==true。");
            }

            return(dal.UpdateTourOrderTraveller(traveller, change) == 1 ? true : false);
        }
Exemplo n.º 4
0
        /// <summary>
        /// 获取客户信息数据源
        /// </summary>
        /// <returns></returns>
        private IList <MTourOrderTraveller> GetCustomList()
        {
            string[] CustomName              = Utils.GetFormValues("CustomName");
            string[] CustomType              = Utils.GetFormValues("CustomType");
            string[] Certificates            = Utils.GetFormValues("Certificates");
            string[] CertificatesNum         = Utils.GetFormValues("CertificatesNum");
            string[] Sex                     = Utils.GetFormValues("Sex");
            string[] ContactTel              = Utils.GetFormValues("ContactTel");
            IList <MTourOrderTraveller> list = new List <MTourOrderTraveller>();
            MTourOrderTraveller         model;

            if (CustomName.Length > 0 && CustomType.Length > 0 && Certificates.Length > 0 && CertificatesNum.Length > 0 && Sex.Length > 0 && ContactTel.Length > 0)
            {
                string errorMsg = string.Empty;
                for (int i = 0; i < CustomName.Length; i++)
                {
                    model = new MTourOrderTraveller();
                    if (!String.IsNullOrEmpty(CustomName[i]))
                    {
                        model.CnName      = CustomName[i];
                        model.CardNumber  = CertificatesNum[i];
                        model.CardType    = Utils.GetEnumValue <EyouSoft.Model.EnumType.TourStructure.CardType>(Certificates[i], EyouSoft.Model.EnumType.TourStructure.CardType.身份证);
                        model.Contact     = ContactTel[i];
                        model.OrderId     = string.Empty;
                        model.TravellerId = Guid.NewGuid().ToString();
                        model.IsInsurance = false;
                        model.Gender      = Utils.GetEnumValue <EyouSoft.Model.EnumType.GovStructure.Gender>(Sex[i], EyouSoft.Model.EnumType.GovStructure.Gender.其他);
                        model.VisitorType = Utils.GetEnumValue <EyouSoft.Model.EnumType.TourStructure.VisitorType>(CustomType[i], EyouSoft.Model.EnumType.TourStructure.VisitorType.成人);
                        list.Add(model);
                    }
                }
                if (String.IsNullOrEmpty(errorMsg))
                {
                    this.SetCustomList = list;
                    return(list);
                }
                else
                {
                    return(null);
                }
            }
            else
            {
                return(null);
            }
        }