public PhoneReportBl MapPhoneReportToPhoneReportBl(PhoneReport phoneReport) { var phoneReportBl = new PhoneReportBl { NameOfTheOffer = phoneReport.NameOfTheOffer, PriceOfTheOffer = phoneReport.PriceOfTheOffer, TotlaCostOfConnections = phoneReport.TotlaCostOfConnections, TotlaCostOfTextMessages = phoneReport.TotlaCostOfTextMessages, PhoneNumber = phoneReport.PhoneNumber }; return(phoneReportBl); }
public OkFromSmsRu(Phone phone, PhoneReport report, Account account) { this.Status = "OK"; this.StatusCode = 200; this.Balance = account.Balance; this.Sms = new Dictionary <Phone, PhoneReport> { { phone, report } }; }
public PhoneReport MapPhoneReportBlToPhoneReport(PhoneReportBl phoneReportBl) { var phoneReport = new PhoneReport { NameOfTheOffer = phoneReportBl.NameOfTheOffer, PriceOfTheOffer = phoneReportBl.PriceOfTheOffer, TotlaCostOfConnections = phoneReportBl.TotlaCostOfConnections, TotlaCostOfTextMessages = phoneReportBl.TotlaCostOfTextMessages, PhoneNumber = phoneReportBl.PhoneNumber }; return(phoneReport); }
private void TryToSaveMessage(Sms sms, PhoneReport answer) { if (answer is OkPhoneReport) { this._db.SmsBox.Add(sms); this._db.SaveChanges(); this._logger.LogInformation($"Message was saved: {sms.ToJson()}"); } else { this._logger.LogInformation($"Message was not saved: {((BadPhoneReport) answer).StatusText}"); } }