public async Task <IActionResult> Delete([FromRoute] long id) { var userProtocol = new UserProtocol() { Id = id }; _context.Remove(userProtocol); await _context.SaveChangesAsync(); return(Ok()); }
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()); } }); } }
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"); }
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()); } }); } }