Example #1
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;
            }
        }
Example #2
0
        protected EyouSoft.Model.TourStructure.LineInquireQuoteInfo SaveInfo(int id)
        {
            EyouSoft.Model.TourStructure.LineInquireQuoteInfo lineInfo = new EyouSoft.Model.TourStructure.LineInquireQuoteInfo();
            //预计出团日期
            lineInfo.LeaveDate = Utils.GetDateTime(Utils.GetFormValue(this.txt_BegTime.UniqueID));
            //总人数
            lineInfo.PeopleNum = Utils.GetInt(Utils.GetFormValue(this.txt_peopleCount.UniqueID), 0);
            //状态
            lineInfo.QuoteState = EyouSoft.Model.EnumType.TourStructure.QuoteState.已处理;
            //备注
            lineInfo.Remark = Utils.GetFormValue(this.txt_remark.UniqueID);
            //客人要求集合
            lineInfo.Requirements = ConProjectControl1.GetDataList();
            //线路编号
            lineInfo.RouteId = Utils.GetInt(xianluWindow1.Id);
            //线路名称
            lineInfo.RouteName = xianluWindow1.Name;
            //价格组成集合
            lineInfo.Services = PriceControl1.GetList;
            //总价
            lineInfo.TotalAmount = PriceControl1.TotalAmount;
            //行程
            lineInfo.XingCheng           = new EyouSoft.Model.TourStructure.XingChengMust();
            lineInfo.XingCheng.QuotePlan = Request.Form[this.txtRoutingNeed.UniqueID];
            lineInfo.XingCheng.QuoteId   = id;
            //行程_附件
            string filepath    = string.Empty;
            string oldfilename = string.Empty;
            bool   file_result = EyouSoft.Common.Function.UploadFile.FileUpLoad(Request.Files["routingFile"], "TourQuotePriceFile", out filepath, out oldfilename);

            if (filepath != "")
            {
                lineInfo.XingCheng.PlanAccessory     = filepath;
                lineInfo.XingCheng.PlanAccessoryName = oldfilename;
            }
            else
            {
                if (hid_img_path.Value != "null")
                {
                    lineInfo.XingCheng.PlanAccessory     = hid_img_path.Value;
                    lineInfo.XingCheng.PlanAccessoryName = hid_img_name.Value;
                }
                else
                {
                    lineInfo.XingCheng.PlanAccessoryName = "";
                    lineInfo.XingCheng.PlanAccessory     = "";
                }
            }
            //机票折扣
            lineInfo.TicketAgio = Utils.GetDecimal(Utils.GetFormValue(this.txt_agio.UniqueID));
            //特殊要求
            lineInfo.SpecialClaim = Utils.GetFormValue(this.txt_need.UniqueID);
            //编号
            lineInfo.Id = id;
            //公司ID
            lineInfo.CompanyId = SiteUserInfo.CompanyID;
            //联系人姓名
            lineInfo.ContactTel = Utils.GetFormValue(this.txt_contactTel.UniqueID);
            //联系人电话
            lineInfo.ContactName = Utils.GetFormValue(this.txt_contactName.UniqueID);
            //询价单位编号
            lineInfo.CustomerId = Utils.GetInt(this.hid_QuoteCompanyId.Value, 0);
            //询价单位名称
            lineInfo.CustomerName = Utils.GetFormValue(this.txt_quoteCompany.UniqueID);
            ///////////////////////////////////////游客信息

            int cusLength = Utils.GetFormValues("cusName").Length;

            lineInfo.Traveller            = new EyouSoft.Model.TourStructure.TourEverydayApplyTravellerInfo();
            lineInfo.Traveller.Travellers = new List <EyouSoft.Model.TourStructure.TourOrderCustomer>();
            for (int i = 0; i < cusLength; i++)
            {
                //游客id
                string cusID = Utils.GetFormValues("cusID")[i];
                EyouSoft.Model.TourStructure.TourOrderCustomer toc = new EyouSoft.Model.TourStructure.TourOrderCustomer();
                toc.VisitorName = Utils.GetFormValues("cusName")[i];
                toc.VisitorType = (EyouSoft.Model.EnumType.TourStructure.VisitorType)(Utils.GetInt(Utils.GetFormValues("cusType")[i]));
                toc.CradType    = (EyouSoft.Model.EnumType.TourStructure.CradType)(Utils.GetInt(Utils.GetFormValues("cusCardType")[i]));
                toc.CradNumber  = Utils.GetFormValues("cusCardNo")[i];

                //游客性别
                int cusSex = Utils.GetInt(Utils.GetFormValues("cusSex")[i]);

                #region 性别
                if (cusSex == 1)
                {
                    toc.Sex = EyouSoft.Model.EnumType.CompanyStructure.Sex.男;
                }
                else if (cusSex == 2)
                {
                    toc.Sex = EyouSoft.Model.EnumType.CompanyStructure.Sex.女;
                }
                else
                {
                    toc.Sex = EyouSoft.Model.EnumType.CompanyStructure.Sex.未知;
                }
                #endregion

                toc.ContactTel = Utils.GetFormValues("cusPhone")[i];

                toc.IssueTime = DateTime.Now;
                EyouSoft.Model.TourStructure.CustomerSpecialService specModel = new EyouSoft.Model.TourStructure.CustomerSpecialService();
                if (string.IsNullOrEmpty(cusID))
                {
                    toc.ID = System.Guid.NewGuid().ToString();
                }
                else
                {
                    toc.ID = cusID;
                }

                if (Utils.GetFormValues("cusState")[i] == "DEL")
                {
                    toc.IsDelete = true;
                }
                else
                {
                    toc.IsDelete = false;
                }
                //特服
                string specive = Utils.GetFormValues("specive")[i];
                if (!string.IsNullOrEmpty(specive))
                {
                    if (specive.LastIndexOf(',') + 1 == specive.Length)
                    {
                        specive = specive.Substring(0, specive.Length - 1);
                    }
                    specModel.CustormerId   = toc.ID;
                    specModel.ProjectName   = Server.UrlDecode(Utils.GetFromQueryStringByKey(specive, "txtItem"));
                    specModel.ServiceDetail = Server.UrlDecode(Utils.GetFromQueryStringByKey(specive, "txtServiceContent"));
                    specModel.IsAdd         = Utils.GetFromQueryStringByKey(specive, "ddlOperate") == "0" ? true : false;
                    specModel.Fee           = Utils.GetDecimal(Utils.GetFromQueryStringByKey(specive,
                                                                                             "txtCost"));
                    specModel.IssueTime = DateTime.Now;
                    //特服项目名不能为空,否则不添加该条特服信息
                    if (!string.IsNullOrEmpty(specModel.ProjectName))
                    {
                        toc.SpecialServiceInfo = specModel;
                    }
                }
                lineInfo.Traveller.Travellers.Add(toc);
            }
            ///
            return(lineInfo);
        }
