/// <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); }
protected void Page_Load(object sender, EventArgs e) { this.Title = "租车预订_" + Master.webinfo.WebName; if (!this.IsPostBack) { if (Request.QueryString["cid"] != null) { cid = Convert.ToInt32(Request.QueryString["cid"]); CarModel = CarBll.GetModel(cid); } if (Request.QueryString["pcid"] != null) { pid = Convert.ToInt32(Request.QueryString["pcid"]); CarPriceModel = CarPriceBll.GetModel(pid); } if (Request.QueryString["oid"] != null) { order = OrderBll.GetModel(Convert.ToInt32(Request.QueryString["oid"])); } if (CarModel == null || CarPriceModel == null || order == null) { Response.Redirect("/Opr.aspx?msg=no"); } } }
protected void Page_Load(object sender, EventArgs e) { if (!string.IsNullOrEmpty(Request.QueryString["id"])) { orderid = Convert.ToInt32(Request.QueryString["id"]); } if (!this.IsPostBack) { DataBindState(); DataBindPay(); if (orderid > 0) { TravelAgent.Model.Order order = OrderBll.GetModel(orderid); if (order != null) { TravelAgent.Model.CarList car = CarBll.GetModel(order.lineId); if (car != null) { this.hdordercode.Value = order.ordercode; this.lblCarName.Text = car.CarName; this.lblOrderCode.Text = order.ordercode; this.lblUseCount.Text = order.account.ToString(); this.lblOrderDate.Text = order.orderDate.ToString(); TravelAgent.Model.CarPrice price = PriceBll.GetModel(order.peopleNumber); if (price != null) { this.lblCarType.Text = price.CarTypeID == 0 ? "旅游租车" : "自驾租车"; } this.lblUseDate.Text = order.usedate + " " + order.timedot + "点"; this.lblHuanDate.Text = order.huandate; } TravelAgent.Model.Club club = ClubBll.GetModel(order.clubid); if (club != null) { this.lblClubInfo.Text = club.clubName + " / " + club.clubMobile + " / " + club.clubEmail; } this.lblLinkName.Text = order.contactName; this.lblEmail.Text = order.contactEmail; this.lblTel.Text = order.contactMobile; this.lblSex.Text = !order.contactSex.Equals("") ? TravelAgent.Tool.EnumHelper.GetMemberName <TravelAgent.Tool.EnumSummary.TouristSex>(order.contactSex) : ""; this.lblOrderTotalPrice.Text = order.orderPrice.ToString(); this.txtJiaJian.Value = order.subPrice.ToString(); this.txtuserPoints.Value = order.usePoints.ToString(); this.lblPayCost.Text = (order.orderPrice - order.usePoints + order.subPrice).ToString(); this.ddlPayType.SelectedValue = order.payType.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 = "未付款"; } } } } }
/// <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); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(TravelAgent.Model.CarList model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into CarList("); strSql.Append("CarName,CarPic,BrandId,ClassId,Seat,CarDesc,CarOrderTip,State,IsLock,Sort)"); strSql.Append(" values ("); strSql.Append("@CarName,@CarPic,@BrandId,@ClassId,@Seat,@CarDesc,@CarOrderTip,@State,@IsLock,@Sort)"); SqlParameter[] parameters = { new SqlParameter("@CarName", SqlDbType.VarChar, 200), new SqlParameter("@CarPic", SqlDbType.NVarChar, 200), new SqlParameter("@BrandId", SqlDbType.Int), new SqlParameter("@ClassId", SqlDbType.Int), new SqlParameter("@Seat", SqlDbType.Int), new SqlParameter("@CarDesc", SqlDbType.Text), new SqlParameter("@CarOrderTip", SqlDbType.Text), new SqlParameter("@State", SqlDbType.VarChar, 50), new SqlParameter("@IsLock", SqlDbType.Int), new SqlParameter("@Sort", SqlDbType.Int) }; parameters[0].Value = model.CarName; parameters[1].Value = model.CarPic; parameters[2].Value = model.BrandId; parameters[3].Value = model.ClassId; parameters[4].Value = model.Seat; parameters[5].Value = model.CarDesc; parameters[6].Value = model.CarOrderTip; parameters[7].Value = model.State; parameters[8].Value = model.IsLock; parameters[9].Value = model.Sort; return(DbHelperSQL.ExecuteSql(strSql.ToString(), parameters)); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(TravelAgent.Model.CarList model) { int lineid = 0; if (dal.Add(model) > 0) { lineid = dal.GetMaxID("Id"); } return(lineid); }
/// <summary> /// 保存进入到下一步 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSave_Click(object sender, EventArgs e) { TravelAgent.Model.CarList model = new TravelAgent.Model.CarList(); model.CarName = this.txtCarName.Text.Trim(); model.CarPic = this.txtImgUrl.Text; model.BrandId = Convert.ToInt32(this.ddlBrand.SelectedValue); model.ClassId = Convert.ToInt32(this.ddlClass.SelectedValue); model.Seat = Convert.ToInt32(this.txtSeat.Text); model.CarDesc = this.txtCarContent.Value; model.CarOrderTip = this.txtOrderTip.Value; string strState = ""; foreach (ListItem item in chkState.Items) { if (item.Selected) { strState = strState + item.Value + ","; } } model.State = !strState.Equals("") ? "," + strState : ""; model.Sort = Convert.ToInt32(this.txtSort.Text); model.IsLock = this.chkIsLock.Checked ? 1 : 0; try { if (carid > 0) { string strsql = "update CarList set CarName='" + model.CarName + "',CarPic='" + model.CarPic + "',BrandId='" + model.BrandId + "',ClassId='" + model.ClassId + "',"; strsql += "Seat='" + model.Seat + "',CarDesc='" + model.CarDesc + "',CarOrderTip='" + model.CarOrderTip + "',State='" + model.State + "',IsLock='" + model.IsLock + "',Sort='" + model.Sort + "' where Id=" + carid; if (CarBll.Update(strsql) > 0) { JscriptPrint("保存成功!", "CarTwo.aspx?carid=" + carid + "&tag=edit", "Success"); } else { JscriptPrint("保存失败!", Request.Url.ToString(), "Error"); } } else { carid = CarBll.Add(model); if (carid > 0) { JscriptPrint("新增成功!", "CarTwo.aspx?carid=" + carid + "&tag=add", "Success"); } else { JscriptPrint("新增失败!", Request.Url.ToString(), "Error"); } } } catch { JscriptPrint("保存失败!", Request.Url.ToString(), "Error"); } }
protected void Page_Load(object sender, EventArgs e) { if (!this.IsPostBack) { if (Request.QueryString["Id"] != null) { car = CarBll.GetModel(Convert.ToInt32(Request.QueryString["Id"])); if (car == null) { Response.Redirect("/404.aspx"); } this.Title = car.CarName + "出租_" + car.CarName + "租赁_" + car.CarName + "租车_" + Master.webinfo.WebName; } } }
protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["carid"] != null) { carid = Convert.ToInt32(Request.QueryString["carid"]); } if (Request.QueryString["tag"] != null) { tag = Request.QueryString["tag"]; } if (!this.IsPostBack) { BindBrand(); BindClass(); DataBindState(); if (carid > 0) { TravelAgent.Model.CarList model = CarBll.GetModel(carid); if (model != null) { this.txtCarName.Text = model.CarName; this.txtImgUrl.Text = model.CarPic; this.ddlBrand.SelectedValue = model.BrandId.ToString(); this.ddlClass.SelectedValue = model.ClassId.ToString(); this.txtSeat.Text = model.Seat.ToString(); this.txtCarContent.Value = model.CarDesc; this.txtOrderTip.Value = model.CarOrderTip; //状态属性 foreach (ListItem item in chkState.Items) { if (model.State.Contains("," + item.Value + ",")) { item.Selected = true; } } this.txtSort.Text = model.Sort.ToString(); this.chkIsLock.Checked = model.IsLock == 1; } } } }
/// <summary> /// 得到一个对象实体 /// </summary> public TravelAgent.Model.CarList GetModel(int Id) { StringBuilder strSql = new StringBuilder(); strSql.Append("select top 1 * ,(select BrandName from CarBrand where Id=BrandId) as BrandName,(select ClassName from CarClass where Id=ClassId) as ClassName from CarList "); strSql.Append(" where Id=@Id "); SqlParameter[] parameters = { new SqlParameter("@Id", SqlDbType.Int, 4) }; parameters[0].Value = Id; TravelAgent.Model.CarList model = new TravelAgent.Model.CarList(); 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.CarName = ds.Tables[0].Rows[0]["CarName"].ToString(); model.CarPic = ds.Tables[0].Rows[0]["CarPic"].ToString(); model.BrandId = int.Parse(ds.Tables[0].Rows[0]["BrandId"].ToString()); model.ClassId = int.Parse(ds.Tables[0].Rows[0]["ClassId"].ToString()); model.Seat = int.Parse(ds.Tables[0].Rows[0]["Seat"].ToString()); model.CarDesc = ds.Tables[0].Rows[0]["CarDesc"].ToString(); model.CarOrderTip = ds.Tables[0].Rows[0]["CarOrderTip"].ToString(); model.State = ds.Tables[0].Rows[0]["State"].ToString(); model.IsLock = int.Parse(ds.Tables[0].Rows[0]["IsLock"].ToString()); model.Sort = int.Parse(ds.Tables[0].Rows[0]["Sort"].ToString()); model.AddDate = DateTime.Parse(ds.Tables[0].Rows[0]["AddDate"].ToString()); model.BrandName = ds.Tables[0].Rows[0]["BrandName"].ToString(); model.ClassName = ds.Tables[0].Rows[0]["ClassName"].ToString(); return(model); } else { return(null); } }
protected void Page_Load(object sender, EventArgs e) { this.Title = "租车预订_" + Master.webinfo.WebName; if (!this.IsPostBack) { if (Request.QueryString["cid"] != null) { cid = Convert.ToInt32(Request.QueryString["cid"]); CarModel = CarBll.GetModel(cid); } if (Request.QueryString["pcid"] != null) { pid = Convert.ToInt32(Request.QueryString["pcid"]); CarPriceModel = CarPriceBll.GetModel(pid); if (CarPriceModel.CarTypeID == 1)//旅游租车 { this.trHuan.Style["display"] = "none"; } } if (CarModel == null || CarPriceModel == null) { Response.Redirect("/Opr.aspx?msg=no"); } if (!string.IsNullOrEmpty(TravelAgent.Tool.CookieHelper.GetCookieValue("uid"))) { CurClub = ClubBll.GetModel(Convert.ToInt32(TravelAgent.Tool.CookieHelper.GetCookieValue("uid"))); } else { CurClub = new TravelAgent.Model.Club(); } strYCDate = DateTime.Now.AddDays(1).ToString("yyyy-MM-dd"); strHCDate = Convert.ToDateTime(strYCDate).AddDays(1).ToString("yyyy-MM-dd"); if (Request["txtHiddenCId"] != null) { TravelAgent.Model.Order order = new TravelAgent.Model.Order(); order.lineId = Convert.ToInt32(Request["txtHiddenCId"]); order.ordercode = "O" + DateTime.Now.ToString("yyyyMMddHHmmssfff"); order.peopleNumber = Convert.ToInt32(Request["txtHiddenPId"]); order.adultNumber = 0; order.childNumber = 0; order.orderDate = DateTime.Now; order.TravelDate = ""; order.orderPrice = Convert.ToInt32(Request["txtHiddenOrderPrice"]); order.attachPrice = 0; 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.处理中); if (string.IsNullOrEmpty(TravelAgent.Tool.CookieHelper.GetCookieValue("uid"))) { order.clubid = 0; } else { order.clubid = Convert.ToInt32(TravelAgent.Tool.CookieHelper.GetCookieValue("uid")); } order.adultPrice = 0; order.childPrice = 0; 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.usedate = Request["txtHiddenYongcheDate"]; order.timedot = Convert.ToInt32(Request["timedot"]); order.huandate = Request["txtHiddenHuancheDate"]; order.account = Convert.ToInt32(Request["selYongchecount"]); try { int orderid = LineOrderBll.Add(order); if (orderid > 0 & order.clubid > 0) { //urlrewrite Response.Redirect("/car/CarOrder2.aspx?cid=" + cid + "&pcid=" + pid + "&oid=" + orderid + "", false); } else { Response.Redirect("/Opr.aspx?t=error&msg=opr"); } } catch (Exception ex) { Response.Redirect("/Opr.aspx?t=error&msg=opr"); } } } }
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(); } }