/// <summary> /// To Get Occupant status /// </summary> /// <returns></returns> public PermanentStructureList GetOccupantstatus() { OracleConnection con = new OracleConnection(AppConfiguration.ConnectionString); OracleCommand cmd; string proc = "USP_TRN_GET_OCCUPANTSTATUSDATA"; 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); PermanentStructureBO BOobj = null; PermanentStructureList Listobj = new PermanentStructureList(); while (dr.Read()) { BOobj = new PermanentStructureBO(); BOobj.OccupantStatusID = (Convert.ToInt32(dr.GetValue(dr.GetOrdinal("OCCUPANTSTATUSID")))); BOobj.OccupantStatus = dr.GetValue(dr.GetOrdinal("OCCUPANTSTATUS")).ToString(); Listobj.Add(BOobj); } dr.Close(); return(Listobj); }
/// <summary> /// To Get Permanent Structure /// </summary> /// <param name="hhid"></param> /// <returns></returns> public PermanentStructureList GetPermanentStructure(string hhid) { OracleConnection cnn = new OracleConnection(AppConfiguration.ConnectionString); OracleCommand cmd; string proc = "USP_TRN_SEL_PERMANST"; cmd = new OracleCommand(proc, cnn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("P_HHID", hhid); cmd.Parameters.Add("Sp_recordset", Oracle.DataAccess.Client.OracleDbType.RefCursor).Direction = ParameterDirection.Output; cmd.Connection.Open(); OracleDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection); PermanentStructureBO PermanentStructureobj = null; PermanentStructureList Listobj = new PermanentStructureList(); while (dr.Read()) { PermanentStructureobj = new PermanentStructureBO(); PermanentStructureobj.PermanentStructureID = Convert.ToInt32(dr.GetValue(dr.GetOrdinal("perm_structureid"))); if (!dr.IsDBNull(dr.GetOrdinal("str_type"))) { PermanentStructureobj.StructTypid = dr.GetString(dr.GetOrdinal("str_type")); } else { PermanentStructureobj.StructTypid = " "; } if (!dr.IsDBNull(dr.GetOrdinal("depreciatedvalue"))) { PermanentStructureobj.DepreciatedValue = dr.GetDecimal(dr.GetOrdinal("depreciatedvalue")); } else { PermanentStructureobj.DepreciatedValue = 0; } if (!dr.IsDBNull(dr.GetOrdinal("depreciatedvalue"))) { PermanentStructureobj.ReplacementValue = dr.GetDecimal(dr.GetOrdinal("replacementvalue")); } else { PermanentStructureobj.ReplacementValue = 0; } if (!dr.IsDBNull(dr.GetOrdinal("StructureType"))) { PermanentStructureobj.StructureType = dr.GetString(dr.GetOrdinal("StructureType")); } else { PermanentStructureobj.StructureType = ""; } // PermanentStructureobj.IsDeleted = dr.GetString(dr.GetOrdinal("isdeleted")); Listobj.Add(PermanentStructureobj); } dr.Close(); return(Listobj); }