private void medicineRecord_Click(object sender, EventArgs e) { operatingSum = (int)((sum - 1) / 5); MedicineDataAddForm_InListView medicineDataAddForm_InListView = new MedicineDataAddForm_InListView(this); medicineDataAddForm_InListView.ShowDialog(); }
private void addDose_Click(object sender, EventArgs e) { MedicineDataAddForm_InListView medicineDataAddForm_InListView = new MedicineDataAddForm_InListView(m, mainView, flag); this.Close(); medicineDataAddForm_InListView.ShowDialog(); }
private void medicineData_DoubleClick(object sender, EventArgs e) { operatingSum = medicineData.CurrentCell.ColumnIndex; operatingIndex = medicineData.CurrentCell.RowIndex; if (medicineData.CurrentCell.RowIndex == medicineData.Rows.Count - 1) { MedicineDataAddForm_InListView medicineDataAddForm_InListView = new MedicineDataAddForm_InListView(this); medicineDataAddForm_InListView.ShowDialog(); } else { AnesthesiaMedicineRecord m = new AnesthesiaMedicineRecord(); m.StartTime = StaticPatient.anesthesiaData.Thebeginningofsurgery.AddSeconds(25 * operatingSum); m.MedicineID = medicineList[medicineData.CurrentCell.RowIndex].Split(' ')[0]; m.AnesthesiaID = StaticPatient.AnesthesiaID; m = medicineRecordRepository.findRecordByTime(m); //判斷注射方式 if (m.AnesthesiaType == 0) { //所操作的單元格為空則默認新增 if (medicineData.CurrentCell.Value == null) { MedicineDataAddForm_InListView medicineDataAddForm_InListView = new MedicineDataAddForm_InListView(medicineDataRepository. selectById(medicineList[medicineData.CurrentCell.RowIndex].Split(' ')[0]), this, 0); medicineDataAddForm_InListView.ShowDialog(); } //若不為空則跳出視窗供使用者選擇 刪除/修改 else { MedicineRecordEdit medicineRecordEdit = new MedicineRecordEdit(m, this, 0); medicineRecordEdit.ShowDialog(); } } else { //所操作的單元格為空則默認新增 if (medicineData.CurrentCell.Value == null) { MedicineDataAddForm_InListView medicineDataAddForm_InListView = new MedicineDataAddForm_InListView(medicineDataRepository. selectById(medicineList[medicineData.CurrentCell.RowIndex].Split(' ')[0]), this, 0); medicineDataAddForm_InListView.ShowDialog(); } //若不為空則跳出視窗供使用者選擇 刪除/修改 else { MedicineRecordEdit medicineRecordEdit = new MedicineRecordEdit(m, this); medicineRecordEdit.ShowDialog(); } } } }
private void medicineLst_DoubleClick(object sender, EventArgs e) { operatingSum = (int)((sum - 1) / 5); try { operatingIndex = medicineLst.CurrentCell.RowIndex; Medicinedata m = medicineDataRepository.selectById(medicineList[medicineLst.CurrentCell.RowIndex].Split(' ')[0]); if (m.Method == 0) { MedicineRecordOperation medicineRecordOperation = new MedicineRecordOperation(medicineDataRepository.selectById(medicineList[this.medicineLst. CurrentCell.RowIndex].Split(' ')[0]), this, 2); medicineRecordOperation.ShowDialog(); } else { if (medicineOnList.Exists(x => x.MedicineID.Equals(m.MId))) { MedicineRecordOperation medicineRecordOperation = new MedicineRecordOperation(medicineDataRepository.selectById(medicineList[this.medicineLst. CurrentCell.RowIndex].Split(' ')[0]), this, 1); medicineRecordOperation.ShowDialog(); } else { MedicineRecordOperation medicineRecordOperation = new MedicineRecordOperation(medicineDataRepository.selectById(medicineList[this.medicineLst. CurrentCell.RowIndex].Split(' ')[0]), this, 0); medicineRecordOperation.ShowDialog(); } } } catch (Exception) { MedicineDataAddForm_InListView medicineDataAddForm_InListView = new MedicineDataAddForm_InListView(this); medicineDataAddForm_InListView.ShowDialog(); } this.medicineLst.CurrentCell = null; }