Ejemplo n.º 1
0
 /// <summary>
 /// 增减费用存在变更
 /// </summary>
 /// <param name="id">订单ID</param>
 /// <param name="toap">增减实体</param>
 /// <returns></returns>
 public string isChange(string id, EyouSoft.Model.TourStructure.TourOrderAmountPlusInfo toap)
 {
     if (toap != null)
     {
         if (toap.AddAmount != 0 || toap.ReduceAmount != 0)
         {
             return("<a href='PlusSubchange.aspx?add=" + toap.AddAmount.ToString() + "&sub=" + toap.ReduceAmount.ToString() + "&remark=" + Uri.EscapeUriString(toap.Remark) + "' class='change'>变更</a>");
         }
     }
     return("");
 }
Ejemplo n.º 2
0
        protected void LinkButton1_Click(object sender, EventArgs e)
        {
            LinkButton btn = sender as LinkButton;

            EyouSoft.BLL.TourStructure.Tour bll = new EyouSoft.BLL.TourStructure.Tour(SiteUserInfo);
            model = (EyouSoft.Model.TourStructure.TourInfo)bll.GetTourInfo(Request.QueryString["tourId"]);

            if (model != null)
            {
                if (!Utils.PlanIsUpdateOrDelete(model.Status.ToString()))
                {
                    Response.Write("<script>alert('该团已提交财务,不能对它操作!');location.href=location.href;</script>");
                    return;
                }
            }
            //结算标准
            string  jsbj      = Request.Form["radio"];
            int     cr_num    = Utils.GetInt(txt_crNum.Value);
            int     et_num    = Utils.GetInt(txt_rtNum.Value);
            decimal sum_money = Utils.GetDecimal(txt_sumMoney.Value);
            string  special   = txt_Special.Value;

            //散拼信息
            //EyouSoft.BLL.TourStructure.Tour bll = new EyouSoft.BLL.TourStructure.Tour();
            //model = (EyouSoft.Model.TourStructure.TourInfo)bll.GetTourInfo(Request.QueryString["tourId"]);

            //model.PriceStandards

            EyouSoft.BLL.TourStructure.TourOrder   orderbll   = new EyouSoft.BLL.TourStructure.TourOrder();
            EyouSoft.Model.TourStructure.TourOrder ordermodel = new EyouSoft.Model.TourStructure.TourOrder();
            int crNum = Utils.GetInt(txt_crNum.Value);

            if (crNum == 0)
            {
                EyouSoft.Common.Function.MessageBox.Show(this.Page, "请填写成人数!");
                BindXlInfo();
                BindPireList();
                return;
            }
            ordermodel.AdultNumber = crNum;
            ordermodel.AreaId      = model.AreaId;
            int teamId = Utils.GetInt(Utils.GetFormValue("hd_teamId"));

            if (teamId == 0)
            {
                EyouSoft.Common.Function.MessageBox.Show(this.Page, "请选择组团社!");
                BindXlInfo();
                BindPireList();
                return;
                //Response.Write("<script>alert('请选择组团社');location.href=location.href;</script>");
            }

            ordermodel.BuyCompanyID   = teamId;
            ordermodel.BuyCompanyName = Utils.GetFormValue("txt_teamName");

            ordermodel.ChildNumber = Utils.GetInt(txt_rtNum.Value);
            ordermodel.ChildPrice  = Utils.GetDecimal(Utils.GetFormValue("hd_rt_price"));
            int cusLevel = Utils.GetInt(Utils.GetFormValue("hd_cuslevel"));

            if (cusLevel == 0)
            {
                EyouSoft.Common.Function.MessageBox.Show(this.Page, "请选择客户等级!");
                BindXlInfo();
                BindPireList();
                return;
            }
            ordermodel.CustomerLevId = cusLevel;
            IList <EyouSoft.Model.TourStructure.TourOrderCustomer> cus_list = new List <EyouSoft.Model.TourStructure.TourOrderCustomer>();

            string[] cus_arr    = Utils.GetFormValues("txtVisitorName");
            string[] uri        = Utils.GetFormValues("tefu");
            string[] cradType   = Utils.GetFormValues("ddlCardType");
            decimal  orderprice = 0;

            for (int k = 0; k < cus_arr.Length; k++)
            {
                if (cus_arr[k] == "")
                {
                    break;
                }
                EyouSoft.Model.TourStructure.TourOrderCustomer item = new EyouSoft.Model.TourStructure.TourOrderCustomer();
                item.VisitorName = cus_arr[k];
                item.VisitorType = Utils.GetFormValues("ddlVisitorType")[k] == "1" ? EyouSoft.Model.EnumType.TourStructure.VisitorType.成人 : EyouSoft.Model.EnumType.TourStructure.VisitorType.儿童;
                //switch (Utils.GetFormValues("ddlCardType")[k])
                //{
                //    case "1":
                //        {
                //            item.CradType = EyouSoft.Model.EnumType.TourStructure.CradType.身份证;
                //        } break;
                //    case "2":
                //        {
                //            item.CradType = EyouSoft.Model.EnumType.TourStructure.CradType.护照;
                //        } break;
                //    case "3":
                //        {
                //            item.CradType = EyouSoft.Model.EnumType.TourStructure.CradType.军官证;
                //        } break;
                //    case "4":
                //        {
                //            item.CradType = EyouSoft.Model.EnumType.TourStructure.CradType.台胞证;
                //        } break;
                //    case "5":
                //        {
                //            item.CradType = EyouSoft.Model.EnumType.TourStructure.CradType.港澳通行证;
                //        } break;
                //    default:
                //        {
                //            item.CradType = EyouSoft.Model.EnumType.TourStructure.CradType.未知;
                //        } break;
                //}
                item.CradType   = (EyouSoft.Model.EnumType.TourStructure.CradType)Utils.GetInt(cradType[k]);
                item.CradNumber = Utils.GetFormValues("txtCardNo")[k];
                switch (Utils.GetFormValues("ddlSex")[k])
                {
                case "2":
                {
                    item.Sex = EyouSoft.Model.EnumType.CompanyStructure.Sex.男;
                } break;

                case "1":
                {
                    item.Sex = EyouSoft.Model.EnumType.CompanyStructure.Sex.女;
                } break;

                default:
                {
                    item.Sex = EyouSoft.Model.EnumType.CompanyStructure.Sex.未知;
                } break;
                }
                item.ContactTel = Utils.GetFormValues("txtContactTel")[k];
                EyouSoft.Model.TourStructure.CustomerSpecialService css = new EyouSoft.Model.TourStructure.CustomerSpecialService();

                css.Fee                 = Utils.GetDecimal(Utils.GetFromQueryStringByKey(uri[k], "txtCost"));
                css.IsAdd               = Utils.GetFromQueryStringByKey(uri[k], "ddlOperate") == "0" ? true : false;
                css.IssueTime           = DateTime.Now;
                css.ProjectName         = Utils.GetFromQueryStringByKey(uri[k], "txtItem");
                css.ServiceDetail       = Utils.GetFromQueryStringByKey(uri[k], "txtServiceContent");
                item.SpecialServiceInfo = css;
                item.IssueTime          = DateTime.Now;
                item.CompanyID          = CurrentUserCompanyID;
                cus_list.Add(item);
                orderprice += Utils.GetDecimal(Utils.GetFromQueryStringByKey(uri[k], "txtCost"));
            }
            ordermodel.IssueTime       = DateTime.Now;
            ordermodel.OperatorContent = Utils.GetFormValue("txt_actMsg");
            ordermodel.SpecialContent  = Utils.GetFormValue("txt_Special");
            ordermodel.CustomerList    = cus_list;
            ordermodel.LastDate        = DateTime.Now;
            ordermodel.LeaveDate       = model.LDate;
            ordermodel.PriceStandId    = Utils.GetInt(Utils.GetFormValue("hd_level"));

            ordermodel.PersonalPrice   = Utils.GetDecimal(Utils.GetFormValue("hd_cr_price"));
            ordermodel.ChildPrice      = Utils.GetDecimal(Utils.GetFormValue("hd_rt_price"));
            ordermodel.ID              = Guid.NewGuid().ToString();
            ordermodel.CustomerList    = cus_list;
            ordermodel.TourId          = model.TourId;
            ordermodel.OrderType       = EyouSoft.Model.EnumType.TourStructure.OrderType.代客预定;
            ordermodel.SellCompanyId   = CurrentUserCompanyID;
            ordermodel.SellCompanyName = SiteUserInfo.CompanyName;
            ordermodel.ViewOperatorId  = SiteUserInfo.ID;
            ordermodel.TourNo          = model.TourCode;
            ordermodel.Tourdays        = model.TourDays;
            ordermodel.TourClassId     = EyouSoft.Model.EnumType.TourStructure.TourType.散拼计划;
            ordermodel.OperatorID      = SiteUserInfo.ID;
            ordermodel.OperatorName    = SiteUserInfo.ContactInfo.ContactName;
            ordermodel.OrderState      = EyouSoft.Model.EnumType.TourStructure.OrderState.未处理;
            ordermodel.OtherPrice      = orderprice;
            ordermodel.RouteId         = model.RouteId;
            ordermodel.RouteName       = model.RouteName;
            ordermodel.SumPrice        = Utils.GetDecimal(Utils.GetFormValue(txt_sumMoney.UniqueID)) + orderprice;
            ordermodel.PeopleNumber    = Utils.GetInt(Utils.GetFormValue("txt_crNum")) + Utils.GetInt(Utils.GetFormValue("txt_rtNum"));
            ordermodel.ContactTel      = lt_phone.Text;
            ordermodel.ContactName     = lb_username.Text;
            ordermodel.ContactMobile   = lt_tel.Text;
            ordermodel.LeaveTraffic    = lt_startBus.Text;
            ordermodel.ReturnTraffic   = lt_backBus.Text;
            ordermodel.ContactFax      = lt_fax.Text;
            EyouSoft.BLL.CompanyStructure.Customer               csbll    = new EyouSoft.BLL.CompanyStructure.Customer();
            EyouSoft.Model.CompanyStructure.CustomerInfo         cusmodel = csbll.GetCustomerModel(Utils.GetInt(Utils.GetFormValue("hd_teamId"))); //
            EyouSoft.Model.TourStructure.TourOrderAmountPlusInfo am       = new EyouSoft.Model.TourStructure.TourOrderAmountPlusInfo();
            am.AddAmount          = Utils.GetDecimal(Utils.GetFormValue("txt_addmoney"));                                                          //增加费用
            am.ReduceAmount       = Utils.GetDecimal(Utils.GetFormValue("txt_minusmoney"));                                                        //减少费用
            am.Remark             = Utils.GetFormValue("txt_remark");                                                                              //备注
            ordermodel.AmountPlus = am;
            if (cusmodel != null)
            {
                ordermodel.SalerId   = cusmodel.SaleId;
                ordermodel.SalerName = cusmodel.Saler;
            }

            #region 返佣和对方操作员
            ordermodel.BuyerContactId   = Utils.GetInt(Utils.GetFormValue("otherOprator"));
            ordermodel.BuyerContactName = Utils.InputText(Utils.GetFormValue("hd_orderOprator"));
            ordermodel.CommissionType   = (EyouSoft.Model.EnumType.CompanyStructure.CommissionType)Utils.GetInt(Utils.GetFormValue("hd_rebateType"));
            ordermodel.CommissionPrice  = Utils.GetDecimal(Utils.GetFormValue("txt_Rebate"));
            #endregion

            switch (btn.CommandName)
            {
            ///提交
            case "submit":
            {
                ordermodel.SaveSeatDate = DateTime.Now;
                ordermodel.OrderState   = EyouSoft.Model.EnumType.TourStructure.OrderState.未处理;
            } break;

            case "Reservations":
            {
                ordermodel.OrderState   = EyouSoft.Model.EnumType.TourStructure.OrderState.已留位;
                ordermodel.SaveSeatDate = Utils.GetDateTime(txtEndTime.Text, DateTime.Now);
            } break;        //留位
            }
            string fileAtt    = "";
            string oldfileAtt = "";

            if (EyouSoft.Common.Function.UploadFile.FileUpLoad(Request.Files[0], "VisitorInfoFile", out fileAtt, out oldfileAtt))
            {
                ordermodel.CustomerFilePath = fileAtt;
            }
            else
            {
                EyouSoft.Common.Function.MessageBox.Show(this.Page, "上传附件失败!");
                return;
            }

            ordermodel.BuyerTourCode  = Utils.GetFormValue(txtBuyerTourCode.ClientID);
            ordermodel.OrderTrafficId = Utils.GetInt(Utils.GetFormValue("selectTraffic"));

            /// 0:失败;
            /// 1:成功;
            /// 2:该团队的订单总人数+当前订单人数大于团队计划人数总和;
            /// 3:该客户所欠金额大于最高欠款金额;
            int i = orderbll.AddOrder(ordermodel);
            switch (i)
            {
            case 1:
            {
                Response.Write("<script>alert('提交成功');parent.Boxy.getIframeDialog('" + Request.QueryString["iframeid"] + "').hide();parent.location.href=parent.location.href;</script>");
            } break;

            case 2: { Response.Write("<script>alert('该团队的订单总人数+当前订单人数大于团队计划人数总和');location.href=location.href;</script>"); } break;

            case 3: { Response.Write("<script>alert('该客户所欠金额大于最高欠款金额');location.href=location.href;</script>"); } break;

            case 4:
            {
                Response.Write("<script>alert('订单人数加上交通出团日期当天已使用票数大于交通出团日期当天人数,添加失败!');location.href=location.href;</script>");
                break;
            }

            default: { Response.Write("<script>alert('添加失败!');location.href=location.href;</script>"); } break;
            }
        }