protected void Page_Load(object sender, EventArgs e) { //Some variables for use on this page int id; string fname; string lname; string perm; string woID; //Check permission level and redirect if needed if (Session["Perm"] == null) { Response.Redirect("login.aspx"); } if (!Session["Perm"].Equals("C")) { Response.Redirect("login.aspx"); } //assign the variables from the session created from the login page id = Convert.ToInt32(Session["CustID"]); perm = Session["Perm"].ToString(); fname = Session["CFname"].ToString(); lname = Session["CLname"].ToString(); woID = Session["WorkOrderID"].ToString(); //Custom welcome message on the screen lblWelcome.Text = "Welcome " + fname + " " + lname + ". Customer ID: " + id; string select = "SELECT Doc from Docs WHERE EmpID IS NOT NULL AND WorkOrderID = " + woID + ";"; FileWork fw = new FileWork(); fw.DownloadFile(select); }
protected void btnDownloadDocs_Click(object sender, EventArgs e) { woID = Convert.ToInt16(ddlWOList.SelectedValue); Session["WorkOrderID"] = woID; FileWork fw = new FileWork(); string select = "Select Doc FROM Docs WHERE WorkOrderID = " + woID + ";"; fw.DownloadFile(select); }