Exemple #1
0
        private void btnSendAuto_Click(object sender, EventArgs e)
        {
            try
            {
                StatusTransaction updateLower = UpdatedLower();
                if (updateLower == StatusTransaction.True)
                {
                    StatusTransaction success = StatusTransaction.NoProcess;
                    if (rdSkip.Checked)
                    {
                        Class.ClsSkipOnStation skip = new Class.ClsSkipOnStation();
                        //success = skip.skipOnStationSendAuto();
                        success = skip.skipOnStationSendAuto((int)_tpr_id, (int)_mrm_id, (int)_tps_id);
                    }
                    else if (rdPending.Checked)
                    {
                        Class.ClsPendingOnStation pend = new Class.ClsPendingOnStation();
                        //success = pend.pendingOnStationSendAuto();
                        success = pend.pendingOnStationSendAuto((int)_tpr_id, (int)_mvt_id, (int)_mrm_id, (int)_mhs_id, (int)_tps_id);
                    }

                    if (success == StatusTransaction.True)
                    {
                        if (rdSkip.Checked)
                        {
                            new Class.logPatientFlowCls(Class.logPatientFlowCls.sendType.SkipAuto,
                                                        (int)_tpr_id,
                                                        (int)_tps_id,
                                                        Program.CurrentSite.mhs_id,
                                                        Program.CurrentRoom.mrd_ename,
                                                        Program.CurrentUser.mut_username);
                        }
                        else if (rdPending.Checked)
                        {
                            new Class.logPatientFlowCls(Class.logPatientFlowCls.sendType.PendingAuto,
                                                        (int)_tpr_id,
                                                        (int)_tps_id,
                                                        Program.CurrentSite.mhs_id,
                                                        Program.CurrentRoom.mrd_ename,
                                                        Program.CurrentUser.mut_username);
                        }

                        Program.CurrentRegis         = null;
                        Program.CurrentPatient_queue = null;
                        this.DialogResult            = System.Windows.Forms.DialogResult.OK;
                    }
                    else if (success == StatusTransaction.ReSendManualSite2)
                    {
                        MessageBox.Show("ไม่สามารถดำเนินการ send auto ได้ กรุณาเลือกห้องที่จะส่งอีกครั้ง", "Alert.", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        MessageBox.Show("กรุณาดำเนินการอีกครั้ง", "Alert.", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        this.DialogResult = System.Windows.Forms.DialogResult.Retry;
                        //return error
                    }
                }
                else if (updateLower == StatusTransaction.Error)
                {
                    MessageBox.Show("กรุณา send auto อีกครั้ง", "Alert.", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            catch
            {
            }
        }
Exemple #2
0
        private void gridStation_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                if (gridStation.Columns[e.ColumnIndex].Name == "colBtn")
                {
                    StatusTransaction updateLower = UpdatedLower();
                    if (updateLower == StatusTransaction.True)
                    {
                        gridStationObj            gso = (gridStationObj)gridStationBindingSource.Current;
                        EmrClass.GetDataMasterCls mst = new EmrClass.GetDataMasterCls();
                        mst_event mvt = mst.GetMstEvent(gso.mvt_id);
                        if (mvt.mvt_code == "EM")
                        {
                            List <gridStationObj> obj           = (List <gridStationObj>)gridStationBindingSource.DataSource;
                            mst_event             eyeNurseEvent = mst.GetMstEvent("EN");
                            var incMvtCode = obj.Select(x => mst.GetMstEvent(x.mvt_id).mvt_code).ToList();
                            if (incMvtCode.Contains(eyeNurseEvent.mvt_code))
                            {
                                MessageBox.Show("Can not send to " + mvt.mvt_ename + " before " + eyeNurseEvent.mvt_ename + "." + Environment.NewLine +
                                                "Please select another room.", "Send Queue Alert", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                return;
                            }
                        }

                        bool           success = false;
                        gridStationObj result  = (gridStationObj)gridStationBindingSource.Current;
                        if (rdSkip.Checked)
                        {
                            Class.ClsSkipOnStation skip = new Class.ClsSkipOnStation();
                            if (_useform == useform.onStation)
                            {
                                //success = skip.skipOnStationSendManaul((int)result.mrm_id, result.mvt_id);
                                StatusTransaction skipStation = skip.skipOnStationSendManaul((int)_tpr_id, (int)_tps_id, (int)result.mrm_id, result.mvt_id);
                                if (skipStation == StatusTransaction.True)
                                {
                                    new Class.logPatientFlowCls(Class.logPatientFlowCls.sendType.SkipManual,
                                                                (int)_tpr_id,
                                                                (int)_tps_id,
                                                                Program.CurrentSite.mhs_id,
                                                                Program.CurrentRoom.mrd_ename,
                                                                Program.CurrentUser.mut_username);

                                    success = true;
                                    //if (new EmrClass.GetDataMasterCls().GetMstRoomHdr((int)result.mrm_id).mrm_code == "DC")
                                    //{
                                    //new Class.FunctionDataCls().stampPEDoctor((int)_tpr_id);
                                    //}
                                }
                                else if (skipStation == StatusTransaction.NoProcess)
                                {
                                    MessageBox.Show("คนไข้ไม่ได้อยู่ในสถานะดำเนินการ skip ต่อได้", "Alert", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                }
                                else if (skipStation == StatusTransaction.Error)
                                {
                                    MessageBox.Show("กรุณา skip อีกครั้ง", "Alert.", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                }
                            }
                            else if (_useform == useform.onWaiting)
                            {
                                //success = skip.skipOnStationSendManaul((int)result.mrm_id, result.mvt_id);
                                StatusTransaction skipStation = skip.skipOnWaitingSendManaul((int)_tpr_id, (int)_tps_id, (int)result.mrm_id, result.mvt_id);
                                if (skipStation == StatusTransaction.True)
                                {
                                    new Class.logPatientFlowCls(Class.logPatientFlowCls.sendType.SkipOnWaitingManual,
                                                                (int)_tpr_id,
                                                                (int)_tps_id,
                                                                Program.CurrentSite.mhs_id,
                                                                "WaitingList",
                                                                Program.CurrentUser.mut_username);

                                    success = true;
                                    //if (new EmrClass.GetDataMasterCls().GetMstRoomHdr((int)result.mrm_id).mrm_code == "DC")
                                    //{
                                    //new Class.FunctionDataCls().stampPEDoctor((int)_tpr_id);
                                    //}
                                }
                                else if (skipStation == StatusTransaction.NoProcess)
                                {
                                    MessageBox.Show("คนไข้ไม่ได้อยู่ในสถานะดำเนินการ skip ต่อได้", "Alert", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                }
                                else if (skipStation == StatusTransaction.Error)
                                {
                                    MessageBox.Show("กรุณา skip อีกครั้ง", "Alert.", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                }
                            }
                        }
                        else if (rdPending.Checked)
                        {
                            Class.ClsPendingOnStation pend = new Class.ClsPendingOnStation();
                            if (_useform == useform.onStation)
                            {
                                //success = pend.pendingOnStationSendManaul((int)result.mrm_id, result.mvt_id);
                                StatusTransaction pendingStation = pend.pendingOnStationSendManaul((int)_tpr_id, (int)_mvt_id, (int)_mrm_id, (int)_mhs_id, (int)result.mrm_id, result.mvt_id, (int)_tps_id);
                                if (pendingStation == StatusTransaction.True)
                                {
                                    new Class.logPatientFlowCls(Class.logPatientFlowCls.sendType.PendingManual,
                                                                (int)_tpr_id,
                                                                (int)_tps_id,
                                                                Program.CurrentSite.mhs_id,
                                                                Program.CurrentRoom.mrd_ename,
                                                                Program.CurrentUser.mut_username);

                                    success = true;
                                    //if (new EmrClass.GetDataMasterCls().GetMstRoomHdr((int)result.mrm_id).mrm_code == "DC")
                                    //{
                                    //new Class.FunctionDataCls().stampPEDoctor((int)_tpr_id);
                                    //}
                                }
                                else if (pendingStation == StatusTransaction.NoProcess)
                                {
                                    MessageBox.Show("คนไข้ไม่ได้อยู่ในสถานะดำเนินการ pending ต่อได้", "Alert", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                }
                                else if (pendingStation == StatusTransaction.Error)
                                {
                                    MessageBox.Show("กรุณา pending อีกครั้ง", "Alert.", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                }
                            }
                            else if (_useform == useform.onWaiting)
                            {
                                //success = pend.pendingOnStationSendManaul((int)result.mrm_id, result.mvt_id);
                                StatusTransaction pendingStation = pend.pendingOnWaitingSendManaul((int)_tpr_id, (int)_mvt_id, (int)_mrm_id, (int)_mhs_id, (int)result.mrm_id, result.mvt_id, (int)_tps_id);
                                if (pendingStation == StatusTransaction.True)
                                {
                                    new Class.logPatientFlowCls(Class.logPatientFlowCls.sendType.PendingOnWaitingManual,
                                                                (int)_tpr_id,
                                                                (int)_tps_id,
                                                                Program.CurrentSite.mhs_id,
                                                                "WaitingList",
                                                                Program.CurrentUser.mut_username);

                                    success = true;
                                    //if (new EmrClass.GetDataMasterCls().GetMstRoomHdr((int)result.mrm_id).mrm_code == "DC")
                                    //{
                                    //new Class.FunctionDataCls().stampPEDoctor((int)_tpr_id);
                                    //}
                                }
                                else if (pendingStation == StatusTransaction.NoProcess)
                                {
                                    MessageBox.Show("คนไข้ไม่ได้อยู่ในสถานะดำเนินการ pending ต่อได้", "Alert", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                }
                                else if (pendingStation == StatusTransaction.Error)
                                {
                                    MessageBox.Show("กรุณากด pending อีกครั้ง", "Alert.", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                }
                            }
                        }
                        if (success)
                        {
                            Program.CurrentRegis         = null;
                            Program.CurrentPatient_queue = null;
                            this.DialogResult            = System.Windows.Forms.DialogResult.OK;
                        }
                    }
                    else if (updateLower == StatusTransaction.Error)
                    {
                        MessageBox.Show("กรุณากด send manual อีกครั้ง", "Alert.", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("กรุณากด send manual อีกครั้ง", "Alert.", MessageBoxButtons.OK, MessageBoxIcon.Information);
                Program.MessageError("frmCancelQueue", "gridStation_CellContentClick", ex, false);
            }
            finally
            {
                this.Close();
            }
        }