/// <summary>
        /// init info
        /// </summary>
        void InitInfo()
        {
            var info = new EyouSoft.BLL.TourStructure.BSingleService().GetSingleServiceExtendByTourId(TourId);

            if (info == null)
            {
                Utils.RCWE("异常请求");
            }
            if (info.CompanyId != SiteUserInfo.CompanyId)
            {
                Utils.RCWE("异常请求");
            }

            txtKeHuName.Text      = info.BuyCompanyName;
            txtKeHuLxr.Text       = info.ContactName;
            txtKeHuTelephone.Text = info.ContactTel;

            var keHuLxrInfo = new EyouSoft.BLL.CrmStructure.BCrmLinkMan().GetLinkManModel(info.ContactDepartId);

            if (keHuLxrInfo != null)
            {
                txtKeHuFax.Text = keHuLxrInfo.Fax;
            }

            txtCompanyName.Text      = SiteUserInfo.CompanyName;
            txtXiaoShouYuanName.Text = info.SellerName;

            var xiaoShouYuanInfo = new EyouSoft.BLL.ComStructure.BComUser().GetModel(info.SellerId, SiteUserInfo.CompanyId);

            if (xiaoShouYuanInfo != null)
            {
                txtXiaoShouYuanTelephone.Text = xiaoShouYuanInfo.ContactTel;
                txtXiaoShouYuanFax.Text       = xiaoShouYuanInfo.ContactFax;
            }

            ltrOrderCode.Text = info.OrderCode;

            rptJuTiYaoQiu.DataSource = info.TourTeamPriceList;
            rptJuTiYaoQiu.DataBind();

            ltrHeTongJinE.Text = info.TourIncome.ToString("C2");

            rptYouKe.DataSource = info.TourOrderTravellerList;
            rptYouKe.DataBind();

            ltrQianFaRiQi.Text = DateTime.Now.ToString("yyyy-MM-dd");
        }
