コード例 #1
0
        /// <summary>
        /// To fetch details from database
        /// </summary>
        /// <returns></returns>
        public CulturePropertiesList GetCulturalPropertyType()
        {
            OracleConnection con = new OracleConnection(AppConfiguration.ConnectionString);
            OracleCommand    cmd;
            string           proc = "USP_TRN_GET_NAME_CULTURPROP";

            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);
            CulturPropertiesBO    BOobj   = null;
            CulturePropertiesList Listobj = new CulturePropertiesList();

            while (dr.Read())
            {
                BOobj = new CulturPropertiesBO();
                BOobj.CULTUREPROPTYPEID = (Convert.ToInt32(dr.GetValue(dr.GetOrdinal("CULTUREPROPTYPEID"))));
                BOobj.CULTUREPROPTYP    = dr.GetValue(dr.GetOrdinal("CULTUREPROPTYPE")).ToString();

                Listobj.Add(BOobj);
            }

            dr.Close();
            return(Listobj);
        }
コード例 #2
0
        /// <summary>
        /// To fetch details from database
        /// </summary>
        /// <param name="householdID"></param>
        /// <returns></returns>
        public CulturePropertiesList GetCultureProp(int householdID)
        {
            OracleConnection cnn = new OracleConnection(AppConfiguration.ConnectionString);
            OracleCommand    cmd;

            string proc = "USP_TRN_SEL_CULTURPROP";

            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);
            CulturPropertiesBO    CulturPropertiesobj = null;
            CulturePropertiesList Listobj             = new CulturePropertiesList();

            while (dr.Read())
            {
                CulturPropertiesobj = new CulturPropertiesBO();


                CulturPropertiesobj.CULTURALPROPID = Convert.ToInt32(dr.GetValue(dr.GetOrdinal("culturalpropid")));
                if (!dr.IsDBNull(dr.GetOrdinal("cultureproptype")))
                {
                    CulturPropertiesobj.CULTUREPROPTYP = dr.GetString(dr.GetOrdinal("cultureproptype"));
                }

                if (!dr.IsDBNull(dr.GetOrdinal("culturepropdescription")))
                {
                    CulturPropertiesobj.CULTUREPROPDESCRIPTION = dr.GetString(dr.GetOrdinal("culturepropdescription"));
                }
                else
                {
                    CulturPropertiesobj.CULTUREPROPDESCRIPTION = " ";
                }
                CulturPropertiesobj.CULT_VALUATIONAMOUNT = Convert.ToDecimal(dr.GetValue(dr.GetOrdinal("cult_valuationamount")));
                Listobj.Add(CulturPropertiesobj);
            }

            dr.Close();

            return(Listobj);
        }