Example #1
0
        private void btnSendManual_Click(object sender, EventArgs e)
        {
            DisableBtnAll();
            this.AutoScrollPosition = new Point(0, 0);
            string messegeAlert = "";

            try
            {
                if (saveData())
                {
                    try
                    {
                        StatusTransaction result = new SendManaulCls().SendManualOnStation(ref messegeAlert);
                        if (result == StatusTransaction.True)
                        {
                            new Class.logPatientFlowCls(Class.logPatientFlowCls.sendType.SendManual,
                                                        (int)tpr_id,
                                                        (int)tps_id,
                                                        Program.CurrentSite.mhs_id,
                                                        Program.CurrentRoom.mrd_ename,
                                                        Program.CurrentUser.mut_username);

                            new ClsTCPClient().sendClearUnitDisplay();
                            new Class.ReserveSkipCls().SendAndReserve(tpr_id);
                            lbAlertMsg.Text = messegeAlert;
                            StatusEmptyRoom();
                            this.tpr_id = null;
                        }
                        else if (result == StatusTransaction.False)
                        {
                            StatusWK();
                        }
                        else if (result == StatusTransaction.Error)
                        {
                            lbAlertMsg.Text = "โปรด send manaul อีกครั้ง";
                            StatusWK();
                        }
                    }
                    catch (Exception ex)
                    {
                        lbAlertMsg.Text = "เกิดความผิดพลาดของระบบ โปรด send manaul อีกครั้ง";
                        Program.MessageError(this.Name, "btnSendManual_Click", ex, false);
                        StatusWK();
                    }
                }
                else
                {
                    lbAlertMsg.Text = "Save Data Incomplete. Please Try Again.";
                    StatusWK();
                }
            }
            catch (Exception ex)
            {
                lbAlertMsg.Focus();
                lbAlertMsg.Text = "กรุณา send manual อีกครั้ง";
                Program.MessageError(this.Name, "btnSendManual_Click", ex, false);
                StatusWK();
            }
        }
Example #2
0
        private void btnSendManual_Click(object sender, EventArgs e)
        {
            DisableBtnAll();
            this.AutoScrollPosition = new Point(0, 0);
            string     messegeAlert = "";
            List <int> mvt_id       = new List <int>();

            if (uu.enable && uu.visible && uu.check && uu.autoCheck)
            {
                mvt_id.Add(uu.mvt_id);
            }
            if (ul.enable && ul.visible && ul.check && ul.autoCheck)
            {
                mvt_id.Add(ul.mvt_id);
            }
            if (ub.enable && ub.visible && ub.check && ub.autoCheck)
            {
                mvt_id.Add(ub.mvt_id);
            }
            if (uw.enable && uw.visible && uw.check && uw.autoCheck)
            {
                mvt_id.Add(uw.mvt_id);
            }
            if (mvt_id.Count() == 0)
            {
                lbAlertMsg.Text = "กรุณาเลือก Order ที่ต้องการตรวจเพิ่มอย่างน้อย 1 รายการ";
                StatusWK();
            }
            else
            {
                if (CheckMinLower())
                {
                    if (SkipLower())
                    {
                        try
                        {
                            StatusTransaction result = new SendManaulCls().SendManualOnStation(mvt_id, ref messegeAlert);
                            if (result == StatusTransaction.True)
                            {
                                new Class.logPatientFlowCls(Class.logPatientFlowCls.sendType.SendManual,
                                                            (int)tpr_id,
                                                            (int)tps_id,
                                                            Program.CurrentSite.mhs_id,
                                                            Program.CurrentRoom.mrd_ename,
                                                            Program.CurrentUser.mut_username);

                                new ClsTCPClient().sendClearUnitDisplay();
                                new Class.ReserveSkipCls().SendAndReserve(tpr_id);
                                lbAlertMsg.Text = messegeAlert;
                                StatusEmptyRoom();
                                this.tpr_id = null;
                            }
                            else if (result == StatusTransaction.False)
                            {
                                StatusWK();
                            }
                            else if (result == StatusTransaction.Error)
                            {
                                lbAlertMsg.Text = "โปรด send manaul อีกครั้ง";
                                StatusWK();
                            }
                        }
                        catch (Exception ex)
                        {
                            lbAlertMsg.Text = "เกิดความผิดพลาดของระบบ โปรด send manaul อีกครั้ง";
                            Program.MessageError(this.Name, "btnSendManual_Click", ex, false);
                            StatusWK();
                        }
                    }
                    else
                    {
                        StatusWK();
                    }
                }
                else
                {
                    StatusWK();
                }
            }
        }