Example #2
0
        /// <summary>
        /// 页面验证
        /// </summary>
        /// <param name="order"></param>
        /// <param name="msg"></param>
        /// <returns></returns>
        private bool PageValidate(ref EyouSoft.Model.TourStructure.MTourOrderExpand order, ref string msg)
        {
            //验证的字段
            string DCompanyName = Utils.GetFormValue("txtDCompanyName");

            if (string.IsNullOrEmpty(DCompanyName))
            {
                msg += "客源单位 不能为空!</br>";
            }
            string DContactName = Utils.GetFormValue("txtDContactName");

            if (string.IsNullOrEmpty(DContactName))
            {
                msg += "联系人 不能为空!</br>";
            }

            string DContactTel = Utils.GetFormValue("txtDContactTel");

            if (string.IsNullOrEmpty(DContactTel))
            {
                msg += "联系定电话 不能为空!</br>";
            }

            int Adults = Utils.GetInt(Utils.GetFormValue("txtAdults"));

            if (Adults < 0)
            {
                msg += "成人数 格式不正确!</br>";
            }

            int Childs = Utils.GetInt(Utils.GetFormValue("txtChilds"));

            if (Childs < 0)
            {
                msg += "儿童数 格式不正确!</br>";
            }
            decimal SumPrice = Utils.GetDecimal(Utils.GetFormValue("txtSumPrice"));

            if (SumPrice <= 0)
            {
                msg += "合计金额 格式不正确!</br>";
            }
            string saveDate = Utils.GetFormValue("txtSaveSeatDate");

            if (!string.IsNullOrEmpty(saveDate))
            {
                DateTime?SaveSeatDate = Utils.GetDateTimeNullable(saveDate);
                if (!SaveSeatDate.HasValue)
                {
                    msg += "留位时间 格式不正确!</br>";
                }
            }
            string tourType = Utils.GetFormValue("hfTourType");

            if (msg.Length <= 0)
            {
                //短线
                if (!string.IsNullOrEmpty(Utils.GetQueryStringValue("IsShort")))
                {
                    string CarLocationID = Utils.GetFormValue("selPickUpPosition");
                    if (!string.IsNullOrEmpty(CarLocationID))
                    {
                        EyouSoft.Model.TourStructure.MTourOrderCarLocation modelcar = new EyouSoft.Model.TourStructure.MTourOrderCarLocation();
                        string location = this.hidlocation.Value;
                        string desc     = this.hidDesc.Value;
                        modelcar.Desc              = desc;
                        modelcar.Location          = location;
                        modelcar.OffPrice          = Utils.GetDecimal(this.hidOffPrice.Value);
                        modelcar.OnPrice           = Utils.GetDecimal(this.hidOnPrice.Value);
                        modelcar.TourLocationId    = CarLocationID;
                        order.TourOrderCarLocation = modelcar;
                    }
                    IList <EyouSoft.Model.TourStructure.MTourOrderCarTypeSeat> listSeat = new List <EyouSoft.Model.TourStructure.MTourOrderCarTypeSeat>();
                    listSeat = Newtonsoft.Json.JsonConvert.DeserializeObject <IList <MTourOrderCarTypeSeat> >(Utils.GetFormValue(this.SetSeat1.setSeatHidClientID));
                    order.TourOrderCarTypeSeatList = listSeat;
                }
                order.CompanyId      = SiteUserInfo.CompanyId;
                order.TourId         = Utils.GetQueryStringValue("TourId");
                order.BuyCompanyName = SiteUserInfo.TourCompanyInfo.CompanyName;
                order.BuyCompanyId   = SiteUserInfo.TourCompanyInfo.CompanyId;
                //客源单位联系人信息(当前分销商)
                string lxrId = SiteUserInfo.TourCompanyInfo.LxrId;
                order.ContactDepartId = lxrId;
                EyouSoft.BLL.CrmStructure.BCrmLinkMan   link    = new EyouSoft.BLL.CrmStructure.BCrmLinkMan();
                EyouSoft.Model.CrmStructure.MCrmLinkman linkMan = link.GetLinkManModel(lxrId);
                if (linkMan != null)
                {
                    order.ContactName = linkMan.Name;
                    order.ContactTel  = linkMan.Telephone;
                }


                order.OrderStatus = EyouSoft.Model.EnumType.TourStructure.OrderStatus.未处理;

                //联系人信息
                order.DCompanyName = DCompanyName;
                order.DContactName = DContactName;
                order.DContactTel  = DContactTel;



                //销售员信息
                order.SellerId   = SiteUserInfo.UserId;
                order.SellerName = SiteUserInfo.Name;
                order.DeptId     = SiteUserInfo.DeptId;

                //操作员信息
                order.Operator   = SiteUserInfo.Name;
                order.OperatorId = SiteUserInfo.UserId;

                order.Adults = Adults;
                order.Childs = Childs;

                //价格组成
                string strPrice = Utils.GetFormValue("txt_PriceStand_radio_price");
                if (!string.IsNullOrEmpty(strPrice))
                {
                    string[] price = strPrice.Split('|');
                    order.LevId      = Utils.GetInt(price[0]);
                    order.AdultPrice = Utils.GetDecimal(price[1]);
                    order.ChildPrice = Utils.GetDecimal(price[2]);
                }

                string strStandard = Utils.GetFormValue("_hstandard");
                if (!string.IsNullOrEmpty(strStandard))
                {
                    int Standard = Utils.GetInt(strStandard);
                    order.PriceStandId = Standard;
                    EyouSoft.BLL.TourStructure.BTour                        bll          = new EyouSoft.BLL.TourStructure.BTour();
                    EyouSoft.Model.TourStructure.MTourSanPinInfo            model        = (EyouSoft.Model.TourStructure.MTourSanPinInfo)bll.GetTourInfo(order.TourId);
                    IList <EyouSoft.Model.TourStructure.MTourPriceStandard> standardList = model.MTourPriceStandard.Where(c => c.Standard == Standard).ToList();

                    if (standardList != null && standardList.Count != 0)
                    {
                        List <EyouSoft.Model.TourStructure.MTourPriceLevel> levelList = new List <EyouSoft.Model.TourStructure.MTourPriceLevel>();
                        foreach (var a in standardList)
                        {
                            levelList.AddRange(a.PriceLevel);
                        }
                        if (levelList != null && levelList.Count != 0)
                        {
                            EyouSoft.Model.TourStructure.MTourPriceLevel item = levelList.SingleOrDefault(c => c.LevType == EyouSoft.Model.EnumType.ComStructure.LevType.内部结算价);
                            if (item != null)
                            {
                                order.PeerAdultPrice  = item.AdultPrice;
                                order.PeerChildPrice  = item.ChildPrice;
                                order.PeerLevId       = item.LevelId;
                                order.SettlementMoney = order.PeerAdultPrice * Adults + order.PeerChildPrice * Childs;
                            }
                        }
                    }
                }

                order.SaleAddCost          = Utils.GetDecimal(Utils.GetFormValue("txtSaleAddCost"));
                order.SaleAddCostRemark    = Utils.GetFormValue("txtSaleAddCostRemark");
                order.SaleReduceCost       = Utils.GetDecimal(Utils.GetFormValue("txtSaleReduceCost"));
                order.SaleReduceCostRemark = Utils.GetFormValue("txtSaleReduceCostRemark");

                order.SumPrice = Utils.GetDecimal(Utils.GetFormValue("txtSumPrice"));

                order.SaveSeatDate = Utils.GetDateTimeNullable(Utils.GetFormValue("txtSaveSeatDate"));
                order.OrderRemark  = Utils.GetFormValue("txtOrderRemark");



                order.OrderType = EyouSoft.Model.EnumType.TourStructure.OrderType.分销商下单;

                order.MTourOrderTravellerList = new List <EyouSoft.Model.TourStructure.MTourOrderTraveller>();
                order.TourType = (EyouSoft.Model.EnumType.TourStructure.TourType)Enum.Parse(typeof(EyouSoft.Model.EnumType.TourStructure.TourType), tourType);
                switch (order.TourType)
                {
                case EyouSoft.Model.EnumType.TourStructure.TourType.组团散拼:
                case TourType.组团散拼短线:
                case EyouSoft.Model.EnumType.TourStructure.TourType.地接散拼:
                    order.MTourOrderTravellerList = UtilsCommons.GetTravelList();
                    break;

                case EyouSoft.Model.EnumType.TourStructure.TourType.出境散拼:
                    order.MTourOrderTravellerList = UtilsCommons.GetTravelListS();
                    break;
                }
            }

            return(msg.Length <= 0);
        }