Exemplo n.º 1
0
        public async Task <IActionResult> Delete([FromRoute] long id)
        {
            var userProtocol = new UserProtocol()
            {
                Id = id
            };

            _context.Remove(userProtocol);
            await _context.SaveChangesAsync();

            return(Ok());
        }
Exemplo n.º 2
0
 public void On(JoinCompleteEvent e)
 {
     this._byteChannel = new ByteChannel<Player>(new CoinChannel());
     var bp = new ByteProtocol<Player>(this._byteChannel);
     var up = new UserProtocol<Player>(bp.RegisterProtocol("ByetUserStreams.Demo"), p => (uint)p.UserId);
     var stream = new ByteStream(up.GetUserChannel(this.Players.OwnPlayer, this.Players.OwnPlayer));
     {
         var writer = new StreamWriter(stream) {AutoFlush = true};
         writer.Write("Hello world!\n");
         var reader = new StreamReader(stream);
         ThreadPool.QueueUserWorkItem(o =>
         {
             while (true)
             {
                 Console.Write((char) reader.Read());
             }
         });
     }
 }
Exemplo n.º 3
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        string username = UsernameTextBox.Text;
        string password = PasswordTextBox.Text;


        //SELECT * from USER WHERE "username"='santino' AND "password"='santino';

        string logQ = "select * from \"USER\" where \"username\" = "
                      + "'" + username + "'" +
                      " and \"password\" = " + "'" + password + "'" +
                      "and \"user_type\"= 'customer'";

        //DebugLabel.Text = selectquery;
        UserProtocol.SelectCommand     = logQ;
        UserProtocol.SelectCommandType = SqlDataSourceCommandType.Text;
        DataView dv = UserProtocol.Select(DataSourceSelectArguments.Empty) as DataView;



        if (dv.Count > 0)
        {
            int cid = Convert.ToInt32(dv.Table.Rows[0][1]);
            Session["cid"] = cid;
            string name = dv.Table.Rows[0]["username"] as string;
            Session["username"] = username as string;
            Response.Redirect("~/CustomerHome.aspx?Name=" + name);


            DebugLabel.Text = "success";
        }
        else
        {
            DebugLabel.Text = "Wrong username or passsword. Please try again.";
        }


        //Response.Redirect("~/Home.aspx");
    }
Exemplo n.º 4
0
 public void On(JoinCompleteEvent e)
 {
     this._byteChannel = new ByteChannel <Player>(new CoinChannel());
     var bp     = new ByteProtocol <Player>(this._byteChannel);
     var up     = new UserProtocol <Player>(bp.RegisterProtocol("ByetUserStreams.Demo"), p => (uint)p.UserId);
     var stream = new ByteStream(up.GetUserChannel(this.Players.OwnPlayer, this.Players.OwnPlayer));
     {
         var writer = new StreamWriter(stream)
         {
             AutoFlush = true
         };
         writer.Write("Hello world!\n");
         var reader = new StreamReader(stream);
         ThreadPool.QueueUserWorkItem(o =>
         {
             while (true)
             {
                 Console.Write((char)reader.Read());
             }
         });
     }
 }