Пример #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            var res = MessageBox.Show($"Do you really want move to previous stage({WorkFlowStage.GetItemById(_currentAuditCheck.Settings.WorkflowStageId + 1).FullName})?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);

            if (res == DialogResult.Yes)
            {
                _currentAuditCheck.Settings.FromWorkflowStageId = _currentAuditCheck.Settings.WorkflowStageId;
                _currentAuditCheck.Settings.WorkflowStageId    -= 1;
                _currentAuditCheck.Settings.WorkflowStatusId    = WorkFlowStatus.Open.ItemId;
                GlobalObjects.CaaEnvironment.NewKeeper.Save(_currentAuditCheck);

                var rec = new CheckListTransfer()
                {
                    Created     = DateTime.Now,
                    From        = _auditor.SpecialistId,
                    To          = _auditor.SpecialistId,
                    AuditId     = _auditId,
                    CheckListId = _currentAuditCheck.CheckListId,
                    Settings    = new CheckListTransferSettings()
                    {
                        Remark            = $"Workflow stage Updated to {WorkFlowStage.GetItemById(_currentAuditCheck.Settings.WorkflowStageId)}!",
                        WorkflowStageId   = _currentAuditCheck.Settings.WorkflowStageId,
                        IsWorkFlowChanged = true
                    }
                };
                GlobalObjects.CaaEnvironment.NewKeeper.Save(rec);
                _animatedThreadWorker.RunWorkerAsync();
                Focus();
            }
        }
Пример #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            var res = MessageBox.Show($"Do you really want move to next stage({WorkFlowStage.GetItemById(_currentAuditCheck.Settings.WorkflowStageId + 1).FullName})?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);

            if (res == DialogResult.Yes)
            {
                if (radioButtonNotSatisfactory.Checked && string.IsNullOrEmpty(metroTextBoxFindings.Text))
                {
                    MessageBox.Show($"Please input some text in Findings and then save current CheckList!", "Exclamation", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button2);
                    return;
                }

                ApplyChanges();

                foreach (var control in flowLayoutPanel1.Controls.OfType <AuditCheckControl>())
                {
                    control.ApplyChanges();
                    GlobalObjects.CaaEnvironment.NewKeeper.Save(control.AuditCheckRecord, true);
                }


                DialogResult = DialogResult.OK;
                Close();


                _currentAuditCheck.Settings.FromWorkflowStageId = _currentAuditCheck.Settings.WorkflowStageId;
                _currentAuditCheck.Settings.WorkflowStageId    += 1;
                _currentAuditCheck.Settings.WorkflowStatusId    = WorkFlowStatus.Open.ItemId;
                GlobalObjects.CaaEnvironment.NewKeeper.Save(_currentAuditCheck);

                var rec = new CheckListTransfer()
                {
                    Created     = DateTime.Now,
                    From        = GlobalObjects.CaaEnvironment.IdentityUser.PersonnelId,
                    To          = GlobalObjects.CaaEnvironment.IdentityUser.PersonnelId,
                    AuditId     = _auditId,
                    CheckListId = _currentAuditCheck.CheckListId,
                    Settings    = new CheckListTransferSettings()
                    {
                        Remark            = $"Workflow stage Updated to {WorkFlowStage.GetItemById(_currentAuditCheck.Settings.WorkflowStageId)}!",
                        WorkflowStageId   = _currentAuditCheck.Settings.WorkflowStageId,
                        IsWorkFlowChanged = true
                    }
                };
                GlobalObjects.CaaEnvironment.NewKeeper.Save(rec);
                _currentCheck.AuditCheck = _currentAuditCheck;
                _animatedThreadWorker.RunWorkerAsync();
                Focus();
            }
        }
