コード例 #1
0
    public List <BLLQuizSetting> SelectQuiz(BLLQuizSetting objbll)
    {
        List <BLLQuizSetting> objlist = new List <BLLQuizSetting>();

        SqlParameter[] param = new SqlParameter[1];

        param[0]       = new SqlParameter("@course_code", SqlDbType.NVarChar);
        param[0].Value = objbll.Course_code;

        SqlDataReader dr;

        objcon.OpenConnection();
        dr = objcon.sqlcmdSelectByMultimoreprogram("sp_selectquizsetting", param);
        while (dr.Read())
        {
            objbll                 = new BLLQuizSetting();
            objbll.Id              = Convert.ToInt32(dr["id"].ToString());
            objbll.Quiz_name       = dr["quiz_name"].ToString();
            objbll.Quiz_type       = dr["quiz_type"].ToString();
            objbll.Quiz_start_date = Convert.ToDateTime(dr["quiz_start_date"].ToString());
            objbll.Quiz_end_date   = Convert.ToDateTime(dr["quiz_end_date"].ToString());
            objbll.Quiz_status     = Convert.ToBoolean(dr["quiz_status"].ToString());
            objbll.Topic           = dr["topic"].ToString();
            objbll.Quiz_level      = dr["quiz_level"].ToString();
            objlist.Add(objbll);
        }
        objcon.CloseConnection();
        return(objlist);
    }
コード例 #2
0
    public List <BLLQuizSetting> Selectsubjectiveanswer(BLLQuizSetting objbll)
    {
        List <BLLQuizSetting> objlist = new List <BLLQuizSetting>();

        SqlParameter[] param = new SqlParameter[1];

        param[0]       = new SqlParameter("@course_code", SqlDbType.NVarChar);
        param[0].Value = objbll.Course_code;

        SqlDataReader dr;

        objcon.OpenConnection();
        dr = objcon.sqlcmdSelectByMultimoreprogram("sp_selectsubjectiveanswer", param);
        while (dr.Read())
        {
            objbll                = new BLLQuizSetting();
            objbll.Id             = Convert.ToInt32(dr["id"].ToString());
            objbll.Rollno         = dr["rollno"].ToString();
            objbll.Course_code    = dr["course_code"].ToString();
            objbll.Quiz_name      = dr["quiz_name"].ToString();
            objbll.Quiz_level     = dr["question_id"].ToString();
            objbll.Question       = dr["question"].ToString();
            objbll.Correct_answer = dr["correct_answer"].ToString();
            objlist.Add(objbll);
        }
        objcon.CloseConnection();
        return(objlist);
    }
コード例 #3
0
    public int InsertQuizAnswerSubjective(BLLQuizSetting objbll)
    {
        SqlParameter[] param = new SqlParameter[7];

        param[0]       = new SqlParameter("@rollno", SqlDbType.NVarChar);
        param[0].Value = objbll.Rollno;

        param[1]       = new SqlParameter("@course_code", SqlDbType.NVarChar);
        param[1].Value = objbll.Course_code;

        param[2]       = new SqlParameter("@quiz_name", SqlDbType.NVarChar);
        param[2].Value = objbll.Quiz_name;

        param[3]       = new SqlParameter("@question_id", SqlDbType.NVarChar);
        param[3].Value = objbll.Id;

        param[4]       = new SqlParameter("@question", SqlDbType.NVarChar);
        param[4].Value = objbll.Question;

        param[5]       = new SqlParameter("@correct_answer", SqlDbType.NVarChar);
        param[5].Value = objbll.Correct_answer;

        param[6]       = new SqlParameter("@Insert_Date", SqlDbType.DateTime);
        param[6].Value = objbll.Insert_date;

        objcon.OpenConnection();
        int a = objcon.sqlcmdInsert("sp_insertquizanswersubjective", param);

        objcon.CloseConnection();
        return(a);
    }
コード例 #4
0
    public List <BLLQuizSetting> SelectQuizNameSubjectiveforCheck(BLLQuizSetting objbll)
    {
        List <BLLQuizSetting> objlist = new List <BLLQuizSetting>();

        SqlParameter[] param = new SqlParameter[3];

        param[0]       = new SqlParameter("@rollno", SqlDbType.NVarChar);
        param[0].Value = objbll.Rollno;

        param[1]       = new SqlParameter("@course_code", SqlDbType.NVarChar);
        param[1].Value = objbll.Course_code;

        param[2]       = new SqlParameter("@quiz_name", SqlDbType.NVarChar);
        param[2].Value = objbll.Quiz_name;

        SqlDataReader dr;

        objcon.OpenConnection();
        dr = objcon.sqlcmdSelectByMultimoreprogram("sp_selectquiznamesubjectiveforcheck", param);
        while (dr.Read())
        {
            objbll           = new BLLQuizSetting();
            objbll.Quiz_name = dr["quiz_name"].ToString();
            objlist.Add(objbll);
        }
        objcon.CloseConnection();
        return(objlist);
    }
