/// <summary> /// 绑定收藏线路 /// </summary> /// <returns></returns> public string BindCollectList() { StringBuilder sbCollect = new StringBuilder(); string strWhere = "ClubId=" + club.id; this.pcount = LineCollectBll.GetCount(strWhere); if (this.pcount > 0) { DataSet ds = LineCollectBll.GetPageList(this.pagesize, this.page, strWhere, "CollectDate desc"); DataRow row = null; TravelAgent.Model.Line line = null; int selectCount = ds.Tables[0].Rows.Count; for (int i = 0; i < selectCount; i++) { row = ds.Tables[0].Rows[i]; line = LineBll.GetModel(Convert.ToInt32(row["LineId"])); if (line != null) { sbCollect.Append("<tr>"); sbCollect.Append("<td><input name=\"collection_id[]\" type=\"checkbox\" value=\"" + row["Id"] + "\" /></td>"); sbCollect.Append("<td class=\"order_pic\"><a href=\"/Line.aspx?id=" + row["LineId"] + "\" target=\"_blank\"><img src=\"" + line.LinePic + "\" />" + line.LineName + "</a><span style=\"text-align: left;\">L" + line.Id.ToString().PadLeft(6, '0') + "</span></td>"); sbCollect.Append("<td class=\"arial order_price\">¥" + line.PriceCommon + "</td><td class=\"arial\">" + row["CollectDate"] + "</td>"); sbCollect.Append("<td class=\"order_operate\"><a href=\"/Line.aspx?id=" + row["LineId"] + "\" target=\"_blank\">去预订</a><a class=\"delcollect\" href=\"javascript:void(0)\" id=\"" + row["Id"] + "\">删除</a></td>"); sbCollect.Append("</tr>"); } } } else { sbCollect.Append("<tr><td colspan=\"5\" style=\"line-height:30px;text-align:center;background-color:#f9f0a8;\">您目前还没有收藏线路哦!</td></tr>"); } return(sbCollect.ToString()); }
/// <summary> /// 返回线路名称 /// </summary> /// <param name="id"></param> /// <param name="orderType"></param> public string getOrderName(int id, int orderType) { string strvalue = ""; if (orderType == Convert.ToInt32(TravelAgent.Tool.EnumSummary.OrderType.线路)) { TravelAgent.Model.Line l = LineBll.GetModel(id); if (l != null) { strvalue = l.LineName; } } else if (orderType == Convert.ToInt32(TravelAgent.Tool.EnumSummary.OrderType.签证)) { TravelAgent.Model.VisaList v = VisaListBll.GetModel(id); if (v != null) { strvalue = v.visaName; } } else if (orderType == Convert.ToInt32(TravelAgent.Tool.EnumSummary.OrderType.租车)) { TravelAgent.Model.CarList c = CarBll.GetModel(id); if (c != null) { strvalue = c.CarName; } } return(strvalue); }
/// <summary> /// 显示行程详细内容 /// </summary> /// <param name="lineId"></param> /// <returns></returns> public string ShowLine(TravelAgent.Model.Line line) { StringBuilder sb = new StringBuilder(); if (line.EditModel == 0) { List <TravelAgent.Model.LineContent> lstLineContent = LineContentBll.GetlstLineContentByLineId(line.Id); TravelAgent.Model.LineContent content = null; for (int i = 0; i < lstLineContent.Count; i++) { content = lstLineContent[i]; sb.Append("<div class=\"titcon\">"); sb.Append("<div class=\"titkey\">第<em>" + content.DaySort + "</em>天</div>"); sb.Append("<div class=\"titpic\">" + TravelAgent.Tool.CommonOprate.ShowLineTitle(content.Title) + "</div>"); sb.Append("</div>"); sb.Append("<div class=\"chizhu\">"); sb.Append("<p><span class=\"chi\" title=\"用餐\"></span><em><font class=\"hco\">早餐</font>-" + TravelAgent.Tool.CommonOprate.ShowCatering(content.Morn) + " , <font class=\"hco\">中餐</font>-" + TravelAgent.Tool.CommonOprate.ShowCatering(content.Noon) + " , <font class=\"hco\">晚餐</font>-" + TravelAgent.Tool.CommonOprate.ShowCatering(content.Night) + "</em></p>"); sb.Append("<p><span class=\"zhu\" title=\"住宿\"></span><em><font class=\"hco\">住宿:</font>" + content.Accom + "</em></p>"); sb.Append("</div>"); sb.Append("<div class=\"text\">"); sb.Append("<div class=\"text_tp\">"); sb.Append(content.Content); sb.Append("</div>"); sb.Append("</div>"); } } else { sb.Append(line.LineContent); } return(sb.ToString()); }
protected void Page_Load(object sender, EventArgs e) { this.Title = "订单结果" + Master.webinfo.WebName; int.TryParse(Request.QueryString["oid"], out oid); if (Request.QueryString["pay"] != null) { strTip = "付款成功"; strSubTip = "如果付款成功,订单的状态仍是‘待付款’,请联系客服工作人员核实修改!"; } if (!this.IsPostBack) { if (oid > 0) { order = LineOrderBll.GetModel(oid); if (order != null) { Line = LineBll.GetModel(order.lineId); if (Line.DealType == Convert.ToInt32(TravelAgent.Tool.EnumSummary.DealType.人工处理)) { this.divPay.Style["display"] = "none"; } else { this.divPay.Style["display"] = ""; } } } } if (order == null) { Response.Redirect("/Opr.aspx?t=error&msg=opr", false); order = new Model.Order(); } if (Line == null) { Response.Redirect("/Opr.aspx?t=error&msg=opr", false); Line = new Model.Line(); } }
/// <summary> /// 显示线路订单 /// </summary> public string ShowLineOrder() { StringBuilder sbLineOrder = new StringBuilder(); DataSet dsLineOrder = LineOrderBll.GetList(5, "clubid=" + club.id, "orderDate desc"); string proname = ""; string propic = ""; TravelAgent.Model.Line linem = null; TravelAgent.Model.VisaList visa = null; foreach (DataRow r in dsLineOrder.Tables[0].Rows) { sbLineOrder.Append("<tr>"); sbLineOrder.Append("<td class=\"arial\">" + r["ordercode"] + "</td>"); if (Convert.ToInt32(r["orderType"]) == Convert.ToInt32(TravelAgent.Tool.EnumSummary.OrderType.线路)) { linem = LineBll.GetModel(Convert.ToInt32(r["lineId"])); if (linem != null) { proname = linem.LineName; propic = linem.LinePic; } sbLineOrder.Append("<td class=\"order_pic\"><a href=\"/Line.aspx?id=" + r["lineId"] + "\"><img src=\"" + propic + "\" />" + proname + "</a></td>"); } else if (Convert.ToInt32(r["orderType"]) == Convert.ToInt32(TravelAgent.Tool.EnumSummary.OrderType.签证)) { visa = VisaListBll.GetModel(Convert.ToInt32(r["lineId"])); if (visa != null) { proname = visa.visaName; propic = visa.picurl; } sbLineOrder.Append("<td class=\"order_pic\"><a href=\"/visa/VisaDetail.aspx?id=" + r["lineId"] + "\" target=\"_blank\"><img src=\"" + propic + "\" />" + proname + "</a></td>"); } //sbLineOrder.Append("<td class=\"order_pic\"><a href=\"/Line.aspx?id=" + r["lineId"] + "\"><img src=\"" + r["LinePic"] + "\" />" + r["ProName"] + "</a></td>"); sbLineOrder.Append("<td class=\"arial\">" + TravelAgent.Tool.EnumHelper.GetMemberName <TravelAgent.Tool.EnumSummary.OrderType>(r["orderType"]) + "</td>"); sbLineOrder.Append("<td class=\"arial order_price\">¥" + (Convert.ToInt32(r["orderPrice"]) + Convert.ToInt32(r["attachPrice"])).ToString() + "</td>"); sbLineOrder.Append("<td>" + TravelAgent.Tool.EnumHelper.GetMemberName <TravelAgent.Tool.EnumSummary.OrderState>(r["orderState"]) + "</td>"); sbLineOrder.Append("<td class=\"arial\">" + r["orderDate"] + "</td>"); if (Convert.ToInt32(r["orderState"]) == Convert.ToInt32(TravelAgent.Tool.EnumSummary.OrderState.填写信息)) { sbLineOrder.Append("<td class=\"order_operate\"><a target=\"_blank\" href=\"/Order2.aspx?oid=" + r["Id"] + "\">补充游客信息</a>"); } else if (Convert.ToInt32(r["orderState"]) == Convert.ToInt32(TravelAgent.Tool.EnumSummary.OrderState.核对订单)) { sbLineOrder.Append("<td class=\"order_operate\"><a target=\"_blank\" href=\"/Order3.aspx?oid=" + r["Id"] + "\">核对订单</a>"); } else if (Convert.ToInt32(r["orderState"]) == Convert.ToInt32(TravelAgent.Tool.EnumSummary.OrderState.待付款)) { sbLineOrder.Append("<td class=\"order_operate\"><a target=\"_blank\" href=\"/Order4.aspx?t=line&oid=" + r["Id"] + "\">付款</a>"); } else { sbLineOrder.Append("<td class=\"order_operate\">"); } sbLineOrder.Append("</td>"); sbLineOrder.Append("</tr>"); } return(sbLineOrder.ToString()); }
protected void Page_Load(object sender, EventArgs e) { this.Title = "填写游客信息-" + Master.webinfo.WebName; int.TryParse(Request.QueryString["oid"], out oid); if (!this.IsPostBack) { if (oid > 0) { order = LineOrderBll.GetModel(oid); if (order != null) { Line = LineBll.GetModel(order.lineId); } else { Response.Redirect("/Opr.aspx?t=error&msg=opr", false); } } else { Response.Redirect("/Opr.aspx?t=error&msg=opr", false); } //提交游客信息 if (Request["txtHiddenUList"] != null) { //TravelAgent.Model.LineOrderTourist tourist = null; string[] arryUlist = Request["txtHiddenUList"].Split('$'); string strsql = ""; string[] strdetail = null; for (int i = 0; i < arryUlist.Length; i++) { strdetail = arryUlist[i].Split('^'); strsql += "insert into LineOrderTourist(orderId,touristName,touristSex,mobile,papersType,papersNo,birthDate,touristType) values"; strsql += "('" + order.Id + "','" + strdetail[0] + "','" + strdetail[3] + "','" + strdetail[5] + "','" + strdetail[1] + "','" + strdetail[2] + "','" + strdetail[4] + "','" + strdetail[8] + "');"; } if (!strsql.Equals("")) { //Access //if (TravelAgent.Tool.DbHelperOleDb.ExecuteSql(strsql) > 0) if (TravelAgent.Tool.DbHelperSQL.ExecuteSql(strsql) > 0) { //urlrewrite Response.Redirect("/lineorder/3/" + oid + ".html", false); } else { Response.Redirect("/Opr.aspx?t=error&msg=opr", false); } } } } if (order == null) { Response.Redirect("/Opr.aspx?t=error&msg=opr", false); order = new Model.Order(); } if (Line == null) { Response.Redirect("/Opr.aspx?t=error&msg=opr", false); Line = new Model.Line(); } }
protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["tag"] != null) { tag = Request.QueryString["tag"]; } if (Request.QueryString["id"] != null) { lineid = Convert.ToInt32(Request.QueryString["id"]); } if (!this.IsPostBack) { if (lineid > 0) { TravelAgent.Model.Line line = LineBll.GetModel(lineid); if (line != null) { this.txtCost.Value = line.LineCost; this.txtOrder.Value = line.OrderTips; this.txtTravel.Value = line.TravelNotice; } } } }
/// <summary> /// 返回线路名称 /// </summary> /// <param name="id"></param> /// <param name="orderType"></param> public string getOrderName(int id, int orderType) { string strvalue = ""; if (orderType == Convert.ToInt32(TravelAgent.Tool.EnumSummary.OrderType.线路)) { TravelAgent.Model.Line l = LineBll.GetModel(id); if (l != null) { strvalue = "<a href=\"/Line.aspx?id=" + id + "\" target=\"_blank\" class=\"tablelink\">" + l.LineName + "</a>"; } } else if (orderType == Convert.ToInt32(TravelAgent.Tool.EnumSummary.OrderType.签证)) { TravelAgent.Model.VisaList v = VisaListBll.GetModel(id); if (v != null) { strvalue = "<a href=\"/visa/VisaDetail.aspx?id=" + id + "\" target=\"_blank\" class=\"tablelink\">" + v.visaName + "</a>"; } } else if (orderType == Convert.ToInt32(TravelAgent.Tool.EnumSummary.OrderType.租车)) { TravelAgent.Model.CarList c = CarBll.GetModel(id); if (c != null) { strvalue = "<a href=\"/car/CarDetail.aspx?id=" + id + "\" target=\"_blank\" class=\"tablelink\">" + c.CarName + "</a>"; } } return(strvalue); }
protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["id"] != null) { orderid = Convert.ToInt32(Request.QueryString["id"]); } if (!this.IsPostBack) { DataBindState(); DataBindPay(); if (orderid > 0) { TravelAgent.Model.Order order = LineOrderBll.GetModel(orderid); if (order != null) { TravelAgent.Model.Line line = LineBll.GetModel(order.lineId); if (line != null) { this.hddonate.Value = line.DonatePoints.ToString(); } this.hdordercode.Value = order.ordercode; this.lblLineName.Text = order.proName; this.lblOrderCode.Text = order.ordercode; this.lblPeopleNum.Text = order.peopleNumber + "(" + order.adultNumber + "/" + order.childNumber + ")"; this.lblOrderDate.Text = order.orderDate.ToString(); this.lblTravelDate.Text = order.TravelDate; this.lblOrderRemark.Text = order.orderRemark; this.IDcard.Text = order.IDcard; this.lbltuijianren.Text = order.tuijianren; this.lblLinkName.Text = order.contactName; this.lblTel.Text = order.contactMobile; this.lblEmail.Text = order.contactEmail; this.hdclubid.Value = order.clubid.ToString(); TravelAgent.Model.Club club = ClubBll.GetModel(order.clubid); if (club != null) { this.lblClubInfo.Text = club.clubName + " / " + club.clubMobile + " / " + club.clubEmail; } this.lblOrderTotalPrice.Text = order.orderPrice.ToString(); this.lblIsBaoxian.Text = order.attachPrice == 0 ? "否" : "是"; this.lblBaoxianCost.Text = order.attachPrice.ToString(); this.txtuserPoints.Value = order.usePoints.ToString(); this.lblPayCost.Text = (order.orderPrice + order.attachPrice - order.usePoints + order.subPrice).ToString(); this.ddlState.SelectedValue = order.orderState.ToString(); this.txtRemark.Value = order.operRemark; if (order.orderState == Convert.ToInt32(TravelAgent.Tool.EnumSummary.OrderState.已付款)) { this.lblPayState.Text = "已付款"; } else { this.lblPayState.Text = "未付款"; } this.ddlPayType.SelectedValue = order.payType.ToString(); } } } }
protected void Page_Load(object sender, EventArgs e) { if (!this.IsPostBack) { if (Request.QueryString["tag"] != null) { tag = Request.QueryString["tag"]; } if (Request.QueryString["id"] != null) { lineid = Convert.ToInt32(Request.QueryString["id"]); this.hidlineid.Value = lineid.ToString(); if (lineid > 0) { TravelAgent.Model.Line line = LineBll.GetModel(lineid); if (line != null) { dayNumber = line.DayNumber; this.rbtnEditModel.SelectedValue = line.EditModel.ToString(); this.trDayEdit.Style["display"] = line.EditModel == 0?"":"none"; this.trVisableEdit.Style["display"] = line.EditModel == 1 ? "" : "none"; List <TravelAgent.Model.LineContent> lineContent = LineContentBll.GetlstLineContentByLineId(lineid); LoadLineContent(dayNumber, lineContent); this.txtContent.Value = line.LineContent; } } } } }
/// <summary> /// 增加一条数据 /// </summary> public int Add(TravelAgent.Model.Line model) { int lineid = 0; if (dal.Add(model) > 0) { lineid = dal.GetMaxID("Id"); } return(lineid); }
protected void Page_Load(object sender, EventArgs e) { int id; if (!string.IsNullOrEmpty(Request.QueryString["id"]) && int.TryParse(Request.QueryString["id"], out id)) { LineModel = LineBll.GetModel(id); if (LineModel == null) { Response.Redirect(""); } } }
protected void Page_Load(object sender, EventArgs e) { int id; if (Request.QueryString["id"] != null && int.TryParse(Request.QueryString["id"], out id)) { Line = LineBll.GetModel(id); } if (Line == null) { Response.Redirect("/Opr.aspx?t=error&msg=opr"); } }
/// <summary> /// 显示位置 /// </summary> /// <param name="strPro"></param> /// <returns></returns> public string ShowPlace(TravelAgent.Model.Line Line) { StringBuilder sbPlace = new StringBuilder(); sbPlace.Append("<span>您当前位置:</span>"); sbPlace.Append(" <a href=\"" + Master.webinfo.WebDomain + "\">首页</a>>"); int proId = 0; if (!string.IsNullOrEmpty(Line.Dest)) { if (Line.Dest.Contains(",")) { proId = Convert.ToInt32(Line.Dest.Split(',')[1]); } else { proId = Convert.ToInt32(Line.Dest); } TravelAgent.Model.Destination dest = DestBll.GetModel(proId); string[] arryplace = dest.navList.Split(','); for (int i = 0; i < arryplace.Length; i++) { if (!string.IsNullOrEmpty(arryplace[i])) { TravelAgent.Model.Destination model = DestBll.GetModel(Convert.ToInt32(arryplace[i])); if (model != null) { sbPlace.Append("<a>" + model.navName + "报价</a>>"); } else { break; } } } sbPlace.Append("<em>" + Line.LineName + "</em>"); } else { TravelAgent.Model.Destination dest = DestBll.GetModel(Line.DestId); if (dest != null) { sbPlace.Append("<a>" + dest.navName + "报价</a>>"); } sbPlace.Append("<em>" + Line.LineName + "</em>"); } return(sbPlace.ToString()); }
protected void Page_Load(object sender, EventArgs e) { int id = 0; if (Request.QueryString["id"] != null && int.TryParse(Request.QueryString["id"], out id)) { Line = LineBll.GetModel(id); } if (Line == null) { Response.Redirect("/Opr.aspx?t=error&msg=opr"); } else { int normalPrice = String.IsNullOrEmpty(Line.PriceContent) ? 0 : Convert.ToInt32(Line.PriceContent.Split(',')[2]); Line.PurchasePrice = GetLineSpePrice(id, normalPrice); } }
protected void Page_Load(object sender, EventArgs e) { int.TryParse(Request.QueryString["id"], out pid); if (!this.IsPostBack) { if (pid > 0) { LineModel = LineBll.GetModel(pid); if (LineModel != null) { LineModel.Insure = InsureBll.GetModel(LineModel.InsureId); } } } if (LineModel == null) { Response.Redirect("/Opr.aspx?t=error&msg=opr"); } }
protected void Page_Load(object sender, EventArgs e) { if (Request["daycount"] != null) { int lineid = Convert.ToInt32(Request["hidlineid"]); int editmodel = Convert.ToInt32(Request["rbtnEditModel"]); ArrayList allist = new ArrayList(); allist.Add("update Line set editModel=" + editmodel + " where Id=" + lineid + ";"); if (editmodel == 0) { int count = Convert.ToInt32(Request["daycount"]); string strsql = ""; for (int i = 1; i <= count; i++) { strsql = "insert into LineContent(title,morn,noon,night,accom,content,daySort,lineId) "; strsql += "values('" + Request["txt_BT_D" + i] + "',"; if (Request["chk_morn_D" + i] == null) { strsql += "0,"; } else { strsql += "1,"; } if (Request["chk_noon_D" + i] == null) { strsql += "0,"; } else { strsql += "1,"; } if (Request["chk_night_D" + i] == null) { strsql += "0,"; } else { strsql += "1,"; } strsql += "'" + Request["txt_ZS_D" + i] + "',"; strsql += "'" + Request["txt_Content_D" + i] + "',"; strsql += "" + i + ","; strsql += "" + lineid + ")"; allist.Add(strsql); } } else if (editmodel == 1) { allist.Add("update Line set lineContent='" + Request["txtContent"] + "' where Id=" + lineid); } try { LineContentBll.InsertContents(allist, lineid); Response.Write("true"); } catch { Response.Write("false"); } } else { Response.Write("false"); } //删除线路 if (Request["tag"] != null) { string strtag = Request["tag"]; int lineid = Convert.ToInt32(Request["lineid"]); if (strtag.Equals("linelist_delete")) { try { LineBll.Delete(lineid); Response.Write("true"); } catch { Response.Write("false"); } } else if (strtag.Equals("linelist_copy")) { TravelAgent.Model.Line Line = LineBll.GetModel(lineid); Line.LineName = "[复制]" + Line.LineName; Line.Adddate = DateTime.Now; try { int newLineid = LineBll.Add(Line); if (newLineid > 0) { ArrayList allist = new ArrayList(); List <TravelAgent.Model.LineContent> lstLineContent = LineContentBll.GetlstLineContentByLineId(lineid); foreach (TravelAgent.Model.LineContent content in lstLineContent) { allist.Add("insert into LineContent(title,morn,noon,night,accom,content,daySort,lineId) values ('" + content.Title + "','" + content.Morn + "','" + content.Noon + "','" + content.Night + "','" + content.Accom + "','" + content.Content + "','" + content.DaySort + "','" + newLineid + "') "); } if (allist.Count > 0) { LineContentBll.InsertContents(allist, newLineid); } allist.Clear(); List <TravelAgent.Model.LineSpePrice> lstSpePrice = SpePriceBll.GetlstSpePriceByLineId(lineid); foreach (TravelAgent.Model.LineSpePrice price in lstSpePrice) { allist.Add("insert into LineSpePrice(lineId,lineDate,linePrice,tag) values ('" + newLineid + "','" + price.lineDate + "','" + price.linePrice + "','" + price.tag + "')"); } if (allist.Count > 0) { SpePriceBll.InsertContents(allist); } Response.Write("true"); } else { Response.Write("false"); } } catch { Response.Write("false"); } } } }
protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["tag"] != null) { tag = Request.QueryString["tag"]; } if (Request.QueryString["id"] != null) { lineid = Convert.ToInt32(Request.QueryString["id"]); } if (!this.IsPostBack) { DataBindSupply(); DataBindCity(); DataBindProperty(); DataBindTheme(); DataBindState(); DataBindInsure(); DataBindHoliday(); if (lineid > 0) { TravelAgent.Model.Line line = LineBll.GetModel(lineid); if (line != null) { this.ddlSupply.SelectedValue = line.SupplyId.ToString(); this.txtTitle.Text = line.LineName; this.txtSubTitle.Text = line.LineSubName; this.txtImgUrl.Text = line.LinePic; this.SEOTitle.Value = line.SeoTitle; this.SEOKeywords.Value = line.SeoKey; this.SEODescription.Value = line.SeoDisc; this.ddlCity.SelectedValue = line.CityId.ToString(); this.ddlDayNumber.SelectedValue = line.DayNumber.ToString(); this.hidDest.Value = line.Dest; DataBindDestType(line.DestId, line.Dest); this.ddlDestType.SelectedValue = line.DestId.ToString(); //参团性质 this.ddlJoinPropery.SelectedValue = line.ProIds; this.txtGZD.Text = line.GZD.ToString(); this.ddlInsurance.SelectedValue = line.InsureId.ToString(); this.chkIsLock.Checked = line.IsLock == 1; //主题 foreach (ListItem item in chkTheme.Items) { if (line.ThemeIds.Contains("," + item.Value + ",")) { item.Selected = true; } } //往返交通 foreach (ListItem item in chkTraffic.Items) { if (line.TrafficIds.Contains("," + item.Value + ",")) { item.Selected = true; } } //状态属性 foreach (ListItem item in chkState.Items) { if (line.State.Contains("," + item.Value + ",")) { item.Selected = true; } } this.txtFeature.Value = line.LineFeature; this.txtAheadNumber.Text = line.AheadNumber.ToString(); this.txtSort.Text = line.Sort.ToString(); //节日 foreach (ListItem item in this.chkHoliday.Items) { if (line.Holiday.Contains("," + item.Value + ",")) { item.Selected = true; } } } } else { DataBindDestType(null, null); } } }
/// <summary> /// 保存返回列表 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSave1_Click(object sender, EventArgs e) { TravelAgent.Model.Line model = new TravelAgent.Model.Line(); model.SupplyId = Convert.ToInt32(ddlSupply.SelectedValue); model.LineName = this.txtTitle.Text.Trim(); model.LineSubName = this.txtSubTitle.Text.Trim(); model.LinePic = this.txtImgUrl.Text; model.SeoTitle = this.SEOTitle.Value.Trim(); model.SeoKey = this.SEOKeywords.Value.Trim(); model.SeoDisc = this.SEODescription.Value.Trim(); model.CityId = Convert.ToInt32(this.ddlCity.SelectedValue); model.DayNumber = Convert.ToInt32(this.ddlDayNumber.SelectedValue); model.DestId = Convert.ToInt32(this.ddlDestType.SelectedValue); model.Dest = this.hidDest.Value; model.IsLock = this.chkIsLock.Checked ? 1 : 0; //string strJoinProperty = ""; //foreach (ListItem item in chkJoinProperty.Items) //{ // if (item.Selected) // { // strJoinProperty = strJoinProperty + item.Value + ","; // } //} model.ProIds = this.ddlJoinPropery.SelectedValue; model.GZD = this.txtGZD.Text.Trim().Equals("") ? 0 : Convert.ToInt32(this.txtGZD.Text); model.InsureId = Convert.ToInt32(this.ddlInsurance.SelectedValue); string strTheme = ""; foreach (ListItem item in chkTheme.Items) { if (item.Selected) { strTheme = strTheme + item.Value + ","; } } model.ThemeIds = !strTheme.Equals("") ? "," + strTheme : ""; model.LineFeature = this.txtFeature.Value; string strTraffic = ""; foreach (ListItem item in chkTraffic.Items) { if (item.Selected) { strTraffic = strTraffic + item.Value + ","; } } model.TrafficIds = !strTraffic.Equals("") ? "," + strTraffic : ""; string strState = ""; foreach (ListItem item in chkState.Items) { if (item.Selected) { strState = strState + item.Value + ","; } } model.State = !strState.Equals("") ? "," + strState : ""; model.AheadNumber = Convert.ToInt32(this.txtAheadNumber.Text); model.Sort = Convert.ToInt32(this.txtSort.Text); string strHoliday = ""; foreach (ListItem item in this.chkHoliday.Items) { if (item.Selected) { strHoliday = strHoliday + item.Value + ","; } } model.Holiday = !strHoliday.Equals("") ? "," + strHoliday : ""; try { if (lineid > 0) { string strsql = "update Line set lineName='" + model.LineName + "',lineSubName='" + model.LineSubName + "',linePic='" + model.LinePic + "',seoTitle='" + model.SeoTitle + "',seoKey='" + model.SeoKey + "',seoDisc='" + model.SeoDisc + "',"; strsql += "cityId='" + model.CityId + "',dayNumber='" + model.DayNumber + "',aheadNumber='" + model.AheadNumber + "',supplyId='" + model.SupplyId + "',destId='" + model.DestId + "',dest='" + model.Dest + "',proIds='" + model.ProIds + "',"; strsql += "themeIds='" + model.ThemeIds + "',trafficIds='" + model.TrafficIds + "',Sort='" + model.Sort + "',lineFeature='" + model.LineFeature + "',State='" + model.State + "',isLock=" + model.IsLock + ",gzd='" + model.GZD + "',holiday='" + model.Holiday + "' where id=" + lineid; if (LineBll.Update(strsql) > 0) { JscriptPrint("保存成功!", "LineList.aspx", "Success"); } else { JscriptPrint("保存失败!", Request.Url.ToString(), "Error"); } } else { lineid = LineBll.Add(model); if (lineid > 0) { JscriptPrint("新增成功!", "LineList.aspx", "Success"); } else { JscriptPrint("新增失败!", Request.Url.ToString(), "Error"); } } } catch { JscriptPrint("保存失败!", Request.Url.ToString(), "Error"); } }
protected void Page_Load(object sender, EventArgs e) { int id; if (!this.IsPostBack && Request.QueryString["id"] != null && int.TryParse(Request.QueryString["id"], out id)) { LineModel = LineBll.GetModel(id); if (LineModel != null) { //增加关注度 string strsql = "update Line set gzd=gzd+1 where Id=" + LineModel.Id; //Access //TravelAgent.Tool.DbHelperOleDb.ExecuteSql(strsql); //SQL TravelAgent.Tool.DbHelperSQL.ExecuteSql(strsql); if (LineModel.SeoTitle.Trim().Equals("")) { this.Title = LineModel.LineName + "-" + Master.webinfo.WebName + "-" + Master.webinfo.SEOTitle; } else { this.Title = LineModel.SeoTitle; } if (LineModel.SeoKey.Trim().Equals("")) { Common.AddMeta(Page.Master.Page, "keywords", Master.webinfo.SEOKeywords); } else { Common.AddMeta(Page.Master.Page, "keywords", LineModel.SeoKey); } if (LineModel.SeoDisc.Trim().Equals("")) { Common.AddMeta(Page.Master.Page, "description", Master.webinfo.SEODescription); } else { Common.AddMeta(Page.Master.Page, "description", LineModel.SeoDisc); } this.divPlace.InnerHtml = ShowPlace(LineModel); TravelAgent.Model.JoinProperty proModel = ProBll.GetModel(Convert.ToInt32(LineModel.ProIds)); if (proModel != null) { this.lblLineType.Text = proModel.joinName; } TravelAgent.Model.DepartureCity cityModel = CityBll.GetModel(LineModel.CityId); if (cityModel != null) { this.lblCity.Text = cityModel.CityName; } int intNormalPrice = String.IsNullOrEmpty(LineModel.PriceContent) ? 0 : Convert.ToInt32(LineModel.PriceContent.Split(',')[2]); int intMinPrice = GetLineSpePrice(LineModel.Id, intNormalPrice); if (intMinPrice == 0) { this.ltPrice.Text = "电询"; } else { this.ltPrice.Text = "¥ " + intMinPrice; } } } if (LineModel == null) { Response.Redirect("/Opr.aspx?t=error&msg=opr"); } }
protected void Page_Load(object sender, EventArgs e) { int id; if (int.TryParse(Request.QueryString["id"], out id)) { StringBuilder sb = new StringBuilder(); string[] Day = new string[] { "星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六" }; TravelAgent.Model.Line Line = LineBll.GetModel(id); if (Line != null) { if (!Line.PriceSDate.Equals("") && !Line.PriceEDate.Equals("")) { DateTime dtstart = Convert.ToDateTime(Line.PriceSDate); DateTime dtend = Convert.ToDateTime(Line.PriceEDate); if (dtend >= dtstart) { sb.Append("["); TimeSpan ts = dtend.Subtract(dtstart); int days = ts.Days; string strSpePrice = ""; for (int i = 0; i <= days; i++) { DateTime dttemp = dtstart.AddDays(i); int dayValue = Convert.ToInt32(dttemp.DayOfWeek); string strCurprice = Line.PriceContent.Split(',')[2] + "," + Line.PriceContent.Split(',')[3]; if (dttemp >= DateTime.Now) { if (Line.PriceEditModel == 0)//天天发团 { strSpePrice = getSpePrice(Line.Id, dttemp.ToString("yyyy-MM-dd"), strCurprice); } else if (Line.PriceEditModel == 1)//按周 { if (TravelAgent.Tool.CommonOprate.IsContainValue(dayValue.ToString(), Line.PriceSetting)) { strSpePrice = getSpePrice(Line.Id, dttemp.ToString("yyyy-MM-dd"), strCurprice); } else { strSpePrice = getSpePrice(Line.Id, dttemp.ToString("yyyy-MM-dd"), ""); } } else if (Line.PriceEditModel == 2)//按月 { if (TravelAgent.Tool.CommonOprate.IsContainValue(dttemp.Day.ToString(), Line.PriceSetting)) { strSpePrice = getSpePrice(Line.Id, dttemp.ToString("yyyy-MM-dd"), strCurprice); } else { strSpePrice = getSpePrice(Line.Id, dttemp.ToString("yyyy-MM-dd"), ""); } } if (!strSpePrice.Equals("")) { sb.Append("{\"id\":\"" + dttemp.ToString("yyyyMMdd") + "\","); sb.Append("\"title\":\"¥" + strSpePrice.Split(',')[0] + "\","); sb.Append("\"start\":\"" + dttemp.ToString("yyyy-MM-dd") + "\","); sb.Append("\"end\":\"" + dttemp.ToString("yyyy-MM-dd") + "\","); sb.Append("\"allDay\":true,"); sb.Append("\"adultprice\":\"" + strSpePrice.Split(',')[0] + "\","); sb.Append("\"childprice\":\"" + strSpePrice.Split(',')[1] + "\","); sb.Append("\"price\":\"" + Line.PriceContent + "\","); sb.Append("\"info\":\"" + dttemp.ToString("yyyy-MM-dd") + "(" + Day[dayValue] + ") " + strSpePrice.Split(',')[0] + "元/成人," + strSpePrice.Split(',')[1] + "元/儿童\","); sb.Append("\"textColor\":\"#eb7f0b\"},"); } } } sb.Remove(sb.Length - 1, 1); sb.Append("]"); } } else { List <TravelAgent.Model.LineSpePrice> listSpePrice = SpePriceBll.GetlstSpePriceByLineId(id); sb.Append("["); foreach (TravelAgent.Model.LineSpePrice price in listSpePrice) { if (price.tag == 1) { DateTime dtspeTemp = Convert.ToDateTime(price.lineDate); sb.Append("{\"id\":\"" + dtspeTemp.ToString("yyyyMMdd") + "\","); sb.Append("\"title\":\"" + price.linePrice.Split(',')[2] + "元\","); sb.Append("\"start\":\"" + price.lineDate + "\","); sb.Append("\"end\":\"" + price.lineDate + "\","); sb.Append("\"allDay\":true,"); sb.Append("\"adultprice\":\"" + price.linePrice.Split(',')[2] + "\","); sb.Append("\"childprice\":\"" + price.linePrice.Split(',')[3] + "\","); sb.Append("\"price\":\"" + Line.PriceContent + "\","); sb.Append("\"info\":\"" + dtspeTemp.ToString("yyyyMMdd") + "(" + Day[Convert.ToInt32(dtspeTemp.DayOfWeek)] + ")" + price.linePrice.Split(',')[2] + "元/成人," + price.linePrice.Split(',')[3] + "元/儿童\","); sb.Append("\"textColor\":\"#eb7f0b\"},"); } } sb.Remove(sb.Length - 1, 1); sb.Append("]"); } } Response.Write(sb.ToString()); } }
protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["id"] != null) { StringBuilder sb = new StringBuilder(); TravelAgent.Model.Line Line = LineBll.GetModel(Convert.ToInt32(Request.QueryString["id"])); if (Line != null) { if (!Line.PriceSDate.Equals("") && !Line.PriceEDate.Equals("")) { DateTime dtstart = Convert.ToDateTime(Line.PriceSDate); DateTime dtend = Convert.ToDateTime(Line.PriceEDate); if (dtend >= dtstart) { sb.Append("["); TimeSpan ts = dtend.Subtract(dtstart); int days = ts.Days; for (int i = 0; i <= days; i++) { DateTime dttemp = dtstart.AddDays(i); if (dttemp >= DateTime.Now) { if (Line.PriceEditModel == 0)//天天发团 { sb.Append("{\"id\":\"" + dttemp.ToString("yyyyMMdd") + "\","); sb.Append("\"title\":\"" + getSpePrice(Line.Id, dttemp.ToString("yyyy-MM-dd"), Line.PriceContent) + "\","); sb.Append("\"start\":\"" + dttemp.ToString("yyyy-MM-dd") + "\","); sb.Append("\"end\":\"" + dttemp.ToString("yyyy-MM-dd") + "\","); sb.Append("\"price\":\"" + Line.PriceContent + "\","); sb.Append("\"color\":\"#fee08f\"},"); } else if (Line.PriceEditModel == 1)//按周 { if (TravelAgent.Tool.CommonOprate.IsContainValue(Convert.ToInt32(dttemp.DayOfWeek).ToString(), Line.PriceSetting)) { sb.Append("{\"id\":\"" + dttemp.ToString("yyyyMMdd") + "\","); sb.Append("\"title\":\"" + getSpePrice(Line.Id, dttemp.ToString("yyyy-MM-dd"), Line.PriceContent) + "\","); sb.Append("\"start\":\"" + dttemp.ToString("yyyy-MM-dd") + "\","); sb.Append("\"end\":\"" + dttemp.ToString("yyyy-MM-dd") + "\","); sb.Append("\"price\":\"" + Line.PriceContent + "\","); sb.Append("\"color\":\"#fee08f\"},"); } else { string strspeprice = getSpePrice2(Line.Id, dttemp.ToString("yyyy-MM-dd"), Line.PriceContent); if (!strspeprice.Equals("")) { sb.Append("{\"id\":\"" + dttemp.ToString("yyyyMMdd") + "\","); sb.Append("\"title\":\"" + strspeprice + "\","); sb.Append("\"start\":\"" + dttemp.ToString("yyyy-MM-dd") + "\","); sb.Append("\"end\":\"" + dttemp.ToString("yyyy-MM-dd") + "\","); sb.Append("\"price\":\"" + Line.PriceContent + "\","); sb.Append("\"color\":\"#fee08f\"},"); } } } else if (Line.PriceEditModel == 2)//按月 { if (TravelAgent.Tool.CommonOprate.IsContainValue(dttemp.Day.ToString(), Line.PriceSetting)) { sb.Append("{\"id\":\"" + dttemp.ToString("yyyyMMdd") + "\","); sb.Append("\"title\":\"" + getSpePrice(Line.Id, dttemp.ToString("yyyy-MM-dd"), Line.PriceContent) + "\","); sb.Append("\"start\":\"" + dttemp.ToString("yyyy-MM-dd") + "\","); sb.Append("\"end\":\"" + dttemp.ToString("yyyy-MM-dd") + "\","); sb.Append("\"price\":\"" + Line.PriceContent + "\","); sb.Append("\"color\":\"#fee08f\"},"); } else { string strspeprice = getSpePrice2(Line.Id, dttemp.ToString("yyyy-MM-dd"), Line.PriceContent); if (!strspeprice.Equals("")) { sb.Append("{\"id\":\"" + dttemp.ToString("yyyyMMdd") + "\","); sb.Append("\"title\":\"" + strspeprice + "\","); sb.Append("\"start\":\"" + dttemp.ToString("yyyy-MM-dd") + "\","); sb.Append("\"end\":\"" + dttemp.ToString("yyyy-MM-dd") + "\","); sb.Append("\"price\":\"" + Line.PriceContent + "\","); sb.Append("\"color\":\"#fee08f\"},"); } } } } } sb.Remove(sb.Length - 1, 1); sb.Append("]"); } } else { List <TravelAgent.Model.LineSpePrice> listSpePrice = getCacheData(Convert.ToInt32(Request.QueryString["id"])); sb.Append("["); foreach (TravelAgent.Model.LineSpePrice price in listSpePrice) { if (price.tag == 1) { sb.Append("{\"id\":\"" + Convert.ToDateTime(price.lineDate).ToString("yyyyMMdd") + "\","); sb.Append("\"title\":\"销:" + price.linePrice.Split(',')[2] + " 余:" + price.linePrice.Split(',')[11] + "\","); sb.Append("\"start\":\"" + price.lineDate + "\","); sb.Append("\"end\":\"" + price.lineDate + "\","); sb.Append("\"price\":\"" + Line.PriceContent + "\","); sb.Append("\"color\":\"#fee08f\"},"); } } sb.Remove(sb.Length - 1, 1); sb.Append("]"); } } Response.Write(sb.ToString()); } }
protected void Page_Load(object sender, EventArgs e) { this.Title = "核对订单-" + Master.webinfo.WebName; int.TryParse(Request.QueryString["oid"], out oid); if (!this.IsPostBack) { TravelAgent.Model.InfoSetting info = new TravelAgent.Model.InfoSetting(); info.ds = bll.GetList(); if (oid > 0) { order = LineOrderBll.GetModel(oid); if (order != null) { Line = LineBll.GetModel(order.lineId); if (Line != null) { if (Line.DestId == 1)//出境 { strAgreeMent = info.getValue("CJAgreeMent"); } else//国内、周边 { strAgreeMent = info.getValue("GNAgreeMent"); } } } else { Response.Redirect("/Opr.aspx?t=error&msg=opr", false); } } else { Response.Redirect("/Opr.aspx?t=error&msg=opr", false); } if (Request["txtHiddenOrderId"] != null) { string strsql = ""; if (Line.DealType == Convert.ToInt32(TravelAgent.Tool.EnumSummary.DealType.自动处理)) { strsql = "update [Order] set orderState=" + Convert.ToInt32(TravelAgent.Tool.EnumSummary.OrderState.待付款) + " where Id=" + oid; } else { strsql = "update [Order] set orderState=" + Convert.ToInt32(TravelAgent.Tool.EnumSummary.OrderState.处理中) + " where Id=" + oid; } if (TravelAgent.Tool.DbHelperSQL.ExecuteSql(strsql) > 0) { //urlrewrite Response.Redirect("/lineorder/5/" + oid + ".html", false); } else { Response.Redirect("/Opr.aspx?t=error&msg=opr", false); } } } if (order == null) { Response.Redirect("/Opr.aspx?t=error&msg=opr", false); order = new Model.Order(); } if (Line == null) { Response.Redirect("/Opr.aspx?t=error&msg=opr", false); Line = new Model.Line(); } }
protected void Page_Load(object sender, EventArgs e) { this.Title = "付款-" + Master.webinfo.WebName; int.TryParse(Request.QueryString["oid"], out oid); int strUid; if (!int.TryParse(TravelAgent.Tool.CookieHelper.GetCookieValue("uid"), out strUid)) { Response.Redirect("/member/Login.aspx"); } else { club = clubBll.GetModel(strUid); } if (Request.QueryString["t"] != null) { strTag = Request.QueryString["t"]; } if (!this.IsPostBack) { if (!string.IsNullOrEmpty(strTag)) { if (oid > 0) { TravelAgent.Model.Order order = OrderBll.GetModel(oid); if (order != null) { strOrdercode = order.ordercode; intPeopleNumber = order.peopleNumber; intTotalPrice = order.orderPrice + order.attachPrice + order.subPrice; orderdate = order.orderDate; if (strTag.Equals("line"))//线路 { Line = LineBll.GetModel(order.lineId); if (Line != null) { strOrderName = Line.LineName; donatePoints = Line.DonatePoints; } else { Response.Redirect("/Opr.aspx?t=error&msg=opr", false); } } else if (strTag.Equals("visa")) { TravelAgent.Model.VisaList visa = VisaBll.GetModel(order.lineId); if (visa != null) { strOrderName = visa.visaName; donatePoints = visa.donatePoints; } else { Response.Redirect("/Opr.aspx?t=error&msg=opr", false); } } else if (strTag.Equals("car")) { TravelAgent.Model.CarList car = CarBll.GetModel(order.lineId); if (car != null) { strOrderName = car.CarName; donatePoints = 0; } else { Response.Redirect("/Opr.aspx?t=error&msg=opr", false); } } } else { Response.Redirect("/Opr.aspx?t=error&msg=opr", false); } } else { Response.Redirect("/Opr.aspx?t=error&msg=opr", false); } } else { Response.Redirect("/Opr.aspx?t=error&msg=opr", false); } } if (club == null) { Response.Redirect("/Opr.aspx?t=error&msg=opr", false); club = new Model.Club(); } if (Line == null) { Response.Redirect("/Opr.aspx?t=error&msg=opr", false); Line = new Model.Line(); } }
protected void Page_Load(object sender, EventArgs e) { //check if the user login - write by jjh CheckLogin(); this.Title = "填写订单-" + Master.webinfo.WebName; int.TryParse(Request.QueryString["adult"], out adult); int.TryParse(Request.QueryString["child"], out child); int.TryParse(Request.QueryString["id"], out id); if (Request.QueryString["ordertime"] != null) { ordertime = Request.QueryString["ordertime"]; } if (!this.IsPostBack) { if (id > 0) { DateTime orderdate; LineModel = LineBll.GetModel(id); if (LineModel != null && DateTime.TryParseExact(ordertime, "yyyyMMdd", Thread.CurrentThread.CurrentCulture, System.Globalization.DateTimeStyles.None, out orderdate)) { ordertime = orderdate.ToString("yyyy-MM-dd"); string strspeprice = getSpePrice(id, ordertime); if (strspeprice.Equals("")) { adultprice = Convert.ToInt32(LineModel.PriceContent.Split(',')[2]); childprice = Convert.ToInt32(LineModel.PriceContent.Split(',')[3]); } else { adultprice = Convert.ToInt32(strspeprice.Split(',')[0]); childprice = Convert.ToInt32(strspeprice.Split(',')[1]); } totalprice = adult * adultprice + child * childprice; if (LineModel.InsureId == 0) { strAttach = "-<span style=\"color:#ff6600\">赠送保险</span>"; this.divattach.Style["display"] = "none"; } } } int uid = 0; if (!string.IsNullOrEmpty(TravelAgent.Tool.CookieHelper.GetCookieValue("uid")) && int.TryParse(TravelAgent.Tool.CookieHelper.GetCookieValue("uid"), out uid)) { CurClub = ClubBll.GetModel(uid); } if (CurClub == null) { CurClub = new TravelAgent.Model.Club(); } //预订第一步 if (Request["txtHiddenPId"] != null) { TravelAgent.Model.Order order = new TravelAgent.Model.Order(); order.lineId = id; order.ordercode = "O" + DateTime.Now.ToString("yyyyMMddHHmmssfff"); int txtHiddenPersonNum; int txtHiddenChildNum; int.TryParse(Request["txtHiddenPersonNum"], out txtHiddenPersonNum); int.TryParse(Request["txtHiddenChildNum"], out txtHiddenChildNum); order.peopleNumber = txtHiddenPersonNum + txtHiddenChildNum; order.adultNumber = txtHiddenPersonNum; order.childNumber = txtHiddenChildNum; order.orderDate = DateTime.Now; order.TravelDate = ordertime; order.orderPrice = totalprice; int txtHiddenAttachPrice; int.TryParse(Request["txtHiddenAttachPrice"], out txtHiddenAttachPrice); order.attachPrice = txtHiddenAttachPrice; order.usePoints = 0; order.donatePoints = 0; order.contactName = Request["txt_name"]; order.contactMobile = Request["txt_mobile"]; order.contactEmail = Request["txt_email"]; order.contactTelephone = Request["txt_start_phone"] + "-" + Request["txt_end_phone"]; order.orderRemark = Request["txt_des"]; order.operRemark = ""; order.orderState = Convert.ToInt32(TravelAgent.Tool.EnumSummary.OrderState.填写信息); order.clubid = uid; order.adultPrice = adultprice; order.childPrice = childprice; order.payType = 0; order.subPrice = 0; order.orderType = Convert.ToInt32(TravelAgent.Tool.EnumSummary.OrderType.线路); order.contactSex = ""; order.sourceType = Convert.ToInt32(TravelAgent.Tool.EnumSummary.SourceType.PC网页); order.tuijianren = Request["txtHiddentuijianren"]; try { int orderid = LineOrderBll.Add(order); if (orderid > 0 & order.clubid > 0) { //urlrewrite Response.Redirect("/lineorder/2/" + orderid + ".html", false); } else { Response.Redirect("/Opr.aspx?t=error&msg=opr"); } } catch (Exception ex) { Response.Redirect("/Opr.aspx?t=error&msg=opr"); } } } if (LineModel == null) { Response.Redirect("/Opr.aspx?t=error&msg=opr"); } }
/// <summary> /// 得到一个对象实体 /// </summary> public TravelAgent.Model.Line GetModel(int Id) { StringBuilder strSql = new StringBuilder(); strSql.Append("select top 1 * from Line "); strSql.Append(" where Id=@Id "); SqlParameter[] parameters = { new SqlParameter("@Id", SqlDbType.Int, 4) }; parameters[0].Value = Id; TravelAgent.Model.Line model = new TravelAgent.Model.Line(); DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters); if (ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["Id"].ToString() != "") { model.Id = int.Parse(ds.Tables[0].Rows[0]["Id"].ToString()); } model.LineName = ds.Tables[0].Rows[0]["lineName"].ToString(); model.LineSubName = ds.Tables[0].Rows[0]["lineSubName"].ToString(); model.LinePic = ds.Tables[0].Rows[0]["linePic"].ToString(); model.SeoTitle = ds.Tables[0].Rows[0]["seoTitle"].ToString(); model.SeoKey = ds.Tables[0].Rows[0]["seoKey"].ToString(); model.SeoDisc = ds.Tables[0].Rows[0]["seoDisc"].ToString(); if (ds.Tables[0].Rows[0]["cityId"].ToString() != "") { model.CityId = int.Parse(ds.Tables[0].Rows[0]["cityId"].ToString()); } if (ds.Tables[0].Rows[0]["dayNumber"].ToString() != "") { model.DayNumber = int.Parse(ds.Tables[0].Rows[0]["dayNumber"].ToString()); } if (ds.Tables[0].Rows[0]["aheadNumber"].ToString() != "") { model.AheadNumber = int.Parse(ds.Tables[0].Rows[0]["aheadNumber"].ToString()); } if (ds.Tables[0].Rows[0]["supplyId"].ToString() != "") { model.SupplyId = int.Parse(ds.Tables[0].Rows[0]["supplyId"].ToString()); } if (ds.Tables[0].Rows[0]["destId"].ToString() != "") { model.DestId = int.Parse(ds.Tables[0].Rows[0]["destId"].ToString()); } model.Dest = ds.Tables[0].Rows[0]["dest"].ToString(); model.ProIds = ds.Tables[0].Rows[0]["proIds"].ToString(); model.ThemeIds = ds.Tables[0].Rows[0]["themeIds"].ToString(); model.TrafficIds = ds.Tables[0].Rows[0]["trafficIds"].ToString(); if (ds.Tables[0].Rows[0]["Sort"].ToString() != "") { model.Sort = int.Parse(ds.Tables[0].Rows[0]["Sort"].ToString()); } model.LineFeature = ds.Tables[0].Rows[0]["lineFeature"].ToString(); model.LineCost = ds.Tables[0].Rows[0]["lineCost"].ToString(); model.OrderTips = ds.Tables[0].Rows[0]["orderTips"].ToString(); model.TravelNotice = ds.Tables[0].Rows[0]["travelNotice"].ToString(); model.State = ds.Tables[0].Rows[0]["State"].ToString(); if (ds.Tables[0].Rows[0]["editModel"].ToString() != "") { model.EditModel = int.Parse(ds.Tables[0].Rows[0]["editModel"].ToString()); } model.LineContent = ds.Tables[0].Rows[0]["lineContent"].ToString(); if (ds.Tables[0].Rows[0]["usePoints"].ToString() != "") { model.UsePoints = int.Parse(ds.Tables[0].Rows[0]["usePoints"].ToString()); } if (ds.Tables[0].Rows[0]["donatePoints"].ToString() != "") { model.DonatePoints = int.Parse(ds.Tables[0].Rows[0]["donatePoints"].ToString()); } model.Adddate = DateTime.Parse(ds.Tables[0].Rows[0]["adddate"].ToString()); if (ds.Tables[0].Rows[0]["priceSdate"].ToString() != "") { model.PriceSDate = ds.Tables[0].Rows[0]["priceSdate"].ToString(); } if (ds.Tables[0].Rows[0]["priceEdate"].ToString() != "") { model.PriceEDate = ds.Tables[0].Rows[0]["priceEdate"].ToString(); } if (ds.Tables[0].Rows[0]["priceEditModel"].ToString() != "") { model.PriceEditModel = int.Parse(ds.Tables[0].Rows[0]["priceEditModel"].ToString()); } model.PriceContent = ds.Tables[0].Rows[0]["priceContent"].ToString(); if (ds.Tables[0].Rows[0]["dealType"].ToString() != "") { model.DealType = int.Parse(ds.Tables[0].Rows[0]["dealType"].ToString()); } model.PriceSetting = ds.Tables[0].Rows[0]["priceSetting"].ToString(); if (ds.Tables[0].Rows[0]["isLock"].ToString() != "") { model.IsLock = int.Parse(ds.Tables[0].Rows[0]["isLock"].ToString()); } model.GZD = int.Parse(ds.Tables[0].Rows[0]["gzd"].ToString()); model.PriceCommon = int.Parse(ds.Tables[0].Rows[0]["priceCommon"].ToString()); if (ds.Tables[0].Rows[0]["insureid"].ToString() != "") { model.InsureId = int.Parse(ds.Tables[0].Rows[0]["insureid"].ToString()); } model.Holiday = ds.Tables[0].Rows[0]["holiday"].ToString(); return(model); } else { return(null); } }
/// <summary> /// 增加一条数据 /// </summary> public int Add(TravelAgent.Model.Line model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into Line("); strSql.Append("lineName,lineSubName,linePic,seoTitle,seoKey,seoDisc,cityId,dayNumber,aheadNumber,supplyId,destId,dest,proIds,themeIds,trafficIds,Sort,"); strSql.Append("lineFeature,lineCost,orderTips,travelNotice,State,editModel,lineContent,usePoints,donatePoints,adddate,priceSdate,priceEdate,priceEditModel,priceContent,dealType,priceSetting,isLock,gzd,priceCommon,insureid,holiday)"); strSql.Append(" values ("); strSql.Append("@lineName,@lineSubName,@linePic,@seoTitle,@seoKey,@seoDisc,@cityId,@dayNumber,@aheadNumber,@supplyId,@destId,@dest,@proIds,@themeIds,@trafficIds,@Sort,"); strSql.Append("@lineFeature,@lineCost,@orderTips,@travelNotice,@State,@editModel,@lineContent,@usePoints,@donatePoints,@adddate,@priceSdate,@priceEdate,@priceEditModel,@priceContent,@dealType,@priceSetting,@isLock,@gzd,@priceCommon,@insureid,@holiday)"); SqlParameter[] parameters = { new SqlParameter("@lineName", SqlDbType.VarChar, 100), new SqlParameter("@lineSubName", SqlDbType.VarChar, 200), new SqlParameter("@linePic", SqlDbType.VarChar, 200), new SqlParameter("@seoTitle", SqlDbType.VarChar, 100), new SqlParameter("@seoKey", SqlDbType.VarChar, 100), new SqlParameter("@seoDisc", SqlDbType.VarChar, 250), new SqlParameter("@cityId", SqlDbType.Int, 4), new SqlParameter("@dayNumber", SqlDbType.Int, 4), new SqlParameter("@aheadNumber", SqlDbType.Int, 4), new SqlParameter("@supplyId", SqlDbType.Int, 4), new SqlParameter("@destId", SqlDbType.Int, 4), new SqlParameter("@dest", SqlDbType.VarChar, 250), new SqlParameter("@proIds", SqlDbType.VarChar, 200), new SqlParameter("@themeIds", SqlDbType.VarChar, 200), new SqlParameter("@trafficIds", SqlDbType.VarChar, 50), new SqlParameter("@Sort", SqlDbType.Int, 4), new SqlParameter("@lineFeature", SqlDbType.Text), new SqlParameter("@lineCost", SqlDbType.Text), new SqlParameter("@orderTips", SqlDbType.Text), new SqlParameter("@travelNotice", SqlDbType.Text), new SqlParameter("@State", SqlDbType.VarChar, 50), new SqlParameter("@editModel", SqlDbType.Int, 4), new SqlParameter("@lineContent", SqlDbType.Text), new SqlParameter("@usePoints", SqlDbType.Int), new SqlParameter("@donatePoints", SqlDbType.Int), new SqlParameter("@adddate", SqlDbType.DateTime), new SqlParameter("@priceSdate", SqlDbType.VarChar), new SqlParameter("@priceEdate", SqlDbType.VarChar), new SqlParameter("@priceEditModel", SqlDbType.Int), new SqlParameter("@priceContent", SqlDbType.VarChar, 200), new SqlParameter("@dealType", SqlDbType.Int), new SqlParameter("@priceSetting", SqlDbType.VarChar, 250), new SqlParameter("@isLock", SqlDbType.Int), new SqlParameter("@gzd", SqlDbType.Int), new SqlParameter("@priceCommon", SqlDbType.Int), new SqlParameter("@insureid", SqlDbType.Int), new SqlParameter("@holiday", SqlDbType.NVarChar, 250) }; parameters[0].Value = model.LineName; parameters[1].Value = model.LineSubName; parameters[2].Value = model.LinePic; parameters[3].Value = model.SeoTitle; parameters[4].Value = model.SeoKey; parameters[5].Value = model.SeoDisc; parameters[6].Value = model.CityId; parameters[7].Value = model.DayNumber; parameters[8].Value = model.AheadNumber; parameters[9].Value = model.SupplyId; parameters[10].Value = model.DestId; parameters[11].Value = model.Dest; parameters[12].Value = model.ProIds; parameters[13].Value = model.ThemeIds; parameters[14].Value = model.TrafficIds; parameters[15].Value = model.Sort; parameters[16].Value = model.LineFeature; parameters[17].Value = model.LineCost; parameters[18].Value = model.OrderTips; parameters[19].Value = model.TravelNotice; parameters[20].Value = model.State; parameters[21].Value = model.EditModel; parameters[22].Value = model.LineContent; parameters[23].Value = model.UsePoints; parameters[24].Value = model.DonatePoints; parameters[25].Value = model.Adddate; parameters[26].Value = model.PriceSDate; parameters[27].Value = model.PriceEDate; parameters[28].Value = model.PriceEditModel; parameters[29].Value = model.PriceContent; parameters[30].Value = model.DealType; parameters[31].Value = model.PriceSetting; parameters[32].Value = model.IsLock; parameters[33].Value = model.GZD; parameters[34].Value = model.PriceCommon; parameters[35].Value = model.InsureId; parameters[36].Value = model.Holiday; return(DbHelperSQL.ExecuteSql(strSql.ToString(), parameters)); }
protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["tag"] != null) { tag = Request.QueryString["tag"]; } if (Request.QueryString["id"] != null) { lineid = Convert.ToInt32(Request.QueryString["id"]); } if (!this.IsPostBack) { if (lineid > 0) { TravelAgent.Model.Line line = LineBll.GetModel(lineid); if (line != null) { this.txtStartDate.Value = line.PriceSDate; this.txtEndDate.Value = line.PriceEDate; this.rbtnPlanType.SelectedValue = line.PriceEditModel.ToString(); if (rbtnPlanType.SelectedValue == "1")//按周 { foreach (ListItem item in chkWeekList.Items) { if (TravelAgent.Tool.CommonOprate.IsContainValue(item.Value, line.PriceSetting)) { item.Selected = true; } } this.hidweek.Value = line.PriceSetting; this.trWeek.Style["display"] = ""; } else if (rbtnPlanType.SelectedValue == "2")//按号 { foreach (ListItem item in chkDayList.Items) { if (TravelAgent.Tool.CommonOprate.IsContainValue(item.Value, line.PriceSetting)) { item.Selected = true; } } this.hidday.Value = line.PriceSetting; this.trDay.Style["display"] = ""; } if (!line.PriceContent.Equals("")) { string[] strArryPrice = line.PriceContent.Split(','); this.txtMenshi_adult.Value = strArryPrice[0]; this.txtMenshi_child.Value = strArryPrice[1]; this.txtPrice_adult.Value = strArryPrice[2]; this.txtPrice_child.Value = strArryPrice[3]; this.txtUsePoints_adult.Value = strArryPrice[4]; this.txtUsePoints_child.Value = strArryPrice[5]; this.txtDoPoints_adult.Value = strArryPrice[6]; this.txtDoPoints_child.Value = strArryPrice[7]; this.txtCheng_adult.Value = strArryPrice[8]; this.txtCheng_child.Value = strArryPrice[9]; this.txtDFC.Value = strArryPrice[10]; this.txtNumber.Value = strArryPrice[11]; } this.rbtnDealType.SelectedValue = line.DealType.ToString(); } } } }