Example #1
0
        /// <summary>
        /// To Get Never Attended School By Id
        /// </summary>
        /// <param name="NASchoolID"></param>
        /// <returns></returns>
        public NeverAttendedSchoolBO GetNASchoolById(int NASchoolID)
        {
            OracleConnection cnn = new OracleConnection(AppConfiguration.ConnectionString);
            OracleCommand    cmd;

            string proc = "USP_MST_GETNASCHOOLDETAILSBYID";

            cmd             = new OracleCommand(proc, cnn);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("NVRATTSCHREASONID", NASchoolID);
            cmd.Parameters.Add("Sp_recordset", OracleDbType.RefCursor).Direction = ParameterDirection.Output;

            cmd.Connection.Open();

            OracleDataReader        dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);
            NeverAttendedSchoolBO   NeverAttendedSchoolBOObj = null;
            NeverAttendedSchoolList NASchoolList             = new NeverAttendedSchoolList();

            NeverAttendedSchoolBOObj = new NeverAttendedSchoolBO();
            while (dr.Read())
            {
                if (ColumnExists(dr, "NVR_ATT_SCH_REASON") && !dr.IsDBNull(dr.GetOrdinal("NVR_ATT_SCH_REASON")))
                {
                    NeverAttendedSchoolBOObj.NVR_ATT_SCH_REASON = dr.GetString(dr.GetOrdinal("NVR_ATT_SCH_REASON"));
                }
                if (ColumnExists(dr, "description") && !dr.IsDBNull(dr.GetOrdinal("description")))
                {
                    NeverAttendedSchoolBOObj.DESCRIPTION = Convert.ToString(dr.GetValue(dr.GetOrdinal("description")));
                }
            }
            dr.Close();


            return(NeverAttendedSchoolBOObj);
        }
Example #2
0
        //public List<NeverAttendedSchoolBO> FetchGridViewDetails()
        //{
        //    try
        //    {
        //        NeverAttendedSchoolBO NeverAttendedSchoolBOObj = new NeverAttendedSchoolBO();
        //        List<NeverAttendedSchoolBO> ListNASchoolList = new List<NeverAttendedSchoolBO>();

        //        //OracleConnection con = new OracleConnection(connStr);
        //        //con.Open();
        //        //OracleCommand cmd = new OracleCommand("USP_MST_GETNASCHOOLDETAILS", con);
        //        //cmd.CommandType = CommandType.StoredProcedure;
        //        //int count = Convert.ToInt32(cmd.CommandType);

        //        OracleConnection cnn = new OracleConnection(AppConfiguration.ConnectionString);
        //        OracleCommand cmd;

        //        string proc = " USP_MST_GETNASCHOOLDETAILS";

        //        cmd = new OracleCommand(proc, cnn);
        //        cmd.CommandType = CommandType.StoredProcedure;
        //        cmd.Parameters.Add("Sp_recordset", OracleDbType.RefCursor).Direction = ParameterDirection.Output;

        //        cmd.Connection.Open();

        //        OracleDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);



        //        while (dr.Read())
        //        {
        //            NeverAttendedSchoolBOObj.NVR_ATT_SCH_REASONID = Convert.ToInt32(dr.GetValue(dr.GetOrdinal("NVR_ATT_SCH_REASONID")));
        //            NeverAttendedSchoolBOObj.NVR_ATT_SCH_REASON = dr.GetString(dr.GetOrdinal("NVR_ATT_SCH_REASON"));
        //            NeverAttendedSchoolBOObj.DESCRIPTION = dr.GetString(dr.GetOrdinal("DESCRIPTION"));
        //            ListNASchoolList.Add(NeverAttendedSchoolBOObj);
        //        }

        //        dr.Close();

        //        return ListNASchoolList;
        //    }
        //    catch (Exception ex)
        //    {
        //        throw ex;
        //    }

        //}


        /// <summary>
        /// To Fetch Never Attended School
        /// </summary>
        /// <returns></returns>
        public NeverAttendedSchoolList FetchNeverAttendedSchool()
        {
            OracleConnection cnn = new OracleConnection(AppConfiguration.ConnectionString);
            OracleCommand    cmd;

            string proc = "USP_MST_GETNASCHOOLDETAILS";

            cmd             = new OracleCommand(proc, cnn);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("Sp_recordset", Oracle.DataAccess.Client.OracleDbType.RefCursor).Direction = ParameterDirection.Output;

            cmd.Connection.Open();
            OracleDataReader        dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);
            NeverAttendedSchoolBO   objNeverAttendedSchool  = null;
            NeverAttendedSchoolList NeverAttendedSchoollist = new NeverAttendedSchoolList();

            while (dr.Read())
            {
                objNeverAttendedSchool = new NeverAttendedSchoolBO();
                if (!dr.IsDBNull(dr.GetOrdinal("NVR_ATT_SCH_REASONID")))
                {
                    objNeverAttendedSchool.NVR_ATT_SCH_REASONID = Convert.ToInt32(dr.GetValue(dr.GetOrdinal("NVR_ATT_SCH_REASONID")));
                }
                if (!dr.IsDBNull(dr.GetOrdinal("NVR_ATT_SCH_REASON")))
                {
                    objNeverAttendedSchool.NVR_ATT_SCH_REASON = dr.GetString(dr.GetOrdinal("NVR_ATT_SCH_REASON"));
                }

                NeverAttendedSchoollist.Add(objNeverAttendedSchool);
            }

            dr.Close();

            return(NeverAttendedSchoollist);
        }