protected void btnAddSchedule_Click(object sender, EventArgs e) { int tourID = PageTools.ParseInt(Request.QueryString["id"]); if (tourID<=0) return; DateTime startDate = dateStart.DateValue; if (startDate < DateTime.Now) { txtAddScheduleMessage.Text = "日期不能在今日之前!"; txtAddScheduleMessage.ForeColor = System.Drawing.Color.Red; return; } AdminTourBiz biz = new AdminTourBiz(); AdminTourScheduleBiz asbiz = new AdminTourScheduleBiz(); int scheduleId = asbiz.GenSepcialSchedule(tourID, startDate, biz.GetTourDays(tourID)); if (scheduleId>0) { txtAddScheduleMessage.Text = "成功添加新Schedule:<b><a href='ScheduleEdit.aspx?id=" + scheduleId.ToString() + "'>" + scheduleId.ToString() + "</a></b>"; txtAddScheduleMessage.ForeColor = System.Drawing.Color.DarkGreen; asbiz.GetPriceFromTour(); } else { txtAddScheduleMessage.Text = "添加指定日期團失敗:" + biz.ErrorMessage ; txtAddScheduleMessage.ForeColor = System.Drawing.Color.Red; } lstSchedule.DataBind(); }
protected void btnAdd_Click(object sender, EventArgs e) { AdminTourScheduleBiz biz = new AdminTourScheduleBiz(); biz.AddScheduleHotels(ScheduleID, Days-1); // reload list _isChanged = true; }
protected void btnOpen_Click(object sender, EventArgs e) { AdminTourScheduleBiz biz = new AdminTourScheduleBiz(); string ids = GetSelectedSchedules(); if (ids.Length > 0) { biz.ChangeStatus(ids, 1); LoadScheduleList(); } }
public void SaveData() { if (ScheduleID > 0 && Days > 1) { AdminTourScheduleBiz biz = new AdminTourScheduleBiz(); foreach (GridViewRow row in lstHotels.Rows) { Controls_DataSelector d = row.FindControl("seleHotel") as Controls_DataSelector; int hotelID = PageTools.ParseInt(d.SelectedValue); int shid = PageTools.ParseInt(((HiddenField)row.FindControl("hdScheduleHotelID")).Value); int night = PageTools.ParseInt(((Literal)row.FindControl("txtNight")).Text); biz.UpdateScheduleHotel(shid, hotelID, night); } _isChanged = true; } }
protected void btnCreateScheduleNow_Click(object sender, EventArgs e) { int tourID = PageTools.ParseInt(Request.QueryString["id"]); if (tourID<=0) return; //先保存再生成 btnSaveWeekly_Click(null, null); AdminTourBiz tbiz = new AdminTourBiz(); int days = tbiz.GetTourDays(tourID) - 1; AdminTourScheduleBiz biz = new AdminTourScheduleBiz(); biz.GenSchedule(tourID, GetWeekly(), days); biz.GetPriceFromTour(); lstSchedule.DataBind(); }