コード例 #1
0
        public void AddTelephone(string modele, int stoimost, string firma, FirmaController firmscontroller)
        {
            foreach (Firma itemfirma in firmscontroller.GetFirms())
            {
                if (itemfirma.Name == firma)
                {
                    telephones.Add(new Telephone(modele, stoimost, itemfirma));
                    return;
                }
                else
                {
                    firmscontroller.Add(firma);
                    Firma newFirma = firmscontroller.GetFirmabyName(firma);

                    telephones.Add(new Telephone(modele, stoimost, newFirma));
                    return;
                }
            }
        }
コード例 #2
0
ファイル: Telephone.cs プロジェクト: DanilMartynov/Telephones
 public Telephone(string modele, int stoimost, Firma firma) : this(modele, stoimost)
 {
     Firma = firma ?? throw new ArgumentException(nameof(firma));
 }