<commit_before>﻿using System;
using System.Text.RegularExpressions;
using DotNetNuke.Data;
using DotNetNuke.ComponentModel.DataAnnotations;
using DotNetNuke.Entities.Portals;
using DotNetNuke.Entities.Users;

namespace R7.University
{
	// More attributes for class:
	// Set caching for table: [Cacheable("R7.University_Divisions", CacheItemPriority.Default, 20)]
	// Explicit mapping declaration: [DeclareColumns]
	// More attributes for class properties:
	// Custom column name: [ColumnName("DivisionID")]
	// Explicit include column: [IncludeColumn]
	// Note: DAL 2 have no AutoJoin analogs from PetaPOCO at this time
	[TableName ("University_EmployeeAchievements")]
	[PrimaryKey ("EmployeeAchievementID", AutoIncrement = true)]
	public class EmployeeAchievementInfo : IReferenceEntity
	{
		#region Fields

		#endregion

		/// <summary>
		/// Empty default cstor
		/// </summary>
		public EmployeeAchievementInfo ()
		{
		}

		#region IReferenceEntity implementation

		public string Title { get; set; }

		public string ShortTitle { get; set; }

		#endregion

		#region Properties

		public int EmployeeAchievementID { get; set; }

		public int EmployeeID  { get; set; }

		public int? AchievementID { get; set; }

		public string Description { get; set; }

		public int? YearBegin { get; set; }

		public int? YearEnd { get; set; }

		public bool IsTitle { get; set; }

		public string DocumentURL { get; set; }

		public string TitleSuffix { get; set; }

		[ColumnName ("AchievementType")]
		public string AchievementTypeString { get; set; }

		#endregion

		[IgnoreColumn]
		public AchievementType? AchievementType
		{
			get
			{ 
				if (!string.IsNullOrWhiteSpace (AchievementTypeString))
					return (AchievementType)AchievementTypeString [0];

				return null;
			}
			set
			{ 
				if (value != null)
					AchievementTypeString = ((char)value).ToString ();
				else
					AchievementTypeString = null;
			}
		}

		[IgnoreColumn]
		public string DisplayShortTitle
		{
			get { return !string.IsNullOrWhiteSpace (TitleSuffix) ? ShortTitle + " " + TitleSuffix : ShortTitle; } 
		}

		[IgnoreColumn]
		public string FormatYears
		{
			get
			{
				if (YearBegin != null && YearEnd == null)
					return YearBegin.ToString (); 
				
				if (YearBegin == null && YearEnd != null)
					return "? - " + YearEnd; 
				
				if (YearBegin != null && YearEnd != null)
				{
					if (YearEnd.Value != 0)
						return string.Format ("{0} - {1}", YearBegin, YearEnd);

					return YearBegin + " - {ATM}";
				}

				return string.Empty;
			}
		}
		
	}
}
<commit_msg>Return empty string if YearBegin is undefined and  YearEnd equals to 0<commit_after>﻿using System;
using System.Text.RegularExpressions;
using DotNetNuke.Data;
using DotNetNuke.ComponentModel.DataAnnotations;
using DotNetNuke.Entities.Portals;
using DotNetNuke.Entities.Users;

namespace R7.University
{
	// More attributes for class:
	// Set caching for table: [Cacheable("R7.University_Divisions", CacheItemPriority.Default, 20)]
	// Explicit mapping declaration: [DeclareColumns]
	// More attributes for class properties:
	// Custom column name: [ColumnName("DivisionID")]
	// Explicit include column: [IncludeColumn]
	// Note: DAL 2 have no AutoJoin analogs from PetaPOCO at this time
	[TableName ("University_EmployeeAchievements")]
	[PrimaryKey ("EmployeeAchievementID", AutoIncrement = true)]
	public class EmployeeAchievementInfo : IReferenceEntity
	{
		#region Fields

		#endregion

		/// <summary>
		/// Empty default cstor
		/// </summary>
		public EmployeeAchievementInfo ()
		{
		}

		#region IReferenceEntity implementation

		public string Title { get; set; }

		public string ShortTitle { get; set; }

		#endregion

		#region Properties

		public int EmployeeAchievementID { get; set; }

		public int EmployeeID  { get; set; }

		public int? AchievementID { get; set; }

		public string Description { get; set; }

		public int? YearBegin { get; set; }

		public int? YearEnd { get; set; }

		public bool IsTitle { get; set; }

		public string DocumentURL { get; set; }

		public string TitleSuffix { get; set; }

		[ColumnName ("AchievementType")]
		public string AchievementTypeString { get; set; }

		#endregion

		[IgnoreColumn]
		public AchievementType? AchievementType
		{
			get
			{ 
				if (!string.IsNullOrWhiteSpace (AchievementTypeString))
					return (AchievementType)AchievementTypeString [0];

				return null;
			}
			set
			{ 
				if (value != null)
					AchievementTypeString = ((char)value).ToString ();
				else
					AchievementTypeString = null;
			}
		}

		[IgnoreColumn]
		public string DisplayShortTitle
		{
			get { return !string.IsNullOrWhiteSpace (TitleSuffix) ? ShortTitle + " " + TitleSuffix : ShortTitle; } 
		}

		[IgnoreColumn]
		public string FormatYears
		{
			get
			{
				if (YearBegin != null && YearEnd == null)
					return YearBegin.ToString (); 
				
				if (YearBegin == null && YearEnd != null)
				{
					if (YearEnd.Value != 0)
						return "? - " + YearEnd; 
				}

				if (YearBegin != null && YearEnd != null)
				{
					if (YearEnd.Value != 0)
						return string.Format ("{0} - {1}", YearBegin, YearEnd);

					return YearBegin + " - {ATM}";
				}

				return string.Empty;
			}
		}
		
	}
}

{'fraction_non_alphanumeric': 0.10517621145374449, 'fraction_numerical': 0.003671071953010279, 'mean_word_length': 2.786657400972898, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5702', 'n_tokens_mistral': 2083, 'n_tokens_neox': 1640, 'n_words': 442}