protected void Page_Load(object sender, EventArgs e) { CurrentLine = LineBLL.SelectLine(GetUrlInt("ID")); if (CurrentLine == null) { Response.Redirect("Default.aspx"); } else { Groups = new TravelGroup().SelectList("IsDel=0 And LineID=" + CurrentLine.ID + " Order By GoDate"); //绑定团期 ddlGoDate.Items.Clear(); foreach (TravelGroupInfo group in Groups) { ddlGoDate.Items.Add(new ListItem(group.GoDate.ToDateOnlyString(), group.ID.ToString())); } ddlGoDate.SelectedValue = CurrentGroupID.ToString(); CurrentGroup = Groups.Find(s => s.ID == ddlGoDate.SelectedValue.ToArrowInt()); if (CurrentGroup == null) { //Response.Redirect("Default.aspx"); CurrentGroup = new TravelGroupInfo(); } } }
/// <summary> /// 提取团的简要信息,包括出发日期,价格,剩余团位 /// </summary> /// <param name="group"></param> /// <returns></returns> public static GroupCurtInfo GroupToCurt(TravelGroupInfo group) { GroupCurtInfo curt = new GroupCurtInfo(); curt.Date = group.GoDate.ToDateOnlyString(); curt.Price = group.OuterPrice.ToString(); curt.Pos = group.RemainNum.ToString(); return(curt); }
protected override void OnInit(EventArgs e) { base.OnInit(e); int promotionID = GetUrlInt("PromotionID"); int groupID = GetUrlInt("GroupID"); int lineID = GetUrlInt("LineID"); if (promotionID > 0) { MyPromotion = PromotionBLL.Select(promotionID); } if (groupID > 0) { MyGroup = GroupBLL.SelectGroup(groupID); } if (lineID > 0) { MyLine = LineBLL.SelectLine(lineID); } if (MyLine == null || MyGroup == null) { Arrow.Framework.MessageBox.Jump("-1"); } BindBuyNum(); if (promotionID == 0) { ltPrice.Text = MyGroup.InnerPrice.ToString(); ltTotal.Text = (MyGroup.InnerPrice * ddlBuyNum.SelectedValue.ToArrowInt()).ToString(); } else { if (MyPromotion.PromotionType == PromotionType.Discount) { ltPrice.Text = decimal.Round(MyGroup.InnerPrice * MyPromotion.Discount, 2).ToString(); ltTotal.Text = (ltPrice.Text.ToArrowDecimal() * ddlBuyNum.SelectedValue.ToArrowInt()).ToString(); } else if (MyPromotion.PromotionType == PromotionType.Bundle) { ltPrice.Text = MyPromotion.TotalPayOneTime.ToString(); ddlBuyNum.SelectedValue = MyPromotion.TotalPayOneTimeJoinNum.ToString(); ddlBuyNum.Enabled = false; ltTotal.Text = MyPromotion.TotalPayOneTime.ToString(); } } }
protected override void OnInit(EventArgs e) { BindBuyNum(); base.OnInit(e); int promotionID = GetUrlInt("PromotionID"); int groupID = GetUrlInt("GroupID"); int lineID = GetUrlInt("LineID"); if (promotionID > 0) { MyPromotion = PromotionBLL.Select(promotionID); } if (groupID > 0) { MyGroup = GroupBLL.SelectGroup(groupID); } if (lineID > 0) { MyLine = LineBLL.SelectLine(lineID); } if (promotionID == 0) { ltPrice.Text = MyGroup.InnerPrice.ToString(); ltTotal.Text = ltPrice.Text; } else { if (MyPromotion.PromotionType == PromotionType.Discount) { ltPrice.Text = decimal.Round(MyGroup.InnerPrice * MyPromotion.Discount, 2).ToString(); ltTotal.Text = ltPrice.Text; } else if (MyPromotion.PromotionType == PromotionType.Bundle) { ltPrice.Text = MyPromotion.TotalPayOneTime.ToString(); ddlBuyNum.SelectedValue = MyPromotion.TotalPayOneTimeJoinNum.ToString(); ddlBuyNum.Enabled = false; ltTotal.Text = MyPromotion.TotalPayOneTime.ToString(); } } }
protected void BindData() { if (MyLine == null) { return; } ltNotice.Text = MyLine.SignUpNotice; ltDesc.Text = MyLine.LineDesc; ltImage.Text = SiteUtility.ShowImage(MyLine.CoverPath, 200, 200, true); ltLineName.Text = MyLine.Name; ltGoTravel.Text = MyLine.GoTravel; ltBackTravel.Text = MyLine.BackTravel; TravelGroupInfo group = MyGroups.Find(s => s.ID == ddlGroup.SelectedValue.ToArrowInt()); if (group == null) { return; } ltBackDate.Text = group.BackDate.ToDateOnlyString(); ltPrice.Text = CurrentMember == null?group.OuterPrice.ToString() : group.InnerPrice.ToString(); ltNum.Text = group.TotalNum.ToString(); ltRemain.Text = group.RemainNum.ToString(); ltTime.Text = group.GatheringTime; ltPlace.Text = group.GatheringPlace; List <LineDetailInfo> details = LineBLL.GetLineDetails(MyLine.ID); ltDetail.Text = ""; foreach (LineDetailInfo model in details) { string title = "<p style='color:red;font-weight:bold;font-size:14px'>第" + model.SortOrder + "天:" + model.Title + "</p>"; string pic = "<p>" + SiteUtility.ShowAllImage(model.DayPics, 150, 150) + "</p>"; string content = "<p>" + model.DayDesc.NewLineCharToBr() + "</p>"; string notice = "<p>温馨提示:" + model.WarmTips + "</p>"; ltDetail.Text += title + pic + content + notice + "<hr/>"; } }
protected void Page_Load(object sender, EventArgs e) { if (CurrentMember == null) { Response.Redirect("Login.aspx"); } ShowTitle("编辑参团人"); if (!Page.IsPostBack) { BindData(); TravelOrderInfo order = OrderBLL.SelectOrder(OrderNum); if (order != null) { LineInfo line = LineBLL.SelectLine(order.LineID); if (line != null) { TravelGroupInfo group = GroupBLL.SelectGroup(order.GroupID); if (group != null) { ltBuyNum.Text = order.BuyNum.ToString(); ltLineName.Text = line.Name.ToString(); ltPrice.Text = group.InnerPrice.ToString(); ltTotal.Text = order.TotalMoney.ToString(); PromotionInfo promotion = PromotionBLL.Select(order.PromotionID); if (promotion != null) { ltPromotionName.Text = promotion.Name; } else { ltPromotionName.Text = "无"; } } } } } }
public static int UpdateGroup(TravelGroupInfo model) { return(dal.Update(model)); }
public static int AddGroup(TravelGroupInfo model) { return(dal.Add(model)); }
protected void btnSubmit_Click(object sender, EventArgs e) { DateTime goDate = tbBegin.Text.Trim().ToArrowDateTime(); DateTime backDate = tbEnd.Text.Trim().ToArrowDateTime(); int totalNum = tbNum.Text.Trim().ToArrowInt(); int remainNum = tbRemain.Text.Trim().ToArrowInt(); decimal outerPrice = tbPrice.Text.Trim().ToArrowDecimal(); decimal innerPrice = tbMemberPrice.Text.Trim().ToArrowDecimal(); decimal deposit = tbDeposit.Text.Trim().ToArrowDecimal(); string gatheringTime = tbGatheringTime.Text.Trim(); string gatheringPlace = tbGatheringPlace.Text.Trim(); string transfer = tbTransfer.Text.Trim(); string leader = tbLeader.Text.Trim(); if ((goDate == DateTime.MinValue).ValidateSuccess("出团日期不正确!")) { return; } if ((backDate == DateTime.MinValue).ValidateSuccess("回程日期不正确!")) { return; } if ((goDate <= DateTime.Now).ValidateSuccess("出团日期必须大于今天!")) { return; } if ((backDate <= goDate).ValidateSuccess("返程日期必须大于出团日期!")) { return; } if ((totalNum <= 0).ValidateSuccess("参团人数不正确!")) { return; } if ((remainNum <= 0).ValidateSuccess("剩余位数不正确!")) { return; } if ((outerPrice <= 0M).ValidateSuccess("价格不正确!")) { return; } if ((innerPrice <= 0M).ValidateSuccess("会员价不正确!")) { return; } if ((deposit <= 0M).ValidateSuccess("订金不正确!")) { return; } if (GroupID == 0) { var model = new TravelGroupInfo(); model.AddTime = DateTime.Now; model.AddUserName = CurrentAdmin.UserName; model.AddUserRealName = CurrentAdmin.RealName; model.BackDate = backDate; model.BackTravel = ""; model.Deposit = deposit; model.GatheringPlace = gatheringPlace; model.GatheringTime = gatheringTime; model.GoDate = goDate; model.GoTravel = ""; model.GroupNum = ""; //团号 model.GruopLeader = leader; model.InnerPrice = innerPrice; model.IsDel = 0; model.IsPublish = 0; model.JoinNum = 0; model.RemainNum = remainNum; model.LineID = LineID; model.Name = ""; model.OuterPrice = outerPrice; model.PromotionNum = 0; model.Remarks = ""; model.TotalNum = totalNum; model.TransferPlace = transfer; model.TravelGuide = ""; GroupBLL.AddGroup(model); MessageBox.Show("添加成功!", CurrentUrl); } else { var model = GroupBLL.SelectGroup(GroupID); if (model == null) { return; } model.BackDate = backDate; model.Deposit = deposit; model.GatheringPlace = gatheringPlace; model.GatheringTime = gatheringTime; model.GoDate = goDate; model.GruopLeader = leader; model.InnerPrice = innerPrice; model.LineID = LineID; model.OuterPrice = outerPrice; model.TotalNum = totalNum; model.RemainNum = remainNum; model.TransferPlace = transfer; GroupBLL.UpdateGroup(model); MessageBox.Show("更新成功!"); } }