public async Task <ActionResult <Reciver> > PostReciver(Reciver reciver) { _context.Reciver.Add(reciver); await _context.SaveChangesAsync(); return(CreatedAtAction("GetReciver", new { id = reciver.ReciverId }, reciver)); }
public void ChangeSettings(object sender, EventArgs args) { bool CurrentConnectionStatus = SignalRService.IsConnected; if (CurrentConnectionStatus) { SignalRService.CloseConnection(); } ConnectionSettings = ConnectionSettingsChanged; UserInfo = UserInfoChanged; IsActivated = IsActivatedChange; SignalRService.Settings = ConnectionSettings; SignalRService.UserInfo = UserInfo; if (CurrentConnectionStatus && IsActivated) { SignalRService.StartConnection(); } ConnectionService.Settings = ConnectionSettings; DataStorageService.StoreData(UserInfo, "UserInfo.json", this); DataStorageService.StoreData(ConnectionSettings, "ConnectionSettings.json", this); DataStorageService.StoreData(IsActivated, "IsActivated.json", this); Reciver.OnReceive(this, new Intent()); }
static void Main(string[] args) { Reciver r1 = new Reciver(); //Waiter w1 = new Waiter(); //Command c1 = new CommandBakeChickenWing(r1); //w1.SetOrder(c1); //w1.Notice(); //Command c2 = new CommandBakeSheep(r1); //w1.SetOrder(c2); //w1.Notice(); //Console.ReadKey(); //2.多个订单一起通知 WaiterB w2 = new WaiterB(); Command c1 = new CommandBakeChickenWing(r1); Command c2 = new CommandBakeSheep(r1); w2.AddOrder(c1); w2.AddOrder(c2); w2.CancleOrder(c1); w2.Notice(); Console.ReadKey(); }
public async Task <IActionResult> PutReciver(int id, Reciver reciver) { if (id != reciver.ReciverId) { return(BadRequest()); } _context.Entry(reciver).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ReciverExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public void sendMsg() { if (Reciver.GetType() == typeof(Member)) { User.SendMsg <Member>(Reciver.Id, rtbText.Text, File); } else { User.SendMsg <Admin>(Reciver.Id, rtbText.Text, File); } }
static void AddReciver() { using (var reciversRepository = new ReciversRepository()) { Reciver reciver = new Reciver(); Console.WriteLine("Введите имя"); reciver.FullName = Console.ReadLine(); Console.WriteLine("Введите адрес"); reciver.Address = Console.ReadLine(); reciversRepository.Add(reciver); } }
/// <summary> /// SendEmail Method for the sending email /// </summary> /// <param name="emailAddress">email Address</param> /// <returns>return true or false</returns> public bool SendEmail(string emailAddress) { try { string body; string subject = "Link To Reset Your FundooApp Credential"; var entry = this.userContext.Register_Models.FirstOrDefault(x => x.Email == emailAddress); if (entry != null) { Sender sender = new Sender(); sender.Send(); Reciver reciver = new Reciver(); var message = reciver.Recive(); body = message; using (MailMessage mailMessage = new MailMessage("*****@*****.**", emailAddress)) { mailMessage.Subject = subject; mailMessage.Body = body; mailMessage.IsBodyHtml = true; SmtpClient smtp = new SmtpClient(); smtp.Host = "smtp.gmail.com"; smtp.EnableSsl = true; NetworkCredential NetworkCred = new NetworkCredential("*****@*****.**", "Dhiraj@123#"); smtp.UseDefaultCredentials = true; smtp.Credentials = NetworkCred; smtp.Port = 587; smtp.Send(mailMessage); } return(true); } else { return(false); } } catch (Exception ex) { throw new Exception("Error in base64Encode" + ex.Message); } }
/// <summary> /// Forgot password to send Reset Password link /// </summary> /// <param name="emailAddress">user Email</param> /// <returns>return True or False</returns> public bool ForgotPassword(string emailAddress) { string body; string subject = "Fundoo Notes"; var dbEntry = fundooContext.UserTable.FirstOrDefault(e => e.Email == emailAddress); if (dbEntry != null) { Sender send = new Sender(); send.MailSender(); Reciver recive = new Reciver(); var linkToSend = recive.MailReciver(); body = linkToSend; } else { return(false); } MailMessage mailMessage = new MailMessage("*****@*****.**", emailAddress) { Subject = subject, Body = body, IsBodyHtml = true }; SmtpClient smtp = new SmtpClient { Host = "smtp.gmail.com", EnableSsl = true }; NetworkCredential NetworkCred = new NetworkCredential("*****@*****.**", "Pass@123"); smtp.UseDefaultCredentials = true; smtp.Credentials = NetworkCred; smtp.Port = 587; smtp.Send(mailMessage); return(true); }
/// <summary> /// 执行命令 /// </summary> public override void ExecuteCommand() { Reciver.OnReciveCommand(this); }
private void Start() { gameObject.GetComponent <Network>().onNeuralSignal.AddListener(ReceveNeuroSignal); currentReciver = SteamVR.enabled ? Reciver.controller : Reciver.keyboard; }
public Command(Reciver r, string command) { m_Reciver = r; m_command = command; }