protected void Page_Load(object sender, EventArgs e) { dtSource = new DataTable(); products = new ProductsDataHandler(); dtSource.Columns.Add("SKU", typeof(string)); dtSource.Columns.Add("Nombre", typeof(string)); dtSource.Columns.Add("Precio", typeof(decimal)); dtSource.Columns.Add("Cantidad", typeof(int)); dtSource.Columns.Add("Monto", typeof(decimal)); dgDetalle.DataSource = dtSource; dgDetalle.DataBind(); sales = new SalesDataHandler(); clients = new ClientsDataHandler(); if (Session["Venta"] == null) { Session["Venta"] = new Sale(); } venta = (Sale)Session["Venta"]; //venta.cliente = int.Parse(ddClientes.SelectedValue); venta.fecha = DateTime.Now; venta.productos = 0; venta.montoTotal = 0; ddClientes.Items.Clear(); foreach (DataRow cliente in clients.FetchClients().Rows) { ddClientes.Items.Add(new ListItem(cliente["Nombre"].ToString() + " " + cliente["APaterno"].ToString() + " " + cliente["AMaterno"].ToString(), cliente["ID"].ToString())); } }
void Start() { Application.targetFrameRate = 60; Application.runInBackground = true; text.text = "This is Client"; inputHandler = new InputHandler(); clientsNetworkManager = new ClientsNetworkManager(); clientsDataManager = new ClientsDataHandler(this); }
public void Update(ClientsDataHandler clientsDataManager, Character playerChar, List <InputType> inputs) { /* Receives data from server */ ReceiveData(clientsDataManager); /* Informs server about player inputs */ if (playerChar != null && inputs.Count > 0) { InputMessage inputMsg = new InputMessage(playerChar.ClientId, inputs.ToArray(), System.DateTime.Now); SendRelibleMessage(inputMsg, connectionId); clientsDataManager.AddUnAcknowledgedMsg(inputMsg); } }
private void ReceiveData(ClientsDataHandler clientsDataManager) { int recHostId; int connectionId; int channelId; byte[] recBuffer = new byte[1024]; int bufferSize = 1024; int dataSize; byte error; NetworkEventType recData = NetworkTransport.Receive(out recHostId, out connectionId, out channelId, recBuffer, bufferSize, out dataSize, out error); switch (recData) { case NetworkEventType.Nothing: break; case NetworkEventType.ConnectEvent: break; case NetworkEventType.DataEvent: Stream stream = new MemoryStream(recBuffer); BinaryFormatter formatter = new BinaryFormatter(); Message message = (Message)formatter.Deserialize(stream); clientsDataManager.HandleIncomingMessage(message); break; case NetworkEventType.DisconnectEvent: Application.Quit(); break; } }
protected void Page_Load(object sender, EventArgs e) { clientes = new ClientsDataHandler(); dgClientes.DataSource = clientes.FetchClients(); dgClientes.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { ClientDA = new ClientsDataHandler(); }