///<summary></summary>
		public FormTaskListSelect(TaskObjectType oType)
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();
			Lan.F(this);
			OType=oType;
		}
 ///<summary></summary>
 public FormTaskListSelect(TaskObjectType oType)
 {
     //
     // Required for Windows Form Designer support
     //
     InitializeComponent();
     Lan.F(this);
     OType = oType;
 }
Beispiel #3
0
        private void OnGoto_Click()
        {
            //not even allowed to get to this point unless a valid task
            Task task = TasksList[clickedI - TaskListsList.Length];

            GotoType   = task.ObjectType;
            GotoKeyNum = task.KeyNum;
            OnGoToChanged();
            //DialogResult=DialogResult.OK;
        }
 ///<summary></summary>
 public FormTaskListSelect(TaskObjectType oType, bool IsTaskNew = false)
 {
     //
     // Required for Windows Form Designer support
     //
     InitializeComponent();
     Lan.F(this);
     OType = oType;
     checkMulti.Visible = IsTaskNew;
 }
 private void butGoto_Click(object sender, System.EventArgs e)
 {
     if (!SaveCur())
     {
         return;
     }
     GotoType     = Cur.ObjectType;
     GotoKeyNum   = Cur.KeyNum;
     DialogResult = DialogResult.OK;
 }
Beispiel #6
0
 /// <summary>Gets all task lists with the give object type.  Used in TaskListSelect when assigning an object to a task list.</summary>
 public static TaskList[] GetForObjectType(TaskObjectType oType)
 {
     if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) {
         return Meth.GetObject<TaskList[]>(MethodBase.GetCurrentMethod(),oType);
     }
     string command=
         "SELECT * FROM tasklist "
         +"WHERE ObjectType="+POut.Long((int)oType)
         +" ORDER BY Descript";
     return Crud.TaskListCrud.SelectMany(command).ToArray();
 }
Beispiel #7
0
        /// <summary>Gets all task lists with the give object type.  Used in TaskListSelect when assigning an object to a task list.</summary>
        public static List <TaskList> GetForObjectType(TaskObjectType oType)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                return(Meth.GetObject <List <TaskList> >(MethodBase.GetCurrentMethod(), oType));
            }
            string command =
                "SELECT * FROM tasklist "
                + "WHERE ObjectType=" + POut.Long((int)oType)
                + " ORDER BY Descript";

            return(Crud.TaskListCrud.SelectMany(command));
        }
Beispiel #8
0
        private void userControlTasks1_GoToChanged(object sender, EventArgs e)
        {
            TaskObjectType gotoType   = userControlTasks1.GotoType;
            long           gotoKeyNum = userControlTasks1.GotoKeyNum;

            if (gotoType == TaskObjectType.Patient)
            {
                if (gotoKeyNum != 0)
                {
                    Patient pat = Patients.GetPat(gotoKeyNum);
                    //OnPatientSelected(pat);
                    if (IsTriage)
                    {
                        GotoModule.GotoChart(pat.PatNum);
                    }
                    else
                    {
                        GotoModule.GotoAccount(pat.PatNum);
                    }
                }
            }
            if (gotoType == TaskObjectType.Appointment)
            {
                if (gotoKeyNum != 0)
                {
                    Appointment apt = Appointments.GetOneApt(gotoKeyNum);
                    if (apt == null)
                    {
                        MsgBox.Show(this, "Appointment has been deleted, so it's not available.");
                        return;
                        //this could be a little better, because window has closed, but they will learn not to push that button.
                    }
                    DateTime dateSelected = DateTime.MinValue;
                    if (apt.AptStatus == ApptStatus.Planned || apt.AptStatus == ApptStatus.UnschedList)
                    {
                        //I did not add feature to put planned or unsched apt on pinboard.
                        MsgBox.Show(this, "Cannot navigate to appointment.  Use the Other Appointments button.");
                        //return;
                    }
                    else
                    {
                        dateSelected = apt.AptDateTime;
                    }
                    Patient pat = Patients.GetPat(apt.PatNum);
                    //OnPatientSelected(pat);
                    GotoModule.GotoAppointment(dateSelected, apt.AptNum);
                }
            }
            //DialogResult=DialogResult.OK;
        }
