Ejemplo n.º 1
0
        private void button_finalSave_Click(object sender, EventArgs e)
        {
            String statusMsg = "";
            bool   isSuccess = false;

            String presIds = "";

            foreach (PermissibleValueObj o in comboBox_presId.Items)
            {
                presIds += "||" + o.Value;
            }
            if (presIds.Length > 0)
            {
                presIds = presIds.Substring(2);
            }

            int saveConStatus = consMgr.saveConsultation(consId, textBox_patId.Text, permissibleValueObjListValueToString(examination), permissibleValueObjListNameToString(examination), permissibleValueObjListValueToString(differentiation), permissibleValueObjListNameToString(differentiation), permissibleValueObjListValueToString(diagnosis), permissibleValueObjListNameToString(diagnosis), presIds, permissibleValueObjListValueToString(acupuncture), permissibleValueObjListNameToString(acupuncture), drRmk[0].Value, ref statusMsg);

            if (saveConStatus == 0)
            {
                isSuccess = true;
            }
            else
            {
                if (saveConStatus == 19)
                {
                    DialogResult needChange = MessageBox.Show(statusMsg, "", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation);
                    if (needChange == System.Windows.Forms.DialogResult.Yes)
                    {
                        return;
                    }
                    else
                    {
                        isSuccess = true;
                    }
                }
                else
                {
                    isSuccess = false;
                }
            }

            if (isSuccess)
            {
                refresh_consultation_data(false);
                isSuccess = consMgr.confirmedConsultation(consId, ref statusMsg);
                MessageBox.Show(statusMsg, "", MessageBoxButtons.OK, MessageBoxIcon.Information);
                if (isSuccess)
                {
                    refresh_consultation_data(false);
                    DialogResult isPrint = MessageBox.Show("列印處方?", "", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                    if (isPrint == System.Windows.Forms.DialogResult.Yes)
                    {
                        ReportViewer rptViewer = new ReportViewer();
                        rptViewer.preparePrescription(consId);
                        rptViewer.ShowDialog();
                    }
                }
            }
            else
            {
                MessageBox.Show(statusMsg, "", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }