Example #1
0
        public OptionParameterMappingList GetOptionParameters(int Pid)
        {
            OracleConnection con = new OracleConnection(connStr);
            OracleCommand    cmd;
            string           proc = "USP_GET_PARAMETERS";

            cmd             = new OracleCommand(proc, con);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("OPTIONAVAILABLEID_", Pid);
            cmd.Parameters.Add("Sp_recordset", OracleDbType.RefCursor).Direction = ParameterDirection.Output;
            cmd.Connection.Open();
            OracleDataReader           dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);
            OptionParameterMappingBO   oOptionParameterBO = null;
            OptionParameterMappingList lstOptionGroup     = new OptionParameterMappingList();

            while (dr.Read())
            {
                oOptionParameterBO      = new OptionParameterMappingBO();
                oOptionParameterBO.ID   = (Convert.ToInt32(dr.GetValue(dr.GetOrdinal("PARAMETERID"))));
                oOptionParameterBO.Name = dr.GetValue(dr.GetOrdinal("PARAMETERNAME")).ToString();
                lstOptionGroup.Add(oOptionParameterBO);
            }

            dr.Close();
            return(lstOptionGroup);
        }
Example #2
0
        /// <summary>
        /// To Get All Option Parameter
        /// </summary>
        /// <param name="subcountyid"></param>
        /// <param name="countyid"></param>
        /// <param name="districtid"></param>
        /// <returns></returns>
        public OptionParameterMappingList GetAllOptionParameterMapping()
        {
            OptionParameterMappingList lstOptPrmMapping = null;

            using (cnn = new OracleConnection(connStr))
            {
                using (cmd = new OracleCommand("USP_GET_ALL_OPT_PRM_MAPPING", cnn))
                {
                    cmd.CommandType = CommandType.StoredProcedure;

                    //cmd.Parameters.Add("SUBCOUNTYID_", subcountyid);

                    cmd.Parameters.Add("Sp_recordset", OracleDbType.RefCursor).Direction = ParameterDirection.Output;
                    cmd.Connection.Open();

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

                    OptionParameterMappingBO optPrmMappingBO = null;
                    lstOptPrmMapping = new OptionParameterMappingList();

                    while (dr.Read())
                    {
                        optPrmMappingBO = new OptionParameterMappingBO();

                        optPrmMappingBO = Mapping(dr);
                        lstOptPrmMapping.Add(optPrmMappingBO);
                    }

                    dr.Close();
                }
            }

            return(lstOptPrmMapping);
        }