Exemple #1
0
        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 All_Students_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                Label  Student_Name = (Label)e.Row.FindControl("Student_Name");
                Label  Father_Name  = (Label)e.Row.FindControl("Father_Name");
                Label  Contact      = (Label)e.Row.FindControl("Contact");
                Label  Email        = (Label)e.Row.FindControl("Email");
                Label  Batch        = (Label)e.Row.FindControl("Batch");
                Label  Date_Of_Join = (Label)e.Row.FindControl("Date_Of_Joining");
                Label  Institute    = (Label)e.Row.FindControl("Institute");
                Button Chng_Status  = (Button)e.Row.FindControl("Change_Status");

                Student_Name.Text = DataBinder.Eval(e.Row.DataItem, "Name").ToString();
                Father_Name.Text  = DataBinder.Eval(e.Row.DataItem, "Father_Name").ToString();
                Contact.Text      = secure.Decrypt(DataBinder.Eval(e.Row.DataItem, "Contact").ToString(), "TSIE-GEHM-TAKUCF");
                Email.Text        = secure.Decrypt(DataBinder.Eval(e.Row.DataItem, "Email").ToString(), "TSIE-GEHM-TAKUCF");
                string batch_id = DataBinder.Eval(e.Row.DataItem, "Batch_ID").ToString();
                Batch.Text        = find.Batches(batch_id).Rows.Count != 0 ? find.Batches(batch_id).Rows[0]["Title"].ToString() : "No Batch Assigned";
                Date_Of_Join.Text = DataBinder.Eval(e.Row.DataItem, "Date_Of_Join").ToString();
                Institute.Text    = DataBinder.Eval(e.Row.DataItem, "Institute").ToString();
                string chng_stts = DataBinder.Eval(e.Row.DataItem, "Status").ToString();
                Chng_Status.CommandArgument = DataBinder.Eval(e.Row.DataItem, "Student_Id").ToString();
                Chng_Status.CommandName     = DataBinder.Eval(e.Row.DataItem, "Status").ToString();
                if (chng_stts == "1")
                {
                    Chng_Status.Text        = "Block";
                    Chng_Status.BackColor   = Color.Red;
                    Chng_Status.BorderColor = Color.Red;
                    Chng_Status.ForeColor   = Color.White;
                }
                else
                {
                    Chng_Status.Text        = "Unblock";
                    Chng_Status.BackColor   = Color.Green;
                    Chng_Status.BorderColor = Color.Green;
                    Chng_Status.ForeColor   = Color.White;
                }
            }
        }
