Example #1
0
        private void gridMain_CellDoubleClick(object sender, ODGridClickEventArgs e)
        {
            switch (_jobLinks[gridMain.SelectedIndices[0]].LinkType)
            {
            case JobLinkType.Task:
                Task         task   = Tasks.GetOne(_jobLinks[gridMain.SelectedIndices[0]].FKey);
                FormTaskEdit FormTE = new FormTaskEdit(task);
                FormTE.ShowDialog();
                FillGrid();
                break;

            case JobLinkType.Request:
                FormRequestEdit FormRE = new FormRequestEdit();
                FormRE.RequestId   = _jobLinks[gridMain.SelectedIndices[0]].FKey;
                FormRE.IsAdminMode = true;
                FormRE.ShowDialog();
                FillGrid();
                break;

            case JobLinkType.Bug:
                break;
                //case JobLinkType.Quote://TODO
                //	JobQuote quote=JobQuotes.GetOne(_jobLinks[gridMain.SelectedIndices[0]].FKey);
                //	FormJobQuoteEdit FormJQE=new FormJobQuoteEdit(quote);
                //	FormJQE.JobLinkNum=_jobLinks[gridMain.SelectedIndices[0]].JobLinkNum;//Allows deletion of the link if the quote is deleted.
                //	FormJQE.ShowDialog();
                //	_jobLinks=JobLinks.GetJobLinks(_jobNum);
                //	FillGrid();
                //	break;
            }
        }
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 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 #4
0
        private void gridTasks_CellDoubleClick(object sender, ODGridClickEventArgs e)
        {
            long taskNum = PIn.Long(gridTasks.Rows[e.Row].Tag.ToString());

            if (IsSelectionMode)
            {
                SelectedTaskNum = taskNum;
                DialogResult    = DialogResult.OK;
                return;
            }
            Task         task   = Tasks.GetOne(taskNum);
            FormTaskEdit FormTE = new FormTaskEdit(task, task.Copy());

            FormTE.Show();
        }
Example #5
0
        private void CreateTask()
        {
            if (gridVoiceMails.SelectedCell.Y == -1 || gridVoiceMails.Rows.Count <= gridVoiceMails.SelectedCell.Y)
            {
                MsgBox.Show(this, "No voice mail selected");
                return;
            }
            VoiceMail voiceMailCur = (VoiceMail)gridVoiceMails.Rows[gridVoiceMails.SelectedCell.Y].Tag;
            VoiceMail voiceMailOld = voiceMailCur.Copy();

            if (voiceMailCur.PatNum == 0)           //Multiple patients had a match for the phone number
            {
                FormPatientSelect FormPS = new FormPatientSelect(new Patient {
                    HmPhone = voiceMailCur.PhoneNumber
                });
                if (FormPS.ShowDialog() != DialogResult.OK)
                {
                    return;
                }
                voiceMailCur.PatNum = FormPS.SelectedPatNum;
                VoiceMails.Update(voiceMailCur, voiceMailOld);
                FillGrid();
            }
            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    = Tasks.TriageTaskListNum;
            task.DateTimeEntry  = voiceMailCur.DateCreated;
            task.PriorityDefNum = Tasks.TriageBlueNum;
            task.ObjectType     = TaskObjectType.Patient;
            task.KeyNum         = voiceMailCur.PatNum;
            task.Descript       = "VM " + TelephoneNumbers.AutoFormat(voiceMailCur.PhoneNumber) + " ";
            FormTaskEdit FormTE = new FormTaskEdit(task, taskOld);

            FormTE.IsNew = true;
            FormTE.Show();            //non-modal
            FormTE.BringToFront();
            //The reason the below line didn't work is because popups would appear behind the task.
            //FormTE.TopMost=true;//For some techs, when they open a task from this window, it goes behind all the other windows. This is an attempted fix.
        }
