예제 #1
0
        /// <summary>
        /// to fetch details
        /// </summary>
        /// <returns></returns>
        public LivelihoodRestoreItemsList GetLiveRestItems_All()
        {
            proc = "USP_MST_GET_LIV_REST_ITEMS_ALL";
            cnn  = new OracleConnection(con);
            LivelihoodRestoreItemsBO oLiveRestItemsBO;

            LivelihoodRestoreItemsList lstLiveRestItems = new LivelihoodRestoreItemsList();

            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())
                {
                    oLiveRestItemsBO = new LivelihoodRestoreItemsBO();

                    lstLiveRestItems.Add(MapData(dr));
                }

                dr.Close();
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(lstLiveRestItems);
        }
예제 #2
0
        /// <summary>
        /// to fetch details
        /// </summary>
        /// <returns></returns>
        public LivelihoodRestoreItemsList GetLiveRestItems()
        {
            proc = "USP_MST_GET_LIV_REST_ITEMS";
            cnn  = new OracleConnection(con);
            LivelihoodRestoreItemsBO oLiveRestItemsBO;

            LivelihoodRestoreItemsList lstLiveRestItems = new LivelihoodRestoreItemsList();

            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())
                {
                    oLiveRestItemsBO = new LivelihoodRestoreItemsBO();

                    //if (!dr.IsDBNull(dr.GetOrdinal("Liv_Rest_ItemID"))) oLiveRestItemsBO.Liv_Rest_ItemID = dr.GetInt32(dr.GetOrdinal("Liv_Rest_ItemID"));
                    //if (!dr.IsDBNull(dr.GetOrdinal("Liv_Rest_ItemName"))) oLiveRestItemsBO.Liv_Rest_ItemName = dr.GetString(dr.GetOrdinal("Liv_Rest_ItemName"));

                    ////if (!dr.IsDBNull(dr.GetOrdinal("IsDeleted"))) objBank.IsDeleted = dr.GetString(dr.GetOrdinal("IsDeleted"));

                    //lstLiveRestItems.Add(oLiveRestItemsBO);
                    lstLiveRestItems.Add(MapData(dr));
                }

                dr.Close();
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(lstLiveRestItems);
        }