Exemple #3
0
        protected void All_Test_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                string Batch_id  = DataBinder.Eval(e.Row.DataItem, "Batch_ID").ToString();
                string Test_id   = DataBinder.Eval(e.Row.DataItem, "Test_ID").ToString();
                string TimeStamp = DataBinder.Eval(e.Row.DataItem, "TimeStamp").ToString();


                Label Test_Name      = (Label)e.Row.FindControl("Test_Name");
                Label Batch_Name     = (Label)e.Row.FindControl("Batch_Name");
                Label Created_on     = (Label)e.Row.FindControl("Created_On");
                Label No_of_Question = (Label)e.Row.FindControl("No_of_Questions");

                if ((find.Batches(Batch_id).Rows.Count != 0) && (find.Test(Test_id).Rows.Count != 0))
                {
                    Test_Name.Text      = find.Test(Test_id).Rows[0]["Name"].ToString();
                    Batch_Name.Text     = find.Batches(Batch_id).Rows[0]["Title"].ToString();
                    Created_on.Text     = TimeStamp;
                    No_of_Question.Text = find.Test_Maker(Test_id).Rows.Count.ToString();
                }
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Student_ID() != "0")
     {
         Student_Name_box.Text = find.Students(Student_ID()).Rows[0]["Name"].ToString();
         Father_Name_box.Text  = find.Students(Student_ID()).Rows[0]["Father_Name"].ToString();
         Contact.Text          = secure.Decrypt(find.Students(Student_ID()).Rows[0]["Contact"].ToString(), "TSIE-GEHM-TAKUCF");
         Email.Text            = secure.Decrypt(find.Students(Student_ID()).Rows[0]["Email"].ToString(), "TSIE-GEHM-TAKUCF");
         Date_Of_Join.Text     = find.Students(Student_ID()).Rows[0]["Date_Of_Join"].ToString();
         Date_Of_Join.Enabled  = false;
         Institute.Text        = find.Students(Student_ID()).Rows[0]["Institute"].ToString();
         Institute.Enabled     = false;
         Date_Of_Birth.Text    = find.Students(Student_ID()).Rows[0]["Date_Of_Birth"].ToString();
         Batch.Text            = find.Batches(find.Students(Student_ID()).Rows[0]["Batch_ID"].ToString()).Rows[0]["Title"].ToString();
         Batch.Enabled         = false;
     }
 }
        void Load_Test(string id)
        {
            HttpCookie stdnt = new HttpCookie("student");

            if (stdnt != null)
            {
                Response.Cookies.Remove("student");
            }


            DataTable test_tbl         = find.Test(id);
            int       Question_ID_temp = Question_ID(id);

            if (test_tbl.Rows.Count != 0 && Question_ID_temp != 0 && find.Question(Question_ID_temp).Rows.Count != 0)
            {
                Test_Title.Text = test_tbl.Rows[0]["Name"].ToString();
                string question_title_temp = find.Question(Question_ID_temp).Rows[0]["Title"].ToString();
                Ques_Title.Text = question_title_temp;
                string question_text = find.Question(Question_ID_temp).Rows[0]["Text"].ToString();
                Ques_Text.Text   = secure.Decrypt(question_text, "1111-2222-123123");
                Batch_Title.Text = find.Batches(Batch_ID().ToString()).Rows.Count != 0 ? find.Batches(Batch_ID().ToString()).Rows[0]["Title"].ToString() : "Unkown Batch";

                string ques = secure.Decrypt(find.Question(Question_ID_temp).Rows[0]["Image"].ToString(), "4444-2222-123456");
                if (ques != null && ques != "")
                {
                    string img_file     = "Images/Question/" + ques;
                    string image_output = "<h5></h5><img src='" + img_file + "' style='width:100%;' />";
                    div_image_pnl.InnerHtml = image_output;
                }

                string aud = secure.Decrypt(find.Question(Question_ID_temp).Rows[0]["Audio"].ToString(), "4444-2222-123456");
                if (aud != null && aud != "")
                {
                    string adio_file    = "Audio/Question/" + aud;
                    string audio_output = "<audio controls><source src='" + adio_file + "' type='audio/mpeg'>Your browser does not support the audio element.</audio>";
                    div_audio_pnl.InnerHtml = audio_output;
                }


                Clock_Duration.InnerText = Get_Time(id) == "0" ? "Unlimited" : Get_Time(id);;

                Mcq_chk_boxs.Items.Clear();
                DataTable mcq_tbl = find.MCQs(Question_ID_temp.ToString());
                for (int i = 0; i < mcq_tbl.Rows.Count; i++)
                {
                    ListItem listItem = new ListItem();
                    listItem.Text  = secure.Decrypt(mcq_tbl.Rows[i]["MCQ"].ToString(), "1111-2222-123123");
                    listItem.Value = mcq_tbl.Rows[i]["MCQ_ID"].ToString();
                    Mcq_chk_boxs.Items.Add(listItem);
                }

                fill_up_panel.Controls.Clear();
                string fill_up_temp = secure.Decrypt(find.Question(Question_ID_temp).Rows[0]["Fill_Ups"].ToString(), "1111-2222-123123");
                string output       = "";
                int    idds         = 0;
                for (int i = 0; i < fill_up_temp.Length; i++)
                {
                    if (fill_up_temp[i] == '{' && fill_up_temp[i + 1] == 'F' && fill_up_temp[i + 2] == 'I' && fill_up_temp[i + 3] == 'L' && fill_up_temp[i + 4] == 'L' && fill_up_temp[i + 5] == 'U' && fill_up_temp[i + 6] == 'P' && fill_up_temp[i + 7] == '}')
                    {
                        Label label = new Label();
                        label.ID   = "label" + idds;
                        label.Text = output;
                        fill_up_panel.Controls.Add(label);

                        TextBox textBox = new TextBox();
                        textBox.ID = "Fill_up" + idds;
                        //textBox.Text = "Fill_Up" + idds;
                        textBox.Text         = "";
                        textBox.Load        += TextBox_Load;
                        textBox.TextChanged += TextBox_TextChanged;
                        textBox.Attributes.Add("Placeholder", "Fill Up");
                        textBox.CssClass = "fillboxclass";
                        //textBox.CssClass = "fillboxclass flup";
                        fill_up_panel.Controls.Add(textBox);
                        output = "";
                        i      = i + 7;
                        idds++;
                    }
                    else
                    {
                        output = output + fill_up_temp[i];
                    }

                    if (i == fill_up_temp.Length - 1)
                    {
                        Label label = new Label();
                        label.ID   = "label" + idds;
                        label.Text = output;
                        fill_up_panel.Controls.Add(label);
                    }
                }

                if (find.Question(Question_ID_temp).Rows[0]["Accept_Text"].ToString() != "1")
                {
                    text.Visible = false;
                }

                if (find.MCQs(Question_ID_temp).Rows.Count == 0)
                {
                    MCQs.Visible = false;
                }

                if (fill_up_temp.Length == 0)
                {
                    fillups.Visible = false;
                }

                if (find.Question(Question_ID_temp).Rows[0]["Audio_Ans"].ToString() != "1")
                {
                    ansAudio.Visible = false;
                }


                Student_Cookie(id);
            }
        }