Example #6
0
        private void OnAddTask_Click()
        {
            Task cur = new Task();

            //if this is a child of any taskList
            if (TreeHistory.Count > 0)
            {
                cur.TaskListNum = ((TaskList)TreeHistory[TreeHistory.Count - 1]).TaskListNum;
            }
            else
            {
                cur.TaskListNum = 0;
                if (tabContr.SelectedIndex == 2)               //by date
                {
                    cur.DateTask = cal.SelectionStart;
                    cur.DateType = TaskDateType.Day;
                }
                else if (tabContr.SelectedIndex == 3)               //by week
                {
                    cur.DateTask = cal.SelectionStart;
                    cur.DateType = TaskDateType.Week;
                }
                else if (tabContr.SelectedIndex == 4)               //by month
                {
                    cur.DateTask = cal.SelectionStart;
                    cur.DateType = TaskDateType.Month;
                }
            }
            if (tabContr.SelectedIndex == 1)           //repeating
            {
                cur.IsRepeating = true;
            }
            FormTaskEdit FormT = new FormTaskEdit(cur);

            FormT.IsNew = true;
            FormT.ShowDialog();
            if (FormT.GotoType != TaskObjectType.None)
            {
                GotoType   = FormT.GotoType;
                GotoKeyNum = FormT.GotoKeyNum;
                OnGoToChanged();
                //DialogResult=DialogResult.OK;
                return;
            }
            FillMain();
        }
Example #7
0
        ///<summary>Returns true if a task was inserted into the DB, when true formTaskEdit is set. Otherwise null.</summary>
        private bool TryCreateTaskAndForm(out FormTaskEdit formTaskEdit)
        {
            formTaskEdit = null;
            if (gridVoiceMails.SelectedCell.Y == -1 || gridVoiceMails.ListGridRows.Count <= gridVoiceMails.SelectedCell.Y)
            {
                MsgBox.Show(this, "No voice mail selected");
                return(false);
            }
            VoiceMail voiceMailCur = (VoiceMail)gridVoiceMails.ListGridRows[gridVoiceMails.SelectedCell.Y].Tag;
            VoiceMail voiceMailOld = voiceMailCur.Copy();

            if (voiceMailCur.PatNum == 0)           //Multiple patients had a match for the phone number
            {
                FormPatientSelect FormPS = new FormPatientSelect(new Patient {
                    HmPhone = voiceMailCur.PhoneNumber
                });
                if (FormPS.ShowDialog() != DialogResult.OK)
                {
                    return(false);
                }
                voiceMailCur.PatNum = FormPS.SelectedPatNum;
                VoiceMails.Update(voiceMailCur, voiceMailOld);
                FillGrid();
            }
            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    = Tasks.TriageTaskListNum;
            task.DateTimeEntry  = voiceMailCur.DateCreated;
            task.PriorityDefNum = Tasks.TriageBlueNum;
            task.ObjectType     = TaskObjectType.Patient;
            task.KeyNum         = voiceMailCur.PatNum;
            task.Descript       = "VM " + TelephoneNumbers.AutoFormat(voiceMailCur.PhoneNumber) + " ";
            FormTaskEdit FormTE = new FormTaskEdit(task, taskOld);

            FormTE.IsNew = true;
            formTaskEdit = FormTE;
            return(true);
        }
        private void listMain_DoubleClick(object sender, System.EventArgs e)
        {
            if (listMain.SelectedIndex == -1)
            {
                return;
            }
            Task task = new Task();

            task.KeyNum      = KeyNum;
            task.ObjectType  = OType;
            task.TaskListNum = TaskListList[listMain.SelectedIndex].TaskListNum;
            FormTaskEdit FormT = new FormTaskEdit(task);

            FormT.IsNew = true;
            FormT.ShowDialog();
            if (FormT.DialogResult == DialogResult.Cancel)
            {
                return;
            }
            DialogResult = DialogResult.OK;
        }
