protected void Page_Load(object sender, EventArgs e)
        {
            if(Session["Service"] != null)
            {
                servbo = (ServiceBO)(Session["Service"]);
                litTop.Text = "<h2>" + servbo.title + "</h2>" + "<p>" + servbo.servicedate + "</p>";

                //set DB param
                dbJobs.SelectParameters["ServiceID"].DefaultValue = servbo.servid.ToString();
                dbJobs.InsertParameters["ServiceID"].DefaultValue = servbo.servid.ToString();
                dbJobs.UpdateParameters["ServiceID"].DefaultValue = servbo.servid.ToString();

                dbWorkers.SelectParameters["ServiceID"].DefaultValue = servbo.servid.ToString();
            }
            else
            {
                Response.Redirect("~/Users/Service.aspx");
            }
        }
Esempio n. 2
0
        protected void uxGridView_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if(e.CommandName == "AssignJobs")
            {
                ServiceBO servbo = new ServiceBO();

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

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

                //set service object attributes
                servbo.servid = Convert.ToInt32(row.Cells[0].Text);
                servbo.title = row.Cells[1].Text;
                servbo.duration = row.Cells[2].Text;
                servbo.servicedate = row.Cells[3].Text;

                Session["Service"] = servbo;

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

        }