コード例 #5
0
    public void InsertQuizSetting()
    {
        BLLQuizSetting objbll = new BLLQuizSetting();

        objbll.Course_code    = txtcoursecode.Text;
        objbll.Course_title   = txtcoursetitle.Text;
        objbll.Quiz_name      = txtquizname.Text;
        objbll.No_of_question = txtnoofquestion.Text;
        objbll.Total_marks    = txttotalmarks.Text;
        objbll.Passing_marks  = txtpassingmarks.Text;
        objbll.Quiz_time      = txtquiztime.Text;
        string value = cbquiztype.SelectedItem.ToString();

        if (value == "Objective")
        {
            objbll.Quiz_type = value;
            string val = cbquizlevel.SelectedItem.ToString();
            if (val == "Topic base")
            {
                objbll.Quiz_level = val;
                objbll.Topic      = txttopic.Text;
            }
            else
            {
                objbll.Quiz_level = val;
                objbll.Topic      = "All Topicss";
            }
        }
        else
        {
            objbll.Quiz_type = value;
            string val = cbquizlevel.SelectedItem.ToString();
            if (val == "Topic base")
            {
                objbll.Quiz_level = val;
                objbll.Topic      = txttopic.Text;
            }
            else
            {
                objbll.Quiz_level = val;
                objbll.Topic      = "All Topicss";
            }
        }
        objbll.Quiz_start_date = Convert.ToDateTime(dtquizstart.Text);
        objbll.Quiz_end_date   = Convert.ToDateTime(dtquizend.Text);
        objbll.Createdby       = user;
        objbll.Modifiedby      = user;
        int a = objbll.InsertQuizSetting(objbll);

        if (a == 1)
        {
            lblresult.Text  = "Quiz Setting save Successfully";
            BtnSave.Enabled = false;
            BtnNew.Enabled  = true;
        }
    }
コード例 #6
0
    public void LoadGrid()
    {
        BLLQuizSetting objbll = new BLLQuizSetting();

        objbll.Course_code = txtcoursecode.Text;
        List <BLLQuizSetting> objlist = new List <BLLQuizSetting>();

        objlist = objbll.SelectQuiz(objbll);
        if (objlist.Count > 0)
        {
            dgquiz.DataSource = objlist;
            dgquiz.DataBind();

            for (int i = 0; i <= dgquiz.Rows.Count - 1; i++)
            {
                DateTime currentdate = System.DateTime.Now;
                DateTime start_date  = objlist[i].Quiz_start_date;
                DateTime end_date    = objlist[i].Quiz_end_date;

                string quiz_name = objlist[i].Quiz_name;
                string status    = Convert.ToString(objlist[i].Quiz_status);

                int a = DateTime.Compare(currentdate, start_date);
                int b = DateTime.Compare(end_date, currentdate);

                CheckQuizName(quiz_name);
                CheckQuizNameSubjective(quiz_name);

                if (namequiz == quiz_name)
                {
                    dgquiz.Rows[i].Cells[1].Enabled = false;
                }
                else
                if (status == "True")
                {
                    dgquiz.Rows[i].Cells[1].Enabled = false;
                }
                else
                if (a == 1 && b == -1)
                {
                    dgquiz.Rows[i].Cells[1].Enabled = true;
                }
                else
                if (a == 1 && b == 1)
                {
                    dgquiz.Rows[i].Cells[1].Enabled = true;
                }
                else
                {
                    dgquiz.Rows[i].Cells[1].Enabled = false;
                }
            }
        }
    }
コード例 #7
0
    public void InsertQuizAnswer()
    {
        BLLQuizSetting objbll = new BLLQuizSetting();

        objbll.Rollno         = user;
        objbll.Course_code    = lblcoursecode.Text;
        objbll.Quiz_name      = lblquizname.Text;
        objbll.Id             = Convert.ToInt32(lblno.Text);
        objbll.Question       = lblQuestionNumber.Text;
        objbll.Correct_answer = txtanswer.Text;
        int d = objbll.InsertQuizAnswerSubjective(objbll);
    }
