protected void BindTrfficList() { PageIndex = EyouSoft.Common.Utils.GetInt(EyouSoft.Common.Utils.GetQueryStringValue("Page"), 0); EyouSoft.Model.PlanStructure.TrafficSearch searchModel = new EyouSoft.Model.PlanStructure.TrafficSearch(); string trfficName = EyouSoft.Common.Utils.GetQueryStringValue("trfficName"); if (!string.IsNullOrEmpty(trfficName)) { searchModel.TrafficName = trfficName; } IList <EyouSoft.Model.PlanStructure.TrafficInfo> List = new EyouSoft.BLL.PlanStruture.PlanTrffic(SiteUserInfo).GetTrafficList(searchModel, PageSize, PageIndex, this.SiteUserInfo.CompanyID, ref RecordCount); if (List != null && List.Count > 0) { this.labMsg.Visible = false; this.repTrfficList.DataSource = List; this.repTrfficList.DataBind(); bindPage(); } else { this.ExporPageInfoSelect1.Visible = false; this.labMsg.Visible = true; this.labMsg.Text = "暂无数据!"; } }
protected void InitStatisList() { Datetime = EyouSoft.Common.Utils.GetQueryStringValue("DateTime"); ticketendtime = EyouSoft.Common.Utils.GetQueryStringValue("endtime"); EyouSoft.Model.PlanStructure.JiaoTongChuPiaoSearch search = new EyouSoft.Model.PlanStructure.JiaoTongChuPiaoSearch(); search.StartTime = EyouSoft.Common.Utils.GetDateTimeNullable(Datetime); search.EndTime = EyouSoft.Common.Utils.GetDateTimeNullable(ticketendtime); IList <EyouSoft.Model.PlanStructure.JiaoTongChuPiao> list = new EyouSoft.BLL.PlanStruture.PlanTrffic().GetJiaoTongChuPiao(this.SiteUserInfo.CompanyID, search); if (list != null && list.Count > 0) { this.prtticketlist.DataSource = list; this.prtticketlist.DataBind(); BindPage(); lenght = list.Count; #region 设置总计 //总票数 this.lblAllTickets.Text = list.Sum(p => p.ChuPiaoShu).ToString(); this.labDaiLiFeiCount.Text = list.Sum(p => p.AgencyPrice).ToString("0.00"); #endregion this.lblMsg.Visible = false; } else { this.lblMsg.Visible = true; this.ExportPageInfo1.Visible = false; } }
/// <summary> /// 初始化 /// </summary> protected void InitTravel(int trId) { EyouSoft.Model.PlanStructure.TravelInfo model = new EyouSoft.BLL.PlanStruture.PlanTrffic().GettravelModel(trId); if (model != null) { this.txtSerialNum.Value = model.SerialNum.ToString(); if (this.seleTfrricType.Items.FindByValue(((int)model.TrafficType).ToString()) != null) { this.seleTfrricType.Items.FindByValue(((int)model.TrafficType).ToString()).Selected = true; } //出发省份 城市 ucLProvince.ProvinceId = model.LProvince; ucLCity.CityId = model.LCity; ucLCity.ProvinceId = model.LProvince; //抵达省份 城市 ucRprovince.ProvinceId = model.RProvince; ucRcity.CityId = model.RCity; ucRcity.ProvinceId = model.RProvince; this.txtFlightNum.Value = model.FilghtNum; if (this.seleLineCompanyNamev.Items.FindByValue(((int)model.FlightCompany).ToString()) != null) { this.seleLineCompanyNamev.Items.FindByValue(((int)model.FlightCompany).ToString()).Selected = true; } this.txtLTime.Value = model.LTime; this.txtRTime.Value = model.RTime; if (this.ddlSpace.Items.FindByValue(((int)model.Space).ToString()) != null) { this.ddlSpace.Items.FindByValue(((int)model.Space).ToString()).Selected = true; } this.txtAirPlaneType.Value = model.AirPlaneType; this.txtIntervalDays.Value = model.IntervalDays.ToString(); //是否停靠 IsStop = model.IsStop == false ? "1" : "0"; } }
/// <summary> /// 修改交通状态 李晓欢 2012-09-07 /// </summary> /// <param name="context"></param> public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; UserInfo userInfo = null; bool _IsLogin = EyouSoft.Security.Membership.UserProvider.IsUserLogin(out userInfo); if (!_IsLogin) { return; } string type = EyouSoft.Common.Utils.GetQueryStringValue("type"); if (type == "status") { int id = Utils.GetInt(Utils.GetQueryStringValue("ID")); int status = Utils.GetInt(Utils.GetQueryStringValue("status")); if (id >= 0) { bool result = new EyouSoft.BLL.PlanStruture.PlanTrffic().UpdateChangeSatus(id, (EyouSoft.Model.EnumType.PlanStructure.TrafficStatus)status); if (result) { HttpContext.Current.Response.Write("{\"ret\":\"1\",\"msg\":\"设置成功!\"}"); } else { HttpContext.Current.Response.Write("{\"ret\":\"0\",\"msg\":\"设置失败!\"}"); } } } }
/// <summary> /// 导出Excel /// </summary> public void CreateExcel(string FileName) { Datetime = EyouSoft.Common.Utils.GetQueryStringValue("DateTime"); ticketendtime = EyouSoft.Common.Utils.GetQueryStringValue("endtime"); //列表数据绑定 Response.Clear(); Response.AppendHeader("Content-Disposition", "attachment;filename=" + FileName + ".xls"); Response.ContentEncoding = System.Text.Encoding.Default; Response.ContentType = "application/ms-excel"; EyouSoft.Model.PlanStructure.JiaoTongChuPiaoSearch search = new EyouSoft.Model.PlanStructure.JiaoTongChuPiaoSearch(); search.StartTime = EyouSoft.Common.Utils.GetDateTimeNullable(Datetime); search.EndTime = EyouSoft.Common.Utils.GetDateTimeNullable(ticketendtime); IList <EyouSoft.Model.PlanStructure.JiaoTongChuPiao> list = new EyouSoft.BLL.PlanStruture.PlanTrffic().GetJiaoTongChuPiao(this.SiteUserInfo.CompanyID, search); if (list != null && list.Count > 0) { //取得数据表各列标题,各标题之间以\t分割,最后一个列标题后加回车符 System.Text.StringBuilder sb = new System.Text.StringBuilder(); sb.AppendFormat("{0}\t{1}\t{2}\n", "交通名称", "出票数", "代理费"); foreach (EyouSoft.Model.PlanStructure.JiaoTongChuPiao cp in list) { sb.AppendFormat("{0}\t{1}\t{2}\n", cp.TrafficName, cp.ChuPiaoShu, cp.AgencyPrice.ToString("0.00")); } sb.AppendFormat("{0}\t{1}\t{2}\n", "总计", list.Sum(p => p.ChuPiaoShu).ToString(), list.Sum(p => p.AgencyPrice).ToString("0.00")); Response.Write(sb.ToString()); Response.End(); } }
/// <summary> /// 关联交通 /// </summary> /// <param name="selTrafficId">选择的交通编号</param> /// <returns></returns> protected string GetSelectTraffic(int selTrafficId) { EyouSoft.BLL.PlanStruture.PlanTrffic BLL = new EyouSoft.BLL.PlanStruture.PlanTrffic(); EyouSoft.Model.PlanStructure.TrafficSearch searchmodel = new EyouSoft.Model.PlanStructure.TrafficSearch(); searchmodel.TourId = Utils.GetQueryStringValue("tourId"); IList <EyouSoft.Model.PlanStructure.TrafficInfo> list = BLL.GetTrafficList(searchmodel, SiteUserInfo.CompanyID); StringBuilder sb = new StringBuilder(); sb.AppendFormat("<option value='' data-price='' data-shengyu='0'>请选择</option>"); if (list != null && list.Count > 0) { foreach (var item in list) { if (item.TrafficId == selTrafficId) { sb.AppendFormat("<option value='{0}' selected='selected' data-price='' data-shengyu='0'>{1}</option>", item.TrafficId, item.TrafficName); } else { sb.AppendFormat("<option value='{0}' data-price='' data-shengyu='0'>{1}</option>", item.TrafficId, item.TrafficName); } } } return(sb.ToString()); }
/// <summary> /// 获取关联交通 /// </summary> /// <returns></returns> protected string GetTrafficList(int selected) { EyouSoft.BLL.PlanStruture.PlanTrffic BLL = new EyouSoft.BLL.PlanStruture.PlanTrffic(SiteUserInfo); EyouSoft.Model.PlanStructure.TrafficInfo SearchModel = new EyouSoft.Model.PlanStructure.TrafficInfo(); //SearchModel.IsDelete = false; IList <EyouSoft.Model.PlanStructure.TrafficInfo> list = BLL.GetTrafficList(null, SiteUserInfo.CompanyID); StringBuilder sb = new StringBuilder(); sb.AppendFormat("<option value='' data-price='' data-shengyu='0'>请选择</option>"); if (list != null && list.Count > 0) { foreach (var item in list) { if (item.TrafficId == selected) { sb.AppendFormat("<option value='{0}' selected='selected' data-price='' data-shengyu='0'>{1}</option>", item.TrafficId, item.TrafficName); } else { sb.AppendFormat("<option value='{0}' data-price='' data-shengyu='0'>{1}</option>", item.TrafficId, item.TrafficName); } } } return(sb.ToString()); }
/// <summary> /// 获取交通实体 /// </summary> /// <param name="trfficID">交通编号</param> private void GetTrafficModel(int trfficID) { EyouSoft.Model.PlanStructure.TrafficInfo model = new EyouSoft.BLL.PlanStruture.PlanTrffic().GetTrafficModel(trfficID); if (model != null) { this.txtTrfficName.Value = model.TrafficName; this.txtChildprices.Value = Utils.GetDecimal(model.ChildPrices.ToString()).ToString("0.00"); } }
/// <summary> /// 获取交通实体 /// </summary> /// <param name="trafficID"></param> protected void InitTraffIcModel(int trafficID, DateTime dt) { EyouSoft.Model.PlanStructure.TrafficInfo traffModel = new EyouSoft.BLL.PlanStruture.PlanTrffic(SiteUserInfo).GetTrafficModel(trafficID); if (traffModel != null) { this.litTrafficName.Text = traffModel.TrafficName; this.litLeaveDate.Text = dt.ToString("yyyy-MM-dd"); } }
/// <summary> /// 保存 /// </summary> /// <returns></returns> protected string PageSave() { string ret = string.Empty; EyouSoft.Model.PlanStructure.TravelInfo travelModel = new EyouSoft.Model.PlanStructure.TravelInfo(); travelModel.TrafficId = Utils.GetInt(Utils.GetQueryStringValue("tfID")); travelModel.AirPlaneType = Utils.GetFormValue(this.txtAirPlaneType.UniqueID); travelModel.CompanyId = this.SiteUserInfo.CompanyID; travelModel.FilghtNum = Utils.GetFormValue(this.txtFlightNum.UniqueID); travelModel.FlightCompany = (EyouSoft.Model.EnumType.PlanStructure.FlightCompany)Utils.GetInt(Utils.GetFormValue(this.seleLineCompanyNamev.UniqueID)); travelModel.InsueTime = DateTime.Now; travelModel.IntervalDays = Utils.GetInt(Utils.GetFormValue(this.txtIntervalDays.UniqueID)); travelModel.IsStop = Utils.GetFormValue("IsStop") == "0" ? true : false; travelModel.LCity = ucLCity.CityId; travelModel.LProvince = ucLProvince.ProvinceId; travelModel.LTime = Utils.GetFormValue(this.txtLTime.UniqueID); travelModel.RTime = Utils.GetFormValue(this.txtRTime.UniqueID); travelModel.Operater = this.SiteUserInfo.UserName; travelModel.OperaterID = this.SiteUserInfo.ID; travelModel.RCity = ucRcity.CityId; travelModel.RProvince = ucRprovince.ProvinceId; travelModel.SerialNum = Utils.GetInt(Utils.GetFormValue(this.txtSerialNum.UniqueID)); travelModel.TrafficType = (EyouSoft.Model.EnumType.PlanStructure.TrafficType)Utils.GetInt(Utils.GetFormValue(this.seleTfrricType.UniqueID)); travelModel.Space = (EyouSoft.Model.EnumType.PlanStructure.Space)Utils.GetInt(Utils.GetFormValue(this.ddlSpace.UniqueID)); string type = Utils.GetQueryStringValue("type"); if (!string.IsNullOrEmpty(type)) { bool retult = false; if (type == "add") { retult = new EyouSoft.BLL.PlanStruture.PlanTrffic().AddPlanTravel(travelModel); if (retult) { ret = "{\"ret\":\"1\",\"msg\":\"添加成功!\"}"; } else { ret = "{\"ret\":\"0\",\"msg\":\"添加失败!\"}"; } } else { travelModel.TravelId = Utils.GetInt(Utils.GetQueryStringValue("trID")); retult = new EyouSoft.BLL.PlanStruture.PlanTrffic().UpdatePlanTravel(travelModel); if (retult) { ret = "{\"ret\":\"1\",\"msg\":\"修改成功!\"}"; } else { ret = "{\"ret\":\"0\",\"msg\":\"修改失败!\"}"; } } } return(ret); }
/// <summary> /// 获取关联交通 /// </summary> /// <returns></returns> protected string GetTrafficList(IList <int> selectList) { EyouSoft.BLL.PlanStruture.PlanTrffic BLL = new EyouSoft.BLL.PlanStruture.PlanTrffic(SiteUserInfo); EyouSoft.Model.PlanStructure.TrafficInfo SearchModel = new EyouSoft.Model.PlanStructure.TrafficInfo(); //SearchModel.IsDelete = false; IList <EyouSoft.Model.PlanStructure.TrafficInfo> list = BLL.GetTrafficList(null, SiteUserInfo.CompanyID); StringBuilder sb = new StringBuilder(); if (list != null && list.Count > 0) { foreach (var item in list) { if (selectList != null && selectList.Count > 0) { if (selectList.Contains(item.TrafficId)) { sb.AppendFormat("<li><a href=\"javascript:void(0);\" data-trafficId='{0}' class=\"select\"><span>", item.TrafficId); } else { sb.AppendFormat("<li><a href=\"javascript:void(0);\" data-trafficId='{0}'><span>", item.TrafficId); } } else { sb.AppendFormat("<li><a href=\"javascript:void(0);\" data-trafficId='{0}'><span>", item.TrafficId); } if (item.travelList != null && item.travelList.Count > 0) { for (int i = 0; i < item.travelList.Count; i++) { if (i != item.travelList.Count - 1) { sb.AppendFormat("[{0}、{1}]-", item.travelList[i].LCityName, item.travelList[i].RCityName); } else { sb.AppendFormat("[{0}、{1}]", item.travelList[i].LCityName, item.travelList[i].RCityName); } } sb.Append("<br/>["); for (int i = 0; i < item.travelList.Count; i++) { sb.AppendFormat("{0}", i != item.travelList.Count - 1 ? item.travelList[i].FilghtNum + "/" : item.travelList[i].FilghtNum); } sb.Append("]"); } else { sb.AppendFormat("{0}<br/>  ", item.TrafficName); } sb.Append("</span></a></li>"); } } return(sb.ToString()); }
/// <summary> /// 绑定交通行程 /// </summary> /// <param name="tfID"></param> protected void BindTravelList(int tfID) { IList <EyouSoft.Model.PlanStructure.TravelInfo> List = new EyouSoft.BLL.PlanStruture.PlanTrffic().GettravelList(PageSize, PageIndex, this.SiteUserInfo.CompanyID, ref RecordCount, tfID); if (List != null && List.Count > 0) { this.repTravelList.DataSource = List; this.repTravelList.DataBind(); } }
/// <summary> /// 获取价格实体 /// </summary> /// <param name="prices"></param> protected void GetTrafficPricesInfo(string pricesId, int trafficId) { EyouSoft.Model.PlanStructure.TrafficPricesInfo info = new EyouSoft.BLL.PlanStruture.PlanTrffic().GetTrafficPrices(pricesId, trafficId); if (info != null) { this.txtTicketPrices.Value = Utils.GetDecimal(info.TicketPrices.ToString()).ToString("0.00"); this.txtTicketNums.Value = info.TicketNums.ToString(); status = ((int)info.Status).ToString(); } }
/// <summary> /// 绑定价格列表 /// </summary> /// <param name="tfID"></param> protected void BindPriceList(int tfID) { IList <EyouSoft.Model.PlanStructure.TrafficPricesInfo> pricesList = new EyouSoft.BLL.PlanStruture.PlanTrffic().GetPricesList(tfID); if (pricesList != null && pricesList.Count > 0) { IsoDateTimeConverter isoDate = new IsoDateTimeConverter(); isoDate.DateTimeFormat = "yyyy-MM-dd"; this.hidChildrenPrices.Value = "{\"data\":" + JsonConvert.SerializeObject(pricesList, isoDate) + "}"; } }
/// <summary> /// 删除行程 /// </summary> /// <param name="travelID">行程编号</param> /// <returns></returns> protected string DeleteTravel(string travelID, int trafficId) { int[] tIdArr = travelID.Split(',').Select(i => Convert.ToInt32(i)).ToArray(); bool ret = new EyouSoft.BLL.PlanStruture.PlanTrffic().DeletePlanTravel(trafficId, tIdArr); if (ret) { return("{\"ret\":\"1\",\"msg\":\"删除成功!\"}"); } else { return("{\"ret\":\"0\",\"msg\":\"删除失败!\"}"); } }
private string PageSave() { string ret = string.Empty; EyouSoft.Model.PlanStructure.TrafficInfo model = new EyouSoft.Model.PlanStructure.TrafficInfo(); model.ChildPrices = Utils.GetDecimal(Utils.GetFormValue(this.txtChildprices.UniqueID), 0); model.CompanyId = this.SiteUserInfo.CompanyID; model.InsueTime = DateTime.Now; model.IsDelete = false; model.Operater = this.SiteUserInfo.UserName; model.OperaterId = this.SiteUserInfo.ID; model.Status = EyouSoft.Model.EnumType.PlanStructure.TrafficStatus.正常; model.TrafficDays = 0; model.TrafficName = Utils.GetFormValue(this.txtTrfficName.UniqueID); bool result = false; string type = Utils.GetQueryStringValue("type"); if (!string.IsNullOrEmpty(type)) { if (type == "update" && !string.IsNullOrEmpty(Utils.GetQueryStringValue("trfficID"))) { model.TrafficId = Utils.GetInt(Utils.GetQueryStringValue("trfficID")); result = new EyouSoft.BLL.PlanStruture.PlanTrffic().UpdatePlanTraffic(model); if (result) { ret = "{\"ret\":\"1\",\"msg\":\"修改成功!\"}"; } else { ret = "{\"ret\":\"0\",\"msg\":\"修改失败!\"}"; } } else { result = new EyouSoft.BLL.PlanStruture.PlanTrffic().AddPlanTraffic(model); if (result) { ret = "{\"ret\":\"1\",\"msg\":\"添加成功!\"}"; } else { ret = "{\"ret\":\"0\",\"msg\":\"添加失败!\"}"; } } } return(ret); }
/// <summary> /// 绑定行程列表 /// </summary> /// <param name="tfID"></param> protected void InitTravelList(int tfID) { PageIndex = EyouSoft.Common.Utils.GetInt(EyouSoft.Common.Utils.GetQueryStringValue("Page"), 0); IList <EyouSoft.Model.PlanStructure.TravelInfo> List = new EyouSoft.BLL.PlanStruture.PlanTrffic().GettravelList(PageSize, PageIndex, this.SiteUserInfo.CompanyID, ref RecordCount, tfID); if (List != null && List.Count > 0) { this.repTravelList.DataSource = List; this.repTravelList.DataBind(); bindPage(); } else { this.labMsg.Visible = true; this.ExporPageInfoSelect1.Visible = false; } }
/// <summary> /// 获取成本价 /// </summary> protected void GetPrice() { DateTime dt = Utils.GetDateTime(Utils.GetQueryStringValue("startDate")); int trafficId = Utils.GetInt(Utils.GetQueryStringValue("trafficId")); EyouSoft.BLL.PlanStruture.PlanTrffic BLL = new EyouSoft.BLL.PlanStruture.PlanTrffic(); EyouSoft.Model.PlanStructure.TrafficPricesInfo model = BLL.GetTrafficPriceModel(trafficId, dt); if (model != null) { Response.Clear(); Response.Write(string.Format("{{\"result\":\"{0}\",\"shengyu\":\"{1}\"}}", Utils.FilterEndOfTheZeroDecimal(model.TicketPrices), model.ShengYu.ToString())); Response.End(); } else { Response.Clear(); Response.Write(string.Format("{{\"result\":\"{0}\",\"shengyu\":\"{1}\"}}", 0, 0)); Response.End(); } }
/// <summary> /// 设置状态 /// </summary> /// <returns></returns> public string pricesUpdateStatus() { string msg = string.Empty; string id = Utils.GetQueryStringValue("Id"); int TrafficId = Utils.GetInt(Utils.GetQueryStringValue("tfId")); if (!string.IsNullOrEmpty(id)) { int status = Utils.GetInt(Utils.GetFormValue("radStatus")); bool ret = new EyouSoft.BLL.PlanStruture.PlanTrffic().UpdatePricesStatus(id, TrafficId, (EyouSoft.Model.EnumType.PlanStructure.TicketStatus)status); if (ret) { msg = "{\"ret\":\"1\",\"msg\":\"状态设置成功!\"}"; } else { msg = "{\"ret\":\"0\",\"msg\":\"状态设置失败!\"}"; } } return(msg); }
/// <summary> /// 保存价格 /// </summary> protected string PageSave() { string ret = string.Empty; //开始时间 DateTime sDate = Utils.GetDateTime(Utils.GetFormValue("txtSDate")); //结束时间 DateTime eDate = Utils.GetDateTime(Utils.GetFormValue("txtEDate")); //价格 string[] PricesArr = Utils.GetFormValues("txtprice"); //数量 string[] NumArr = Utils.GetFormValues("txtnum"); if (PricesArr.Length > 0) { string tfID = Utils.GetQueryStringValue("tfId"); for (int i = 0; i < PricesArr.Length; i++) { EyouSoft.Model.PlanStructure.TrafficPricesInfo model = new EyouSoft.Model.PlanStructure.TrafficPricesInfo(); model.TrafficId = Utils.GetInt(tfID); model.InsueTime = DateTime.Now; model.SDateTime = sDate.AddDays(i); model.Status = EyouSoft.Model.EnumType.PlanStructure.TicketStatus.正常; model.TicketNums = Utils.GetInt(NumArr[i]); model.TicketPrices = Utils.GetDecimal(PricesArr[i]); bool result = new EyouSoft.BLL.PlanStruture.PlanTrffic().AddTrafficPrice(model); if (result) { ret = "{\"ret\":\"1\",\"msg\":\"添加成功!\"}"; } else { ret = "{\"ret\":\"0\",\"msg\":\"添加失败!\"}"; } } } return(ret); }
/// <summary> /// 保存 /// </summary> /// <param name="pricesId">价格编号</param> /// <returns></returns> protected string PageSave() { string msg = string.Empty; EyouSoft.Model.PlanStructure.TrafficPricesInfo priceInfo = new EyouSoft.Model.PlanStructure.TrafficPricesInfo(); priceInfo.InsueTime = DateTime.Now; priceInfo.SDateTime = Utils.GetDateTime(Utils.GetQueryStringValue("date")); priceInfo.Status = (EyouSoft.Model.EnumType.PlanStructure.TicketStatus)Utils.GetInt(Utils.GetFormValue("radStatus")); priceInfo.TicketNums = Utils.GetInt(Utils.GetFormValue(this.txtTicketNums.UniqueID)); priceInfo.TicketPrices = Utils.GetDecimal(Utils.GetFormValue(this.txtTicketPrices.UniqueID)); priceInfo.TrafficId = Utils.GetInt(Utils.GetQueryStringValue("tfId")); if (Utils.GetQueryStringValue("type") == "update") { priceInfo.PricesID = Utils.GetQueryStringValue("pricesId"); bool ret = new EyouSoft.BLL.PlanStruture.PlanTrffic().UpdatetrafficPrice(priceInfo); if (ret) { msg = "{\"msg\":\"修改成功!\"}"; } else { msg = "{\"msg\":\"修改失败!\"}"; } } else { bool ret = new EyouSoft.BLL.PlanStruture.PlanTrffic().AddTrafficPrice(priceInfo); if (ret) { msg = "{\"msg\":\"添加成功!\"}"; } else { msg = "{\"msg\":\"添加失败!\"}"; } } return(msg); }
protected void Page_Load(object sender, EventArgs e) { string type = Utils.GetQueryStringValue("type"); if (!string.IsNullOrEmpty(type) && type == "update") { Response.Clear(); Response.Write(pricesUpdateStatus()); Response.End(); } if (!IsPostBack) { int trafficId = Utils.GetInt(Utils.GetQueryStringValue("tfId")); string Id = Utils.GetQueryStringValue("Id"); if (trafficId > 0 && !string.IsNullOrEmpty(Id)) { EyouSoft.Model.PlanStructure.TrafficPricesInfo pricesInfo = new EyouSoft.BLL.PlanStruture.PlanTrffic().GetTrafficPrices(Id, trafficId); if (pricesInfo != null) { ticketStatus = ((int)pricesInfo.Status).ToString(); } } } }
/// <summary> /// 保存事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSubmit_Click(object sender, EventArgs e) { NumConfig = (int)(new EyouSoft.BLL.CompanyStructure.CompanySetting().GetTeamNumberOfPeople(CurrentUserCompanyID)); #region 将表单值赋值于变量 //团号 string teamNum = this.txtTeamNum.Text.Trim(); //线路区域名 string lineArea = Utils.GetFormValue(this.ddlLineArea.UniqueID); //计调员 string coordinatorId = Utils.GetFormValue(this.ddlSeller.UniqueID); //线路名称 string xianLuName = this.xianluWindow1.Name; //线路ID string routeId = this.xianluWindow1.Id; //组团社ID int buyerCId = Utils.GetInt(this.hideGroupsId.Value); //组团社名称 string buyerCName = Utils.GetFormValue(this.txtGroupsName.UniqueID); //天数 int?dayCount = Utils.GetIntNull(this.txtDayCount.Text); //人数 int?peopleCount = Utils.GetIntNull(this.txtPeopelCount.Text); //出发交通 string startTraffic = this.txtStartTraffic.Text.Trim(); //返程交通 string endTraffic = this.txtEndTraffic.Text.Trim(); //出团日期 DateTime lDate = Utils.GetDateTime(this.txtLDate.Text); //不含项目 string noProject = this.txtNoProject.Text.Trim(); //购物安排 string buyPlan = this.txtBuyPlan.Text; //儿童安排 string childPlan = this.txtChildPlan.Text; //自费项目 string selfProject = this.txtSelfProject.Text; //注意事项 string note = this.txtNote.Text; //温馨提示 string tips = this.txtTips.Text; //内部信息 string internalMsg = this.txtNeiBu.Text; //集合时间 //string gatheredTime = (Utils.GetFormValue(this.txtGathered.UniqueID)) + " " + ddl_jh_date.SelectedValue + ":00:00"; string gatheredTime = Utils.GetFormValue(this.txtGathered.UniqueID); //集合地点 string place = Utils.GetFormValue(this.txtPlace.UniqueID); //集合标志 string logo = Utils.GetFormValue(this.txtLogo.UniqueID); //送团人 string operatorId = this.selectOperator1.OperId; //常用城市 int tourCity = Utils.GetInt(Utils.GetFormValue(this.ddlCityList.UniqueID)); #endregion #region 验证上传文件的格式是否正确 string msg = ""; if (!EyouSoft.Common.Function.UploadFile.CheckFileType(Request.Files, "fileField", new[] { ".gif", ".jpeg", ".jpg", ".png", ".xls", ".doc", ".docx", ".rar", ".txt" }, null, out msg)) { this.litMsg.Text = Utils.ShowMsg(msg); return; } #endregion #region 地接信息 IList <EyouSoft.Model.TourStructure.TourLocalAgencyInfo> djList = this.DiJieControl1.GetList; #endregion #region 行程安排 IList <EyouSoft.Model.TourStructure.TourPlanInfo> planList = this.xingcheng1.GetValues(); #endregion #region 包含项目 IList <EyouSoft.Model.TourStructure.TourTeamServiceInfo> standList = this.PriceControl1.GetList; #endregion #region 验证 if (lineArea == "") { this.litMsg.Text = Utils.ShowMsg("请选择线路区域!"); return; } //判断是否选择组团社 if (buyerCId <= 0) { EyouSoft.Common.Function.MessageBox.ResponseScript(this, Utils.ShowMsg("请选择组团社!")); return; } if (xianLuName == "") { EyouSoft.Common.Function.MessageBox.ResponseScript(this, Utils.ShowMsg("请输入线路名称!")); return; } if (coordinatorId == "-1") { EyouSoft.Common.Function.MessageBox.ResponseScript(this, Utils.ShowMsg("请选择计调员!")); return; } if (dayCount == null || dayCount == 0) { EyouSoft.Common.Function.MessageBox.ResponseScript(this, Utils.ShowMsg("请输入天数!")); return; } if ((peopleCount == null || peopleCount == 0) && NumConfig == (int)EyouSoft.Model.EnumType.CompanyStructure.TeamNumberOfPeople.OnlyTotalNumber) { EyouSoft.Common.Function.MessageBox.ResponseScript(this, Utils.ShowMsg("请输入人数!")); return; } int crNum = Utils.GetInt(txt_crNum.Text); if (crNum == 0 && NumConfig == (int)EyouSoft.Model.EnumType.CompanyStructure.TeamNumberOfPeople.PartNumber) { EyouSoft.Common.Function.MessageBox.ResponseScript(this, Utils.ShowMsg("请输入人数!")); return; } #endregion //声明bll对象 EyouSoft.BLL.TourStructure.Tour bll = new EyouSoft.BLL.TourStructure.Tour(SiteUserInfo); //声明model对象 EyouSoft.Model.TourStructure.TourTeamInfo model = new EyouSoft.Model.TourStructure.TourTeamInfo(); //如果是修改那么先获得该对象model if (this.hideType.Value == "Update") { //如果是修改操作,那么先获的这个对象 model = (EyouSoft.Model.TourStructure.TourTeamInfo)bll.GetTourInfo(this.hideID.Value); } //判断对象是否存在 if (model != null) { #region 对象属性赋值 model.TourCode = teamNum; model.AreaId = Convert.ToInt32(lineArea); //修改时原购买单位 if (model.BuyerCId > 0) { model.OBuyerCId = model.BuyerCId; } model.Coordinator = new EyouSoft.Model.TourStructure.TourCoordinatorInfo(); model.Coordinator.CoordinatorId = Utils.GetInt(coordinatorId); model.BuyerCId = buyerCId; model.BuyerCName = buyerCName; model.RouteName = xianLuName; if (model.RouteId != 0) { model.ORouteId = model.RouteId; } model.RouteId = Utils.GetInt(routeId); model.TourDays = Convert.ToInt32(dayCount); #region 添加送团人 if (this.selectOperator1.OperId.Trim() != "") { string[] operIdList = this.selectOperator1.OperId.Split(','); if (operIdList.Count() > 0) { model.SentPeoples = new List <EyouSoft.Model.TourStructure.TourSentPeopleInfo>(); for (int i = 0; i < operIdList.Count(); i++) { if (operIdList[i].Trim() != "") { EyouSoft.Model.TourStructure.TourSentPeopleInfo sentPeopleModel = new EyouSoft.Model.TourStructure.TourSentPeopleInfo(); sentPeopleModel.OperatorId = Utils.GetInt(operIdList[i]); model.SentPeoples.Add(sentPeopleModel); } } } } #endregion model.GatheringPlace = place; model.GatheringSign = logo; model.GatheringTime = gatheredTime; model.PlanPeopleNumber = Convert.ToInt32(peopleCount); model.LTraffic = startTraffic; model.RTraffic = endTraffic; model.LDate = lDate; model.LocalAgencys = djList; EyouSoft.Model.TourStructure.TourTeamNormalPrivateInfo tourTeamModel = new EyouSoft.Model.TourStructure.TourTeamNormalPrivateInfo(); tourTeamModel.Plans = planList; tourTeamModel.BuHanXiangMu = noProject; tourTeamModel.GouWuAnPai = buyPlan; tourTeamModel.ErTongAnPai = childPlan; tourTeamModel.ZiFeiXIangMu = selfProject; tourTeamModel.ZhuYiShiXiang = note; tourTeamModel.WenXinTiXing = tips; tourTeamModel.NeiBuXingXi = internalMsg; model.TourNormalInfo = tourTeamModel; model.Services = standList; model.CompanyId = SiteUserInfo.CompanyID; model.OperatorId = SiteUserInfo.ID; model.TourType = EyouSoft.Model.EnumType.TourStructure.TourType.团队计划; model.ReleaseType = EyouSoft.Model.EnumType.TourStructure.ReleaseType.Normal; model.TicketStatus = EyouSoft.Model.EnumType.PlanStructure.TicketState.None; model.TotalAmount = PriceControl1.TotalAmount; //model.SelfUnitPriceAmount = PriceControl1.OnePriceAll; model.TourCityId = tourCity; model.TourTraffic = new List <int>() { Utils.GetInt(Utils.GetFormValue("selectTraffic"), -1) }; ///人数、单价 by txb model.TourTeamUnit = new EyouSoft.Model.TourStructure.MTourTeamUnitInfo(); model.TourTeamUnit.NumberCr = Utils.GetInt(txt_crNum.Text); model.TourTeamUnit.NumberEt = Utils.GetInt(txt_rtNum.Text); model.TourTeamUnit.NumberQp = Utils.GetInt(txt_allNum.Text); model.TourTeamUnit.UnitAmountCr = PriceControl1.cr_price; model.TourTeamUnit.UnitAmountEt = PriceControl1.rt_price; model.TourTeamUnit.UnitAmountQp = PriceControl1.all_price; #endregion #region 单文件 //团队附件实体 EyouSoft.Model.TourStructure.TourAttachInfo attachModel = new EyouSoft.Model.TourStructure.TourAttachInfo(); //文件路径 string filePath = ""; //文件名 string fileName = ""; //文件上传 if (EyouSoft.Common.Function.UploadFile.FileUpLoad(Request.Files["fileField"], "TeamPlanFile", out filePath, out fileName)) { if (filePath.Trim() != "" && fileName.Trim() != "") { //设置文件上传后的虚拟路劲 attachModel.FilePath = filePath; //保存原文件名 attachModel.Name = fileName; IList <EyouSoft.Model.TourStructure.TourAttachInfo> attachList = new List <EyouSoft.Model.TourStructure.TourAttachInfo>(); attachList.Add(attachModel); model.Attachs = attachList; } else if (this.hideData.Value.Trim() != "") { //设置文件上传后的虚拟路劲 attachModel.FilePath = this.hideData.Value; IList <EyouSoft.Model.TourStructure.TourAttachInfo> attachList = new List <EyouSoft.Model.TourStructure.TourAttachInfo>(); attachList.Add(attachModel); model.Attachs = attachList; } else { model.Attachs = null; } } else { //上传失败提示 this.litMsg.Text = Utils.ShowMsg("文件上传失败!"); return; } #endregion #region 数据操作 int count = 0; if (model.TourTraffic != null && model.TourTraffic.Count > 0) { EyouSoft.BLL.PlanStruture.PlanTrffic BLL = new EyouSoft.BLL.PlanStruture.PlanTrffic(); EyouSoft.Model.PlanStructure.TrafficPricesInfo TrafficPricesInfoModel = BLL.GetTrafficPriceModel(model.TourTraffic.First(), model.LDate); if (TrafficPricesInfoModel != null && TrafficPricesInfoModel.TicketNums > 0) { //新增和复制操作时 进行数据添加操作 if (this.hideType.Value == "Add" || this.hideType.Value == "Copy") { //数据库添加操作 count = bll.InsertTeamTourInfo(model); //新增成功 if (count > 0) { Utils.ShowAndRedirect("添加成功!", "/TeamPlan/TeamPlanList.aspx"); } else //失败时提示 if (count == -1) { EyouSoft.Common.Function.MessageBox.ResponseScript(this, "javascript:alert('团号重复!');"); } else { EyouSoft.Common.Function.MessageBox.ResponseScript(this, "javascript:alert('添加失败!');"); } } else { //数据库修改操作 count = bll.UpdateTeamTourInfo(model); //成功提示 if (count > 0) { Utils.ShowAndRedirect("修改成功!", "/TeamPlan/TeamPlanList.aspx"); } else { EyouSoft.Common.Function.MessageBox.ResponseScript(this, "javascript:alert('修改失败!');"); } } } else { Response.Write("<script type='text/javascript'>alert('提交失败,关联交通票数为零!');location.href=location.href;</script>"); } } else { Response.Write("<script type='text/javascript'>alert('提交失败,关联交通为空!');location.href=location.href;</script>"); } #endregion } else { Utils.ShowAndRedirect("该计划不存在!", "/TeamPlan/TeamPlanList.aspx"); } }
/// <summary> /// 保存事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSubmit_Click(object sender, EventArgs e) { NumConfig = (int)(new EyouSoft.BLL.CompanyStructure.CompanySetting().GetTeamNumberOfPeople(CurrentUserCompanyID)); #region 将表单值 赋值给变量 //团号 string teamNum = Utils.InputText(this.txtTeamNum.Text); //线路区域名 string lineArea = Utils.GetFormValue(this.ddlLineArea.UniqueID); //计调员 string coordinatorId = Utils.GetFormValue(this.ddlSeller.UniqueID); //组团社ID int buyerCId = Utils.GetInt(this.hideGroupsId.Value); //组团社名称 string buyerCName = Utils.GetFormValue(this.txtGroupsName.UniqueID); //线路名称 string xianLuName = this.xianluWindow1.Name; //线路ID string routeId = this.xianluWindow1.Id; //天数 int dayCount = Utils.GetInt(this.txtDayCount.Text); //人数 int peopleCount = Utils.GetInt(this.txtPeopelCount.Text); //出发交通 string startTraffic = Utils.InputText(this.txtStartTraffic.Text); //返程交通 string endTraffic = Utils.InputText(this.txtEndTraffic.Text.Trim()); //出团日期 DateTime lDate = Convert.ToDateTime(this.txtLDate.Text); //回团日期 // DateTime rDate = Convert.ToDateTime(this.txtRDate.Text); //添加地接社信息 IList <EyouSoft.Model.TourStructure.TourLocalAgencyInfo> list = this.DiJieControl1.GetList; //添加价格组成 IList <EyouSoft.Model.TourStructure.TourTeamServiceInfo> listPrice = this.PriceControl1.GetList; //行程安排 string travel = Utils.EditInputText(this.txtTravel.Text); //服务标准 string services = Utils.EditInputText(this.txtServices.Text); //备注 string remarks = this.txtRemarks.Text; //常用城市 int tourCity = Utils.GetInt(Utils.GetFormValue(this.ddlCityList.UniqueID)); #endregion #region 验证 //判断线路区域不能为空 if (lineArea == "") { EyouSoft.Common.Function.MessageBox.ResponseScript(this, Utils.ShowMsg("请选择线路区域")); return; } //判断是否选择组团社 if (buyerCId <= 0) { EyouSoft.Common.Function.MessageBox.ResponseScript(this, Utils.ShowMsg("请选择组团社!")); return; } if (coordinatorId == "-1") { EyouSoft.Common.Function.MessageBox.ResponseScript(this, Utils.ShowMsg("请选择计调员!")); return; } //判断线路名称不能为空 if (xianLuName == "") { EyouSoft.Common.Function.MessageBox.ResponseScript(this, Utils.ShowMsg("请输入线路名称!")); return; } //判断天数不能为空 if (dayCount == 0) { EyouSoft.Common.Function.MessageBox.ResponseScript(this, Utils.ShowMsg("请输入天数!")); return; } //判断人数不能为空 if ((peopleCount == null || peopleCount == 0) && NumConfig == (int)EyouSoft.Model.EnumType.CompanyStructure.TeamNumberOfPeople.OnlyTotalNumber) { EyouSoft.Common.Function.MessageBox.ResponseScript(this, Utils.ShowMsg("请输入人数!")); return; } int crNum = Utils.GetInt(txt_crNum.Text); if (crNum == 0 && NumConfig == (int)EyouSoft.Model.EnumType.CompanyStructure.TeamNumberOfPeople.PartNumber) { EyouSoft.Common.Function.MessageBox.ResponseScript(this, Utils.ShowMsg("请输入人数!")); return; } #endregion #region 验证上传文件的格式是否正确 string msg = ""; if (!EyouSoft.Common.Function.UploadFile.CheckFileType(Request.Files, "fileField", new[] { ".gif", ".jpeg", ".jpg", ".png", ".xls", ".doc", ".docx", ".rar", ".txt" }, null, out msg)) { this.litMsg.Text = Utils.ShowMsg(msg); return; } #endregion //声明bll对象 EyouSoft.BLL.TourStructure.Tour bll = new EyouSoft.BLL.TourStructure.Tour(); //声明团队计划对象 EyouSoft.Model.TourStructure.TourTeamInfo model = new EyouSoft.Model.TourStructure.TourTeamInfo(); if (this.hideType.Value == "Update") { //如果是修改操作,那么先获的这个对象 model = (EyouSoft.Model.TourStructure.TourTeamInfo)bll.GetTourInfo(this.hideID.Value); } #region 对象属性赋值 //判断对象时候存在 if (model != null) { //对象属性赋值 model.TourCode = teamNum; model.AreaId = Convert.ToInt32(lineArea); model.Coordinator = new EyouSoft.Model.TourStructure.TourCoordinatorInfo(); model.Coordinator.CoordinatorId = Utils.GetInt(coordinatorId); //修改时原购买单位 if (model.BuyerCId > 0) { model.OBuyerCId = model.BuyerCId; } model.BuyerCId = buyerCId; model.BuyerCName = buyerCName; model.RouteName = xianLuName; if (model.RouteId > 0) { model.ORouteId = model.RouteId; } model.RouteId = Utils.GetInt(routeId); model.TourDays = dayCount; model.PlanPeopleNumber = peopleCount; model.LTraffic = startTraffic; model.RTraffic = endTraffic; model.LDate = lDate; model.LocalAgencys = list; model.Services = listPrice; model.CompanyId = SiteUserInfo.CompanyID; EyouSoft.Model.TourStructure.TourQuickPrivateInfo quickInfo = new EyouSoft.Model.TourStructure.TourQuickPrivateInfo(); quickInfo.QuickPlan = travel; quickInfo.Service = services; quickInfo.Remark = remarks; model.TourQuickInfo = quickInfo; model.OperatorId = SiteUserInfo.ID; model.TourType = EyouSoft.Model.EnumType.TourStructure.TourType.团队计划; model.ReleaseType = EyouSoft.Model.EnumType.TourStructure.ReleaseType.Quick; model.TicketStatus = EyouSoft.Model.EnumType.PlanStructure.TicketState.None; model.TotalAmount = PriceControl1.TotalAmount; model.TourCityId = tourCity; model.TourTraffic = new List <int>() { Utils.GetInt(Utils.GetFormValue("selectTraffic"), -1) }; ///人数、单价 by txb model.TourTeamUnit = new EyouSoft.Model.TourStructure.MTourTeamUnitInfo(); model.TourTeamUnit.NumberCr = Utils.GetInt(txt_crNum.Text); model.TourTeamUnit.NumberEt = Utils.GetInt(txt_rtNum.Text); model.TourTeamUnit.NumberQp = Utils.GetInt(txt_allNum.Text); model.TourTeamUnit.UnitAmountCr = PriceControl1.cr_price; model.TourTeamUnit.UnitAmountEt = PriceControl1.rt_price; model.TourTeamUnit.UnitAmountQp = PriceControl1.all_price; #endregion #region 单文件 //团队附件实体 EyouSoft.Model.TourStructure.TourAttachInfo attachModel = new EyouSoft.Model.TourStructure.TourAttachInfo(); //文件路径 string filePath = ""; //文件名 string fileName = ""; //文件上传 if (EyouSoft.Common.Function.UploadFile.FileUpLoad(Request.Files["fileField"], "TeamPlanFile", out filePath, out fileName)) { if (filePath.Trim() != "" && fileName.Trim() != "") { //设置文件上传后的虚拟路劲 attachModel.FilePath = filePath; //保存原文件名 attachModel.Name = fileName; IList <EyouSoft.Model.TourStructure.TourAttachInfo> attachList = new List <EyouSoft.Model.TourStructure.TourAttachInfo>(); attachList.Add(attachModel); model.Attachs = attachList; } else if (Utils.GetFormValue(this.hideData.UniqueID).Trim() != "") { attachModel.FilePath = this.hideData.Value; IList <EyouSoft.Model.TourStructure.TourAttachInfo> attachList = new List <EyouSoft.Model.TourStructure.TourAttachInfo>(); attachList.Add(attachModel); model.Attachs = attachList; } else { model.Attachs = null; } } else { //上传失败提示 this.litMsg.Text = Utils.ShowMsg("文件上传失败!"); return; } #endregion int count = 0; if (model.TourTraffic != null && model.TourTraffic.Count > 0) { EyouSoft.BLL.PlanStruture.PlanTrffic BLL = new EyouSoft.BLL.PlanStruture.PlanTrffic(); EyouSoft.Model.PlanStructure.TrafficPricesInfo TrafficPricesInfoModel = BLL.GetTrafficPriceModel(model.TourTraffic.First(), model.LDate); if (TrafficPricesInfoModel != null && TrafficPricesInfoModel.TicketNums > 0) { //如果是新增和复制 时 都做新增操作 if (this.hideType.Value == "Add" || this.hideType.Value == "Copy") { //数据库添加操作 count = bll.InsertTeamTourInfo(model); //新增成功 if (count > 0) { Utils.ShowAndRedirect("添加成功!", "/TeamPlan/TeamPlanList.aspx"); } else //失败时提示 if (count == -1) { EyouSoft.Common.Function.MessageBox.ResponseScript(this, Utils.ShowMsg("团号重复!")); } else { EyouSoft.Common.Function.MessageBox.ResponseScript(this, Utils.ShowMsg("添加失败!")); } } else { //数据库修改操作 count = bll.UpdateTeamTourInfo(model); //成功提示 if (count > 0) { Utils.ShowAndRedirect("修改成功!", "/TeamPlan/TeamPlanList.aspx"); } else { EyouSoft.Common.Function.MessageBox.ResponseScript(this, Utils.ShowMsg("修改失败!")); } } } else { Response.Write("<script type='text/javascript'>alert('提交失败,关联交通票数为零!');location.href=location.href;</script>"); } } else { Response.Write("<script type='text/javascript'>alert('提交失败,关联交通为空!');location.href=location.href;</script>"); } } else { Utils.ShowAndRedirect("该计划不存在!", "/TeamPlan/TeamPlanList.aspx"); } }