예제 #1
0
        /// <summary>
        /// To Get Major shock
        /// </summary>
        /// <param name="householdID"></param>
        /// <returns></returns>
        public major_shockList GetMshock(int householdID)
        {
            OracleConnection cnn = new OracleConnection(AppConfiguration.ConnectionString);
            OracleCommand    cmd;

            string proc = "USP_TRN_SEL_SHOCK";

            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);

            MajorshockBO    Majorshockobj      = null;
            major_shockList major_shockListobj = new major_shockList();

            while (dr.Read())
            {
                Majorshockobj = new MajorshockBO();
                Majorshockobj.PAP_SHOCKID1      = Convert.ToInt32(dr.GetValue(dr.GetOrdinal("PAP_SHOCKID")));
                Majorshockobj.SHOCKEXPERIENCED1 = dr.GetString(dr.GetOrdinal("shockexperienced"));
                Majorshockobj.SUPPORTEDBY1      = dr.GetString(dr.GetOrdinal("supportedby"));
                Majorshockobj.COP_MECHANISM1    = dr.GetString(dr.GetOrdinal("cop_mechanism"));
                Majorshockobj.ISDELETED1        = dr.GetString(dr.GetOrdinal("ISDELETED"));
                major_shockListobj.Add(Majorshockobj);
            }

            dr.Close();

            return(major_shockListobj);
        }