void Load_Tests(string value, string keyword) { Batch_ID.Value = value; DataTable temp_table = new DataTable(); temp_table.Columns.Add(new DataColumn("Test_ID", typeof(string))); temp_table.Columns.Add(new DataColumn("Name", typeof(string))); temp_table.Columns.Add(new DataColumn("Details", typeof(string))); temp_table.Columns.Add(new DataColumn("TimeStamp", typeof(string))); DataTable remain_table = new DataTable(); remain_table.Columns.Add(new DataColumn("Test_ID", typeof(string))); remain_table.Columns.Add(new DataColumn("Name", typeof(string))); remain_table.Columns.Add(new DataColumn("Details", typeof(string))); remain_table.Columns.Add(new DataColumn("TimeStamp", typeof(string))); if (keyword == "") { for (int i = 0; i < search.Test().Rows.Count; i++) { if (find.Batch_Test(Batch_ID.Value, search.Test().Rows[i]["Test_ID"].ToString()).Rows.Count != 0) { temp_table.ImportRow(search.Test().Rows[i]); } else { remain_table.ImportRow(search.Test().Rows[i]); } } for (int i = 0; i < remain_table.Rows.Count; i++) { temp_table.ImportRow(remain_table.Rows[i]); } } else { for (int i = 0; i < search.Test().Rows.Count; i++) { if (find.Batch_Test(Batch_ID.Value, search.Test().Rows[i]["Test_ID"].ToString()).Rows.Count != 0 && find.Test_NAME(keyword).Rows.Count != 0) { temp_table.ImportRow(search.Test().Rows[i]); } else { remain_table.ImportRow(search.Test().Rows[i]); } } } All_Test.DataSource = temp_table; All_Test.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["gid"] != null && !IsPostBack) { string Giving_ID = secure.Decrypt(Request.QueryString["gid"], "momo-ctni-isbest"); All_Questions.DataSource = find.Giving_Ans(Giving_ID); All_Questions.DataBind(); if (find.Giving(Giving_ID).Rows.Count != 0) { studentdtl.Visible = true; string Student_id = find.Giving(Giving_ID).Rows[0]["Student_ID"].ToString(); string Batch_Test_ID = find.Giving(Giving_ID).Rows[0]["Batch_Test_ID"].ToString(); if (find.Batch_Test(Batch_Test_ID).Rows.Count != 0 && find.Students(Student_id).Rows.Count != 0) { string Batch_ID = find.Batch_Test(Batch_Test_ID).Rows[0]["Batch_ID"].ToString(); string Test_ID = find.Batch_Test(Batch_Test_ID).Rows[0]["Test_ID"].ToString(); if (find.Test(Test_ID).Rows.Count != 0) { Sheet_title.Text = find.Test(Test_ID).Rows[0]["Name"].ToString(); } if (find.Batches(Batch_ID).Rows.Count != 0) { Sheet_title.Text = Sheet_title.Text + " || " + find.Batches(Batch_ID).Rows[0]["Title"].ToString(); } Sheet_Name.Text = find.Students(Student_id).Rows[0]["Name"].ToString(); Sheet_Contact.Text = secure.Decrypt(find.Students(Student_id).Rows[0]["Contact"].ToString(), "TSIE-GEHM-TAKUCF"); Sheet_Email.Text = secure.Decrypt(find.Students(Student_id).Rows[0]["Email"].ToString(), "TSIE-GEHM-TAKUCF"); Sheet_Date.Text = find.Giving(Giving_ID).Rows[0]["TimeStamp"].ToString(); } } } else if (Request.QueryString["tid"] != null && !IsPostBack) { studentdtl.Visible = false; string tid = secure.Decrypt(Request.QueryString["tid"].ToString(), "momo-ctni-isbest"); All_Questions.DataSource = find.Test_Maker(tid); All_Questions.DataBind(); } }
protected void Find_Btn_Click(object sender, EventArgs e) { string batch_id = find.Students(Student_ID()).Rows[0]["Batch_ID"].ToString(); DataTable temp_table = new DataTable(); temp_table.Columns.Add(new DataColumn("Batch_Test_ID", typeof(string))); temp_table.Columns.Add(new DataColumn("Batch_ID", typeof(string))); temp_table.Columns.Add(new DataColumn("Test_ID", typeof(string))); temp_table.Columns.Add(new DataColumn("TimeStamp", typeof(string))); for (int i = 0; i < find.Test_NAME(Search_Console.Text).Rows.Count; i++) { string test_id_temp = find.Test_NAME(Search_Console.Text).Rows[i]["Test_ID"].ToString(); if (find.Batch_Test(batch_id, test_id_temp).Rows.Count != 0) { temp_table.ImportRow(find.Batch_Test(batch_id, test_id_temp).Rows[0]); } } All_Test.DataSource = temp_table; All_Test.DataBind(); }
protected void Load_test_questions_Command(object sender, CommandEventArgs e) { string batch_test_id = e.CommandName.ToString(); batch_test_id_fld.Value = batch_test_id; if (find.Giving_BATCH(batch_test_id).Rows.Count != 0) { All_Students.DataSource = find.Giving_BATCH(batch_test_id); All_Students.DataBind(); string Batch_id = find.Batch_Test(batch_test_id).Rows[0]["Batch_ID"].ToString(); string Test_id = find.Batch_Test(batch_test_id).Rows[0]["Test_ID"].ToString(); if ((find.Batches(Batch_id).Rows.Count != 0) && (find.Test(Test_id).Rows.Count != 0)) { //Test_Details.Text = "Test :- " + find.Test(Test_id).Rows[0]["Name"].ToString() + " || Batch :- " + find.Batches(Batch_id).Rows[0]["Title"].ToString(); } } else { } }
protected void CHng_Pg_Click(object sender, EventArgs e) { string batch_test_id = secure.Decrypt(Batch_Test_IDFld.Value, "MONE-YMAT-TERSLT"); if (find.Giving(Student_ID(), batch_test_id).Rows.Count == 0) { args[0] = Student_ID(); args[1] = batch_test_id; args[2] = DateTime.Now.ToString(); insertion.Giving(args); } string url = "Test_Page.aspx?Test_ID=" + secure.Encrypt((find.Batch_Test(batch_test_id).Rows.Count != 0 ? find.Batch_Test(batch_test_id).Rows[0]["Test_ID"].ToString() : "UNKOWN"), "MONE-YMAT-TERSLT"); Response.Redirect(url); }
private string Tests(string test) { string data = ""; DataTable dt = new DataTable(); if (test == "ALL") { dt = search.Test(); } else { dt = find.Test_NAME(test); } for (int i = 0; i < dt.Rows.Count; i++) { data = data + dt.Rows[i]["Name"].ToString() + "," + find.Batch_Test(dt.Rows[i]["Test_ID"].ToString()).Rows.Count.ToString() + "," + "Assigns" + "," + "Created On" + "," + dt.Rows[i]["TimeStamp"].ToString().Substring(0, 10) + "," + "Total Questions" + "," + find.Test_Maker(dt.Rows[i]["Test_ID"].ToString()).Rows.Count.ToString() + "," + ";"; } return(data); }
string Batch_Test_ID(string test_id) { return(find.Batch_Test(Batch_ID().ToString(), test_id).Rows.Count != 0 ? find.Batch_Test(Batch_ID().ToString(), test_id).Rows[0]["Batch_Test_ID"].ToString() : "0"); }