コード例 #8
0
    public void LoadQuizzes()
    {
        BLLQuizSetting objbll = new BLLQuizSetting();

        objbll.Course_code = cbcourses.SelectedItem.Value.ToString();
        List <BLLQuizSetting> objlist = new List <BLLQuizSetting>();

        objlist = objbll.Selectsubjectiveanswer(objbll);
        if (objlist.Count > 0)
        {
            dgquiz.DataSource = objlist;
            dgquiz.DataBind();
        }
    }
コード例 #9
0
    public void LoadQuizName()
    {
        BLLQuizSetting objbll = new BLLQuizSetting();

        objbll.Course_code = cbcourses.SelectedItem.ToString();
        List <BLLQuizSetting> objlist = new List <BLLQuizSetting>();

        objlist = objbll.SelectQuizNamebycode(objbll);
        if (objlist.Count > 0)
        {
            cbname.DataSource = objlist;
            cbname.ValueField = "quiz_name";
            cbname.TextField  = "quiz_name";
            cbname.DataBind();
        }
    }
コード例 #10
0
    public string CheckQuizName(string quiz)
    {
        BLLQuizSetting objbll = new BLLQuizSetting();

        objbll.Rollno      = user;
        objbll.Course_code = txtcoursecode.Text;
        objbll.Quiz_name   = quiz;
        List <BLLQuizSetting> objlist = new List <BLLQuizSetting>();

        objlist = objbll.SelectQuizNameforCheck(objbll);
        if (objlist.Count > 0)
        {
            namequiz = objlist[0].Quiz_name;
        }
        return(namequiz);
    }
コード例 #11
0
    public void LoadHeader()
    {
        BLLQuizSetting objbll = new BLLQuizSetting();

        objbll.Id = Convert.ToInt32(id);
        List <BLLQuizSetting> objlist = new List <BLLQuizSetting>();

        objlist = objbll.SelecttakeQuiz(objbll);
        if (objlist.Count > 0)
        {
            lblcoursecode.Text   = objlist[0].Course_code;
            lblcoursetitle.Text  = objlist[0].Course_title;
            lblquizname.Text     = objlist[0].Quiz_name;
            lbltotalmarks.Text   = objlist[0].Total_marks;
            lblpassingmarks.Text = objlist[0].Passing_marks;
            lblquiztype.Text     = objlist[0].Quiz_type;
            lblquizlevel.Text    = objlist[0].Quiz_level;
            time           = Convert.ToInt32(objlist[0].Quiz_time);
            no_of_question = Convert.ToInt32(objlist[0].No_of_question);
        }
    }
コード例 #12
0
    public List <BLLQuizSetting> SelecttakeQuiz(BLLQuizSetting objbll)
    {
        List <BLLQuizSetting> objlist = new List <BLLQuizSetting>();

        SqlParameter[] param = new SqlParameter[1];

        param[0]       = new SqlParameter("@id", SqlDbType.Int);
        param[0].Value = objbll.Id;

        SqlDataReader dr;

        objcon.OpenConnection();
        dr = objcon.sqlcmdSelectByMultimoreprogram("sp_selecttakequiz", param);
        while (dr.Read())
        {
            objbll                 = new BLLQuizSetting();
            objbll.Id              = Convert.ToInt32(dr["id"].ToString());
            objbll.Course_code     = dr["course_code"].ToString();
            objbll.Course_title    = dr["course_title"].ToString();
            objbll.Quiz_name       = dr["quiz_name"].ToString();
            objbll.No_of_question  = dr["no_of_question"].ToString();
            objbll.Total_marks     = dr["total_marks"].ToString();
            objbll.Passing_marks   = dr["passing_marks"].ToString();
            objbll.Quiz_time       = dr["quiz_time"].ToString();
            objbll.Quiz_type       = dr["quiz_type"].ToString();
            objbll.Quiz_start_date = Convert.ToDateTime(dr["quiz_start_date"].ToString());
            objbll.Quiz_end_date   = Convert.ToDateTime(dr["quiz_end_date"].ToString());
            objbll.Status          = Convert.ToBoolean(dr["status"].ToString());
            objbll.Createdby       = dr["createdby"].ToString();
            objbll.Modifiedby      = dr["modifiedby"].ToString();
            objbll.Insert_date     = Convert.ToDateTime(dr["insert_date"].ToString());
            objbll.Update_date     = Convert.ToDateTime(dr["update_date"].ToString());
            objbll.Topic           = dr["topic"].ToString();
            objbll.Quiz_level      = dr["quiz_level"].ToString();
            objbll.Quiz_status     = Convert.ToBoolean(dr["quiz_status"].ToString());
            objlist.Add(objbll);
        }
        objcon.CloseConnection();
        return(objlist);
    }
コード例 #13
0
    public int InsertQuizSetting(BLLQuizSetting objbll)
    {
        DALQuizSetting objdal = new DALQuizSetting();

        return(objdal.InsertQuizSetting(objbll));
    }
コード例 #14
0
    public int InsertQuizAnswerSubjective(BLLQuizSetting objbll)
    {
        DALQuizSetting objdal = new DALQuizSetting();

        return(objdal.InsertQuizAnswerSubjective(objbll));
    }
コード例 #15
0
    public List <BLLQuizSetting> SelecttakeQuiz(BLLQuizSetting objbll)
    {
        DALQuizSetting objdal = new DALQuizSetting();

        return(objdal.SelecttakeQuiz(objbll));
    }
コード例 #16
0
    public List <BLLQuizSetting> SelectQuizNamebycode(BLLQuizSetting objbll)
    {
        DALQuizSetting objdal = new DALQuizSetting();

        return(objdal.SelectQuizNamebycode(objbll));
    }
コード例 #17
0
    public int InsertQuizSetting(BLLQuizSetting objbll)
    {
        SqlParameter[] param = new SqlParameter[18];

        param[0]       = new SqlParameter("@course_code", SqlDbType.NVarChar);
        param[0].Value = objbll.Course_code;

        param[1]       = new SqlParameter("@course_title", SqlDbType.NVarChar);
        param[1].Value = objbll.Course_title;

        param[2]       = new SqlParameter("@quiz_name", SqlDbType.NVarChar);
        param[2].Value = objbll.Quiz_name;

        param[3]       = new SqlParameter("@no_of_question", SqlDbType.NVarChar);
        param[3].Value = objbll.No_of_question;

        param[4]       = new SqlParameter("@total_marks", SqlDbType.NVarChar);
        param[4].Value = objbll.Total_marks;

        param[5]       = new SqlParameter("@passing_marks", SqlDbType.NVarChar);
        param[5].Value = objbll.Passing_marks;

        param[6]       = new SqlParameter("@quiz_time", SqlDbType.NVarChar);
        param[6].Value = objbll.Quiz_time;

        param[7]       = new SqlParameter("@quiz_type", SqlDbType.NVarChar);
        param[7].Value = objbll.Quiz_type;

        param[8]       = new SqlParameter("@quiz_start_date", SqlDbType.NVarChar);
        param[8].Value = objbll.Quiz_start_date;

        param[9]       = new SqlParameter("@quiz_end_date", SqlDbType.NVarChar);
        param[9].Value = objbll.Quiz_end_date;

        param[10]       = new SqlParameter("@status", SqlDbType.Bit);
        param[10].Value = objbll.Status;

        param[11]       = new SqlParameter("@createdby", SqlDbType.NVarChar);
        param[11].Value = objbll.Createdby;

        param[12]       = new SqlParameter("@modifiedby ", SqlDbType.NVarChar);
        param[12].Value = objbll.Modifiedby;

        param[13]       = new SqlParameter("@Insert_Date", SqlDbType.DateTime);
        param[13].Value = objbll.Insert_date;

        param[14]       = new SqlParameter("@Update_Date", SqlDbType.DateTime);
        param[14].Value = objbll.Update_date;

        param[15]       = new SqlParameter("@topic", SqlDbType.NVarChar);
        param[15].Value = objbll.Topic;

        param[16]       = new SqlParameter("@quiz_level", SqlDbType.NVarChar);
        param[16].Value = objbll.Quiz_level;

        param[17]       = new SqlParameter("@quiz_status", SqlDbType.Bit);
        param[17].Value = objbll.Quiz_status;

        objcon.OpenConnection();
        int a = objcon.sqlcmdInsert("sp_insertquizsetting", param);

        objcon.CloseConnection();
        return(a);
    }
コード例 #18
0
    public List <BLLQuizSetting> SelectQuizNameSubjectiveforCheck(BLLQuizSetting objbll)
    {
        DALQuizSetting objdal = new DALQuizSetting();

        return(objdal.SelectQuizNameSubjectiveforCheck(objbll));
    }
コード例 #19
0
    public List <BLLQuizSetting> Selectsubjectiveanswer(BLLQuizSetting objbll)
    {
        DALQuizSetting objdal = new DALQuizSetting();

        return(objdal.Selectsubjectiveanswer(objbll));
    }