Ejemplo n.º 1
0
        /// <summary>
        /// To Get NPS
        /// </summary>
        /// <param name="householdID"></param>
        /// <returns></returns>
        public Non_perm_structureList GetNPS(int householdID)
        {
            OracleConnection cnn = new OracleConnection(AppConfiguration.ConnectionString);
            OracleCommand    cmd;

            string proc = "USP_TRN_SEL_NPS";

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

            NonPermanentStructureBO BOobj1 = null;
            Non_perm_structureList  Non_perm_structureListobj = new Non_perm_structureList();

            while (dr.Read())
            {
                BOobj1 = new NonPermanentStructureBO();
                BOobj1.NonPermanentStructureID = Convert.ToInt32(dr.GetValue(dr.GetOrdinal("NONPERM_STRUCTUREID")));
                BOobj1.STR_TYPE         = dr.GetString(dr.GetOrdinal("str_type"));
                BOobj1.STR_CATEGORYNAME = dr.GetString(dr.GetOrdinal("str_categoryname"));
                BOobj1.STR_CONDITION    = dr.GetString(dr.GetOrdinal("str_condition"));
                BOobj1.IsDeleted        = dr.GetString(dr.GetOrdinal("ISDELETED"));
                Non_perm_structureListobj.Add(BOobj1);
            }

            dr.Close();

            return(Non_perm_structureListobj);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// To Get Non Permanent Structure Id
        /// </summary>
        /// <param name="NonPermanentStructureID"></param>
        /// <returns></returns>
        public NonPermanentStructureBO GetNPSId(int NonPermanentStructureID)
        {
            OracleConnection cnn = new OracleConnection(AppConfiguration.ConnectionString);
            OracleCommand    cmd;

            string proc = "USP_TRN_GET_NPS";

            cmd             = new OracleCommand(proc, cnn);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("S_NONPERM_STRUCTUREID", NonPermanentStructureID);
            cmd.Parameters.Add("Sp_recordset", OracleDbType.RefCursor).Direction = ParameterDirection.Output;

            cmd.Connection.Open();

            OracleDataReader        dr     = cmd.ExecuteReader(CommandBehavior.CloseConnection);
            NonPermanentStructureBO BOobj1 = null;
            Non_perm_structureList  Non_perm_structureListobj = new Non_perm_structureList();

            BOobj1 = new NonPermanentStructureBO();
            while (dr.Read())
            {
                if (ColumnExists(dr, "nonperm_structureid") && !dr.IsDBNull(dr.GetOrdinal("nonperm_structureid")))
                {
                    BOobj1.NonPermanentStructureID = Convert.ToInt32(dr.GetValue(dr.GetOrdinal("nonperm_structureid")));
                }
                if (ColumnExists(dr, "str_typeid") && !dr.IsDBNull(dr.GetOrdinal("str_typeid")))
                {
                    BOobj1.StructureTypeID = dr.GetInt32(dr.GetOrdinal("str_typeid"));
                }
                if (ColumnExists(dr, "categoryid") && !dr.IsDBNull(dr.GetOrdinal("categoryid")))
                {
                    BOobj1.CategoryID = dr.GetInt32(dr.GetOrdinal("categoryid"));
                }
                if (ColumnExists(dr, "str_conditionid") && !dr.IsDBNull(dr.GetOrdinal("str_conditionid")))
                {
                    BOobj1.StructureConditionID = dr.GetInt32(dr.GetOrdinal("str_conditionid"));
                }
                if (ColumnExists(dr, "otherstructuretype") && !dr.IsDBNull(dr.GetOrdinal("otherstructuretype")))
                {
                    BOobj1.OtherStructureType = dr.GetString(dr.GetOrdinal("otherstructuretype"));
                }
                if (ColumnExists(dr, "owner") && !dr.IsDBNull(dr.GetOrdinal("owner")))
                {
                    BOobj1.Owner = dr.GetString(dr.GetOrdinal("owner"));
                }
                if (ColumnExists(dr, "ownername") && !dr.IsDBNull(dr.GetOrdinal("ownername")))
                {
                    BOobj1.OwnerName = dr.GetString(dr.GetOrdinal("ownername"));
                }
                if (ColumnExists(dr, "occupant") && !dr.IsDBNull(dr.GetOrdinal("occupant")))
                {
                    BOobj1.Occupant = dr.GetString(dr.GetOrdinal("occupant"));
                }
                if (ColumnExists(dr, "otheroccupantname") && !dr.IsDBNull(dr.GetOrdinal("otheroccupantname")))
                {
                    BOobj1.OtherOccupantName = dr.GetString(dr.GetOrdinal("otheroccupantname"));
                }

                if (ColumnExists(dr, "occupantstatusid") && !dr.IsDBNull(dr.GetOrdinal("occupantstatusid")))
                {
                    BOobj1.OccupantStatusID = dr.GetInt32(dr.GetOrdinal("occupantstatusid"));
                }

                if (ColumnExists(dr, "otheroccupantstatus") && !dr.IsDBNull(dr.GetOrdinal("otheroccupantstatus")))
                {
                    BOobj1.OtherOccupantStatus = dr.GetString(dr.GetOrdinal("otheroccupantstatus"));
                }

                if (!dr.IsDBNull(dr.GetOrdinal("dimen_length")))
                {
                    BOobj1.DimensionLength = Convert.ToDecimal(dr.GetValue(dr.GetOrdinal("dimen_length")));
                }

                if (!dr.IsDBNull(dr.GetOrdinal("dimen_width")))
                {
                    BOobj1.DimensionWidth = Convert.ToDecimal(dr.GetValue(dr.GetOrdinal("dimen_width")));
                }

                if (!dr.IsDBNull(dr.GetOrdinal("noofrooms")))
                {
                    BOobj1.NoOfRooms = Convert.ToInt32(dr.GetValue(dr.GetOrdinal("noofrooms")));
                }

                if (!dr.IsDBNull(dr.GetOrdinal("surfacearea")))
                {
                    BOobj1.SurfaceArea = Convert.ToDecimal(dr.GetValue(dr.GetOrdinal("surfacearea")));
                }
            }
            dr.Close();


            return(BOobj1);
        }