예제 #1
0
        /// <summary>
        /// To fetch details from database
        /// </summary>
        /// <returns></returns>
        public FenceList GetFencedescription( )

        {
            OracleConnection con = new OracleConnection(AppConfiguration.ConnectionString);
            OracleCommand    cmd;
            string           proc = "USP_TRN_GET_FENCEDATA";

            cmd             = new OracleCommand(proc, con);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("Sp_recordset", OracleDbType.RefCursor).Direction = ParameterDirection.Output;
            cmd.Connection.Open();
            OracleDataReader dr      = cmd.ExecuteReader(CommandBehavior.CloseConnection);
            FenceBO          BOobj   = null;
            FenceList        Listobj = new FenceList();

            while (dr.Read())
            {
                BOobj                  = new FenceBO();
                BOobj.Fenceid          = (Convert.ToInt32(dr.GetValue(dr.GetOrdinal("FENCEID"))));
                BOobj.Fencedescription = dr.GetValue(dr.GetOrdinal("FENCEDESCRIPTION")).ToString();

                Listobj.Add(BOobj);
            }

            dr.Close();
            return(Listobj);
        }
예제 #2
0
        /// <summary>
        /// To fetch details from database
        /// </summary>
        /// <param name="householdID"></param>
        /// <returns></returns>
        public FenceList GetFencedata(int householdID)
        {
            OracleConnection cnn = new OracleConnection(AppConfiguration.ConnectionString);
            OracleCommand    cmd;

            string proc = "USP_TRN_SEL_FENCE";

            cmd             = new OracleCommand(proc, cnn);
            cmd.CommandType = CommandType.StoredProcedure;

            cmd.Parameters.Add("HHID_", householdID);
            cmd.Parameters.Add("Sp_recordset", Oracle.DataAccess.Client.OracleDbType.RefCursor).Direction = ParameterDirection.Output;

            cmd.Connection.Open();

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

            FenceBO   FenceBOobj   = null;
            FenceList FenceListobj = new FenceList();

            while (dr.Read())
            {
                FenceBOobj                  = new FenceBO();
                FenceBOobj.Pap_fenceid      = Convert.ToInt32(dr.GetValue(dr.GetOrdinal("PAP_FENCEID")));
                FenceBOobj.Fencedescription = dr.GetString(dr.GetOrdinal("FENCEDESCRIPTION"));
                FenceBOobj.Fen_dimen_length = Convert.ToDecimal(dr.GetValue(dr.GetOrdinal("FEN_DIMEN_LENGTH")));
                FenceBOobj.Fen_dimen_height = Convert.ToDecimal(dr.GetValue(dr.GetOrdinal("FEN_DIMEN_HEIGHT")));
                FenceBOobj.Depreciatedvalue = Convert.ToDecimal(dr.GetValue(dr.GetOrdinal("DEPRECIATEDVALUE")));
                FenceBOobj.IsDeleted        = dr.GetString(dr.GetOrdinal("ISDELETED"));

                FenceListobj.Add(FenceBOobj);
            }

            dr.Close();

            return(FenceListobj);
        }