Example #9
0
 private void listMain_DoubleClick(object sender, System.EventArgs e)
 {
     if (clickedI == -1)
     {
         return;
     }
     if (clickedI >= TaskListsList.Length)             //is task
     {
         FormTaskEdit FormT = new FormTaskEdit(TasksList[clickedI - TaskListsList.Length]);
         FormT.ShowDialog();
         if (FormT.GotoType != TaskObjectType.None)
         {
             GotoType   = FormT.GotoType;
             GotoKeyNum = FormT.GotoKeyNum;
             OnGoToChanged();
             //DialogResult=DialogResult.OK;
             return;
         }
     }
     FillMain();
 }
        private void butOK_Click(object sender, System.EventArgs e)
        {
            if (listMain.SelectedIndex == -1)
            {
                MsgBox.Show(this, "Please select a task list first.");
                return;
            }
            Task task = new Task();

            task.KeyNum      = KeyNum;
            task.ObjectType  = OType;
            task.TaskListNum = TaskListList[listMain.SelectedIndex].TaskListNum;
            FormTaskEdit FormT = new FormTaskEdit(task);

            FormT.IsNew = true;
            FormT.ShowDialog();
            if (FormT.DialogResult == DialogResult.Cancel)
            {
                return;
            }
            DialogResult = DialogResult.OK;
        }
Example #11
0
        private void gridTasks_CellDoubleClick(object sender, ODGridClickEventArgs e)
        {
            long taskNum = PIn.Long(gridTasks.ListGridRows[e.Row].Tag.ToString());

            if (IsSelectionMode)
            {
                SelectedTaskNum = taskNum;
                DialogResult    = DialogResult.OK;
                return;
            }
            Task task = Tasks.GetOne(taskNum);

            if (task != null)
            {
                FormTaskEdit FormTE = new FormTaskEdit(task);
                FormTE.Show();
            }
            else
            {
                MsgBox.Show(this, "The task no longer exists.");
            }
        }
Example #12
0
 private void OnEdit_Click()
 {
     if (clickedI < TaskListsList.Length)             //is list
     {
         FormTaskListEdit FormT = new FormTaskListEdit(TaskListsList[clickedI]);
         FormT.ShowDialog();
     }
     else              //task
     {
         FormTaskEdit FormT
             = new FormTaskEdit(TasksList[clickedI - TaskListsList.Length]);
         FormT.ShowDialog();
         if (FormT.GotoType != TaskObjectType.None)
         {
             GotoType   = FormT.GotoType;
             GotoKeyNum = FormT.GotoKeyNum;
             OnGoToChanged();
             //DialogResult=DialogResult.OK;
             return;
         }
     }
     FillMain();
 }
Example #13
0
        private void gridTasks_CellDoubleClick(object sender, ODGridClickEventArgs e)
        {
            if (!(gridTasks.Rows[e.Row].Tag is long))
            {
                return;                //should never happen
            }
            //GoTo patietn will not work from this form. It would require a delegate to be passed in all the way from FormOpenDental.
            Task         task   = Tasks.GetOne((long)gridTasks.Rows[e.Row].Tag);
            FormTaskEdit FormTE = new FormTaskEdit(task, task.Copy());

            FormTE.Show();
            FormTE.FormClosing += (o, ea) => {
                if (FormTE.DialogResult != DialogResult.OK)
                {
                    return;
                }
                if (this == null || this.IsDisposed)
                {
                    return;
                }
                try { this.Invoke((Action)FillGridTasks); } catch (Exception) { }               //If form disposed, this will catch.
            };
        }
