Exemplo n.º 1
0
        /// <summary>
        /// 写入航期浏览记录信息
        /// </summary>
        private void InsertHangQJiLu(string HangQiId)
        {
            EyouSoft.BLL.YlStructure.BHangQi bll = new EyouSoft.BLL.YlStructure.BHangQi();
            EyouSoft.Model.YlStructure.MHangQiLiuLanJiLuInfo info = new MHangQiLiuLanJiLuInfo()
            {
                HangQiId = HangQiId
            };
            EyouSoft.Model.SSOStructure.MYlHuiYuanInfo m = null;
            bool isLogin = false;

            isLogin = EyouSoft.Security.Membership.YlHuiYuanProvider.IsLogin(out m);
            if (isLogin)
            {
                info.YongHuId = m.HuiYuanId;
            }
            bll.InsertHangQiLiuLanJiLu(info);
        }
Exemplo n.º 2
0
        private string Sava()
        {
            string         str     = "";
            bool           isLogin = false;
            MYlHuiYuanInfo m       = null;

            isLogin = EyouSoft.Security.Membership.YlHuiYuanProvider.IsLogin(out m);

            decimal keYongJiFen  = 0;
            string  feiHuiYuanId = string.Empty;

            string xiaDanRenId = string.Empty;

            if (isLogin)
            {
                xiaDanRenId = m.HuiYuanId;
                var huiYuanInfo = new EyouSoft.BLL.YlStructure.BHuiYuan().GetHuiYuanInfo(m.HuiYuanId);
                if (huiYuanInfo != null)
                {
                    keYongJiFen = huiYuanInfo.KeYongJiFen;
                }
            }
            else
            {
                var feiHuiYuanInfo = GetFeiHuiYuanInfo();
                xiaDanRenId  = feiHuiYuanInfo.id;
                feiHuiYuanId = feiHuiYuanInfo.id;
            }

            string valuejson = Utils.GetFormValue(hd_page1json.UniqueID);

            var info = Newtonsoft.Json.JsonConvert.DeserializeObject <MrTuanGouList>(valuejson);

            if (info == null)
            {
                return(UtilsCommons.AjaxReturnJson("0", "订单提交失败,请重新提交!", new { FeiHuiYuanId = feiHuiYuanId, DingDanId = string.Empty, DingDanStatus = -1 }));
            }

            EyouSoft.BLL.YlStructure.BHangQi bll = new EyouSoft.BLL.YlStructure.BHangQi();

            var HangQiInfo = bll.GetHangQiInfo(info.HangQiId);


            #region 表单赋值
            MHangQiDingDanInfo model = new MHangQiDingDanInfo();
            IList <MHangQiDingDanYouKeInfo> YouKes = null;
            BingKeInfo(ref YouKes, xiaDanRenId);
            IList <MHangQiDingDanJiaGeInfo> JiaGes = info.JiaGes;

            if (string.IsNullOrEmpty(info.HangQiId))
            {
                str += "-请重新选择订单!</br>";
            }
            else
            {
                model.HangQiId = info.HangQiId;
            }
            if (string.IsNullOrEmpty(info.RiQiId))
            {
                str += "-请选择出发日期</br>";
            }
            else
            {
                model.RiQiId = info.RiQiId;
            }
            model.CompanyId = YuMingInfo.CompanyId;
            if (info.DingdanRenShu > 0)
            {
                model.RenShu = info.DingdanRenShu;
            }
            else
            {
                str += "-请添加出发人数</br>";
            }


            model.DingDanStatus = EyouSoft.Model.EnumType.YlStructure.HangQiDingDanStatus.未处理;
            model.FuKuanStatus  = EyouSoft.Model.EnumType.YlStructure.FuKuanStatus.未付款;
            string YuDingRenName = Utils.GetFormValue("txtYudingName");
            if (!string.IsNullOrEmpty(YuDingRenName))
            {
                model.YuDingRenName = YuDingRenName;
            }
            else
            {
                str += "-请填写预订人姓名</br>";
            }
            string YuDingRenDianHua = Utils.GetFormValue("txtYudingtell");
            string YuDingRenShouJi  = Utils.GetFormValue("txtYudingphone");
            if (string.IsNullOrEmpty(YuDingRenDianHua) && string.IsNullOrEmpty(YuDingRenShouJi))
            {
                str += "-手机号码和联系电话至少填写一项</br>";
            }
            else
            {
                model.YuDingRenShouJi  = YuDingRenShouJi;
                model.YuDingRenDianHua = YuDingRenDianHua;
            }

            string YuDingRenYouXiang = Utils.GetFormValue("txtYudingEmail");
            if (!string.IsNullOrEmpty(YuDingRenYouXiang))
            {
                model.YuDingRenYouXiang = YuDingRenYouXiang;
            }
            //else
            //    str += "-请填写预订人电子邮件</br>";

            model.IsXuYaoFaPiao = Utils.GetInt(Utils.GetFormValue("IscheckFaPiao")) == 1 ? true : false;
            model.FaPiaoTaiTou  = Utils.GetFormValue("txtFapiaoTitle");
            //model.FaPiaoMingXi = Utils.GetFormValue("txtFapiaoMingxi");
            model.FaPiaoLeiXing = Utils.GetFormValue("txt_fapiao_mxlx");
            model.FaPiaoMingXi  = GetFaPiaoMXLX(model.FaPiaoLeiXing);

            //***********************发票配送方式*******************
            model.FaPiaoPeiSongFangShi = EyouSoft.Model.EnumType.YlStructure.FaPiaoPeiSongFangShi.快递;
            if (model.IsXuYaoFaPiao)
            {
                model.FaPiaoDiZhiId = Utils.GetFormValue(hidAddressId.UniqueID);
            }
            else
            {
                model.FaPiaoDiZhiId = "";
            }
            if (model.IsXuYaoFaPiao)
            {
                model.FaPiaoKuaiDiJinE = HangQiInfo.FaPiaoKuaiDiJinE;
            }
            else
            {
                model.FaPiaoKuaiDiJinE = 0;
            }
            model.XiaDanRenId = xiaDanRenId;
            model.IssueTime   = DateTime.Now;


            model.IsTuanGou     = true;
            model.TuanGouId     = info.TuanGouId;
            model.FuJiaChanPins = null;
            if (YouKes != null && YouKes.Count > 0 && YouKes.Count == info.DingdanRenShu)
            {
                model.YouKes = YouKes;
            }
            else
            {
                str += "-请填写游客信息</br>";
            }
            if (JiaGes != null && JiaGes.Count > 0)
            {
                model.JiaGes = JiaGes;
            }
            else
            {
                str += "-请选择房型</br>";
            }
            //********************************优惠信息**********************
            MHangQiDingDanYouHuiInfo YouHui = new MHangQiDingDanYouHuiInfo();
            model.YouHuis = null;
            MHangQiDingDanDiKouInfo DiKou = new MHangQiDingDanDiKouInfo();

            model.DiKouInfo = null;

            //******************************产品金额的计算******************************************


            decimal ZongJinE = 0;
            foreach (var item in model.JiaGes)
            {
                ZongJinE += item.JiaGe1 * item.RenShu1;
            }
            if (ZongJinE > 0 && info.DingdanFangXingJinE == ZongJinE)
            {
                if (model.IsXuYaoFaPiao)
                {
                    ZongJinE += model.FaPiaoKuaiDiJinE;
                }
            }
            else
            {
                str += "-请重新选择订单!";
            }
            model.JinE = ZongJinE;
            //************************************************************************************

            model.JiFenLeiJiBiLi = HangQiInfo.JiFenLeiJiBiLi;
            model.MingCheng      = HangQiInfo.MingCheng;
            model.GysName        = HangQiInfo.GysName;
            model.GongSiName     = HangQiInfo.GongSiName;
            model.XiLieName      = HangQiInfo.XiLieName;
            model.ChuanZhiName   = HangQiInfo.ChuanZhiName;
            model.XiaDanBeiZhu   = Utils.GetFormValue("txtXiaDanBeiZhu");
            #endregion

            if (!string.IsNullOrEmpty(str))
            {
                return(UtilsCommons.AjaxReturnJson("0", str, new { FeiHuiYuanId = feiHuiYuanId, DingDanId = string.Empty, DingDanStatus = -1 }));
            }

            EyouSoft.BLL.YlStructure.BHangQiDingDan DingDan_Bll = new EyouSoft.BLL.YlStructure.BHangQiDingDan();
            int num = DingDan_Bll.InsertDingDan(model);

            if (num != 1)
            {
                return(UtilsCommons.AjaxReturnJson("0", "订单提交失败,请重新提交!", new { FeiHuiYuanId = feiHuiYuanId, DingDanId = string.Empty, DingDanStatus = -1 }));
            }

            var tj = DingDan_Bll.GetDingDanInfo(model.DingDanId);

            return(UtilsCommons.AjaxReturnJson("1", "下单成功", new { FeiHuiYuanId = feiHuiYuanId, DingDanId = model.DingDanId, DingDanStatus = (int)tj.DingDanStatus }));
        }
