Example #1
0
        /// <summary>
        /// To Get Representation
        /// </summary>
        /// <returns></returns>
        public RepresentationList GetRepresentation()
        {
            OracleConnection cnn = new OracleConnection(AppConfiguration.ConnectionString);
            OracleCommand    cmd;

            string proc = "USP_MST_GET_REPRESENTATION";

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

            cmd.Connection.Open();
            OracleDataReader   dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);
            RepresentationBO   objRepresentationBO = null;
            RepresentationList Representation      = new RepresentationList();

            while (dr.Read())
            {
                objRepresentationBO = new RepresentationBO();
                objRepresentationBO.RepresentationID   = Convert.ToInt32(dr.GetValue(dr.GetOrdinal("representationid")));
                objRepresentationBO.RepresentationName = dr.GetString(dr.GetOrdinal("representationname"));
                objRepresentationBO.IsDeleted          = dr.GetString(dr.GetOrdinal("isdeleted"));

                Representation.Add(objRepresentationBO);
            }

            dr.Close();

            return(Representation);
        }
Example #2
0
        /// <summary>
        /// To Load Representation Data
        /// </summary>
        /// <returns></returns>
        public RepresentationList LoadRepresentationData()
        {
            cnn = new OracleConnection(AppConfiguration.ConnectionString);
            string proc = "USP_MST_LOADREPRESENTATION";

            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);
            RepresentationBO   obMaster = null;
            RepresentationList Master   = new RepresentationList();

            while (dr.Read())
            {
                obMaster = new RepresentationBO();
                if (!dr.IsDBNull(dr.GetOrdinal("ID")))
                {
                    obMaster.RepresentationID = dr.GetInt32(dr.GetOrdinal("ID"));
                }
                if (!dr.IsDBNull(dr.GetOrdinal("Name")))
                {
                    obMaster.RepresentationName = dr.GetString(dr.GetOrdinal("Name"));
                }
                Master.Add(obMaster);
            }
            dr.Close();
            return(Master);
        }
 public HalResourceListTests()
 {
     representation = new OrganisationListRepresentation(
         new List<OrganisationRepresentation>
         {
             new OrganisationRepresentation(1, "Org1"),
             new OrganisationRepresentation(2, "Org2")
         });
 }
Example #4
0
 public HalResourceListTests()
 {
     representation = new OrganisationListRepresentation(
         new List <OrganisationRepresentation>
     {
         new OrganisationRepresentation(1, "Org1"),
         new OrganisationRepresentation(2, "Org2")
     });
 }