Example #3
0
        //确认提交
        protected void lbtnSubmit_Click(object sender, EventArgs e)
        {
            string msg = "";

            EyouSoft.BLL.TourStructure.TourOrder   TourOrderBll   = new EyouSoft.BLL.TourStructure.TourOrder();
            EyouSoft.Model.TourStructure.TourOrder TourOrderModel = new EyouSoft.Model.TourStructure.TourOrder();
            System.Collections.Generic.IList <EyouSoft.Model.TourStructure.TourOrderCustomer> curList = new System.Collections.Generic.List <EyouSoft.Model.TourStructure.TourOrderCustomer>();

            if (checkData(ref msg))
            {
                int cusLength = Utils.GetFormValues("cusName").Length;
                for (int i = 0; i < cusLength; i++)
                {
                    //游客id
                    string cusID = Utils.GetFormValues("cusID")[i];
                    //游客姓名
                    string cusName = Utils.GetFormValues("cusName")[i];

                    if (cusName == "")
                    {
                        continue;
                    }
                    //游客证件名称
                    int cusCardType = Utils.GetInt(Utils.GetFormValues("cusCardType")[i]);
                    //游客证件号码
                    string cusCardNo = Utils.GetFormValues("cusCardNo")[i];
                    //游客性别
                    int cusSex = Utils.GetInt(Utils.GetFormValues("cusSex")[i]);
                    //游客联系电话
                    string cusPhone = Utils.GetFormValues("cusPhone")[i];
                    //游客类型
                    int cusType = Utils.GetInt(Utils.GetFormValues("cusType")[i]);

                    EyouSoft.Model.TourStructure.TourOrderCustomer      cusModel  = new EyouSoft.Model.TourStructure.TourOrderCustomer();
                    EyouSoft.Model.TourStructure.CustomerSpecialService specModel = new EyouSoft.Model.TourStructure.CustomerSpecialService();
                    if (string.IsNullOrEmpty(cusID))
                    {
                        cusModel.ID = System.Guid.NewGuid().ToString();
                    }
                    else
                    {
                        cusModel.ID = cusID;
                    }
                    cusModel.OrderId   = OrderID;
                    cusModel.CompanyID = this.SiteUserInfo.CompanyID;
                    //特服
                    string specive = Utils.GetFormValues("specive")[i];
                    if (!string.IsNullOrEmpty(specive))
                    {
                        if (specive.LastIndexOf(',') + 1 == specive.Length)
                        {
                            specive = specive.Substring(0, specive.Length - 1);
                        }
                        specModel.CustormerId   = cusModel.ID;
                        specModel.ProjectName   = Utils.GetFromQueryStringByKey(specive, "txtItem");
                        specModel.ServiceDetail = Utils.GetFromQueryStringByKey(specive, "txtServiceContent");
                        specModel.IsAdd         = Utils.GetFromQueryStringByKey(specive, "ddlOperate") == "1" ? true : false;
                        specModel.Fee           = Utils.GetDecimal(Utils.GetFromQueryStringByKey(specive,
                                                                                                 "txtCost"));
                        //特服项目名不能为空,否则不添加该条特服信息
                        if (!string.IsNullOrEmpty(specModel.ProjectName))
                        {
                            cusModel.SpecialServiceInfo = specModel;
                        }
                    }
                    //添加到游客列表
                    cusModel.VisitorName = cusName;
                    if (Utils.GetFormValues("cusState")[i] == "DEL")
                    {
                        cusModel.IsDelete = true;
                    }
                    else
                    {
                        cusModel.IsDelete = false;
                    }
                    #region 游客证件类型
                    cusModel.CradType = (EyouSoft.Model.EnumType.TourStructure.CradType)cusCardType;
                    #endregion
                    cusModel.CradNumber = cusCardNo;
                    cusModel.ContactTel = cusPhone;
                    #region 游客类型
                    if (cusType == 1)
                    {
                        cusModel.VisitorType = EyouSoft.Model.EnumType.TourStructure.VisitorType.成人;
                        //doultCount++;
                    }
                    //儿童
                    else if (cusType == 2)
                    {
                        cusModel.VisitorType = EyouSoft.Model.EnumType.TourStructure.VisitorType.儿童;
                        //childCount++;
                    }
                    //其它
                    else
                    {
                        //cusModel.VisitorType = EyouSoft.Model.EnumType.TourStructure.VisitorType.未知;
                        printFaiMsg("请选择游客类型");
                        Response.End();
                    }
                    #endregion
                    #region 性别
                    if (cusSex == 1)
                    {
                        cusModel.Sex = EyouSoft.Model.EnumType.CompanyStructure.Sex.男;
                    }
                    else if (cusSex == 2)
                    {
                        cusModel.Sex = EyouSoft.Model.EnumType.CompanyStructure.Sex.女;
                    }
                    else
                    {
                        cusModel.Sex = EyouSoft.Model.EnumType.CompanyStructure.Sex.未知;
                    }
                    #endregion
                    //添加到游客列表中
                    curList.Add(cusModel);
                }
                //特殊要求说明
                string specialRe = this.txtSpecialRe.Text;
                //操作留言
                string operMes = this.txtOperMes.Text;
                //总金额
                decimal totalMoney = Utils.GetDecimal(this.txtTotalMoney.Text);
                //报价标准编号
                PriceStandId = Utils.GetFormValue("hd_PriceStandId");
                //客户等级编号
                CustomerLevId = Utils.GetFormValue("hd_LevelID");
                //成人价
                decimal adultP = Utils.GetDecimal(Utils.GetFormValue("hd_cr_price"));
                //儿童价
                decimal childP = Utils.GetDecimal(Utils.GetFormValue("hd_rt_price"));
                TourOrderModel.ID               = OrderID;
                TourOrderModel.TourId           = this.TourID.Value;
                TourOrderModel.SellCompanyId    = this.SiteUserInfo.CompanyID;
                TourOrderModel.ContactName      = this.txtContactName.Text;
                TourOrderModel.ContactTel       = this.txtContactPhone.Text;
                TourOrderModel.ContactMobile    = this.txtContactMobile.Text;
                TourOrderModel.ContactFax       = this.txtContactFax.Text;
                TourOrderModel.SaveSeatDate     = DateTime.Now;
                TourOrderModel.LastDate         = DateTime.Now;
                TourOrderModel.SpecialContent   = specialRe;
                TourOrderModel.OperatorContent  = operMes;
                TourOrderModel.SumPrice         = totalMoney;
                TourOrderModel.ChildNumber      = Utils.GetInt(this.txtChildCount.Text);
                TourOrderModel.AdultNumber      = Utils.GetInt(this.txtDdultCount.Text);
                TourOrderModel.PeopleNumber     = TourOrderModel.ChildNumber + TourOrderModel.AdultNumber;
                TourOrderModel.PersonalPrice    = adultP;
                TourOrderModel.ChildPrice       = childP;
                TourOrderModel.BuyCompanyID     = Utils.GetInt(this.hd_BuyCompanyId.Value);
                TourOrderModel.PriceStandId     = Utils.GetInt(PriceStandId);
                TourOrderModel.CustomerLevId    = Utils.GetInt(CustomerLevId);
                TourOrderModel.OrderState       = EyouSoft.Model.EnumType.TourStructure.OrderState.未处理;
                TourOrderModel.RouteId          = Utils.GetInt(this.hd_lineID.Value);
                TourOrderModel.CustomerFilePath = uploadFile();
                //是否组团端报名
                TourOrderModel.IsTourOrderEdit     = true;
                TourOrderModel.CustomerDisplayType = String.IsNullOrEmpty(TourOrderModel.CustomerFilePath) ? EyouSoft.Model.EnumType.TourStructure.CustomerDisplayType.输入方式 : EyouSoft.Model.EnumType.TourStructure.CustomerDisplayType.附件方式;
                TourOrderModel.CustomerList        = curList;
                TourOrderModel.BuyCompanyName      = SiteUserInfo.TourCompany.CompanyName;
                switch (TourOrderBll.Update(TourOrderModel))
                {
                case 0:
                {
                    TourOrderModel = null;
                    curList        = null;
                    printFaiMsg("修改失败");
                    break;
                }

                case 1:
                {
                    TourOrderModel = null;
                    curList        = null;
                    printSuccMsg("修改成功");
                    break;
                }

                case 2:
                {
                    TourOrderModel = null;
                    curList        = null;
                    printFaiMsg("该团队的订单总人数+当前订单人数大于团队计划人数总和");
                    break;
                }

                case 3:
                {
                    TourOrderModel = null;
                    curList        = null;
                    printFaiMsg("该客户所欠金额大于最高欠款金额");
                    break;
                }
                }
            }
            else
            {
                printFaiMsg(msg);
            }
            TourOrderModel = null;
            curList        = null;
            onInit();
        }