Beispiel #9
0
        /// <summary>Gets all task lists with the given object type.
        /// Used in TaskListSelect when assigning an object to a task list. If doIncludeArchived is false, also excludes child lists of archived lists.
        /// </summary>
        public static List <TaskList> GetForObjectType(TaskObjectType objectType, bool doIncludeArchived)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                return(Meth.GetObject <List <TaskList> >(MethodBase.GetCurrentMethod(), objectType, doIncludeArchived));
            }
            List <TaskList>             listTaskLists    = GetAll();
            Dictionary <long, TaskList> dictAllTaskLists = listTaskLists.ToDictionary(x => x.TaskListNum);

            listTaskLists.RemoveAll(x => x.ObjectType != objectType ||
                                    //We are excluding archived lists AND The current task list or any of its ancestors are archived
                                    (!doIncludeArchived && (x.TaskListStatus == TaskListStatusEnum.Archived || IsAncestorTaskListArchived(ref dictAllTaskLists, x, true))));
            return(listTaskLists.OrderBy(x => x.Descript).ToList());
        }
Beispiel #10
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();
        }
Beispiel #11
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();
 }
Beispiel #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();
 }
Beispiel #13
0
        ///<summary>Creates a TaskSubscription, dateTimeEntry will be DateTime.Now if not specified.</summary>
        public static Task CreateTask(long taskListNum          = 0, long keyNum = 0, string descript = "",
                                      TaskStatusEnum taskStatus = TaskStatusEnum.New, bool isRepeating        = false, TaskDateType dateType = TaskDateType.None, long fromNum       = 0,
                                      TaskObjectType objectType = TaskObjectType.None, DateTime dateTimeEntry = new DateTime(), long userNum = 0, bool isUnread                      = false, string parentDesc = "", string patientName = "",
                                      long priorityDefNum       = 0, string reminderGroupId = "", TaskReminderType reminderType = TaskReminderType.NoReminder, int reminderFrequency = 0)
        {
            if (dateTimeEntry == DateTime.MinValue)
            {
                dateTimeEntry = DateTime.Now;
            }
            Task task = new Task
            {
                TaskListNum       = taskListNum,
                DateTask          = DateTime.MinValue,
                KeyNum            = keyNum,
                Descript          = descript,
                TaskStatus        = taskStatus,
                IsRepeating       = isRepeating,
                DateType          = dateType,
                FromNum           = fromNum,
                ObjectType        = objectType,
                DateTimeEntry     = dateTimeEntry,
                UserNum           = userNum,
                DateTimeFinished  = DateTime.MinValue,
                IsUnread          = isUnread,
                ParentDesc        = parentDesc,
                PatientName       = patientName,
                PriorityDefNum    = priorityDefNum,
                ReminderGroupId   = reminderGroupId,
                ReminderType      = reminderType,
                ReminderFrequency = reminderFrequency,
                DateTimeOriginal  = DateTime.Now
            };

            Tasks.Insert(task);
            task = Tasks.GetOne(task.TaskNum);          //Make sure task matches Db. Avoids problems with DateTime columns.
            return(task);
        }
Beispiel #14
0
        /// <summary>Gets all task lists with the give object type.  Used in TaskListSelect when assigning an object to a task list.</summary>
        public static TaskList[] GetForObjectType(TaskObjectType oType)
        {
            string command =
                "SELECT * FROM tasklist "
                + "WHERE ObjectType=" + POut.PInt((int)oType)
                + " ORDER BY Descript";
            DataTable table = General.GetTable(command);

            TaskList[] List = new TaskList[table.Rows.Count];
            for (int i = 0; i < table.Rows.Count; i++)
            {
                List[i]               = new TaskList();
                List[i].TaskListNum   = PIn.PInt(table.Rows[i][0].ToString());
                List[i].Descript      = PIn.PString(table.Rows[i][1].ToString());
                List[i].Parent        = PIn.PInt(table.Rows[i][2].ToString());
                List[i].DateTL        = PIn.PDate(table.Rows[i][3].ToString());
                List[i].IsRepeating   = PIn.PBool(table.Rows[i][4].ToString());
                List[i].DateType      = (TaskDateType)PIn.PInt(table.Rows[i][5].ToString());
                List[i].FromNum       = PIn.PInt(table.Rows[i][6].ToString());
                List[i].ObjectType    = (TaskObjectType)PIn.PInt(table.Rows[i][7].ToString());
                List[i].DateTimeEntry = PIn.PDateT(table.Rows[i][8].ToString());
            }
            return(List);
        }
