Beispiel #1
0
    public static TMSExamDetails Get(System.Int64 edExamDetailsId)
    {
        DataSet        ds;
        Database       db;
        string         sqlCommand;
        DbCommand      dbCommand;
        TMSExamDetails instance;


        instance = new TMSExamDetails();

        db         = DatabaseFactory.CreateDatabase();
        sqlCommand = "[dbo].gspTMSExamDetails_SELECT";
        dbCommand  = db.GetStoredProcCommand(sqlCommand, edExamDetailsId);

        // Get results.
        ds = db.ExecuteDataSet(dbCommand);
        // Verification.
        if (ds == null || ds.Tables[0].Rows.Count == 0)
        {
            throw new ApplicationException("Could not get TMSExamDetails ID:" + edExamDetailsId.ToString() + " from Database.");
        }
        // Return results.
        ds.Tables[0].TableName = TABLE_NAME;

        instance.MapFrom(ds.Tables[0].Rows[0]);
        return(instance);
    }
Beispiel #2
0
    public static TMSExamDetails[] Search(System.Int64?edExamDetailsId, System.String edExamCode, System.Int64?edFacultyId, System.Int64?edFacultyLoginId, System.String edExamType, System.Int64?edUnitTestId, System.Int64?edSchoolId, System.Int64?edSchoolSubId, System.Int64?edSubjectId, System.Int64?edConductFacultyId, System.Int64?edDepartmentID, System.String edExtraDescription, System.String edClasstestTitle, System.String edExtra1, System.DateTime?edExamDate, System.String edStartTime, System.String edEndTime, System.String edExamFees, System.String edTotalMarks, System.String edPassingMarks, System.DateTime?edDate, System.Int32?edStatus, System.String edTitle, System.String edTitle1)
    {
        DataSet   ds;
        Database  db;
        string    sqlCommand;
        DbCommand dbCommand;


        db         = DatabaseFactory.CreateDatabase();
        sqlCommand = "[dbo].gspTMSExamDetails_SEARCH";
        dbCommand  = db.GetStoredProcCommand(sqlCommand, edExamDetailsId, edExamCode, edFacultyId, edFacultyLoginId, edExamType, edUnitTestId, edSchoolId, edSchoolSubId, edSubjectId, edConductFacultyId, edDepartmentID, edExtraDescription, edClasstestTitle, edExtra1, edExamDate, edStartTime, edEndTime, edExamFees, edTotalMarks, edPassingMarks, edDate, edStatus, edTitle, edTitle1);

        ds = db.ExecuteDataSet(dbCommand);
        ds.Tables[0].TableName = TABLE_NAME;
        return(TMSExamDetails.MapFrom(ds));
    }
Beispiel #3
0
    public static TMSExamDetails[] MapFrom(DataSet ds)
    {
        List <TMSExamDetails> objects;


        // Initialise Collection.
        objects = new List <TMSExamDetails>();

        // Validation.
        if (ds == null)
        {
            throw new ApplicationException("Cannot map to dataset null.");
        }
        else if (ds.Tables[TABLE_NAME].Rows.Count == 0)
        {
            return(objects.ToArray());
        }

        if (ds.Tables[TABLE_NAME] == null)
        {
            throw new ApplicationException("Cannot find table [dbo].[TMS_ExamDetails] in DataSet.");
        }

        if (ds.Tables[TABLE_NAME].Rows.Count < 1)
        {
            throw new ApplicationException("Table [dbo].[TMS_ExamDetails] is empty.");
        }

        // Map DataSet to Instance.
        foreach (DataRow dr in ds.Tables[TABLE_NAME].Rows)
        {
            TMSExamDetails instance = new TMSExamDetails();
            instance.MapFrom(dr);
            objects.Add(instance);
        }

        // Return collection.
        return(objects.ToArray());
    }
    public static TMSExamDetails[] MapFrom(DataSet ds)
    {
        List<TMSExamDetails> objects;

        // Initialise Collection.
        objects = new List<TMSExamDetails>();

        // Validation.
        if (ds == null)
        throw new ApplicationException("Cannot map to dataset null.");
        else if (ds.Tables[TABLE_NAME].Rows.Count == 0)
        return objects.ToArray();

        if (ds.Tables[TABLE_NAME] == null)
        throw new ApplicationException("Cannot find table [dbo].[TMS_ExamDetails] in DataSet.");

        if (ds.Tables[TABLE_NAME].Rows.Count < 1)
        throw new ApplicationException("Table [dbo].[TMS_ExamDetails] is empty.");

        // Map DataSet to Instance.
        foreach (DataRow dr in ds.Tables[TABLE_NAME].Rows)
        {
            TMSExamDetails instance = new TMSExamDetails();
            instance.MapFrom(dr);
            objects.Add(instance);
        }

        // Return collection.
        return objects.ToArray();
    }
    public static TMSExamDetails Get(System.Int64 edExamDetailsId)
    {
        DataSet ds;
        Database db;
        string sqlCommand;
        DbCommand dbCommand;
        TMSExamDetails instance;

        instance = new TMSExamDetails();

        db = DatabaseFactory.CreateDatabase();
        sqlCommand = "[dbo].gspTMSExamDetails_SELECT";
        dbCommand = db.GetStoredProcCommand(sqlCommand, edExamDetailsId);

        // Get results.
        ds = db.ExecuteDataSet(dbCommand);
        // Verification.
        if (ds == null || ds.Tables[0].Rows.Count == 0) throw new ApplicationException("Could not get TMSExamDetails ID:" + edExamDetailsId.ToString()+ " from Database.");
        // Return results.
        ds.Tables[0].TableName = TABLE_NAME;

        instance.MapFrom( ds.Tables[0].Rows[0] );
        return instance;
    }