示例#1
0
        /// <summary> Gets the reservations. </summary>
        /// <param name="moduleId"> The module identifier. </param>
        /// <param name="startDate"> The start date. </param>
        /// <param name="endDate"> The end date. </param>
        /// <returns> DataSet. </returns>
        public static DataSet GetReservations(int moduleId, DateTime startDate, DateTime endDate)
        {
            var sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_Reservation_SelectByDate", 3);

            sph.DefineSqlParameter("@ModuleID", SqlDbType.Int, ParameterDirection.Input, moduleId);
            sph.DefineSqlParameter("@BeginDate", SqlDbType.DateTime, ParameterDirection.Input, startDate);
            sph.DefineSqlParameter("@EndDate", SqlDbType.DateTime, ParameterDirection.Input, endDate);
            return(sph.ExecuteDataset());
        }
示例#2
0
        public DataSet GetAll()
        {
            DataSet ds;
            var     sp = new SqlParameterHelper(StoredProcedure.GetAllUsers, StoredProcedure.GetAllUsersParameters);

            try
            {
                ds = sp.ExecuteDataset();
            }
            catch (SqlException exception)
            {
                _logger.Error("ERROR IN CLASS =>> USERDAO, METHOD =>> GetAll, EXCEPTION MESSAGE =>> " + exception.Message);
                throw new Exception(exception.Message);
            }
            return(ds);
        }
示例#3
0
        public DataSet GetUserByUsername(string username)
        {
            DataSet ds;
            var     sp = new SqlParameterHelper(StoredProcedure.CheckUsername, StoredProcedure.CheckUsernamePara);

            sp.DefineSqlParameter("@username", SqlDbType.VarChar, ParameterDirection.Input, username);

            try
            {
                ds = sp.ExecuteDataset();
            }
            catch (SqlException exception)
            {
                _logger.Error("ERROR IN CLASS =>> USERDAO, METHOD =>> CheckUsername, EXCEPTION MESSAGE =>> " + exception.Message);
                throw new Exception(exception.Message);
            }
            return(ds);
        }
示例#4
0
        public DataSet GetById(int userId)
        {
            DataSet ds;
            var     sp = new SqlParameterHelper(StoredProcedure.GetUserById, StoredProcedure.GetUserByIdPara);

            sp.DefineSqlParameter("@user_id", SqlDbType.Int, ParameterDirection.Input, userId);

            try
            {
                ds = sp.ExecuteDataset();
            }
            catch (SqlException exception)
            {
                _logger.Error("ERROR IN CLASS =>> USERDAO, METHOD =>> GetById, EXCEPTION MESSAGE =>>" + exception.Message);
                throw new Exception(exception.Message);
            }
            return(ds);
        }