Example #14
0
 ///<summary>Called every time timerSignals_Tick fires.  Usually about every 5-10 seconds.</summary>
 public void ProcessSignals()
 {
     try {
         List<Signalod> sigList=Signalods.RefreshTimed(signalLastRefreshed);//this also attaches all elements to their sigs
         if(sigList.Count==0) {
             return;
         }
         if(Security.CurUser==null) {
             return;
         }
         //look for shutdown signal
         for(int i=0;i<sigList.Count;i++) {
             if(sigList[i].ITypes==((int)InvalidType.ShutDownNow).ToString()) {
                 timerSignals.Enabled=false;//quit receiving signals.
                 //close the webcam if present so that it can be updated too.
                 if(PrefC.GetBool(PrefName.DockPhonePanelShow)) {
                     Process[] processes=Process.GetProcessesByName("WebCamOD");
                     for(int p=0;p<processes.Length;p++) {
                         processes[p].Kill();
                     }
                 }
                 //start the thread that will kill the application
                 Thread killThread=new Thread(new ThreadStart(KillThread));
                 killThread.Start();
                 string msg="";
                 if(Process.GetCurrentProcess().ProcessName=="OpenDental") {
                     msg+="All copies of Open Dental ";
                 }
                 else {
                     msg+=Process.GetCurrentProcess().ProcessName+" ";
                 }
                 msg+=Lan.g(this,"will shut down in 15 seconds.  Quickly click OK on any open windows with unsaved data.");
                 MsgBoxCopyPaste msgbox=new MsgBoxCopyPaste(msg);
                 msgbox.Size=new Size(300,300);
                 msgbox.TopMost=true;
                 msgbox.ShowDialog();
                 return;
             }
         }
         if(sigList[sigList.Count-1].AckTime.Year>1880) {
             signalLastRefreshed=sigList[sigList.Count-1].AckTime;
         }
         else {
             signalLastRefreshed=sigList[sigList.Count-1].SigDateTime;
         }
         if(ContrAppt2.Visible && Signalods.ApptNeedsRefresh(sigList,AppointmentL.DateSelected.Date)) {
             ContrAppt2.RefreshPeriod();
         }
         bool areAnySignalsTasks=false;
         for(int i=0;i<sigList.Count;i++) {
             if(sigList[i].ITypes==((int)InvalidType.Task).ToString()
                 || sigList[i].ITypes==((int)InvalidType.TaskPopup).ToString()) {
                 areAnySignalsTasks=true;
             }
         }
         List<Task> tasksPopup=Signalods.GetNewTaskPopupsThisUser(sigList,Security.CurUser.UserNum);
         if(tasksPopup.Count>0) {
             for(int i=0;i<tasksPopup.Count;i++) {
                 //Even though this is triggered to popup, if this is my own task, then do not popup.
                 List<TaskNote> notesForThisTask=TaskNotes.GetForTask(tasksPopup[i].TaskNum);
                 if(notesForThisTask.Count==0) {//'sender' is the usernum on the task
                     if(tasksPopup[i].UserNum==Security.CurUser.UserNum) {
                         continue;
                     }
                 }
                 else {//'sender' is the user on the last added note
                     if(notesForThisTask[notesForThisTask.Count-1].UserNum==Security.CurUser.UserNum) {
                         continue;
                     }
                 }
                 if(tasksPopup[i].TaskListNum!=Security.CurUser.TaskListInBox//if not my inbox
                     && userControlTasks1.PopupsAreBlocked)//and popups blocked
                 {
                     continue;//no sound or popup
                     //in other words, popups will always show for my inbox even if popups blocked.
                 }
                 System.Media.SoundPlayer soundplay=new SoundPlayer(Properties.Resources.notify);
                 soundplay.Play();
                 this.BringToFront();//don't know if this is doing anything.
                 FormTaskEdit FormT=new FormTaskEdit(tasksPopup[i],tasksPopup[i].Copy());
                 FormT.IsPopup=true;
                 FormT.Closing+=new CancelEventHandler(TaskGoToEvent);
                 FormT.Show();//non-modal
             }
         }
         if(areAnySignalsTasks || tasksPopup.Count>0) {
             //if user has the Task dialog open, we can't easily tell it to refresh,
             //So that dialog is responsible for auto refreshing every minute on a timer.
             //Improve this.
             if(userControlTasks1.Visible) {
                 userControlTasks1.RefreshTasks();
             }
         }
         List<int> itypes=Signalods.GetInvalidTypes(sigList);
         InvalidType[] itypeArray=new InvalidType[itypes.Count];
         for(int i=0;i<itypeArray.Length;i++) {
             itypeArray[i]=(InvalidType)itypes[i];
         }
         //InvalidTypes invalidTypes=Signalods.GetInvalidTypes(sigList);
         if(itypes.Count>0) {//invalidTypes!=0){
             RefreshLocalData(itypeArray);
         }
         List<Signalod> sigListButs=Signalods.GetButtonSigs(sigList);
         ContrManage2.LogMsgs(sigListButs);
         FillSignalButtons(sigListButs);
         //Need to add a test to this: do not play messages that are over 2 minutes old.
         Thread newThread=new Thread(new ParameterizedThreadStart(PlaySounds));
         newThread.Start(sigListButs);
     }
     catch {
         signalLastRefreshed=DateTime.Now;
     }
 }