Пример #3
0
        private void radChat1_SendMessage(object sender, SendMessageEventArgs e)
        {
            if (_entedPressed)
            {
                return;
            }

            var textMessage = e.Message as ChatTextMessage;

            if (string.IsNullOrWhiteSpace(textMessage.Message))
            {
                return;
            }

            var rec = new CheckListTransfer()
            {
                Created     = DateTime.Now,
                From        = GlobalObjects.CaaEnvironment.IdentityUser.PersonnelId,
                To          = _opponent.SpecialistId,
                AuditId     = _auditId,
                CheckListId = _checkListId,
                Settings    = new CheckListTransferSettings()
                {
                    Remark          = textMessage.Message,
                    WorkflowStageId = _stageId
                }
            };

            GlobalObjects.CaaEnvironment.NewKeeper.Save(rec);

            if (_auditCheck.Settings.WorkflowStatusId != WorkFlowStatus.Review.ItemId)
            {
                _auditCheck.Settings.WorkflowStatusId = WorkFlowStatus.Review.ItemId;
                GlobalObjects.CaaEnvironment.NewKeeper.Save(_auditCheck);
            }


            radChat2.ChatElement.SendButtonElement.Enabled = false;

            if (_auditorId == GlobalObjects.CaaEnvironment.IdentityUser.PersonnelId)
            {
                radChat2.ChatElement.MessagesViewElement.Items.Remove(radChat2.ChatElement.MessagesViewElement.Items.LastOrDefault());
            }

            AddAuditorMsg(rec);
            AddBotWaitMsg();


            _entedPressed = true;
        }
Пример #4
0
        private void ControlOnAccept(object sender, EventArgs e)
        {
            var item = sender as CheckListCAPItem;

            item.ApplyChanges();

            var wf = item._workFlowStatus;

            var res = MessageBox.Show(wf == WorkFlowStatus.Open ?  $"Do you really want move to next status({WorkFlowStatus.GetItemById(_currentAuditCheck.Settings.WorkflowStatusId)})?" :
                                      $"Do you really want move to next status({WorkFlowStatus.GetItemById(_currentAuditCheck.Settings.WorkflowStatusId + 1)})?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);

            if (res == DialogResult.Yes)
            {
                _currentAuditCheck.Settings.FromWorkflowStatusId = _currentAuditCheck.Settings.WorkflowStatusId == WorkFlowStatus.Open.ItemId ? WorkFlowStatus.Open.ItemId : wf.ItemId;
                _currentAuditCheck.Settings.WorkflowStatusId     = _currentAuditCheck.Settings.WorkflowStatusId == WorkFlowStatus.Open.ItemId ? wf.ItemId :  wf.ItemId + 1;

                if (_currentAuditCheck.Settings.WorkflowStatusId == WorkFlowStatus.VOI.ItemId)
                {
                    _currentAuditCheck.Settings.VOIDate = DateTime.Now;
                }
                else if (_currentAuditCheck.Settings.WorkflowStatusId == WorkFlowStatus.FAT.ItemId)
                {
                    _currentAuditCheck.Settings.FATDate = DateTime.Now;
                }

                GlobalObjects.CaaEnvironment.NewKeeper.Save(_currentAuditCheck);

                var rec = new CheckListTransfer()
                {
                    Created     = DateTime.Now,
                    From        = _auditor.SpecialistId,
                    To          = _auditor.SpecialistId,
                    AuditId     = _auditId,
                    CheckListId = _currentAuditCheck.CheckListId,
                    Settings    = new CheckListTransferSettings()
                    {
                        Remark            = $"Workflow status Updated to {wf}!",
                        WorkflowStageId   = _currentAuditCheck.WorkflowStageId,
                        IsWorkFlowChanged = true,
                    }
                };
                GlobalObjects.CaaEnvironment.NewKeeper.Save(rec);
                _animatedThreadWorker.RunWorkerAsync();
            }
            Focus();
        }
Пример #5
0
 private void AddAuditeeMsg(CheckListTransfer tag)
 {
     radChat2.AddMessage(new CustomChatTextMessage <CheckListTransfer>(tag, tag.Settings.Remark, _author2, DateTime.Now));
 }