public void DeviceLoad() { int pdaNumber = 0; string pageIndexAndCount = null; try { pageIndexAndCount = winFormPager1.PageIndex + "." + winFormPager1.PageSize; ResultModelOfArrayOfModel_PDAInfod4FqxSXX pda = cs.GetPDAList(pdaNumber, true, pageIndexAndCount); ResultModelOfArrayOfModel_PDAInfod4FqxSXX count = cs.GetPDAList(pdaNumber, true, null); winFormPager1.DrawControl(count.Data.Count <Model_PDAInfo>()); if (count.Data.Count <Model_PDAInfo>() <= 0) { contextMenuStrip1.Enabled = false; } else { contextMenuStrip1.Enabled = true; } if (pda.Code != 0) { MessageBox.Show(pda.Message); } else { dataGridView1.AutoGenerateColumns = false; dataGridView1.Rows.Clear(); foreach (Model_PDAInfo item in pda.Data) { int rowIndex = dataGridView1.Rows.Add(); dataGridView1.Rows[rowIndex].Cells[0].Value = item.Idk__BackingField; dataGridView1.Rows[rowIndex].Cells[1].Value = item.Numberk__BackingField; dataGridView1.Rows[rowIndex].Cells[2].Value = item.Namek__BackingField; dataGridView1.Rows[rowIndex].Cells[3].Value = item.CreateAtk__BackingField.ToString("yyyy-MM-dd HH:mm:ss"); dataGridView1.Rows[rowIndex].Tag = item; } } } catch (Exception ex) { MessageBox.Show(ex.Message, "error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
/// <summary> /// pda设备 /// </summary> public void PDALoad() { try { ResultModelOfArrayOfModel_PDAInfod4FqxSXX pda = cs.GetPDAList(0, true, null); if (pda.Code != 0) { MessageBox.Show(pda.Message); } else { cmbPDA.DisplayMember = "namek__BackingField"; cmbPDA.ValueMember = "idk__BackingField"; cmbPDA.DataSource = pda.Data; } } catch (Exception ex) { MessageBox.Show(ex.Message, "error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }