Exemple #1
0
 public static STD_Exam GetSTD_ExamByExamID(int ExamID)
 {
     STD_Exam sTD_Exam = new STD_Exam();
     SqlSTD_ExamProvider sqlSTD_ExamProvider = new SqlSTD_ExamProvider();
     sTD_Exam = sqlSTD_ExamProvider.GetSTD_ExamByExamID(ExamID);
     return sTD_Exam;
 }
Exemple #2
0
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        try
        {
            STD_Exam sTD_Exam = new STD_Exam();
            //	sTD_Exam.ExamID=  int.Parse(ddlExamID.SelectedValue);
            sTD_Exam.ExamName = "Exam Of" + " " + ddlSubjectID.SelectedItem.Text + " " + "for" + " " + ddlClassID.SelectedItem.Text;
            sTD_Exam.Description = txtDescription.Text;
            sTD_Exam.ClassSubjectID = int.Parse(ddlSubjectID.SelectedValue);
            sTD_Exam.ExamTypeID = int.Parse(ddlExamTypeID.SelectedValue);
            sTD_Exam.TotalMarks = 0;
            sTD_Exam.ExtraField1 = "";
            sTD_Exam.ExtraField2 = "";
            sTD_Exam.ExtraField3 = "";
            sTD_Exam.ExtraField4 = "";
            sTD_Exam.ExtraField5 = "";
            sTD_Exam.AddedBy = "530038e1-cf38-4ddb-84a4-99b6974b4f9d";
            sTD_Exam.AddedDate = DateTime.Now;
            sTD_Exam.UpdatedBy = "530038e1-cf38-4ddb-84a4-99b6974b4f9d";
            sTD_Exam.UpdatedDate = DateTime.Now;
            sTD_Exam.RowStatusID = 1;
            int resutl = STD_ExamManager.InsertSTD_Exam(sTD_Exam);
            Response.Redirect("AdminDisplaySTD_Exam.aspx");
        }

        catch(Exception ex)
        {
        }
    }
Exemple #3
0
 public static STD_Exam GetSTD_ClassSubjectByClassSubjectID(int ClassSubjectID)
 {
     STD_Exam sTD_Exam = new STD_Exam();
     SqlSTD_ExamProvider sqlSTD_ExamProvider = new SqlSTD_ExamProvider();
     sTD_Exam = sqlSTD_ExamProvider.GetSTD_ExamByClassSubjectID(ClassSubjectID);
     return sTD_Exam;
 }
Exemple #4
0
    private void showSTD_ExamData()
    {
        try
        {
            STD_Exam sTD_Exam = new STD_Exam();
            sTD_Exam = STD_ExamManager.GetSTD_ExamByExamID(Int32.Parse(Request.QueryString["ID"]));

            STD_ClassSubject classSubject = STD_ClassSubjectManager.GetSTD_ClassSubjectByClassSubjectID(sTD_Exam.ClassSubjectID);

            txtDescription.Text = sTD_Exam.Description.ToString();

            ddlExamTypeID.SelectedValue = sTD_Exam.ExamTypeID.ToString();

            ddlClassID.SelectedValue = classSubject.ClassID.ToString();
            ddlSubjectID.SelectedValue = classSubject.ClassSubjectID.ToString();
            ddlSubjectID.SelectedItem.Text = classSubject.SubjectName;
        }
        catch (Exception ex)
        {
        }
    }