Example #4
0
        protected void LinkButton1_Click(object sender, EventArgs e)
        {
            //散客天天发申请
            EyouSoft.Model.TourStructure.TourEverydayApplyInfo TourEverydayApplyInfo = new EyouSoft.Model.TourStructure.TourEverydayApplyInfo();
            EyouSoft.BLL.TourStructure.TourEveryday            tourbll = new EyouSoft.BLL.TourStructure.TourEveryday();
            //散拼天天发业务逻辑和实体类
            string TourId = Utils.GetQueryStringValue("tourId");

            toureveryday = blltour.GetTourEverydayInfo(TourId);
            if (TourId != null && TourId != "")
            {
                if (toureveryday != null)
                {
                    TourEverydayApplyInfo.CompanyId = toureveryday.CompanyId;
                }
            }
            TourEverydayApplyInfo.TourId             = Utils.GetQueryStringValue("tourId");
            TourEverydayApplyInfo.OperatorId         = SiteUserInfo.ID;
            TourEverydayApplyInfo.AdultNumber        = EyouSoft.Common.Utils.GetInt(EyouSoft.Common.Utils.GetFormValue("TxtAdultPrice"));
            TourEverydayApplyInfo.ApplyCompanyId     = SiteUserInfo.TourCompany.TourCompanyId;
            TourEverydayApplyInfo.ApplyId            = SiteUserInfo.ID.ToString();
            TourEverydayApplyInfo.ApplyTime          = System.DateTime.Now;
            TourEverydayApplyInfo.ChildrenNumber     = EyouSoft.Common.Utils.GetInt(EyouSoft.Common.Utils.GetFormValue("TxtChildrenPrice"));
            TourEverydayApplyInfo.HandleStatus       = EyouSoft.Model.EnumType.TourStructure.TourEverydayHandleStatus.未处理;
            TourEverydayApplyInfo.LDate              = EyouSoft.Common.Utils.GetDateTime(EyouSoft.Common.Utils.GetFormValue("TxtSartTime"));
            TourEverydayApplyInfo.LevelId            = EyouSoft.Common.Utils.GetInt(EyouSoft.Common.Utils.GetFormValue(this.hd_LevelID.UniqueID));
            TourEverydayApplyInfo.StandardId         = EyouSoft.Common.Utils.GetInt(EyouSoft.Common.Utils.GetFormValue(this.hd_PriceStandId.UniqueID));
            TourEverydayApplyInfo.SpecialRequirement = EyouSoft.Common.Utils.GetFormValue("txt_Special");

            #region
            TourEverydayApplyInfo.Traveller = new EyouSoft.Model.TourStructure.TourEverydayApplyTravellerInfo();
            TourEverydayApplyInfo.Traveller.TravellerDisplayType = EyouSoft.Model.EnumType.TourStructure.CustomerDisplayType.附件方式;
            #region 游客附件信息
            EyouSoft.Model.TourStructure.TourAttachInfo Attachinfo = new EyouSoft.Model.TourStructure.TourAttachInfo();
            string fileAtt         = string.Empty;
            string oldfileAtt      = string.Empty;
            string VisitorInfoFile = "/uploadFiles/zutuanFile/";
            if (EyouSoft.Common.Function.UploadFile.FileUpLoad(Request.Files["fuiLoadAttachment"], VisitorInfoFile, out fileAtt, out oldfileAtt))
            {
                if (fileAtt.Trim() != "" && oldfileAtt.Trim() != "")
                {
                    TourEverydayApplyInfo.Traveller.TravellerFilePath = fileAtt;
                }
            }
            else
            {
                EyouSoft.Common.Function.MessageBox.Show(this.Page, "上传附件失败!");
                return;
            }
            #endregion
            TourEverydayApplyInfo.Traveller.Travellers = new List <EyouSoft.Model.TourStructure.TourOrderCustomer>();
            //获取所有的游客姓名
            string[] cus_arr = Utils.GetFormValues("txtVisitorName");
            //获取特服信息
            string[] uri        = Utils.GetFormValues("tefu");
            string[] cardType   = Utils.GetFormValues("ddlCardType");
            decimal  orderprice = 0;
            for (int k = 0; k < cus_arr.Length; k++)
            {
                if (Utils.GetFormValues("txtVisitorName")[k] == "")
                {
                    break;
                }
                //订单游客信息实体
                EyouSoft.Model.TourStructure.TourOrderCustomer item = new EyouSoft.Model.TourStructure.TourOrderCustomer();

                item.VisitorName = Utils.GetFormValues("txtVisitorName")[k];
                //游客类型
                item.VisitorType = Utils.GetFormValues("ddlVisitorType")[k] == "1" ? EyouSoft.Model.EnumType.TourStructure.VisitorType.成人 : EyouSoft.Model.EnumType.TourStructure.VisitorType.儿童;
                #region 游客证件类型
                //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;
                //}
                #endregion
                item.CradType = (EyouSoft.Model.EnumType.TourStructure.CradType)Utils.GetInt(cardType[k]);
                //游客证件号码
                item.CradNumber = Utils.GetFormValues("txtCardNo")[k];
                #region 游客性别
                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;
                }
                #endregion

                //游客联系电话
                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          = SiteUserInfo.CompanyID;

                //游客所有的信息添加到订单
                TourEverydayApplyInfo.Traveller.Travellers.Add(item);
                orderprice += Utils.GetDecimal(Utils.GetFromQueryStringByKey(uri[k], "txtCost"));
            }
            #endregion

            int result = tourbll.ApplyTourEveryday(TourEverydayApplyInfo);
            if (result > 0)
            {
                Response.Write("<script>alert('提交成功');parent.Boxy.getIframeDialog('" + Request.QueryString["iframeid"] + "').hide()</script>");
            }
            else
            {
                Response.Write("<script>alert('提交失败!');location.href=location.href;</script>");
            }
        }
