Example #1
0
        private void PrintMUBLabels_OnPrintMUBLabelSucceeded(object sender, PrintMUBAndTTLabelsEventArgs e)
        {
            try
            {
                _PrintMUBSucceed = true;
                var labelInfo = new Trinity.BE.Label
                {
                    UserId        = e.LabelInfo.UserId,
                    Label_Type    = EnumLabelType.MUB,
                    CompanyName   = e.LabelInfo.CompanyName,
                    MarkingNo     = e.LabelInfo.MarkingNo,
                    DrugType      = e.LabelInfo.DrugType,
                    NRIC          = e.LabelInfo.NRIC,
                    Name          = e.LabelInfo.Name,
                    Date          = DateTime.Now,
                    QRCode        = e.LabelInfo.QRCode,
                    LastStation   = e.LabelInfo.LastStation,
                    PrintCount    = e.LabelInfo.PrintCount,
                    ReprintReason = e.LabelInfo.ReprintReason
                };

                var dalLabel = new DAL_Labels();
                dalLabel.UpdateLabel(labelInfo);

                //// Update queue status is finished
                //var dalQueue = new DAL_QueueNumber();
                //dalQueue.UpdateQueueStatusByUserId(labelInfo.UserId, EnumStation.SSA, EnumStation.UHP, EnumQueueStatuses.Finished, "Printer MUB/TT Label");

                //DeleteQRCodeImageFileTemp();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error in Trinity.SSA.JSCallCS.PrintMUBLabels_OnPrintMUBLabelSucceeded. Details:" + ex.Message);
            }
        }
Example #2
0
        private void PrintTTLabels_OnPrintTTLabelSucceeded(object sender, PrintMUBAndTTLabelsEventArgs e)
        {
            try
            {
                _PrintTTSucceed = true;
                var labelInfo = new Trinity.BE.Label
                {
                    UserId      = e.LabelInfo.UserId,
                    Label_Type  = EnumLabelType.TT,
                    CompanyName = e.LabelInfo.CompanyName,
                    MarkingNo   = e.LabelInfo.MarkingNo,
                    //DrugType = e.LabelInfo.DrugType,
                    NRIC          = e.LabelInfo.NRIC,
                    Name          = e.LabelInfo.Name,
                    Date          = DateTime.Now,
                    LastStation   = e.LabelInfo.LastStation,
                    PrintCount    = e.LabelInfo.PrintCount,
                    ReprintReason = e.LabelInfo.ReprintReason
                };

                var dalLabel = new DAL_Labels();
                var update   = dalLabel.UpdateLabel(labelInfo);
                if (update != null)
                {
                    var dalAppointment = new DAL_Appointments();
                    var dalQueue       = new DAL_QueueNumber();
                    var appointment    = dalAppointment.GetTodayAppointmentByUserId(labelInfo.UserId);
                    //var appointment = result.Data;

                    if (appointment != null)
                    {
                        var sskQueue = new DAL_QueueNumber().GetQueueDetailByAppointment(appointment, EnumStation.SSK);

                        dalQueue.UpdateQueueStatus(sskQueue.Queue_ID, EnumQueueStatuses.Finished, EnumStation.SSK);
                        dalQueue.UpdateQueueStatus(sskQueue.Queue_ID, EnumQueueStatuses.Processing, EnumStation.SSA);
                    }
                    //this._web.RunScript("$('#WaitingSection').hide();$('#CompletedSection').show(); ; ");
                    //this._web.RunScript("$('.status-text').css('color','#000').text('Please collect your labels');");

                    //DeleteQRCodeImageFileTemp();
                }
            }
            catch (Exception ex)
            {
            }
        }
Example #3
0
        private void PrintTTLabels_OnPrintTTLabelFailed(object sender, PrintMUBAndTTLabelsEventArgs e)
        {
            try
            {
                _PrintTTSucceed = false;
                var labelInfo = new Trinity.BE.Label
                {
                    UserId        = e.LabelInfo.UserId,
                    Label_Type    = EnumLabelType.TT,
                    CompanyName   = e.LabelInfo.CompanyName,
                    MarkingNo     = e.LabelInfo.MarkingNo,
                    DrugType      = e.LabelInfo.DrugType,
                    NRIC          = e.LabelInfo.NRIC,
                    Name          = e.LabelInfo.Name,
                    Date          = DateTime.Now,
                    QRCode        = e.LabelInfo.QRCode,
                    LastStation   = e.LabelInfo.LastStation,
                    PrintCount    = e.LabelInfo.PrintCount,
                    ReprintReason = e.LabelInfo.ReprintReason,
                    PrintStatus   = e.LabelInfo.PrintStatus,
                    Message       = e.LabelInfo.Message
                };

                var dalLabel = new DAL_Labels();
                dalLabel.UpdateLabel(labelInfo);

                Trinity.SignalR.Client.Instance.SendToAllDutyOfficers(e.LabelInfo.UserId, "Cannot print TT Label", "User '" + labelInfo.UserId + "' cannot print TT label.", EnumNotificationTypes.Error);

                //DeleteQRCodeImageFileTemp();
                //LogOut();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error in Trinity.SSA.JSCallCS.PrintTTLabels_OnPrintTTLabelFailed. Details:" + ex.Message);
            }
        }