public GraveList GetGraveFinish() { OracleConnection con = new OracleConnection(AppConfiguration.ConnectionString); OracleCommand cmd; string proc = "USP_TRN_GET_GRAVEDATA"; 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); GraveBO BOobj = null; GraveList Listobj = new GraveList(); while (dr.Read()) { BOobj = new GraveBO(); BOobj.Grv_finishid = (Convert.ToInt32(dr.GetValue(dr.GetOrdinal("GRV_FINISHID")))); BOobj.Grv_finishtype = dr.GetValue(dr.GetOrdinal("GRV_FINISHTYPE")).ToString(); Listobj.Add(BOobj); } dr.Close(); return(Listobj); }
/// <summary> /// to fetch details /// </summary> /// <param name="householdID"></param> /// <returns></returns> public GraveList GetGravedata(int householdID) { OracleConnection cnn = new OracleConnection(AppConfiguration.ConnectionString); OracleCommand cmd; string proc = "USP_TRN_SEL_GRAVE"; 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); GraveBO GraveBOobj = null; GraveList GraveListobj = new GraveList(); while (dr.Read()) { GraveBOobj = new GraveBO(); GraveBOobj.Pap_graveid = Convert.ToInt32(dr.GetValue(dr.GetOrdinal("PAP_GRAVEID"))); GraveBOobj.Grv_finishtype = dr.GetString(dr.GetOrdinal("GRV_FINISHTYPE")); GraveBOobj.Grv_dimen_length = Convert.ToDecimal(dr.GetValue(dr.GetOrdinal("GRV_DIMEN_LENGTH"))); GraveBOobj.Grv_dimen_width = Convert.ToDecimal(dr.GetValue(dr.GetOrdinal("GRV_DIMEN_WIDTH"))); GraveBOobj.Depreciatedvalue = Convert.ToDecimal(dr.GetValue(dr.GetOrdinal("DEPRECIATEDVALUE"))); GraveBOobj.IsDeleted = dr.GetString(dr.GetOrdinal("ISDELETED")); GraveListobj.Add(GraveBOobj); } dr.Close(); return(GraveListobj); }