protected void ro_rpt_priceList_ItemDataBound(object sender, RepeaterItemEventArgs e) { EyouSoft.Model.TourStructure.TourPriceDetail priceModel = e.Item.DataItem as EyouSoft.Model.TourStructure.TourPriceDetail; decimal adultPrice = priceModel.PriceDetail.Where(i => i.CustomerLevelType == EyouSoft.Model.CompanyStructure.CustomerLevelType.行).First().AdultPrice; decimal childPrice = priceModel.PriceDetail.Where(i => i.CustomerLevelType == EyouSoft.Model.CompanyStructure.CustomerLevelType.行).First().ChildrenPrice; decimal roomPrice = priceModel.PriceDetail.Where(i => i.CustomerLevelType == EyouSoft.Model.CompanyStructure.CustomerLevelType.单房差).First().AdultPrice; StringBuilder builder = new StringBuilder(); string class1 = "class=\"ro_noselect\""; string class2 = "style=\"display:none\" class=\"ro_select\""; string check = ""; string disabled = "disabled=\"disabled\""; if (e.Item.ItemIndex == 0)//默认第一个报价类型展开 { class1 = "class=\"ro_noselect\" style=\"display:none\""; class2 = "class=\"ro_select\""; check = "checked='checked'"; disabled = ""; ro_txtSumPrice.Value = string.Format("{0:f}", adultPrice * adultNum + childPrice * childNum);//初始总额 } string str = string.Format("<span><input name=\"ro_rdiPriceStandId\" type=\"radio\" id=\"changgui\" value=\"{0}\" {7} onclick=\"RouteOrder.selectPrice(this)\"/>" + "<label>{1} </label>" + "<span {5}>成人价¥<label>{2,0:f}</label> 儿童价¥<label>{3,0:f}</label> 单房差¥<label>{4,0:f}</label></span><span {6}>" + "成人数<input name=\"ro_txtManCount\" id=\"ro_txtManCount1\" {8} runat=\"server\" onchange=\"RouteOrder.changePeopleCount(this,'1')\" type=\"text\" sourceCount=\"{9}\" value=\"{9}\" style=\"border:1px solid #7F9DB9;width:20px;\"/>×单价<input name=\"ro_txtManPrice\" id=\"ro_txtManPrice\" type=\"text\" readonly=\"readonly\" {8} value=\"{2,0:f}\" style=\"width:50px;border:1px solid #7F9DB9; color:Gray\"/><span style=\"font-size:20px; font-weight:bold; color:#cc0000;\">+</span>" + "儿童数<input name=\"ro_txtChildCount\" id=\"ro_txtChildCount1\" {8} onchange=\"RouteOrder.changePeopleCount(this,'0')\" sourceCount=\"{10}\" type=\"text\" value=\"{10}\" style=\"width:20px;border:1px solid #7F9DB9;\"/>×单价<input name=\"ro_txtChildPrice\" id=\"ro_txtChildPrice\" type=\"text\" {8} value=\"{3,0:f}\" readonly=\"readonly\" style=\"width:50px;border:1px solid #7F9DB9;color:Gray\"/><span style=\"font-size:20px; font-weight:bold; color:#cc0000;\">+</span>" + "单房差<input name=\"ro_txtOneRoomCount\" {8} onchange=\"RouteOrder.ro_change(this)\" id=\"ro_txtOneRoomCount1\" sourceCount=\"0\" type=\"text\" value=\"0\" style=\"width:20px;border:1px solid #7F9DB9;\"/>×单价<input name=\"ro_txtOneRoomPrice\" id=\"ro_txtOneRoomPrice\" {8} type=\"text\" value=\"{4,0:f}\" readonly=\"readonly\" style=\"width:50px;border:1px solid #7F9DB9;color:Gray\"/>+" + "其它费用<input name=\"ro_txtOtherPrice\" {8} onchange=\"RouteOrder.ro_change(this)\" id=\"ro_txtOtherPrice1\" type=\"text\" value=\"0\" sourceCount=\"0\" style=\"width:50px;border:1px solid #7F9DB9;\"/></span></span><br/>", priceModel.PriceStandId, priceModel.PriceStandName, adultPrice, childPrice, roomPrice, class1, class2, check, disabled, adultNum, childNum); LiteralControl liter = new LiteralControl(str); e.Item.Controls.Add(liter); }
/// <summary> /// 写入团队报价信息 /// </summary> private IList <EyouSoft.Model.TourStructure.TourPriceDetail> InsertTourPriceDetail() { string[] PriceStand = Utils.GetFormValues("drpPriceRank"); string[] hidCustomerLevelID = Utils.GetFormValues("hidCustomerLevelID"); IList <EyouSoft.Model.TourStructure.TourPriceDetail> priceList = new List <EyouSoft.Model.TourStructure.TourPriceDetail>(); int i = 0; if (PriceStand != null) { foreach (string pricestand in PriceStand) { IList <EyouSoft.Model.TourStructure.TourPriceCustomerLeaveDetail> list = new List <EyouSoft.Model.TourStructure.TourPriceCustomerLeaveDetail>(); EyouSoft.Model.TourStructure.TourPriceDetail priceModel = new EyouSoft.Model.TourStructure.TourPriceDetail(); priceModel.PriceStandId = pricestand; foreach (string customerlevelid in hidCustomerLevelID) { string[] PeoplePrice = Utils.GetFormValues("PeoplePrice" + customerlevelid); string[] ChildPrice = Utils.GetFormValues("ChildPrice" + customerlevelid); EyouSoft.Model.TourStructure.TourPriceCustomerLeaveDetail model = new EyouSoft.Model.TourStructure.TourPriceCustomerLeaveDetail(); if (!String.IsNullOrEmpty(PeoplePrice[i]) && Utils.GetDecimal(PeoplePrice[i]) != 0) { model.AdultPrice = decimal.Parse(PeoplePrice[i]); } else { model.AdultPrice = 0; } if (!String.IsNullOrEmpty(ChildPrice[i]) && Utils.GetDecimal(ChildPrice[i]) != 0) { model.ChildrenPrice = decimal.Parse(ChildPrice[i]); } else { model.ChildrenPrice = 0; } model.CustomerLevelId = int.Parse(customerlevelid); list.Add(model); model = null; } priceModel.PriceDetail = list; list = null; priceList.Add(priceModel); priceModel = null; i++; } } return(priceList); }
/// <summary> /// 团队报价信息 /// </summary> /// <returns></returns> private IList <EyouSoft.Model.TourStructure.TourPriceDetail> InsertTourPriceDetail() { string[] PriceStand = Utils.GetFormValues("drpPriceRank"); //价格等级编号 string[] hidCustomerLevelID = Utils.GetFormValues("hidCustomerLevelID"); //客户等级编号 IList <EyouSoft.Model.TourStructure.TourPriceDetail> priceList = new List <EyouSoft.Model.TourStructure.TourPriceDetail>(); int i = 0; if (PriceStand != null) { foreach (string pricestand in PriceStand) { IList <EyouSoft.Model.TourStructure.TourPriceCustomerLeaveDetail> list = new List <EyouSoft.Model.TourStructure.TourPriceCustomerLeaveDetail>(); EyouSoft.Model.TourStructure.TourPriceDetail priceModel = new EyouSoft.Model.TourStructure.TourPriceDetail(); priceModel.PriceStandId = pricestand; foreach (string customerlevelid in hidCustomerLevelID) { string[] PeoplePrice = Utils.GetFormValues("PeoplePrice" + customerlevelid); string[] ChildPrice = Utils.GetFormValues("ChildPrice" + customerlevelid); string CustomerType = Utils.GetFormValue("hidCustomerType" + customerlevelid); EyouSoft.Model.TourStructure.TourPriceCustomerLeaveDetail model = new EyouSoft.Model.TourStructure.TourPriceCustomerLeaveDetail(); model.AdultPrice = Utils.GetDecimal(PeoplePrice[i]); model.ChildrenPrice = Utils.GetDecimal(ChildPrice[i], 0); model.CustomerLevelId = Utils.GetInt(customerlevelid); list.Add(model); model = null; } priceModel.PriceDetail = list; priceList.Add(priceModel); int PriceStandCount = 0; PriceStandCount = priceList.Count(item => item.PriceStandId == pricestand); if (PriceStandCount > 1) { Response.Clear(); Response.Write("[{isSuccess:false,ErrorMessage:'价格等级相同,保存失败!'}]"); Response.End(); } list = null; i++; } } return(priceList); }
protected void SaveOrder() { //团队所属公司ID string TourCompanyId = ""; //获得订单信息 tourModel = tourBll.GetTourInfo(tourId); string priceId = Utils.GetFormValue("ro_rdiPriceStandId");//获取选择的报价等级编号 EyouSoft.Model.TourStructure.TourOrder orderModel = new EyouSoft.Model.TourStructure.TourOrder(); orderModel.AdultNumber = Utils.GetInt(Utils.GetFormValue("ro_txtManCount"), 0); //获取成人数 orderModel.BuyCompanyID = SiteUserInfo.CompanyID; //预定单位 orderModel.BuyCompanyName = SiteUserInfo.CompanyName; //预定单位名 orderModel.ChildNumber = Utils.GetInt(Utils.GetFormValue("ro_txtChildCount"), 0); //儿童数 EyouSoft.Model.TourStructure.TourPriceDetail price = tourModel.TourPriceDetail.Where(i => i.PriceStandId == priceId).First(); //根据获取的报价等级编号获取相应报价等级 orderModel.ChildPrice = price.PriceDetail.Where(i => i.CustomerLevelType == EyouSoft.Model.CompanyStructure.CustomerLevelType.行).First().ChildrenPrice;//儿童价 TourCompanyId = tourModel.CompanyID; orderModel.CompanyID = TourCompanyId; orderModel.ContactFax = SiteUserInfo.ContactInfo.Fax; orderModel.ContactMQ = SiteUserInfo.ContactInfo.MQ; orderModel.ContactName = SiteUserInfo.ContactInfo.ContactName; orderModel.ContactQQ = SiteUserInfo.ContactInfo.QQ; orderModel.ContactTel = SiteUserInfo.ContactInfo.Tel; orderModel.LastOperatorID = SiteUserInfo.ID; //最后操作人 orderModel.MarketNumber = int.Parse(Utils.GetFormValue("ro_txtOneRoomCount")); //单房差数 orderModel.MarketPrice = price.PriceDetail.Where(i => i.CustomerLevelType == EyouSoft.Model.CompanyStructure.CustomerLevelType.单房差).First().AdultPrice; //单房差价 orderModel.OperatorContent = Utils.GetFormValue("ro_txtOperatorContent"); //操作留言 orderModel.OperatorID = SiteUserInfo.ID; //操作人ID orderModel.OperatorName = SiteUserInfo.ContactInfo.ContactName; //操作人名 orderModel.OrderType = 0; //预定类型 orderModel.OtherPrice = decimal.Parse(Utils.GetFormValue("ro_txtOtherPrice")); //其他费用 orderModel.PeopleNumber = orderModel.ChildNumber + orderModel.AdultNumber; //总人数 if (orderModel.PeopleNumber == 0) { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), Guid.NewGuid().ToString(), "<script>;alert('请填写游客!');</script>"); } orderModel.AreaType = tourModel.AreaType; orderModel.AreaId = tourModel.AreaId; orderModel.PersonalPrice = price.PriceDetail.Where(i => i.CustomerLevelType == EyouSoft.Model.CompanyStructure.CustomerLevelType.行).First().AdultPrice; //成人价 orderModel.PriceStandId = priceId; //报价等级 orderModel.RouteName = tourModel.RouteName; orderModel.LeaveDate = tourModel.LeaveDate; //出发时间 orderModel.SpecialContent = Utils.GetFormValue("ro_txtSpecialContent"); //特别要求 orderModel.SumPrice = orderModel.AdultNumber * orderModel.PersonalPrice + orderModel.ChildNumber * orderModel.ChildPrice + orderModel.MarketNumber * orderModel.MarketPrice + orderModel.OtherPrice; //总金额 orderModel.TourCompanyId = tourModel.CompanyID; //专线编号 orderModel.TourCompanyName = tourModel.CompanyName; //专线公司名 orderModel.TourDays = tourModel.TourDays; //天数 orderModel.SaveSeatDate = DateTime.Now; //留位时间 orderModel.TourId = tourModel.ID; //团队编号 orderModel.TourNo = tourModel.TourNo; //团号 orderModel.TourType = EyouSoft.Model.TourStructure.TourType.组团团队; orderModel.IssueTime = DateTime.Now; //添加时间 orderModel.OrderSource = EyouSoft.Model.TourStructure.TourOrderOperateType.组团社下单; //订单来源 //获得游客信息 List <EyouSoft.Model.TourStructure.TourOrderCustomer> customerList = new List <EyouSoft.Model.TourStructure.TourOrderCustomer>(); List <string> custNoList = Request.Form.AllKeys.Where(i => i.Contains("CustomerName")).Select(i => i.Substring(12, i.Length - 12)).ToList(); foreach (string customerNo in custNoList) { EyouSoft.Model.TourStructure.TourOrderCustomer customerModel = new EyouSoft.Model.TourStructure.TourOrderCustomer(); customerModel.CompanyID = SiteUserInfo.CompanyID; //所属公司 customerModel.CompanyName = SiteUserInfo.CompanyName; //所属公司名 customerModel.ContactTel = Utils.GetFormValue("CustomerTelphone" + customerNo); customerModel.CradNumber = Utils.GetFormValue("CertificateNo" + customerNo); //证件编号 customerModel.CradType = (EyouSoft.Model.TourStructure.CradType) int.Parse(Utils.GetFormValue("CertificateName" + customerNo)); //证件类型 customerModel.Remark = Utils.GetFormValue("CustomerRemark" + customerNo); //备注信息 customerModel.Sex = Utils.GetFormValue("CustomerSex" + customerNo) == "1"?true:false; //性别 customerModel.SiteNo = Utils.GetFormValue("CustomerSiteNo" + customerNo); //座位号 orderModel.SeatList += customerModel.SiteNo + ","; //座位号集 customerModel.VisitorName = Utils.GetFormValue("CustomerName" + customerNo); //姓名 customerModel.VisitorType = Utils.GetFormValue("CustomerType" + customerNo) == "1"?true:false; //类型(成人,儿童) customerModel.IssueTime = DateTime.Now; customerModel.RouteName = routeName; customerModel.TourId = tourId; //团队ID customerModel.TourNo = tourModel.TourNo; //团号 customerList.Add(customerModel); } orderModel.SeatList = orderModel.SeatList.TrimEnd(','); //获得座位号 orderModel.TourOrderCustomer = customerList; //保存游客信息 EyouSoft.IBLL.TourStructure.ITourOrder tourOrderBll = EyouSoft.BLL.TourStructure.TourOrder.CreateInstance(); //开始下订单 if (tourOrderBll.AddTourOrder(orderModel) > 0) { EyouSoft.Model.CompanyStructure.CompanyDetailInfo _companyInfo = EyouSoft.BLL.CompanyStructure.CompanyInfo.CreateInstance().GetModel(TourCompanyId); bool isSend = Utils.SendSMSForReminderOrder( TourCompanyId, SiteUserInfo.CompanyName, SiteUserInfo.ContactInfo.ContactName, _companyInfo != null ? _companyInfo.CityId : 0); if (isSend) { EyouSoft.Model.CompanyStructure.CompanyDetailInfo model = EyouSoft.BLL.CompanyStructure.CompanyInfo.CreateInstance().GetModel(TourCompanyId); //发送短信记录 EyouSoft.Model.ToolStructure.MsgTipRecord tipModel = new EyouSoft.Model.ToolStructure.MsgTipRecord(); tipModel.Email = string.Empty; tipModel.FromMQID = SiteUserInfo.ContactInfo.MQ; tipModel.ToMQID = model.ContactInfo.MQ; //接收方MQ tipModel.Mobile = model.ContactInfo.Mobile; //接收方手机 tipModel.MsgType = EyouSoft.Model.ToolStructure.MsgType.NewOrder; tipModel.SendWay = EyouSoft.Model.ToolStructure.MsgSendWay.SMS; EyouSoft.BLL.ToolStructure.MsgTipRecord msgTipBll = new EyouSoft.BLL.ToolStructure.MsgTipRecord(); msgTipBll.Add(tipModel); } Utils.SendEmailForReminderOrder(TourCompanyId, SiteUserInfo.CompanyName, SiteUserInfo.UserName); Page.ClientScript.RegisterClientScriptBlock(this.GetType(), Guid.NewGuid().ToString(), "<script>;alert('预定成功!');if(window.parent.Boxy){window.parent.Boxy.getIframeDialog('" + Request.QueryString["iframeId"] + "').hide();if(window.parent.RouteStock){window.parent.RouteStock.refresh();};}else{window.close();}</script>"); } else { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), Guid.NewGuid().ToString(), "<script>;alert('预定失败!');</script>"); } }