/// <summary> /// 新增表单 /// </summary> /// <param name="_entrytype"></param> public EntryForm(UIModels.EntryType _entrytype,DeviceInfo _deviceinfo) { ThisEntryType = _entrytype; //thisdeviceinfo = _deviceinfo; InitializeComponent(); LoadDeviceItems(); }
/// <summary> /// 编辑表单信息 /// </summary> /// <param name="_entrytype"></param> /// <param name="_Model"></param> public EntryForm(UIModels.EntryType _entrytype, object _Model, DeviceInfo _deviceinfo) { ThisEntryType = _entrytype; ModelData = _Model; thisdeviceinfo = _deviceinfo; InitializeComponent(); LoadDeviceItems(); }
/// <summary> /// 添加 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void button1_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(textBox1.Text.Trim())) { KPS.Model.DeviceInfo _deviceinfo = new Model.DeviceInfo(); _deviceinfo.DeviceType = textBox1.Text.Trim(); if (isSelDevice) { //调用BLL获取所有的仪器类型 KPS.BLL.DeviceInfoManager manager = new BLL.DeviceInfoManager(); RecordList = manager.GetModelList(string.Format("DeviceType like '%{0}%'", _deviceinfo.DeviceType)); ReaLoadSpList();//重新加载列表 } else { //调用BLL获取所有的用户列表 KPS.BLL.DeviceInfoManager manager = new BLL.DeviceInfoManager(); if (manager.Add(_deviceinfo)) { _deviceinfo.DeviceID = manager.GetMaxId(); } if (_deviceinfo.DeviceID != null && _deviceinfo.DeviceID != 0) { if (RecordList == null) { RecordList = new List<Model.DeviceInfo>(); } RecordList.Add(_deviceinfo); ReaLoadSpList(); MessageBox.Show("添加成功!"); } else { MessageBox.Show("添加失败!"); } } } else { MessageBox.Show("名称不可为空!"); } }
/// <summary> /// 添加 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void button1_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(textBox1.Text.Trim())) { KPS.Model.DeviceInfo _deviceinfo = new Model.DeviceInfo(); _deviceinfo.DeviceType = textBox1.Text.Trim(); if (isSelDevice) { //调用BLL获取所有的仪器类型 KPS.BLL.DeviceInfoManager manager = new BLL.DeviceInfoManager(); RecordList = manager.GetModelList(string.Format("DeviceType like '%{0}%'", _deviceinfo.DeviceType)); ReaLoadSpList();//重新加载列表 } else { //调用BLL获取所有的用户列表 KPS.BLL.DeviceInfoManager manager = new BLL.DeviceInfoManager(); if (manager.Add(_deviceinfo)) { _deviceinfo.DeviceID = manager.GetMaxId(); } if (_deviceinfo.DeviceID != null && _deviceinfo.DeviceID != 0) { if (RecordList == null) { RecordList = new List <Model.DeviceInfo>(); } RecordList.Add(_deviceinfo); ReaLoadSpList(); MessageBox.Show("添加成功!"); } else { MessageBox.Show("添加失败!"); } } } else { MessageBox.Show("名称不可为空!"); } }
/// <summary> /// 更改医疗器械类型 /// </summary> /// <param name="_Device"></param> public override void ChangeDeviceType(KPS.Model.DeviceInfo _Device) { thisdevice = _Device; button1_Click(null, null); }
public BHGPQueryControl(DeviceInfo _deviceinfo) { thisdevice = _deviceinfo; InitializeComponent(); }
public YSQueryControl(DeviceInfo _device) { thisdevice = _device; InitializeComponent(); }
/// <summary> /// 加载医疗器械类型列表 /// </summary> private void LoadDeviceItems() { DeviceCacheInstanceManager devicemanager = new DeviceCacheInstanceManager(); List<KPS.Model.DeviceInfo> listdevicelist = devicemanager.DeviceList; CmboxDeviceClass.Items.Clear(); if (listdevicelist != null && listdevicelist.Count > 0) { int selectedindex = 0; int forindex = 0; foreach (KPS.Model.DeviceInfo _device in listdevicelist) { if (thisdeviceinfo != null && thisdeviceinfo.DeviceID == _device.DeviceID) { selectedindex = forindex; } CmboxDeviceClass.Items.Add(_device.DeviceType); forindex++; } CmboxDeviceClass.Tag = listdevicelist; CmboxDeviceClass.SelectedIndex = selectedindex; thisdeviceinfo = listdevicelist[selectedindex]; } }
private void CmboxDeviceClass_SelectedIndexChanged(object sender, EventArgs e) { if (CmboxDeviceClass.Items != null && CmboxDeviceClass.Items.Count > 0) { thisdeviceinfo = ((List<KPS.Model.DeviceInfo>)CmboxDeviceClass.Tag)[CmboxDeviceClass.SelectedIndex]; if (ModelData != null) { this.Text = string.Format("{0}{1} 信息编辑", thisdeviceinfo.DeviceType, ThisFromTitle); } else { //窗体标题 this.Text = string.Format("{0}{1}", thisdeviceinfo.DeviceType, ThisFromTitle); } } }
/// <summary> /// 确定 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void button2_Click(object sender, EventArgs e) { if (!isSelDevice) { this.DialogResult = DialogResult.OK; } else { if (this._RecordListView.SelectedObjects != null && this._RecordListView.SelectedObjects.Count > 0) { selDeviceInfo = (DeviceInfo)this._RecordListView.SelectedObjects[0]; this.DialogResult = DialogResult.OK; } else { MessageBox.Show("您未选择任何项,请选择对应项后再试!"); } } }