private void butAdd_Click(object sender, EventArgs e) { FormSheetPicker FormS = new FormSheetPicker(); FormS.SheetType = SheetTypeEnum.PatientForm; FormS.ShowDialog(); if (FormS.DialogResult != DialogResult.OK) { return; } SheetDef sheetDef; Sheet sheet = null; //only useful if not Terminal bool isPatUsingEClipboard = MobileAppDevices.PatientIsAlreadyUsingDevice(PatNum); for (int i = 0; i < FormS.SelectedSheetDefs.Count; i++) { sheetDef = FormS.SelectedSheetDefs[i]; if (FormS.TerminalSend && isPatUsingEClipboard && !sheetDef.HasMobileLayout) { if (!MsgBox.Show(MsgBoxButtons.YesNo, $"The patient is currently using an eClipboard to fill out forms, but the " + $"{sheetDef.Description} sheet does not have a mobile layout and cannot be used with eClipboard. " + $"If you add this form to the patient's list it will not be shown in eClipboard. Do you still want to add this form?")) { continue; } } sheet = SheetUtil.CreateSheet(sheetDef, PatNum); SheetParameter.SetParameter(sheet, "PatNum", PatNum); SheetFiller.FillFields(sheet); SheetUtil.CalculateHeights(sheet); if (FormS.TerminalSend) { sheet.InternalNote = ""; //because null not ok sheet.ShowInTerminal = (byte)(Sheets.GetBiggestShowInTerminal(PatNum) + 1); Sheets.SaveNewSheet(sheet); //save each sheet. //Push new sheet to eClipboard. if (isPatUsingEClipboard && sheetDef.HasMobileLayout) { OpenDentBusiness.WebTypes.PushNotificationUtils.CI_AddSheet(sheet.PatNum, sheet.SheetNum); } } } if (FormS.TerminalSend) { //do not show a dialog now. User will need to click the terminal button. FillGrid(); Signalods.SetInvalid(InvalidType.Kiosk); } else if (sheet != null) { FormSheetFillEdit.ShowForm(sheet, FormSheetFillEdit_FormClosing); } }
private void butAdd_Click(object sender, EventArgs e) { FormSheetPicker FormS = new FormSheetPicker(); FormS.SheetType = SheetTypeEnum.PatientForm; FormS.ShowDialog(); if (FormS.DialogResult != DialogResult.OK) { return; } SheetDef sheetDef; Sheet sheet = null; //only useful if not Terminal for (int i = 0; i < FormS.SelectedSheetDefs.Count; i++) { sheetDef = FormS.SelectedSheetDefs[i]; sheet = SheetUtil.CreateSheet(sheetDef, PatNum); SheetParameter.SetParameter(sheet, "PatNum", PatNum); SheetFiller.FillFields(sheet); SheetUtil.CalculateHeights(sheet, this.CreateGraphics()); if (FormS.TerminalSend) { sheet.InternalNote = ""; //because null not ok sheet.ShowInTerminal = (byte)(Sheets.GetBiggestShowInTerminal(PatNum) + 1); Sheets.SaveNewSheet(sheet); //save each sheet. } } if (FormS.TerminalSend) { //do not show a dialog now. //User will need to click the terminal button. FillGrid(); } else { FormSheetFillEdit FormSF = new FormSheetFillEdit(sheet); FormSF.ShowDialog(); if (FormSF.DialogResult == DialogResult.OK) { FillGrid(); } } }