Exemplo n.º 1
0
 /// <summary>
 /// Retrieves Get Total Rows of UserActivity
 /// </summary>
 /// <returns>Int32 type object</returns>
 public Int32 GetRowCount()
 {
     using (UserActivityDataAccess data = new UserActivityDataAccess(ClientContext))
     {
         return(data.GetRowCount());
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Retrieve list of UserActivity  by query String.
 /// <param name="query"></param>
 /// </summary>
 /// <returns>List of UserActivity</returns>
 public UserActivityList GetByQuery(String query)
 {
     using (UserActivityDataAccess data = new UserActivityDataAccess(ClientContext))
     {
         return(data.GetByQuery(query));
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// Retrieve list of UserActivity  by PageRequest.
 /// <param name="request"></param>
 /// </summary>
 /// <returns>List of UserActivity</returns>
 public UserActivityList GetPaged(PagedRequest request)
 {
     using (UserActivityDataAccess data = new UserActivityDataAccess(ClientContext))
     {
         return(data.GetPaged(request));
     }
 }
Exemplo n.º 4
0
 /// <summary>
 /// Retrieve list of UserActivity.
 /// no parameters required to be passed in.
 /// </summary>
 /// <returns>List of UserActivity</returns>
 public UserActivityList GetAll()
 {
     using (UserActivityDataAccess data = new UserActivityDataAccess(ClientContext))
     {
         return(data.GetAll());
     }
 }
Exemplo n.º 5
0
 /// <summary>
 /// Retrieve UserActivity data using unique ID
 /// </summary>
 /// <param name="_Id"></param>
 /// <returns>UserActivity Object</returns>
 public UserActivity Get(Int32 _Id)
 {
     using (UserActivityDataAccess data = new UserActivityDataAccess(ClientContext))
     {
         return(data.Get(_Id));
     }
 }
Exemplo n.º 6
0
 /// <summary>
 /// Delete operation for UserActivity
 /// <param name="_Id"></param>
 /// <returns></returns>
 private bool Delete(Int32 _Id)
 {
     using (UserActivityDataAccess data = new UserActivityDataAccess(ClientContext))
     {
         // return if code > 0
         return(data.Delete(_Id) > 0);
     }
 }
Exemplo n.º 7
0
        /// <summary>
        /// Retrieve list of UserActivity.
        /// </summary>
        /// <param name="fillChild"></param>
        /// <returns>List of UserActivity</returns>
        public UserActivityList GetAll(bool fillChild)
        {
            UserActivityList userActivityList = new UserActivityList();

            using (UserActivityDataAccess data = new UserActivityDataAccess(ClientContext))
            {
                userActivityList = data.GetAll();
            }
            if (fillChild)
            {
                foreach (UserActivity userActivityObject in userActivityList)
                {
                    FillUserActivityWithChilds(userActivityObject, fillChild);
                }
            }
            return(userActivityList);
        }
Exemplo n.º 8
0
        /// <summary>
        /// Update base of UserActivity Object.
        /// Data manipulation processing for: new, deleted, updated UserActivity
        /// </summary>
        /// <param name="userActivityObject"></param>
        /// <returns></returns>
        public bool UpdateBase(UserActivity userActivityObject)
        {
            // use of switch for different types of DML
            switch (userActivityObject.RowState)
            {
            // insert new rows
            case BaseBusinessEntity.RowStateEnum.NewRow:
                return(Insert(userActivityObject));

            // delete rows
            case BaseBusinessEntity.RowStateEnum.DeletedRow:
                return(Delete(userActivityObject.Id));
            }
            // update rows
            using (UserActivityDataAccess data = new UserActivityDataAccess(ClientContext))
            {
                return(data.Update(userActivityObject) > 0);
            }
        }
Exemplo n.º 9
0
 /// <summary>
 /// Insert new userActivity.
 /// data manipulation for insertion of UserActivity
 /// </summary>
 /// <param name="userActivityObject"></param>
 /// <returns></returns>
 private bool Insert(UserActivity userActivityObject)
 {
     // new userActivity
     using (UserActivityDataAccess data = new UserActivityDataAccess(ClientContext))
     {
         // insert to userActivityObject
         Int32 _Id = data.Insert(userActivityObject);
         // if successful, process
         if (_Id > 0)
         {
             userActivityObject.Id = _Id;
             return(true);
         }
         else
         {
             return(false);
         }
     }
 }