Добавил:
выбрасываю тут свой мусор, надеюсь, что он кому-то может пригодится... Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
laba3.docx
Скачиваний:
6
Добавлен:
03.12.2023
Размер:
328.61 Кб
Скачать

FirmFactory.Cs

namespace Shtan

{

public class FirmFactory

{

public Dictionary<string, string> flds { get; set; }

public List<string> NameMain { get; set; }

public Firm Create()

{

Firm new_firm = new Firm(flds);

return new_firm;

}

public void fldsName(Dictionary<string, string> new_flds)

{

flds = new_flds;

}

}

}

Program.Cs

namespace Shtan

{

class Program

{

static void Main(string[] args)

{

Console.ReadLine();

}

}

}

SubFirm.Cs

namespace Shtan

{

public class SubFirm

{

private string bossName;

private string email;

private string name;

private string ofcBossName;

private string tel;

public List<Contact> contacts { get; set; }

public SbFirmType SbFirmtpy { get; set; }

public string BossName

{

get

{

return bossName;

}

set

{

bossName = value;

}

}

public string Email

{

get

{

return email;

}

set

{

email = value;

}

}

public string Name

{

get

{

return name;

}

set

{

name = value;

}

}

public string OfcBossName

{

get

{

return ofcBossName;

}

set

{

ofcBossName = value;

}

}

public string Tel

{

get

{

return tel;

}

set

{

tel = value;

}

}

public void AddCont(Contact new_contact)

{

contacts.Add(new_contact);

}

public bool ExistContact(Contact contact_for_search)

{

foreach (Contact cur_contact in contacts)

{

if (cur_contact == contact_for_search)

return true;

}

return false;

}

public bool isYourType(SbFirmType _type)

{

if (SbFirmtpy.IsMain == _type.IsMain)

{

return true;

}

return false;

}

public SubFirm()

{

contacts = new List<Contact>();

}

}

}

SbFirmType.Cs

namespace Shtan

{

public class SbFirmType

{

private bool isMain;

private string name;

public bool IsMain

{

get

{

return isMain;

}

set

{

isMain = value;

}

}

public string Name

{

get

{

return name;

}

set

{

name = value;

}

}

}

}

Соседние файлы в предмете Объектно-ориентированное программирование