Exemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            string username = textBox1.Text;
            int port =12345;//使用12345作为监听端口
            UdpClient client = new UdpClient(new IPEndPoint(IPAddress.Any, 0));
            IPEndPoint endpoint = new IPEndPoint(IPAddress.Parse("255.255.255.255"), port);//使用广播,告诉对方自己登陆信息
            IPHostEntry ipe = Dns.GetHostEntry(Dns.GetHostName());
            IPAddress ipa = null;
            foreach (IPAddress ip in ipe.AddressList)
            {
                if (ip.AddressFamily == System.Net.Sockets.AddressFamily.InterNetworkV6)
                    continue;
                ipa = ip;
                break;
            }
            string ip1 = ipa.ToString();
            string users = username + ";" + ip1 + ":" + port.ToString();
            byte[] buf = Encoding.Default.GetBytes("login:"******";" + ip1);//登陆信息格式,login命令+用户名+自己的IP
            client.Send(buf, buf.Length, endpoint);  // 发送登陆消息到自己的广

            Member main = new Member();
            main.Username = username;
            main.Users = users;
            main.Port = port;
            main.ThisIP = ip1;
            this.Hide();
            main.ShowDialog();
        }
Exemplo n.º 2
0
 private void Checkout()
 {
      ConsumptionObj obj = cqControl.GetlvConsumption().GetCurrentObj();
      if (obj != null)
      {
          Member mb = new Member(obj.Consumption.id, this);
          mb.ShowDialog();
      }
 }
Exemplo n.º 3
0
        /// <summary>
        /// 结账按钮
        /// </summary>
        private void BtnCheckout_Click(object sender, EventArgs e)
        {
            bool choosedesk = false;

            foreach (Control ctl in this.panelDesk.Controls)
            {
                if (ctl is DeskControl.DeskControl)
                {
                    DeskControl.DeskControl dcdc = (DeskControl.DeskControl)ctl;
                    if (dcdc.lbStatus.Text == "dining" && dcdc.picCheck.Visible == true)
                    {
                        choosedesk = true;
                    }
                }
            }
            if (choosedesk)
            {
                Member mb = new Member(PassValue.consumptionid);
                mb.Owner = this;
                mb.ShowDialog();
            }
        }
Exemplo n.º 4
0
 /// <summary>
 /// 结账按钮
 /// </summary>
 private void BtnCheckout_Click(object sender, EventArgs e)
 {
     bool choosedesk = false;
     foreach (Control ctl in this.panelDesk.Controls)
     {
         if (ctl is DeskControl.DeskControl)
         {
             DeskControl.DeskControl dcdc = (DeskControl.DeskControl)ctl;
             if (dcdc.lbStatus.Text == "dining" && dcdc.picCheck.Visible == true)
             {
                 choosedesk = true;
             }
         }
     }
     if (choosedesk)
     {
         Member mb = new Member(PassValue.consumptionid);
         mb.Owner = this;
         mb.ShowDialog();
     }
 }
Exemplo n.º 5
0
 private void Checkout()
 {
     ConsumptionObj obj = cqControl.GetlvConsumption().GetCurrentObj();
      if (obj != null)
      {
          Member mb = new Member(obj.Consumption.id, this);
          mb.ShowDialog();
      }
 }