Exemple #5
0
    public bool UpdateSTD_Exam(STD_Exam sTD_Exam)
    {
        using (SqlConnection connection = new SqlConnection(this.ConnectionString))
        {
            SqlCommand cmd = new SqlCommand("UpdateSTD_Exam", connection);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@ExamID", SqlDbType.Int).Value = sTD_Exam.ExamID;
            cmd.Parameters.Add("@ExamName", SqlDbType.NVarChar).Value = sTD_Exam.ExamName;
            cmd.Parameters.Add("@Description", SqlDbType.NText).Value = sTD_Exam.Description;
            cmd.Parameters.Add("@ClassSubjectID", SqlDbType.Int).Value = sTD_Exam.ClassSubjectID;
            cmd.Parameters.Add("@ExamTypeID", SqlDbType.Int).Value = sTD_Exam.ExamTypeID;
            cmd.Parameters.Add("@TotalMarks", SqlDbType.Decimal).Value = sTD_Exam.TotalMarks;
            cmd.Parameters.Add("@ExtraField1", SqlDbType.NVarChar).Value = sTD_Exam.ExtraField1;
            cmd.Parameters.Add("@ExtraField2", SqlDbType.NVarChar).Value = sTD_Exam.ExtraField2;
            cmd.Parameters.Add("@ExtraField3", SqlDbType.NVarChar).Value = sTD_Exam.ExtraField3;
            cmd.Parameters.Add("@ExtraField4", SqlDbType.NVarChar).Value = sTD_Exam.ExtraField4;
            cmd.Parameters.Add("@ExtraField5", SqlDbType.NVarChar).Value = sTD_Exam.ExtraField5;
            cmd.Parameters.Add("@UpdatedBy", SqlDbType.NVarChar).Value = sTD_Exam.UpdatedBy;
            cmd.Parameters.Add("@UpdatedDate", SqlDbType.DateTime).Value = sTD_Exam.UpdatedDate;
            cmd.Parameters.Add("@RowStatusID", SqlDbType.Int).Value = sTD_Exam.RowStatusID;
            connection.Open();

            int result = cmd.ExecuteNonQuery();
            return result == 1;
        }
    }
Exemple #6
0
    public STD_Exam GetSTD_ExamFromReader(IDataReader reader)
    {
        try
        {
            STD_Exam sTD_Exam = new STD_Exam
                (

                     DataAccessObject.IsNULL<int>(reader["ExamID"]),
                     DataAccessObject.IsNULL<string>(reader["ExamName"]),
                     DataAccessObject.IsNULL<string>(reader["Description"]),
                     DataAccessObject.IsNULL<int>(reader["ClassSubjectID"]),
                     DataAccessObject.IsNULL<int>(reader["ExamTypeID"]),
                     DataAccessObject.IsNULL<Decimal>(reader["TotalMarks"]),
                     DataAccessObject.IsNULL<string>(reader["ExtraField1"]),
                     DataAccessObject.IsNULL<string>(reader["ExtraField2"]),
                     DataAccessObject.IsNULL<string>(reader["ExtraField3"]),
                     DataAccessObject.IsNULL<string>(reader["ExtraField4"]),
                     DataAccessObject.IsNULL<string>(reader["ExtraField5"]),
                     DataAccessObject.IsNULL<string>(reader["AddedBy"].ToString()),
                     DataAccessObject.IsNULL<DateTime>(reader["AddedDate"]),
                     DataAccessObject.IsNULL<string>(reader["UpdatedBy"].ToString()),
                     DataAccessObject.IsNULL<DateTime>(reader["UpdatedDate"]),
                     DataAccessObject.IsNULL<int>(reader["RowStatusID"])
                );
             return sTD_Exam;
        }
        catch(Exception ex)
        {
            return null;
        }
    }
Exemple #7
0
 public static STD_Exam GetSTD_RowStatusByRowStatusID(int RowStatusID)
 {
     STD_Exam sTD_Exam = new STD_Exam();
     SqlSTD_ExamProvider sqlSTD_ExamProvider = new SqlSTD_ExamProvider();
     sTD_Exam = sqlSTD_ExamProvider.GetSTD_ExamByRowStatusID(RowStatusID);
     return sTD_Exam;
 }
Exemple #8
0
 public static bool UpdateSTD_Exam(STD_Exam sTD_Exam)
 {
     SqlSTD_ExamProvider sqlSTD_ExamProvider = new SqlSTD_ExamProvider();
     return sqlSTD_ExamProvider.UpdateSTD_Exam(sTD_Exam);
 }
Exemple #9
0
 public static int InsertSTD_Exam(STD_Exam sTD_Exam)
 {
     SqlSTD_ExamProvider sqlSTD_ExamProvider = new SqlSTD_ExamProvider();
     return sqlSTD_ExamProvider.InsertSTD_Exam(sTD_Exam);
 }