/// <summary> /// To Get All Structure Type /// </summary> /// <returns></returns> public StructureTypeList GetAllStructureType() { //Get All Records from Structure Type proc = "USP_MST_GET_ALL_STRUCTURETYPE"; cnn = new OracleConnection(con); StructureTypeBO objStructureType = null; StructureTypeList lstStructureTypeList = new StructureTypeList(); cmd = new OracleCommand(proc, cnn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("Sp_recordset", OracleDbType.RefCursor).Direction = ParameterDirection.Output; try { cmd.Connection.Open(); OracleDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection); while (dr.Read()) { objStructureType = new StructureTypeBO(); if (ColumnExists(dr, "str_typeid") && !dr.IsDBNull(dr.GetOrdinal("str_typeid"))) { objStructureType.StructureTypeID = Convert.ToInt32(dr.GetValue(dr.GetOrdinal("str_typeid"))); } if (ColumnExists(dr, "str_type") && !dr.IsDBNull(dr.GetOrdinal("str_type"))) { objStructureType.StructureTypeName = dr.GetString(dr.GetOrdinal("str_type")); } if (ColumnExists(dr, "IsDeleted") && !dr.IsDBNull(dr.GetOrdinal("IsDeleted"))) { objStructureType.IsDeleted = dr.GetString(dr.GetOrdinal("IsDeleted")); } // objStructureType = MapData(dr); lstStructureTypeList.Add(objStructureType); } dr.Close(); } catch (Exception ex) { throw ex; } return(lstStructureTypeList); }
/// <summary> /// To Get Structure Type /// </summary> /// <returns></returns> public StructureTypeList GetStructureType() { // Get Only Active Structure Types proc = "USP_MST_GET_STRUCTURETYPE"; cnn = new OracleConnection(con); StructureTypeBO objStructureType = null; StructureTypeList lstStructureTypeList = new StructureTypeList(); cmd = new OracleCommand(proc, cnn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("Sp_recordset", OracleDbType.RefCursor).Direction = ParameterDirection.Output; try { cmd.Connection.Open(); OracleDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection); while (dr.Read()) { objStructureType = new StructureTypeBO(); objStructureType = MapData(dr); lstStructureTypeList.Add(objStructureType); } dr.Close(); } catch (Exception ex) { throw ex; } return(lstStructureTypeList); }