Example #1
0
        private void butVersionPrompt_Click(object sender, EventArgs e)
        {
            FormVersionPrompt FormVP = new FormVersionPrompt();

            FormVP.VersionText = textVersion.Text;
            FormVP.ShowDialog();
            if (FormVP.DialogResult != DialogResult.OK || string.IsNullOrEmpty(FormVP.VersionText))
            {
                return;
            }
            textVersion.Text = FormVP.VersionText;
        }
        private void butAuto_Click(object sender, EventArgs e)
        {
            FormVersionPrompt FormVP = new FormVersionPrompt("Please type a version number", false);

            FormVP.VersionText = "XX.XX";
            if (FormVP.ShowDialog() == DialogResult.Cancel)
            {
                DialogResult = DialogResult.Cancel;
                return;
            }
            FeatureRequests.CompleteRequests(_listRequestLinks.Select(x => x.FKey).ToList(), FormVP.VersionText);
            DialogResult = DialogResult.OK;
        }
Example #3
0
        public static Bug AddBugAndJob(ODForm form, List <BugSubmission> listSelectedSubs, Patient pat)
        {
            if (!JobPermissions.IsAuthorized(JobPerm.Concept, true) &&
                !JobPermissions.IsAuthorized(JobPerm.NotifyCustomer, true) &&
                !JobPermissions.IsAuthorized(JobPerm.FeatureManager, true) &&
                !JobPermissions.IsAuthorized(JobPerm.Documentation, true))
            {
                return(null);
            }
            if (listSelectedSubs.Count == 0)
            {
                MsgBox.Show(form, "You must select a bug submission to create a job for.");
                return(null);
            }
            Job jobNew = new Job();

            jobNew.Category = JobCategory.Bug;
            InputBox titleBox = new InputBox("Provide a brief title for the job.");

            if (titleBox.ShowDialog() != DialogResult.OK)
            {
                return(null);
            }
            if (String.IsNullOrEmpty(titleBox.textResult.Text))
            {
                MsgBox.Show(form, "You must type a title to create a job.");
                return(null);
            }
            List <Def> listJobPriorities = Defs.GetDefsForCategory(DefCat.JobPriorities, true);

            if (listJobPriorities.Count == 0)
            {
                MsgBox.Show(form, "You have no priorities setup in definitions.");
                return(null);
            }
            jobNew.Title = titleBox.textResult.Text;
            long priorityNum = 0;

            priorityNum           = listJobPriorities.FirstOrDefault(x => x.ItemValue.Contains("BugDefault")).DefNum;
            jobNew.Priority       = priorityNum == 0?listJobPriorities.First().DefNum:priorityNum;
            jobNew.PhaseCur       = JobPhase.Concept;
            jobNew.UserNumConcept = Security.CurUser.UserNum;
            Bug bugNew = new Bug();

            bugNew = Bugs.GetNewBugForUser();
            InputBox bugDescription = new InputBox("Provide a brief description for the bug. This will appear in the bug tracker.", jobNew.Title);

            if (bugDescription.ShowDialog() != DialogResult.OK)
            {
                return(null);
            }
            if (String.IsNullOrEmpty(bugDescription.textResult.Text))
            {
                MsgBox.Show(form, "You must type a description to create a bug.");
                return(null);
            }
            FormVersionPrompt FormVP = new FormVersionPrompt("Enter versions found");

            FormVP.ShowDialog();
            if (FormVP.DialogResult != DialogResult.OK || string.IsNullOrEmpty(FormVP.VersionText))
            {
                MsgBox.Show(form, "You must enter a version to create a bug.");
                return(null);
            }
            bugNew.Status_       = BugStatus.Accepted;
            bugNew.VersionsFound = FormVP.VersionText;
            bugNew.Description   = bugDescription.textResult.Text;
            BugSubmission sub = listSelectedSubs.First();

            jobNew.Requirements = BugSubmissions.GetSubmissionDescription(pat, sub);
            Jobs.Insert(jobNew);
            JobLink jobLinkNew = new JobLink();

            jobLinkNew.LinkType = JobLinkType.Bug;
            jobLinkNew.JobNum   = jobNew.JobNum;
            jobLinkNew.FKey     = Bugs.Insert(bugNew);
            JobLinks.Insert(jobLinkNew);
            BugSubmissions.UpdateBugIds(bugNew.BugId, listSelectedSubs.Select(x => x.BugSubmissionNum).ToList());
            if (MsgBox.Show(form, MsgBoxButtons.YesNo, "Would you like to create a task too?"))
            {
                long taskNum = CreateTask(pat, sub);
                if (taskNum != 0)
                {
                    jobLinkNew          = new JobLink();
                    jobLinkNew.LinkType = JobLinkType.Task;
                    jobLinkNew.JobNum   = jobNew.JobNum;
                    jobLinkNew.FKey     = taskNum;
                    JobLinks.Insert(jobLinkNew);
                }
            }
            Signalods.SetInvalid(InvalidType.Jobs, KeyType.Job, jobNew.JobNum);
            FormOpenDental.S_GoToJob(jobNew.JobNum);
            return(bugNew);
        }