/// <summary> /// to fetch details /// </summary> /// <returns></returns> public GOUAllowanceList GetAllSchoolGOUAllowance() { OracleConnection cnn = new OracleConnection(AppConfiguration.ConnectionString); OracleCommand cmd; string proc = "USP_MST_GETALL_GOUALLOWANC"; 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); GOUAllowanceBO objUser = null; GOUAllowanceList ReasonList = new GOUAllowanceList(); while (dr.Read()) { objUser = new GOUAllowanceBO(); if (!dr.IsDBNull(dr.GetOrdinal("GOUALLOWANCECATEGORYID"))) { objUser.GOUALLOWANCECATEGORYID = Convert.ToInt32(dr.GetValue(dr.GetOrdinal("GOUALLOWANCECATEGORYID"))); } if (!dr.IsDBNull(dr.GetOrdinal("GOUALLOWANCECATEGORY"))) { objUser.GOUAllowanceCategory = dr.GetString(dr.GetOrdinal("GOUALLOWANCECATEGORY")); } if (!dr.IsDBNull(dr.GetOrdinal("GOUALLOWANCEVALUE"))) { objUser.GOUAllowanceValue = Convert.ToDecimal(dr.GetValue(dr.GetOrdinal("GOUALLOWANCEVALUE"))); } if (!dr.IsDBNull(dr.GetOrdinal("ISDELETED"))) { objUser.Isdeleted = Convert.ToBoolean(dr.GetValue(dr.GetOrdinal("ISDELETED"))); } ReasonList.Add(objUser); } dr.Close(); return(ReasonList); }
/// <summary> /// to fetch details by ID /// </summary> /// <param name="GouAllowanceID"></param> /// <returns></returns> public GOUAllowanceBO GetGOUAllowancebyID(int GouAllowanceID) { OracleConnection cnn = new OracleConnection(AppConfiguration.ConnectionString); OracleCommand cmd; string proc = "USP_MST_GET_GOUALLOWANCEBYID"; cmd = new OracleCommand(proc, cnn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("p_GOUALLOWANCECATEGORYID", GouAllowanceID); cmd.Parameters.Add("Sp_recordset", OracleDbType.RefCursor).Direction = ParameterDirection.Output; cmd.Connection.Open(); OracleDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection); GOUAllowanceBO GOUAllowanceBOobj = null; GOUAllowanceList Users = new GOUAllowanceList(); GOUAllowanceBOobj = new GOUAllowanceBO(); while (dr.Read()) { if (ColumnExists(dr, "GOUALLOWANCECATEGORY") && !dr.IsDBNull(dr.GetOrdinal("GOUALLOWANCECATEGORY"))) { GOUAllowanceBOobj.GOUAllowanceCategory = dr.GetString(dr.GetOrdinal("GOUALLOWANCECATEGORY")); } if (ColumnExists(dr, "GOUALLOWANCEVALUE") && !dr.IsDBNull(dr.GetOrdinal("GOUALLOWANCEVALUE"))) { GOUAllowanceBOobj.GOUAllowanceValue = Convert.ToDecimal(dr.GetValue(dr.GetOrdinal("GOUALLOWANCEVALUE"))); } if (ColumnExists(dr, "GOUALLOWANCECATEGORYID") && !dr.IsDBNull(dr.GetOrdinal("GOUALLOWANCECATEGORYID"))) { GOUAllowanceBOobj.GOUALLOWANCECATEGORYID = Convert.ToInt32(dr.GetValue(dr.GetOrdinal("GOUALLOWANCECATEGORYID"))); } } dr.Close(); return(GOUAllowanceBOobj); }