示例#1
0
文件: ClansDAL.cs 项目: abigabaw/wis
        /// <summary>
        /// To Get Clans By Id from database
        /// </summary>
        /// <param name="ClansID"></param>
        /// <returns></returns>
        public ClansBO GetClansById(int ClansID)
        {
            OracleConnection cnn = new OracleConnection(AppConfiguration.ConnectionString);
            OracleCommand    cmd;

            string proc = "USP_MST_GetClansByID";

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

            cmd.Connection.Open();

            OracleDataReader dr           = cmd.ExecuteReader(CommandBehavior.CloseConnection);
            ClansBO          ClansBOObj   = null;
            ClansList        ClansListObj = new ClansList();

            ClansBOObj = new ClansBO();
            while (dr.Read())
            {
                if (ColumnExists(dr, "CLANNAME") && !dr.IsDBNull(dr.GetOrdinal("CLANNAME")))
                {
                    ClansBOObj.CLANNAME = Convert.ToString(dr.GetValue(dr.GetOrdinal("CLANNAME")));
                }
            }
            dr.Close();


            return(ClansBOObj);
        }
示例#2
0
文件: ClansDAL.cs 项目: abigabaw/wis
        /// <summary>
        /// To Fetch ALL Clans List from database
        /// </summary>
        /// <param name="tribeID"></param>
        /// <returns></returns>

        public ClansList FetchALLClansList(int tribeID)
        {
            OracleConnection cnn = new OracleConnection(AppConfiguration.ConnectionString);
            OracleCommand    cmd;

            string proc = "USP_MST_GETALLCLANSDETAILS";

            cmd             = new OracleCommand(proc, cnn);
            cmd.CommandType = CommandType.StoredProcedure;

            cmd.Parameters.Add("TRIBEID_", tribeID);
            cmd.Parameters.Add("Sp_recordset", Oracle.DataAccess.Client.OracleDbType.RefCursor).Direction = ParameterDirection.Output;

            cmd.Connection.Open();
            OracleDataReader dr           = cmd.ExecuteReader(CommandBehavior.CloseConnection);
            ClansBO          ClansBOObj   = null;
            ClansList        ClansListObj = new ClansList();

            try
            {
                while (dr.Read())
                {
                    ClansBOObj           = new ClansBO();
                    ClansBOObj.CLANID    = Convert.ToInt32(dr.GetValue(dr.GetOrdinal("CLANID")));
                    ClansBOObj.TRIBEID   = Convert.ToInt32(dr.GetValue(dr.GetOrdinal("TRIBEID")));
                    ClansBOObj.CLANNAME  = dr.GetString(dr.GetOrdinal("CLANNAME"));
                    ClansBOObj.IsDeleted = dr.GetString(dr.GetOrdinal("IsDeleted"));

                    ClansListObj.Add(ClansBOObj);
                }

                dr.Close();
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(ClansListObj);
        }