Example #1
0
    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();
    }
Example #2
0
 protected void btnSaveWeekly_Click(object sender, EventArgs e)
 {
     int tourID = PageTools.ParseInt(Request.QueryString["id"]);
     if (tourID>0)
     {
         AdminTourBiz biz = new AdminTourBiz();
         string weekly = (chkAutoCreate.Checked ? 'Y' : 'N') + GetWeekly();
         biz.SetWeekly(tourID, weekly);
         LoadWeekly(tourID);
     }
 }
Example #3
0
    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();
    }
Example #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            int tourID = PageTools.GetSavedId("tourID", Request.QueryString["id"]);
            if (tourID > 0 && Request.QueryString["id"] == null)
                Response.Redirect("TourDestinations.aspx?id=" + tourID.ToString());

            AdminTourBiz biz = new AdminTourBiz();
            DS_Tours.tourDetailDataTable dt = biz.GetTourDetail(tourID);

            if (tourID > 0 && dt.Rows.Count > 0)
            {
                DS_Tours.tourDetailRow row = dt.Rows[0] as DS_Tours.tourDetailRow;
                lbTourName.Text = "#" + row.TourID.ToString() + ":" + row.TourName + " / " + row.TourName_cn;
            }
            fvTourDayDest.ChangeMode(FormViewMode.Insert);
        }
    }
Example #5
0
    private void LoadWeekly(int tourID)
    {
        if (tourID>0)
        {
            AdminTourBiz biz = new AdminTourBiz();
            string weekly = biz.GetWeekly(tourID);

            chkAutoCreate.Checked = (weekly[0] == 'Y');
            chkMonday.Checked = (weekly.IndexOf('1') >= 0);
            chkTuesday.Checked = (weekly.IndexOf('2') >= 0);
            chkWednesday.Checked = (weekly.IndexOf('3') >= 0);
            chkThursday.Checked = (weekly.IndexOf('4') >= 0);
            chkFriday.Checked = (weekly.IndexOf('5') >= 0);
            chkSaturday.Checked = (weekly.IndexOf('6') >= 0);
            chkSunday.Checked = (weekly.IndexOf('0') >= 0);

            DS_Tours.tourDetailDataTable dt = biz.GetTourDetail(tourID);
            if (dt.Rows.Count > 0)
            {
                DS_Tours.tourDetailRow row = dt.Rows[0] as DS_Tours.tourDetailRow;
                lbTourName.Text = "#" + row.TourID.ToString() + ":" + row.TourName + " / " + row.TourName_cn;
            }
        }
    }