Exemplo n.º 3
0
        private void Page1Info(MrTuanGouList model)
        {
            EyouSoft.BLL.YlStructure.BHangQi bll = new EyouSoft.BLL.YlStructure.BHangQi();
            var           FromHangqi             = bll.GetHangQiInfo(model.HangQiId);
            DateTime      Data    = DateTime.Now;
            StringBuilder dingdan = new StringBuilder();
            StringBuilder sb      = new StringBuilder();
            int           Sum     = 0;
            string        BkHtml  = "";
            int           num     = 1;

            if (model.JiaGes != null && model.JiaGes.Count > 0)
            {
                foreach (var item in model.JiaGes)
                {
                    if (item.RenShu1 > 0)
                    {
                        Sum += item.RenShu1;
                        sb.AppendFormat("<dl><dt>【{0}】</dt>", JiChuXinXi(item.FangXingId));
                        sb.AppendFormat("<dd>{0}{1}人 共计:{2}元</dd>", JiChuXinXi(item.BinKeLeiXingId), item.RenShu1, (item.JiaGe1 * item.RenShu1).ToString("F2"));

                        BkHtml += BingKeHtml(item, ref num);
                        sb.Append("</dl>");
                    }
                }
            }

            var tuanGouInfo = bll.GetTuanGouInfo(model.TuanGouId);

            dingdan.Append("<table width=\"100%\" border=\"0\" align=\"center\" cellspacing=\"0\" cellpadding=\"0\">");
            dingdan.Append("<tbody><tr><th>出发日期</th><th>名称</th><th>项目详情</th><th>金额</th><th>下单时间</th>");
            // dingdan.Append("<th>操作</th>");
            dingdan.Append("</tr><tr>");
            dingdan.AppendFormat("<td align=\"center\" class=\"font14\">{0}</td>", model.ChuFaTime);
            dingdan.AppendFormat("<td valign=\"middle\" class=\"font14 padd20\">{0}<br><a class=\"fontgreen font12\" target=\"_blank\" href=\"tuangouxiangqing.aspx?tuangouid={1}\">【详情】</a></td>", tuanGouInfo.MingCheng, tuanGouInfo.TuanGouId);
            dingdan.AppendFormat("<td valign=\"top\" class=\"font12\">{0}</td>", sb.ToString());
            dingdan.AppendFormat("<td valign=\"middle\" align=\"center\"><b class=\"font20 fontred\">{0}</b><br></td>", (model.DingdanFangXingJinE).ToString("C2"));
            dingdan.AppendFormat("<td valign=\"middle\" align=\"center\">{0}<br>{1}</td>", Data.ToString("yyyy-MM-dd"), Data.ToString("t"));
            //dingdan.Append("<td valign=\"middle\" align=\"center\" class=\"right\"><a class=\"del_btn\" href=\"#\">删除</a></td>");
            dingdan.Append("</tr></tbody></table>");

            #region Page2
            StringBuilder sb2 = new StringBuilder();
            sb2.Append("<table width=\"100%\" border=\"0\" align=\"center\" cellspacing=\"0\" cellpadding=\"0\">");
            sb2.Append("<tbody><tr><th width=\"35%\">名称</th> <th width=\"15%\">出发日期</th><th width=\"35%\">项目详情</th>");
            sb2.Append("<th class=\"right\">金额</th></tr><tr>");
            sb2.AppendFormat("<td class=\"font14 padd20\">{0}</br><a class=\"fontgreen font12\"  target=\"_blank\" href=\"tuangouxiangqing.aspx?tuangouid={1}\">【详情】</a></td>", FromHangqi.MingCheng, tuanGouInfo.TuanGouId);
            sb2.AppendFormat("<td valign=\"middle\" align=\"center\" class=\"font14\">{0}</td>", model.ChuFaTime);
            sb2.AppendFormat("<td valign=\"top\" class=\"font12\">{0} </td>", sb.ToString());
            sb2.AppendFormat("<td valign=\"middle\" align=\"center\" class=\"right\"><b class=\"font20 fontred\">{0}</b></td></tr></tbody></table>", (model.DingdanFangXingJinE).ToString("C2"));
            #endregion


            model.html          = dingdan.ToString();
            model.DingdanRenShu = Sum;
            if (model.DingdanRenShu > 0)
            {
                model.DingdanRenjun = model.DingdanFangXingJinE / model.DingdanRenShu;
            }
            else
            {
                model.DingdanRenjun = 0;
            }
            model.html3 = BkHtml;
            model.html2 = sb2.ToString();
        }