protected void QA_Click(object sender, EventArgs e) { Boolean chk1, chk2, chk3, chk4, chk5; if (CheckBox1.Checked) { chk1 = true; } else { chk1 = false; } if (CheckBox2.Checked) { chk2 = true; } else { chk2 = false; } if (CheckBox3.Checked) { chk3 = true; } else { chk3 = false; } if (CheckBox4.Checked) { chk4 = true; } else { chk4 = false; } if (CheckBox5.Checked) { chk5 = true; } else { chk5 = false; } input1.QAChange(Convert.ToInt16(Session["User_ID"]), Convert.ToInt16(Session["id"]), "QA Checked"); input1.AddQADetails(Convert.ToInt16(Session["id"]), Convert.ToInt16(Session["User_ID"]), chk1, chk2, chk3, chk4, chk5); change_id = Convert.ToInt16(Session["id"]); if (FileUpload1.HasFile) { HttpFileCollection hfc = Request.Files; string time1 = DateTime.Now.ToString(); string directoryPath = Server.MapPath(string.Format("~/File_Uploads/" + change_id + "/")); if (!System.IO.Directory.Exists(directoryPath)) { System.IO.Directory.CreateDirectory(@directoryPath); } else { } for (int i = 0; i < hfc.Count; i++) { HttpPostedFile hpf = hfc[i]; if (hpf.ContentLength > 0) { string file_name = hpf.FileName; hpf.SaveAs(directoryPath + "\\" + file_name); string full_path = directoryPath + file_name; input1.InsertFile(full_path, change_id, file_name); } } } Response.Redirect("~/QA_Pending_QA_1.aspx"); }