Example #5
0
        /// <summary>
        /// 提交
        /// </summary>
        /// <param name="orderState">true=非同意留位操作</param>
        /// <param name="saveSeatDate">留位时间</param>

        private void Save(bool state, DateTime saveSeatDate)
        {
            EyouSoft.BLL.TourStructure.Tour bll = new EyouSoft.BLL.TourStructure.Tour(SiteUserInfo);
            string TourId = Utils.GetQueryStringValue("tourId");

            model = (EyouSoft.Model.TourStructure.TourInfo)bll.GetTourInfo(TourId);
            #region 提交财务后不允许操作 by  txb 6.17
            if (model != null)
            {
                if (!Utils.PlanIsUpdateOrDelete(model.Status.ToString()))
                {
                    Response.Write("<script>alert('该团已提交财务,不能对它操作!');location.href=location.href;</script>");
                    return;
                }
            }
            #endregion
            //订单信息业务逻辑层
            EyouSoft.BLL.TourStructure.TourOrder orderbll = new EyouSoft.BLL.TourStructure.TourOrder();
            //订单信息实体类
            EyouSoft.Model.TourStructure.TourOrder ordermodel = new EyouSoft.Model.TourStructure.TourOrder();
            //线路区域编号
            ordermodel.AreaId = model.AreaId;
            //儿童数
            ordermodel.ChildNumber = Utils.GetInt(Utils.GetFormValue(txtChildCount.UniqueID));
            //儿童价
            ordermodel.ChildPrice = Utils.GetDecimal(Utils.GetFormValue("hd_rt_price"));
            //成人数
            ordermodel.AdultNumber = Utils.GetInt(Utils.GetFormValue(txtDdultCount.UniqueID));
            //成人价
            ordermodel.PersonalPrice = Utils.GetDecimal(Utils.GetFormValue("hd_cr_price"));
            //预定人姓名
            ordermodel.ContactName = this.txtContactName.Text;
            //预订人电话
            ordermodel.ContactTel = this.txtContactPhone.Text;
            //手机
            ordermodel.ContactMobile = this.txtContactMobile.Text;
            //传真
            ordermodel.ContactFax = this.txtContactFax.Text;
            //客户等级编号
            ordermodel.CustomerLevId = SiteUserInfo.TourCompany.CustomerLevel;
            //报价等级编号
            ordermodel.PriceStandId = Utils.GetInt(Utils.GetFormValue(hd_PriceStandId.UniqueID));
            //下单时间
            ordermodel.IssueTime = DateTime.Now;
            //游客特别要求
            ordermodel.SpecialContent = Utils.GetFormValue("txt_Special");
            //组团社编号
            ordermodel.BuyCompanyID = SiteUserInfo.TourCompany.TourCompanyId;
            //是否组团端报名
            ordermodel.IsTourOrderEdit = true;
            //组团社单位名称
            EyouSoft.Model.CompanyStructure.CustomerInfo customInfo =
                new EyouSoft.BLL.CompanyStructure.Customer().GetCustomerModel(SiteUserInfo.TourCompany.TourCompanyId);
            if (customInfo != null)
            {
                ordermodel.BuyCompanyName = customInfo.Name;
                //销售员
                ordermodel.SalerId   = customInfo.SaleId;
                ordermodel.SalerName = customInfo.Saler;
            }

            //下单人联系手机
            //ordermodel.ContactMobile = SiteUserInfo.ContactInfo.ContactMobile;
            //下单人传真
            //ordermodel.ContactFax = SiteUserInfo.ContactInfo.ContactFax;

            //计调员
            ordermodel.OperatorList = new List <EyouSoft.Model.TourStructure.TourOperator>();
            EyouSoft.Model.TourStructure.TourOperator TourOperator = new EyouSoft.Model.TourStructure.TourOperator();
            TourOperator.ContactName = model.Coordinator.Name.ToString();
            TourOperator.OperatorId  = model.Coordinator.CoordinatorId;
            ordermodel.OperatorList.Add(TourOperator);

            #region 根据团队计划获取线路编号
            EyouSoft.BLL.TourStructure.Tour bllTour = new EyouSoft.BLL.TourStructure.Tour();
            //计划团队信息实体类
            string TourID = Utils.GetQueryStringValue("tourId");
            if (TourID != null && TourID != "")
            {
                model = (EyouSoft.Model.TourStructure.TourInfo)bllTour.GetTourInfo(TourID);
                if (model != null)
                {
                    ordermodel.RouteId        = model.RouteId;
                    ordermodel.ViewOperatorId = model.OperatorId;
                }
            }
            #endregion

            //获取团队类型编号
            ordermodel.TourClassId = EyouSoft.Model.EnumType.TourStructure.TourType.散拼计划;

            //订单游客信息业务逻辑
            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[] cardType   = Utils.GetFormValues("ddlCardType");
            decimal  orderprice = 0;
            for (int k = 0; k < cus_arr.Length; k++)
            {
                if (Utils.GetFormValues("txtVisitorName")[k] == "")
                {
                    break;
                }
                //订单游客信息实体
                EyouSoft.Model.TourStructure.TourOrderCustomer item = new EyouSoft.Model.TourStructure.TourOrderCustomer();
                item.VisitorName = Utils.GetFormValues("txtVisitorName")[k];
                //游客类型
                item.VisitorType = Utils.GetFormValues("ddlVisitorType")[k] == "1" ? EyouSoft.Model.EnumType.TourStructure.VisitorType.成人 : EyouSoft.Model.EnumType.TourStructure.VisitorType.儿童;
                item.CradType    = (EyouSoft.Model.EnumType.TourStructure.CradType)Utils.GetInt(cardType[k]);
                //游客证件号码
                item.CradNumber = Utils.GetFormValues("txtCardNo")[k];
                #region 游客性别
                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;
                }
                #endregion

                //游客联系电话
                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          = SiteUserInfo.CompanyID;

                //游客所有的信息添加到订单
                cus_list.Add(item);
                orderprice += Utils.GetDecimal(Utils.GetFromQueryStringByKey(uri[k], "txtCost"));
            }

            //游客信息集合
            ordermodel.CustomerList = cus_list;
            //返佣金额
            ordermodel.CommissionPrice = Utils.GetDecimal(this.hideBackMoney.Value);
            //返佣类型
            ordermodel.CommissionType = (EyouSoft.Model.EnumType.CompanyStructure.CommissionType)Utils.GetInt(this.hideBackType.Value);
            ordermodel.BuyerContactId = new EyouSoft.BLL.CompanyStructure.Customer().GetContactId
                                            (SiteUserInfo.ID);
            ordermodel.BuyerContactName = SiteUserInfo.ContactInfo.ContactName;
            ordermodel.LastDate         = DateTime.Now;
            ordermodel.LeaveDate        = model.LDate;
            ordermodel.SaveSeatDate     = saveSeatDate;
            ordermodel.PersonalPrice    = Utils.GetDecimal(Utils.GetFormValue("hd_cr_price"));
            ordermodel.ChildPrice       = Utils.GetDecimal(Utils.GetFormValue("hd_rt_price"));
            ordermodel.ID              = Guid.NewGuid().ToString();
            ordermodel.TourId          = model.TourId;
            ordermodel.OrderType       = EyouSoft.Model.EnumType.TourStructure.OrderType.组团下单;
            ordermodel.SellCompanyId   = SiteUserInfo.CompanyID;
            ordermodel.SellCompanyName = this.SiteUserInfo.CompanyName;

            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   = state ? EyouSoft.Model.EnumType.TourStructure.OrderState.未处理 : EyouSoft.Model.EnumType.TourStructure.OrderState.已留位;
            ordermodel.OtherPrice   = orderprice;
            ordermodel.RouteId      = model.RouteId;
            ordermodel.RouteName    = model.RouteName;
            ordermodel.OtherPrice   = orderprice;
            ordermodel.SumPrice     = Utils.GetDecimal(Utils.GetFormValue("txtTotalMoney").ToString());
            ordermodel.PeopleNumber = Utils.GetInt(Utils.GetFormValue(txtDdultCount.UniqueID)) + Utils.GetInt(Utils.GetFormValue(txtChildCount.UniqueID));

            #region 游客附件信息
            string fileAtt         = "";
            string oldfileAtt      = "";
            string VisitorInfoFile = "/uploadFiles/zutuanFile/";
            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;
            }
            #endregion
            //提交订单
            /// 0:失败;
            /// 1:成功;
            /// 2:该团队的订单总人数+当前订单人数大于团队计划人数总和;
            /// 3:该客户所欠金额大于最高欠款金额;
            int i = orderbll.AddOrder(ordermodel);
            switch (i)
            {
            case 1:
            {
                Utils.ShowMsgAndCloseBoxy("提交成功", Request.QueryString["iframeid"], true);
            } 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;

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

            orderbll   = null;
            ordermodel = null;
            cus_list   = null;
        }