Beispiel #1
0
        public bool Action()
        {
            if (com != null)
            {
                DataBase.Entities.Com portCom =
                    new DataBase.Entities.Com {
                    ComName = com.Name, Description = com.Description
                };
                db.AddCom(portCom);
                if (card != null)
                {
                    DataBase.Entities.SimCard simCard = new DataBase.Entities.SimCard {
                        ComName = com.Name, Operator = card.Operator.ToString(), Number = card.Number
                    };
                    db.AddCard(simCard);
                    Console.WriteLine("Данные сохранены в БД");
                    Console.WriteLine($"com.Name: {com.Name}\r\ncom.Description: {com.Description}\r\ncard.Number: {card.Number}\r\ncard.Operator: {card.Operator}");
                }
            }

            return(true);
        }