Example #1
0
        public static string FetchSourceName(SourceType sourceType, int sourceId)
        {
            var result = string.Empty;

            switch (sourceType)
            {
            case SourceType.Task:
                result = sourceId.ToString();
                break;

            case SourceType.Project:
                result = ForeignKeyMapper.FetchProjectName(sourceId);
                break;

            case SourceType.Invoice:
                result = ForeignKeyMapper.FetchInvoiceNumber(sourceId);
                break;

            case SourceType.User:
                result = ForeignKeyMapper.FetchUserName(sourceId);
                break;

            default:
                break;
            }

            return(result);
        }
Example #2
0
 private void OnProjectIdChanged()
 {
     this.LoadProperty(ProjectNameProperty, ForeignKeyMapper.FetchProjectName(this.ProjectId));
 }