/// <summary> /// To GET ALL LivPlanItem /// </summary> /// <returns></returns> public LivPlanItemList GETALLLivPlanItem() { // used in Master page OracleConnection cnn = new OracleConnection(AppConfiguration.ConnectionString); OracleCommand cmd; string proc = " USP_MST_GETALLLivPlanItem"; cmd = new OracleCommand(proc, cnn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("Sp_recordset", OracleDbType.RefCursor).Direction = ParameterDirection.Output; cmd.Connection.Open(); OracleDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection); LivPlanItemBO objLivPlanItem = null; LivPlanItemList LivPlanItem = new LivPlanItemList(); while (dr.Read()) { objLivPlanItem = new LivPlanItemBO(); objLivPlanItem.LivPlanItemID = Convert.ToInt32(dr.GetValue(dr.GetOrdinal("LIV_REST_ITEMID"))); objLivPlanItem.LivPlanItemName = dr.GetString(dr.GetOrdinal("LIV_REST_ITEMNAME")); objLivPlanItem.Isdeleted = dr.GetString(dr.GetOrdinal("IsDeleted")); LivPlanItem.Add(objLivPlanItem); } dr.Close(); return(LivPlanItem); }
/// <summary> /// get the data based on ID /// </summary> /// <param name="LivPlanItemID"></param> /// <returns></returns> public LivPlanItemBO GetLivPlanItemById(int LivPlanItemID) { OracleConnection cnn = new OracleConnection(AppConfiguration.ConnectionString); OracleCommand cmd; string proc = "USP_MST_GETSELECTLivPlanItem"; cmd = new OracleCommand(proc, cnn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("LivPlanItemID_", LivPlanItemID); cmd.Parameters.Add("Sp_recordset", OracleDbType.RefCursor).Direction = ParameterDirection.Output; cmd.Connection.Open(); OracleDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection); LivPlanItemBO LivPlanItemObj = null; LivPlanItemList Users = new LivPlanItemList(); LivPlanItemObj = new LivPlanItemBO(); while (dr.Read()) { if (ColumnExists(dr, "LIV_REST_ITEMNAME") && !dr.IsDBNull(dr.GetOrdinal("LIV_REST_ITEMNAME"))) { LivPlanItemObj.LivPlanItemName = dr.GetString(dr.GetOrdinal("LIV_REST_ITEMNAME")); } if (ColumnExists(dr, "LIV_REST_ITEMID") && !dr.IsDBNull(dr.GetOrdinal("LIV_REST_ITEMID"))) { LivPlanItemObj.LivPlanItemID = Convert.ToInt32(dr.GetValue(dr.GetOrdinal("LIV_REST_ITEMID"))); } } dr.Close(); return(LivPlanItemObj); }