Example #1
0
        private void butNewTask_Click(object sender, EventArgs e)
        {
            FormTaskListSelect FormTLS = new FormTaskListSelect(TaskObjectType.Patient);

            FormTLS.Text = Lan.g(FormTLS, "Add Task") + " - " + FormTLS.Text;
            FormTLS.ShowDialog();
            if (FormTLS.DialogResult != DialogResult.OK || FormTLS.ListSelectedLists[0] == 0)
            {
                return;
            }
            Task task = new Task()
            {
                TaskListNum = -1
            };                                                    //don't show it in any list yet.

            Tasks.Insert(task);
            Task taskOld = task.Copy();

            task.UserNum     = Security.CurUser.UserNum;
            task.TaskListNum = FormTLS.ListSelectedLists[0];
            FormTaskEdit FormTE = new FormTaskEdit(task, taskOld);

            FormTE.IsNew = true;
            FormTE.ShowDialog();            //modal
            if (FormTE.DialogResult != DialogResult.OK)
            {
                return;
            }
            SelectedTaskNum = task.TaskNum;
            DialogResult    = DialogResult.OK;
            Close();
        }
Example #2
0
        public static long CreateTask(Patient pat, BugSubmission sub)
        {
            //Button is only enabled if _patCur is not null (user has 1 row selected).
            //Mimics FormOpenDental.OnTask_Click()
            FormTaskListSelect FormT = new FormTaskListSelect(TaskObjectType.Patient);

            //FormT.Location=new Point(50,50);
            FormT.Text = Lan.g(FormT, "Add Task") + " - " + FormT.Text;
            FormT.ShowDialog();
            if (FormT.DialogResult != DialogResult.OK)
            {
                return(0);
            }
            Task task = new Task();

            task.TaskListNum = -1;          //don't show it in any list yet.
            Tasks.Insert(task);
            Task taskOld = task.Copy();

            task.KeyNum      = pat.PatNum;
            task.ObjectType  = TaskObjectType.Patient;
            task.TaskListNum = FormT.ListSelectedLists[0];
            task.UserNum     = Security.CurUser.UserNum;
            //Mimics the ?bug quick note at HQ.
            task.Descript = BugSubmissions.GetSubmissionDescription(pat, sub);
            FormTaskEdit FormTE = new FormTaskEdit(task, taskOld);

            FormTE.IsNew = true;
            FormTE.ShowDialog();
            return(task.TaskNum);
        }
Example #3
0
 private void OnTasklist_Click()
 {
     FormTaskListSelect FormT=new FormTaskListSelect(TaskObjectType.Patient);//,CurPatNum);
     FormT.Location=new Point(50,50);
     FormT.ShowDialog();
     if(FormT.DialogResult!=DialogResult.OK) {
         return;
     }
     Task task=new Task();
     task.TaskListNum=-1;//don't show it in any list yet.
     Tasks.Insert(task);
     Task taskOld=task.Copy();
     task.KeyNum=CurPatNum;
     task.ObjectType=TaskObjectType.Patient;
     task.TaskListNum=FormT.SelectedTaskListNum;
     task.UserNum=Security.CurUser.UserNum;
     FormTaskEdit FormTE=new FormTaskEdit(task,taskOld);
     FormTE.IsNew=true;
     FormTE.Show();
 }
Example #4
0
		private void butTask_Click(object sender,EventArgs e) {
			if(!UpdateToDB()) {
				return;
			}
			FormTaskListSelect FormT=new FormTaskListSelect(TaskObjectType.Appointment);//,AptCur.AptNum);
			FormT.ShowDialog();
			if(FormT.DialogResult!=DialogResult.OK) {
				return;
			}
			Task task=new Task();
			task.TaskListNum=-1;//don't show it in any list yet.
			Tasks.Insert(task);
			Task taskOld=task.Copy();
			task.KeyNum=AptCur.AptNum;
			task.ObjectType=TaskObjectType.Appointment;
			task.TaskListNum=FormT.SelectedTaskListNum;
			task.UserNum=Security.CurUser.UserNum;
			FormTaskEdit FormTE=new FormTaskEdit(task,taskOld);
			FormTE.IsNew=true;
			FormTE.ShowDialog();
		}
Example #5
0
		///<summary>Send to another user.</summary>
		private void butSend_Click(object sender,EventArgs e) {
			//This button is always present.
			if(OwnedForms.Length>0) {
				MsgBox.Show(this,"One or more task note edit windows are open and must be closed.");
				return;
			}
			if(listObjectType.SelectedIndex==(int)TaskObjectType.Patient) {
				FormTaskListSelect FormT=new FormTaskListSelect(TaskObjectType.Patient);
				FormT.ShowDialog();
				if(FormT.DialogResult!=DialogResult.OK) {
					return;
				}
				TaskCur.TaskListNum=FormT.SelectedTaskListNum;
				TaskListCur=TaskLists.GetOne(TaskCur.TaskListNum);
				textTaskList.Text=TaskListCur.Descript;
				if(!SaveCur()) {
					return;
				}
				DataValid.SetInvalidTask(TaskCur.TaskNum,true);//popup
			}
			else {//to an in-box
				FormTaskSendUser FormT=new FormTaskSendUser();
				FormT.ShowDialog();
				if(FormT.DialogResult!=DialogResult.OK) {
					return;
				}
				TaskCur.TaskListNum=FormT.TaskListNum;
				TaskListCur=TaskLists.GetOne(TaskCur.TaskListNum);
				textTaskList.Text=TaskListCur.Descript;
				if(!SaveCur()) {
					return;
				}
				DataValid.SetInvalidTask(TaskCur.TaskNum,true);//popup
			}
			DialogResult=DialogResult.OK;
			Close();
		}
Example #6
0
 ///<summary>Send to another user.</summary>
 private void butSend_Click(object sender,EventArgs e)
 {
     //This button is always present.
     if(listObjectType.SelectedIndex==(int)TaskObjectType.Patient) {
         FormTaskListSelect FormT=new FormTaskListSelect(TaskObjectType.Patient);
         FormT.ShowDialog();
         if(FormT.DialogResult!=DialogResult.OK) {
             return;
         }
         TaskCur.TaskListNum=FormT.SelectedTaskListNum;
         TaskListCur=TaskLists.GetOne(TaskCur.TaskListNum);
         textTaskList.Text=TaskListCur.Descript;
         if(!SaveCur()) {
             return;
         }
         DataValid.SetInvalidTask(TaskCur.TaskNum,true);//popup
     }
     else {//to an in-box
         FormTaskSendUser FormT=new FormTaskSendUser();
         FormT.ShowDialog();
         if(FormT.DialogResult!=DialogResult.OK) {
             return;
         }
         TaskCur.TaskListNum=FormT.TaskListNum;
         TaskListCur=TaskLists.GetOne(TaskCur.TaskListNum);
         textTaskList.Text=TaskListCur.Descript;
         if(!SaveCur()) {
             return;
         }
         DataValid.SetInvalidTask(TaskCur.TaskNum,true);//popup
     }
     DialogResult=DialogResult.OK;
     Close();
 }
Example #7
0
		private void butTask_Click(object sender, System.EventArgs e) {
			if(!UpdateToDB())
				return;
			FormTaskListSelect FormT=new FormTaskListSelect(TaskObjectType.Appointment,AptCur.AptNum);
			FormT.ShowDialog();
		}