Example #15
0
		private void gridMain_CellDoubleClick(object sender,ODGridClickEventArgs e) {
			if(e.Col==0){
				//no longer allow double click on checkbox, because it's annoying.
				return;
			}
			if(e.Row >= TaskListsList.Count) {//is task
				//It's important to grab the task directly from the db because the status in this list is fake, being the "unread" status instead.
				Task task=Tasks.GetOne(TasksList[e.Row-TaskListsList.Count].TaskNum);
				FormTaskEdit FormT=new FormTaskEdit(task,task.Copy());
				FormT.Closing+=new CancelEventHandler(TaskGoToEvent);
				FormT.Show();//non-modal
			}
		}
Example #16
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 #17
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 #18
0
		private void AddTask_Clicked() {
			if(Plugins.HookMethod(this,"UserControlTasks.AddTask_Clicked")) {
				return;
			}
			//if(tabContr.SelectedTab==tabUser && TreeHistory.Count==0) {//trunk of user tab
			//	MsgBox.Show(this,"Not allowed to add a task to the trunk of the user tab.  Add it to a child list instead.");
			//	return;
			//}
			//if(tabContr.SelectedTab==tabNew) {//new tab
			//	MsgBox.Show(this,"Not allowed to add items to the 'New' tab.");
			//	return;
			//}
			Task task=new Task();
			task.TaskListNum=-1;//don't show it in any list yet.
			Tasks.Insert(task);
			Task taskOld=task.Copy();
			//if this is a child of any taskList
			if(TreeHistory.Count>0) {
				task.TaskListNum=TreeHistory[TreeHistory.Count-1].TaskListNum;
			}
			else if(tabContr.SelectedTab==tabNew) {//new tab
				task.TaskListNum=-1;
			}
			else if(tabContr.SelectedTab==tabUser && TreeHistory.Count==0) {//trunk of user tab
				task.TaskListNum=-1;
			}
			else {
				task.TaskListNum=0;
				if(tabContr.SelectedTab==tabDate) {
					task.DateTask=cal.SelectionStart;
					task.DateType=TaskDateType.Day;
				}
				else if(tabContr.SelectedTab==tabWeek) {
					task.DateTask=cal.SelectionStart;
					task.DateType=TaskDateType.Week;
				}
				else if(tabContr.SelectedTab==tabMonth) {
					task.DateTask=cal.SelectionStart;
					task.DateType=TaskDateType.Month;
				}
			}
			if(tabContr.SelectedTab==tabRepeating) {
				task.IsRepeating=true;
			}
			task.UserNum=Security.CurUser.UserNum;
			FormTaskEdit FormT=new FormTaskEdit(task,taskOld);
			FormT.IsNew=true;
			FormT.Closing+=new CancelEventHandler(TaskGoToEvent);
			FormT.Show();//non-modal
		}
Example #19
0
		private void Edit_Clicked() {
			if(clickedI < TaskListsList.Count) {//is list
				FormTaskListEdit FormT=new FormTaskListEdit(TaskListsList[clickedI]);
				FormT.ShowDialog();
				FillGrid();
			}
			else {//task
				FormTaskEdit FormT=new FormTaskEdit(TasksList[clickedI-TaskListsList.Count],TasksList[clickedI-TaskListsList.Count].Copy());
				FormT.Closing+=new CancelEventHandler(TaskGoToEvent);
				FormT.Show();//non-modal
			}
		}
