Ejemplo n.º 1
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();
        }
Ejemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            EyouSoft.BLL.CompanyStructure.CompanySetting CompanyBll = new EyouSoft.BLL.CompanyStructure.CompanySetting();
            OrderPrintPath         = CompanyBll.GetPrintPath(SiteUserInfo.CompanyID, EyouSoft.Model.EnumType.CompanyStructure.PrintTemplateType.组团订单打印名单);
            this.selectXianlu1.Url = "/GroupEnd/Orders/OrderList.aspx";

            #region 定义变量接受参数
            //操作
            string act = EyouSoft.Common.Utils.GetQueryStringValue("act");
            //继续留位id
            string ID = EyouSoft.Common.Utils.GetQueryStringValue("ID");
            //线路区域
            string OrderID = EyouSoft.Common.Utils.GetQueryStringValue("OrderID");
            //线路名称
            string LineName = EyouSoft.Common.Utils.GetQueryStringValue("LineName");
            //出团开始时间
            DateTime?StartTime = EyouSoft.Common.Utils.GetDateTimeNullable(EyouSoft.Common.Utils.GetQueryStringValue("BeginTime"));
            //出团结束时间
            DateTime?EndTime = EyouSoft.Common.Utils.GetDateTimeNullable(EyouSoft.Common.Utils.GetQueryStringValue("EndTime"));
            //订单下单开始时间
            DateTime?OrderStartDate = EyouSoft.Common.Utils.GetDateTimeNullable(EyouSoft.Common.Utils.GetQueryStringValue("OrderStartDate"));
            //订单下单结束时间
            DateTime?OrderEndDate = EyouSoft.Common.Utils.GetDateTimeNullable(EyouSoft.Common.Utils.GetQueryStringValue("OrderEndDate"));
            //线路区域ID
            int?xlid = EyouSoft.Common.Utils.GetIntNull(EyouSoft.Common.Utils.GetQueryStringValue("xlid"));
            #endregion
            #region 初始化变量参数
            if (OrderID != null)
            {
                this.TxtOrderID.Value = OrderID;
            }
            if (LineName != "")
            {
                this.xl_XianlName.Value = LineName.ToString();
            }
            if (StartTime != null)
            {
                this.BeginTime.Value = Convert.ToDateTime(StartTime).ToString("yyyy-MM-dd");
            }
            if (EndTime != null)
            {
                this.EndTime.Value = Convert.ToDateTime(EndTime).ToString("yyyy-MM-dd");
            }
            if (OrderStartDate != null)
            {
                this.inputOrderStartDate.Value = Convert.ToDateTime(OrderStartDate).ToString("yyyy-MM-dd");
            }
            if (OrderEndDate != null)
            {
                this.inputOrderEndDate.Value = Convert.ToDateTime(OrderEndDate).ToString("yyyy-MM-dd");
            }
            #endregion
            if (act == "updateContinue")
            {
                //订单信息业务逻辑类
                EyouSoft.BLL.TourStructure.TourOrder BllTourOrder = new EyouSoft.BLL.TourStructure.TourOrder(SiteUserInfo);
                //订单信息实体类
                EyouSoft.Model.TourStructure.TourOrder TourOrderModel = BllTourOrder.GetOrderModel(SiteUserInfo.CompanyID, ID);
                TourOrderModel.LastDate   = DateTime.Now;
                TourOrderModel.OrderState = EyouSoft.Model.EnumType.TourStructure.OrderState.未处理;
                string msg = string.Empty;
                switch (BllTourOrder.Update(TourOrderModel))
                {
                case 0:
                {
                    TourOrderModel = null;
                    msg            = "留位失败";
                    break;
                }

                case 1:
                {
                    TourOrderModel = null;

                    msg = "留位成功";
                    break;
                }

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

                case 3:
                {
                    TourOrderModel = null;
                    msg            = "该客户所欠金额大于最高欠款金额";
                    break;
                }
                }
                MessageBox.ShowAndRedirect(this, msg, "/GroupEnd/Orders/OrderList.aspx");
            }
            else
            {
                BindLineInfo(OrderID, LineName, StartTime, EndTime, OrderStartDate, OrderEndDate, xlid);
            }
        }