Example #1
0
 /// <summary>
 /// Creates payment type of specified kind for specified project and responsible user
 /// </summary>
 public PaymentType(PaymentTypeKind typeKind, int projectId, int userId)
 {
     IsActive  = true;
     TypeKind  = typeKind;
     Name      = typeKind.ToString().ToLowerInvariant();
     ProjectId = projectId;
     UserId    = userId;
 }
 public PaymentTypeListItemViewModel(PaymentTypeKind typeKind, User user, int projectId)
 {
     Name                    = typeKind.GetDisplayName(user);
     PaymentTypeId           = null;
     ProjectId               = projectId;
     Master                  = user;
     TypeKind                = (PaymentTypeKindViewModel)typeKind;
     CanBePermanentlyDeleted = false;
     IsDefault               = false;
     IsActive                = false;
 }
Example #3
0
 /// <summary>
 /// Returns display name of the payment type kind
 /// </summary>
 public static string GetDisplayName(this PaymentTypeKind kind, User user, string defaultName = null)
 => ((PaymentTypeKindViewModel)kind).GetDisplayName(user, defaultName);