Example #20
0
		private void phoneSmall_GoToChanged(object sender,EventArgs e) {
			if(phoneSmall.GotoPatNum==0) {
				return;
			}
			CurPatNum=phoneSmall.GotoPatNum;
			Patient pat=Patients.GetPat(CurPatNum);
			RefreshCurrentModule();
			FillPatientButton(pat);
			Commlog commlog=Commlogs.GetIncompleteEntry(Security.CurUser.UserNum,CurPatNum);
			PhoneEmpDefault ped=PhoneEmpDefaults.GetByExtAndEmp(phoneSmall.Extension,Security.CurUser.EmployeeNum);
			if(ped!=null && ped.IsTriageOperator) {
				if(Plugins.HookMethod(this,"FormOpenDental.phoneSmall_GoToChanged_IsTriage",pat,phoneSmall.Extension)) {
					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=1697;//Hardcoded for internal Triage task list.
				task.UserNum=Security.CurUser.UserNum;
				task.Descript=Phones.GetPhoneForExtension(Phones.GetPhoneList(),phoneSmall.Extension).CustomerNumberRaw+" ";//Prefill description with customers number.
				FormTaskEdit FormTE=new FormTaskEdit(task,taskOld);
				FormTE.IsNew=true;
				FormTE.Show();
			}
			else {//Not a triage operator.
				if(Plugins.HookMethod(this,"FormOpenDental.phoneSmall_GoToChanged_NotTriage",pat)) {
					return;
				}
				if(commlog==null) {
					commlog = new Commlog();
					commlog.PatNum = CurPatNum;
					commlog.CommDateTime = DateTime.Now;
					commlog.CommType =Commlogs.GetTypeAuto(CommItemTypeAuto.MISC);
					commlog.Mode_=CommItemMode.Phone;
					commlog.SentOrReceived=CommSentOrReceived.Received;
					commlog.UserNum=Security.CurUser.UserNum;
					FormCommItem FormCI=new FormCommItem(commlog);
					FormCI.IsNew = true;
					FormCI.ShowDialog();
					if(FormCI.DialogResult==DialogResult.OK) {
						RefreshCurrentModule();
					}
				}
				else {
					FormCommItem FormCI=new FormCommItem(commlog);
					FormCI.ShowDialog();
					if(FormCI.DialogResult==DialogResult.OK) {
						RefreshCurrentModule();
					}
				}
			}
		}
Example #21
0
		private void gridProg_CellDoubleClick(object sender,ODGridClickEventArgs e) {
			Chartscrollval=gridProg.ScrollValue;
			DataRow row=(DataRow)gridProg.Rows[e.Row].Tag;
			if(row["ProcNum"].ToString()!="0"){
				if(checkAudit.Checked){
					MsgBox.Show(this,"Not allowed to edit procedures when in audit mode.");
					return;
				}
				Procedure proc=Procedures.GetOneProc(PIn.Long(row["ProcNum"].ToString()),true);
				if(ProcedureCodes.GetStringProcCode(proc.CodeNum)==ProcedureCodes.GroupProcCode){
					FormProcGroup FormP=new FormProcGroup();		
					List<ProcGroupItem> groupItemList=ProcGroupItems.GetForGroup(proc.ProcNum);
					List<Procedure> procList=new List<Procedure>();
					for(int i=0;i<groupItemList.Count;i++){
						procList.Add(Procedures.GetOneProc(groupItemList[i].ProcNum,false));
					}
					FormP.GroupCur=proc;
					FormP.GroupItemList=groupItemList;
					FormP.ProcList=procList;
					FormP.ShowDialog();
					if(FormP.DialogResult==DialogResult.OK){
						ModuleSelected(PatCur.PatNum);
						FillProgNotes();
					}
					return;
				}
				else{
					FormProcEdit FormP=new FormProcEdit(proc,PatCur,FamCur);
					Plugins.HookAddCode(this, "ContrChart.gridProg_CellDoubleClick_proc", proc, FormP);
					if(!FormP.IsDisposed) { //Form might be disposed by the above hook.
						FormP.ShowDialog();
					} 
					Plugins.HookAddCode(this, "ContrChart.gridProg_CellDoubleClick_proc2", proc, FormP);
					if(FormP.DialogResult!=DialogResult.OK) {
						return;
					}
				}
			}
			else if(row["CommlogNum"].ToString()!="0"){
				Commlog comm=Commlogs.GetOne(PIn.Long(row["CommlogNum"].ToString()));
				FormCommItem FormC=new FormCommItem(comm);
				FormC.ShowDialog();
				if(FormC.DialogResult!=DialogResult.OK){
					return;
				}
			}
			else if(row["RxNum"].ToString()!="0") {
				RxPat rx=RxPats.GetRx(PIn.Long(row["RxNum"].ToString()));
				FormRxEdit FormRxE=new FormRxEdit(PatCur,rx);
				FormRxE.ShowDialog();
				if(FormRxE.DialogResult!=DialogResult.OK){
					return;
				}
			}
			else if(row["LabCaseNum"].ToString()!="0") {
				LabCase lab=LabCases.GetOne(PIn.Long(row["LabCaseNum"].ToString()));
				FormLabCaseEdit FormL=new FormLabCaseEdit();
				FormL.CaseCur=lab;
				FormL.ShowDialog();
				//needs to always refresh due to complex ok/cancel
			}
			else if(row["TaskNum"].ToString()!="0") {
				Task task=Tasks.GetOne(PIn.Long(row["TaskNum"].ToString()));
				if(task==null) {
					MsgBox.Show(this,"This task has been deleted by another user.");
				}
				else {
					FormTaskEdit FormT=new FormTaskEdit(task,task.Copy());
					FormT.Closing+=new CancelEventHandler(TaskGoToEvent);
					FormT.Show();//non-modal
				}
			}
			else if(row["AptNum"].ToString()!="0") {
				//Appointment apt=Appointments.GetOneApt(
				FormApptEdit FormA=new FormApptEdit(PIn.Long(row["AptNum"].ToString()));
				//PinIsVisible=false
				FormA.IsInChartModule=true;
				FormA.ShowDialog();
				if(FormA.CloseOD) {
					((Form)this.Parent).Close();
					return;
				}
				if(FormA.DialogResult!=DialogResult.OK) {
					return;
				}
			}
			else if(row["EmailMessageNum"].ToString()!="0") {
				EmailMessage msg=EmailMessages.GetOne(PIn.Long(row["EmailMessageNum"].ToString()));
				if(msg.SentOrReceived==EmailSentOrReceived.WebMailReceived
					|| msg.SentOrReceived==EmailSentOrReceived.WebMailRecdRead
					|| msg.SentOrReceived==EmailSentOrReceived.WebMailSent
					|| msg.SentOrReceived==EmailSentOrReceived.WebMailSentRead) 
				{
					//web mail uses special secure messaging portal
					FormWebMailMessageEdit FormWMME=new FormWebMailMessageEdit(PatCur.PatNum,msg.EmailMessageNum);
					if(FormWMME.ShowDialog()!=DialogResult.OK) {
						return;
					}
				}
				else {
					FormEmailMessageEdit FormE=new FormEmailMessageEdit(msg);
					FormE.ShowDialog();
					if(FormE.DialogResult!=DialogResult.OK) {
						return;
					}
				}
			}
			else if(row["SheetNum"].ToString()!="0") {
				Sheet sheet=Sheets.GetSheet(PIn.Long(row["SheetNum"].ToString()));
				FormSheetFillEdit FormSFE=new FormSheetFillEdit(sheet);
				FormSFE.ShowDialog();
				if(FormSFE.DialogResult!=DialogResult.OK) {
					return;
				}
			}
			else if(row["FormPatNum"].ToString()!="0"){
				FormPat form=FormPats.GetOne(PIn.Long(row["FormPatNum"].ToString()));
				FormFormPatEdit FormP=new FormFormPatEdit();
				FormP.FormPatCur=form;
				FormP.ShowDialog();
				if(FormP.DialogResult==DialogResult.OK)
				{
					ModuleSelected(PatCur.PatNum);//Why is this called here and down 3 lines? Do we need the Allocator, or should we return here?
				}
			}
			ModuleSelected(PatCur.PatNum);
			Reporting.Allocators.MyAllocator1_ProviderPayment.AllocateWithToolCheck(this.PatCur.Guarantor);
		}
Example #22
0
		private void SendToMe_Clicked() {
			if(Security.CurUser.TaskListInBox==0) {
				MsgBox.Show(this,"You do not have an inbox.");
				return;
			}
			Task oldTask;
			Task task;
			try {
				//If a user right clicks on a task and then the task list is updated soon after, it is possible that clickedI-TaskListsList.Count will be an index out bounds.
				//This try catch simply solves the one scenario where the user right clicked on the last task in the list, the list auto-refreshed and the task was moved, then send to me was clicked.
				//This fix does not fix the root of the problem because a user could right click on a task in the middle of the list which will cause a different task right to be sent.
				//Because this is such a rare bug and no customers are complaining about it (yet), Jordan has decided to only fix the potential UE because the correct fix is very time consuming.
				oldTask=TasksList[clickedI-TaskListsList.Count];
				task=oldTask.Copy();
				task.TaskListNum=Security.CurUser.TaskListInBox;
			}
			catch {
				MsgBox.Show(this,"Not allowed to save changes because the task has been altered by someone else.");
				return;
			}
			try {
				Tasks.Update(task,oldTask);
				//At HQ the refresh interval wasn't quick enough for the task to pop up.
				//We will immediately show the task instead of waiting for the refresh interval.
				DataValid.SetInvalidTask(task.TaskNum,false);
				FormTaskEdit FormT=new FormTaskEdit(task,task.Copy());
				FormT.IsPopup=true;
				FormT.Closing+=new CancelEventHandler(TaskGoToEvent);
				FormT.Show();//non-modal
			}
			catch(Exception ex) {
				MessageBox.Show(ex.Message);
				return;
			}
		}
Example #23
0
		private void gridProg_CellDoubleClick(object sender,ODGridClickEventArgs e) {
			//Chartscrollval = gridProg.ScrollValue;
			DataRow row = (DataRow)gridProg.Rows[e.Row].Tag;
			if(row["ProcNum"].ToString() != "0") {
				if(checkAudit.Checked) {
					MsgBox.Show(this,"Not allowed to edit procedures when in audit mode.");
					return;
				}
				Procedure proc = Procedures.GetOneProc(PIn.Long(row["ProcNum"].ToString()),true);
				FormProcEdit FormP = new FormProcEdit(proc,PatCur,FamCur);
				FormP.ShowDialog();
				if(FormP.DialogResult != DialogResult.OK) {
					return;
				}
			}
			else if(row["CommlogNum"].ToString() != "0") {
				Commlog comm = Commlogs.GetOne(PIn.Long(row["CommlogNum"].ToString()));
				FormCommItem FormC = new FormCommItem(comm);
				FormC.ShowDialog();
				if(FormC.DialogResult != DialogResult.OK) {
					return;
				}
			}
			else if(row["RxNum"].ToString() != "0") {
				RxPat rx = RxPats.GetRx(PIn.Long(row["RxNum"].ToString()));
				FormRxEdit FormRxE = new FormRxEdit(PatCur,rx);
				FormRxE.ShowDialog();
				if(FormRxE.DialogResult != DialogResult.OK) {
					return;
				}
			}
			else if(row["LabCaseNum"].ToString() != "0") {
				LabCase lab = LabCases.GetOne(PIn.Long(row["LabCaseNum"].ToString()));
				FormLabCaseEdit FormL = new FormLabCaseEdit();
				FormL.CaseCur = lab;
				FormL.ShowDialog();
			}
			else if(row["TaskNum"].ToString() != "0") {
				Task task = Tasks.GetOne(PIn.Long(row["TaskNum"].ToString()));
				FormTaskEdit FormT = new FormTaskEdit(task,task.Copy());
				FormT.Closing+=new CancelEventHandler(TaskGoToEvent);
				FormT.Show();//non-modal
			}
			else if(row["AptNum"].ToString() != "0") {
				//Appointment apt=Appointments.GetOneApt(
				FormApptEdit FormA = new FormApptEdit(PIn.Long(row["AptNum"].ToString()));
				//PinIsVisible=false
				FormA.ShowDialog();
				if(FormA.DialogResult != DialogResult.OK) {
					return;
				}
			}
			else if(row["EmailMessageNum"].ToString() != "0") {
				EmailMessage msg = EmailMessages.GetOne(PIn.Long(row["EmailMessageNum"].ToString()));
				FormEmailMessageEdit FormE = new FormEmailMessageEdit(msg);
				FormE.ShowDialog();
				if(FormE.DialogResult != DialogResult.OK) {
					return;
				}
			}
			ModuleSelected(PatCur.PatNum);
		}