protected void Page_Load(object sender, EventArgs e)
        {
            if(Session["SessionWorker"] != null)
            {
                wbo = (WorkerBO)(Session["SessionWorker"]);
                litWorkerInfo.Text = "<h2>" + wbo.fname + " " + wbo.lname + "</h2>";

                uxWorkerAvailableSql.SelectParameters["WorkerID"].DefaultValue = wbo.wid.ToString();
                uxWorkerAvailableSql.InsertParameters["WorkerID"].DefaultValue = wbo.wid.ToString();
                uxWorkerAvailableSql.UpdateParameters["WorkerID"].DefaultValue = wbo.wid.ToString();
                uxWorkerAvailableSql.DeleteParameters["WorkerID"].DefaultValue = wbo.wid.ToString();
            }
            else
            {
                Response.Redirect("~/Users/Worker.aspx");
            }
        }
Ejemplo n.º 2
0
        protected void uxGridView_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if(e.CommandName == "UnavailableDates")
            {
                WorkerBO wbo = new WorkerBO();

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

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

                //set worker object attributes
                wbo.wid = Convert.ToInt32(row.Cells[0].Text);
                wbo.fname = row.Cells[1].Text;
                wbo.lname = row.Cells[2].Text;
                wbo.phone = row.Cells[3].Text;
                wbo.email = row.Cells[4].Text;
                wbo.lastworked = row.Cells[5].Text;

                Session["SessionWorker"] = wbo;

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