예제 #1
0
        /// <summary>
        /// To Get Health Center By Id
        /// </summary>
        /// <param name="HEALTHCENTERID"></param>
        /// <returns></returns>
        public HealthCenterBO GetHealthCenterById(int HEALTHCENTERID)
        {
            OracleConnection cnn = new OracleConnection(AppConfiguration.ConnectionString);
            OracleCommand    cmd;

            string proc = "USP_MST_GET_HEALTH";

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

            cmd.Connection.Open();

            OracleDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);
            HealthCenterBO   HealthCenterBOobj   = null;
            HealthCenterList HealthCenterListobj = new HealthCenterList();

            HealthCenterBOobj = new HealthCenterBO();
            while (dr.Read())
            {
                if (ColumnExists(dr, "HEALTHCENTERNAME") && !dr.IsDBNull(dr.GetOrdinal("HEALTHCENTERNAME")))
                {
                    HealthCenterBOobj.HEALTHCENTERNAME = dr.GetString(dr.GetOrdinal("HEALTHCENTERNAME"));
                }
                if (ColumnExists(dr, "HEALTHCENTERID") && !dr.IsDBNull(dr.GetOrdinal("HEALTHCENTERID")))
                {
                    HealthCenterBOobj.HEALTHCENTERID = Convert.ToInt32(dr.GetValue(dr.GetOrdinal("HEALTHCENTERID")));
                }
            }
            dr.Close();


            return(HealthCenterBOobj);
        }
예제 #2
0
        /// <summary>
        /// To Get Health Center
        /// </summary>
        /// <returns></returns>
        public HealthCenterList GetHealthCenter()
        {
            OracleConnection cnn = new OracleConnection(AppConfiguration.ConnectionString);
            OracleCommand    cmd;

            string proc = "USP_MST_SEL_HEALTH";

            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);
            HealthCenterBO   HealthCenterBOobj   = null;
            HealthCenterList HealthCenterListobj = new HealthCenterList();

            while (dr.Read())
            {
                HealthCenterBOobj = new HealthCenterBO();
                HealthCenterBOobj.HEALTHCENTERID   = Convert.ToInt32(dr.GetValue(dr.GetOrdinal("healthcenterid")));
                HealthCenterBOobj.HEALTHCENTERNAME = dr.GetString(dr.GetOrdinal("healthcentername"));
                // Vaccinationobj.ISDELETED = dr.GetString(dr.GetOrdinal("isdeleted"));

                HealthCenterListobj.Add(HealthCenterBOobj);
            }

            dr.Close();

            return(HealthCenterListobj);
        }