Beispiel #15
0
 private void TaskGoTo(TaskObjectType taskOT,long keyNum)
 {
     if(taskOT==TaskObjectType.None) {
         return;
     }
     if(taskOT==TaskObjectType.Patient) {
         if(keyNum!=0) {
             CurPatNum=keyNum;
             Patient pat=Patients.GetPat(CurPatNum);
             RefreshCurrentModule();
             FillPatientButton(CurPatNum,pat.GetNameLF(),pat.Email!="",pat.ChartNumber,pat.SiteNum);
         }
     }
     if(taskOT==TaskObjectType.Appointment) {
         if(keyNum!=0) {
             Appointment apt=Appointments.GetOneApt(keyNum);
             if(apt==null) {
                 MsgBox.Show(this,"Appointment has been deleted, so it's not available.");
                 return;
             }
             DateTime dateSelected=DateTime.MinValue;
             if(apt.AptStatus==ApptStatus.Planned || apt.AptStatus==ApptStatus.UnschedList) {
                 //I did not add feature to put planned or unsched apt on pinboard.
                 MsgBox.Show(this,"Cannot navigate to appointment.  Use the Other Appointments button.");
                 //return;
             }
             else {
                 dateSelected=apt.AptDateTime;
             }
             CurPatNum=apt.PatNum;//OnPatientSelected(apt.PatNum);
             GotoModule.GotoAppointment(dateSelected,apt.AptNum);
         }
     }
 }
Beispiel #16
0
		public void TaskGoToEvent(object sender,CancelEventArgs e) {
			FormTaskEdit FormT=(FormTaskEdit)sender;
			if(FormT.GotoType!=TaskObjectType.None) {
				GotoType=FormT.GotoType;
				GotoKeyNum=FormT.GotoKeyNum;
				OnGoToChanged();
			}
			if(!this.IsDisposed) {
				FillGrid();
			}
		}
		private void butGoto_Click(object sender,System.EventArgs e) {
			if(OwnedForms.Length>0) {
				MsgBox.Show(this,"One or more task note edit windows are open and must be closed.");
				return;
			}
			if(!SaveCur()) {
				return;
			}
			GotoType=TaskCur.ObjectType;
			GotoKeyNum=TaskCur.KeyNum;
			DialogResult=DialogResult.OK;
			Close();
		}
Beispiel #18
0
 private void userControlTasks1_GoToChanged(object sender,EventArgs e)
 {
     GotoType=userControlTasks1.GotoType;
     GotoKeyNum=userControlTasks1.GotoKeyNum;
     DialogResult=DialogResult.OK;
 }
Beispiel #19
0
 private void butGoto_Click(object sender, System.EventArgs e)
 {
     if(!SaveCur()){
         return;
     }
     GotoType=TaskCur.ObjectType;
     GotoKeyNum=TaskCur.KeyNum;
     DialogResult=DialogResult.OK;
     Close();
 }
Beispiel #20
0
 private void userControlTasks1_GoToChanged(object sender, EventArgs e)
 {
     GotoType     = userControlTasks1.GotoType;
     GotoKeyNum   = userControlTasks1.GotoKeyNum;
     DialogResult = DialogResult.OK;
 }
Beispiel #21
0
        ///<summary>Creates a TaskList.  If parent is not 0, then a parentDesc must also be provided.</summary>
        public static TaskList CreateTaskList(string descript = "", long parent = 0, bool isRepeating = false, TaskDateType dateType = TaskDateType.None, long fromNum = 0, TaskObjectType objectType = TaskObjectType.None, string parentDesc = "", GlobalTaskFilterType globalTaskFilterType = GlobalTaskFilterType.None)
        {
            TaskList taskList = new TaskList
            {
                Descript             = descript,
                Parent               = parent,
                DateTL               = DateTime.MinValue,
                IsRepeating          = isRepeating,
                DateType             = dateType,
                FromNum              = fromNum,
                ObjectType           = objectType,
                DateTimeEntry        = DateTime.Now,
                ParentDesc           = parentDesc,
                NewTaskCount         = 0,
                GlobalTaskFilterType = globalTaskFilterType,
            };

            TaskLists.Insert(taskList);
            return(taskList);
        }
Beispiel #22
0
		private void Goto_Clicked() {
			//not even allowed to get to this point unless a valid task
			Task task=TasksList[clickedI-TaskListsList.Count];
			GotoType=task.ObjectType;
			GotoKeyNum=task.KeyNum;
			OnGoToChanged();
		}