Сильно переделанная версия, добавлены избранные контакты, отправка фото и т.п.

This commit is contained in:
V1RTUOZ
2025-04-30 02:34:18 +03:00
parent 608c79d3de
commit a205f274b5
7 changed files with 529 additions and 132 deletions
+12 -8
View File
@@ -3,6 +3,7 @@
public class EmployeeContact
{
public static string GeneralPhoneNumber => "+78123352577";
public EmployeeContact(Employee employee)
{
FullName = employee.FullName;
@@ -20,7 +21,9 @@ public class EmployeeContact
Department = employee.Department;
Position = employee.Position;
ExtensionNumber = employee.Phone ?? null; //string.IsNullOrEmpty(employee.Phone) ? null : employee.Phone;
Phone = string.IsNullOrEmpty(ExtensionNumber) ? GeneralPhoneNumber : $"{GeneralPhoneNumber},{ExtensionNumber}";
Phone = string.IsNullOrEmpty(ExtensionNumber)
? GeneralPhoneNumber
: $"{GeneralPhoneNumber},{ExtensionNumber}";
if (!string.IsNullOrEmpty(employee.Mobile))
{
Mobile = employee.Mobile;
@@ -34,13 +37,14 @@ public class EmployeeContact
{
get
{
string text = "BEGIN:VCARD\n"
+ "VERSION:2.1\n"
+ $"N:{LastName};{FirstName}\n"
+ $"FN:{FullName}\n"
+ "ORG:NSSZ\n"
+ $"ROLE:{Department}\n"
+ $"TITLE:{Position}\n";
string text =
"BEGIN:VCARD\n"
+ "VERSION:2.1\n"
+ $"N:{LastName};{FirstName}\n"
+ $"FN:{FullName}\n"
+ "ORG:NSSZ\n"
+ $"ROLE:{Department}\n"
+ $"TITLE:{Position}\n";
if (!string.IsNullOrEmpty(Mobile))
text += $"TEL;CELL:{Mobile}\n";