Пример #1
0
        public async Task <ActionResult <Reciver> > PostReciver(Reciver reciver)
        {
            _context.Reciver.Add(reciver);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetReciver", new { id = reciver.ReciverId }, reciver));
        }
Пример #2
0
        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());
        }
Пример #3
0
        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();
        }
Пример #4
0
        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());
        }
Пример #5
0
 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);
     }
 }
Пример #6
0
        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);
            }
        }
Пример #7
0
        /// <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);
            }
        }
Пример #8
0
        /// <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);
        }
Пример #9
0
 /// <summary>
 /// 执行命令
 /// </summary>
 public override void ExecuteCommand()
 {
     Reciver.OnReciveCommand(this);
 }
Пример #10
0
 private void Start()
 {
     gameObject.GetComponent <Network>().onNeuralSignal.AddListener(ReceveNeuroSignal);
     currentReciver = SteamVR.enabled ? Reciver.controller : Reciver.keyboard;
 }
Пример #11
0
 public Command(Reciver r, string command)
 {
     m_Reciver = r;
     m_command = command;
 }