//对话框载入 private void OrderTableForm_Load(object sender, EventArgs e) { dgv.ColumnHeadersDefaultCellStyle.Font = new Font("宋体", 13); dgv.RowsDefaultCellStyle.Font = new Font("宋体", 13); menu.Items.AddRange(db.Menu.Select(x => x.name).ToArray()); itemSi.Items.AddRange(db.StockIn.Select(x => x.name).Distinct().ToArray()); itemSo.Items.AddRange(db.StockOut.Select(x => x.name).Distinct().ToArray()); orderStockOut_item.Items.AddRange(db.OrderStockOut.Select(x => x.name).Distinct().ToArray()); startTime.CustomFormat = "yyyy-MM-dd-HH:mm:ss"; endTime.CustomFormat = "yyyy-MM-dd-HH:mm:ss"; orderStockOut_start.CustomFormat = "yyyy-MM-dd-HH:mm:ss"; orderStockOut_end.CustomFormat = "yyyy-MM-dd-HH:mm:ss"; startTime.Value = Convert.ToDateTime(DateTime.Now.AddDays(-1).ToShortDateString() + " 00:00:00"); startTimeSi.Value = DateTime.Now.AddMonths(-1); startTimeSo.Value = DateTime.Now.AddMonths(-1); orderStockOut_start.Value = Convert.ToDateTime(DateTime.Now.AddDays(-1).ToShortDateString() + " 00:00:00"); var local_ip = BathClass.get_local_ip(); stock = db.Stock.FirstOrDefault(x => x.ips == local_ip); dgv_show(); }
//对话框载入 private void OrderForm_Load(object sender, EventArgs e) { dao = new DAO(m_con_str); if (!dao.execute_command("update [Seat] set ordering='True' where text='" + m_Seat.text + "'")) { BathClass.printErrorMsg("手牌状态更新失败!"); return; } m_options = dao.get_options(); if (typeList.Count == 0) { typeList = dao.get_catgories(null); } //typeList = db.Catgory.Select(x => x.name).ToList(); dgvExpense.Columns[11].Visible = MConvert <bool> .ToTypeOrDefault(m_options.启用客房面板, false); inputBillId = MConvert <bool> .ToTypeOrDefault(m_options.录单输入单据编号, false); inputTechType = MConvert <bool> .ToTypeOrDefault(m_options.录单区分点钟轮钟, false); string local_ip = BathClass.get_local_ip(); stock = dao.get_Stock("select * from [Stock] where ips='" + local_ip + "'"); this.Invoke(new no_par_delegate(initial_ui), null); //MessageBox.Show((DateTime.Now - st).TotalMilliseconds.ToString()); }
//获取计算机列表 private void EnumComputers() { try { string local_ip = BathClass.get_local_ip(); string ip_zone = local_ip.Substring(0, local_ip.LastIndexOf('.') + 1); for (int i = 0; i <= 255; i++) { Ping myPing; myPing = new Ping(); myPing.PingCompleted += new PingCompletedEventHandler(myPing_PingCompleted); string pingIP = ip_zone + i.ToString(); myPing.SendAsync(pingIP, 1000, null); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }