コード例 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if(Session["SessionSchedule"] != null)
            {
                sbo = (ScheduleBO)(Session["SessionSchedule"]);
                litScheduleInfo.Text = "<h2>" + sbo.ScheduleTitle + "</h2>";

                dbServiceSql.SelectParameters["ScheduleID"].DefaultValue = sbo.sid.ToString();
            }
            else
            {
                Response.Redirect("~/Users/Schedule.aspx");
            }
        }
コード例 #2
0
        protected void uxGridView_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if(e.CommandName == "ScheduleService")
            {
                ScheduleBO sbo = new ScheduleBO();

                int index = Convert.ToInt32(e.CommandArgument);

                //get row of selected index
                GridViewRow row = uxGridView.Rows[index];

                //set schedule object attributes
                sbo.sid = Convert.ToInt32(row.Cells[0].Text);
                sbo.ScheduleTitle = row.Cells[1].Text;

                //create a session variable
                Session["SessionSchedule"] = sbo;

                Response.Redirect("~/Users/Service.aspx");
            }
        }