Exemple #1
0
        public static TaskObject TaskRowToObject(DataRow task)
        {
            TaskObject obj = new TaskObject();

            try
            {
                if (task != null)
                {
                    obj.TaskID       = RowFunctions.GetValueFromRowToGuid(task, TaskObject.TASK_ID, true, DataRowVersion.Current);
                    obj.Tag          = RowFunctions.GetValueFromRowToString(task, TaskObject.TAG, true, DataRowVersion.Current);
                    obj.CreationDate = RowFunctions.GetValueFromRowToString(task, TaskObject.CREATION_DATE, true, DataRowVersion.Current);
                    obj.UpdateDate   = RowFunctions.GetValueFromRowToString(task, TaskObject.UPDATE_DATE, true, DataRowVersion.Current);
                    obj.DueDate      = RowFunctions.GetValueFromRowToString(task, TaskObject.DUE_DATE, true, DataRowVersion.Current);
                    //Do not upload the task description as default for performance issues.
                    obj.Status   = (Enumeration.Task.Status)RowFunctions.GetValueFromRowToInteger(task, TaskObject.STATUS, true, DataRowVersion.Current);
                    obj.Priority = (Enumeration.Task.Priority)RowFunctions.GetValueFromRowToInteger(task, TaskObject.PRIORITY, true, DataRowVersion.Current);
                    obj.Effort   = (Enumeration.Task.Effort)RowFunctions.GetValueFromRowToInteger(task, TaskObject.EFFORT, true, DataRowVersion.Current);
                    return(obj);
                }
                obj = null;
            }
            catch (System.Exception exception1)
            {
                Exception innerException = exception1;
                throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
            return(obj);
        }
Exemple #2
0
 public static TaskObject TaskRowToObject(DataRow task)
 {
     TaskObject obj = new TaskObject();
     try
     {
         if (task != null)
         {
             obj.TaskID = RowFunctions.GetValueFromRowToGuid(task, TaskObject.TASK_ID, true, DataRowVersion.Current);
             obj.Tag = RowFunctions.GetValueFromRowToString(task, TaskObject.TAG, true, DataRowVersion.Current);
             obj.CreationDate = RowFunctions.GetValueFromRowToString(task, TaskObject.CREATION_DATE, true, DataRowVersion.Current);
             obj.UpdateDate = RowFunctions.GetValueFromRowToString(task, TaskObject.UPDATE_DATE, true, DataRowVersion.Current);
             obj.DueDate = RowFunctions.GetValueFromRowToString(task, TaskObject.DUE_DATE, true, DataRowVersion.Current);
             //Do not upload the task description as default for performance issues.
             obj.Status = (Enumeration.Task.Status)RowFunctions.GetValueFromRowToInteger(task, TaskObject.STATUS, true, DataRowVersion.Current);
             obj.Priority = (Enumeration.Task.Priority)RowFunctions.GetValueFromRowToInteger(task, TaskObject.PRIORITY, true, DataRowVersion.Current);
             obj.Effort = (Enumeration.Task.Effort)RowFunctions.GetValueFromRowToInteger(task, TaskObject.EFFORT, true, DataRowVersion.Current);
             return obj;
         }
         obj = null;
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
     return obj;
 }
 public int Add(TaskObject value)
 {
     try
     {
         return(List.Add(value));
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
Exemple #4
0
 public void GetDescription(TaskObject task)
 {
     try
     {
         task.Description = new TaskDataService().GetDescription(task.TaskID);
     }
     catch (Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
 public void Remove(TaskObject value)
 {
     try
     {
         List.Remove(value);
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
 // Called by TaskObject when it changes
 internal void TaskObjectChanged(TaskObject task)
 {
     try
     {
         int index = List.IndexOf(task);
         OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, index));
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
 // Methods.
 object IBindingList.AddNew()
 {
     try
     {
         TaskObject task = new TaskObject();
         List.Add(task);
         return(task);
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
 protected override void OnRemoveComplete(int index, object value)
 {
     try
     {
         TaskObject task = (TaskObject)value;
         task.Parent = this;
         OnListChanged(new ListChangedEventArgs(ListChangedType.ItemDeleted, index));
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
Exemple #9
0
 public TaskPeopleObjectCollection GetAssigneesSupplierByTaskID(TaskObject task)
 {
     TaskPeopleObjectCollection taskPeoples;
     try
     {
         taskPeoples = new TaskPeopleDataService().GetAssigneesSupplierByTaskID(task.TaskID);
     }
     catch (System.Exception exception1)
     {
         System.Exception innerException = exception1;
         throw new System.Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
     return taskPeoples;
 }
Exemple #10
0
 public void AddChilds(TaskObject task)
 {
     try
     {
         TaskPeople bl = new TaskPeople();
         task.AssigneesCustomer = bl.GetAssigneesCustomerByTaskID(task);
         task.AssigneesEmployee = bl.GetAssigneesEmployeeByTaskID(task);
         task.AssigneesSupplier = bl.GetAssigneesSupplierByTaskID(task);
         task.AssigneesUnknown = bl.GetAssigneesUnknownByTaskID(task);
         task.Reporters = bl.GetReporterByTaskID(task);
         task.Subscriptions = new TaskSchedule().GetSchedulesByTaskID(task);
         task.ChildsAdded = true;
     }
     catch (Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
        protected override void OnSetComplete(int index, object oldValue, object newValue)
        {
            try
            {
                if (oldValue != newValue)
                {
                    TaskObject oldTask = (TaskObject)oldValue;
                    TaskObject newTask = (TaskObject)newValue;
                    oldTask.Parent = null;
                    newTask.Parent = this;

                    OnListChanged(new ListChangedEventArgs(ListChangedType.ItemAdded, index));
                }
            }
            catch (System.Exception exception1)
            {
                Exception innerException = exception1;
                throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
        }
Exemple #12
0
 public Task(PROF_IT.Common.Enumerations.TypeForm typeForm, TaskObject task)
 {
     try
     {
         _taskOriginal = task.Clone();
         InitializeComponent();
         _task     = task;
         _typeForm = typeForm;
         if (_typeForm == PROF_IT.Common.Enumerations.TypeForm.NewForm)
         {
             throw new NotImplementedException();
         }
         else
         {
             InitializePropertyForm();
         }
     }
     catch (System.Exception exception1)
     {
         System.Exception innerException = exception1;
         throw new System.Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
Exemple #13
0
        public void Initialize()
        {
            try
            {
                _task = new TaskObject();
                gdcAssigneeSupplier.DataSource = TaskMember.AssigneesSupplier.GetActive();
                gdcAssigneeEmployee.DataSource = TaskMember.AssigneesEmployee.GetActive();
                gdcAssigneeUnknown.DataSource  = TaskMember.AssigneesUnknown.GetActive();
                gdcSubscription.DataSource     = TaskMember.Subscriptions.GetActive();

                glouReporter.Properties.DataSource    = new BL.Internal.Employee().GetAll();
                glouReporter.Properties.ValueMember   = "EmpID";
                glouReporter.Properties.DisplayMember = "Email";
                cmbEffort.Properties.Items.AddRange(Enum.GetValues(typeof(Enumeration.Task.Effort)));
                cmbPriority.Properties.Items.AddRange(Enum.GetValues(typeof(Enumeration.Task.Priority)));
                cmbStatus.Properties.Items.AddRange(Enum.GetValues(typeof(Enumeration.Task.Status)));
            }
            catch (System.Exception exception1)
            {
                System.Exception innerException = exception1;
                throw new System.Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
        }
Exemple #14
0
 public void Save(TaskObject task)
 {
     try
     {
         CheckTransaction();
         new TaskDataService(Transaction).Save(task);
         if (task.AssigneesCustomer != null)
             new TaskPeople(Transaction).Save(task.AssigneesCustomer);
         if (task.AssigneesEmployee != null)
             new TaskPeople(Transaction).Save(task.AssigneesEmployee);
         if (task.AssigneesSupplier != null)
             new TaskPeople(Transaction).Save(task.AssigneesSupplier);
         if (task.AssigneesUnknown != null)
             new TaskPeople(Transaction).Save(task.AssigneesUnknown);
         if (task.Reporters != null)
             new TaskPeople(Transaction).Save(task.Reporters);
         if (task.Subscriptions != null)
             new TaskSchedule(Transaction).Save(task.Subscriptions);
         if (IsOwner) Transaction.Commit();
     }
     catch (Exception exception1)
     {
         if (IsOwner) Transaction.Rollback();
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
     finally
     {
         if (IsOwner) Connection.Close();
     }
 }
 public int Add(TaskObject value)
 {
     try
     {
         return List.Add(value);
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
Exemple #16
0
        private void ProcessEmailAddressReporter(TaskObject task, string emailAddress)
        {
            TIS.BL.Internal.Employee blEmp = new TIS.BL.Internal.Employee();
            TIS.DL.Internal.Employee.EmployeeObject employee;
            TIS.DL.Internal.TaskPeople.TaskPeopleObject taskPeople;

            try
            {
                //Voorlopig enkel werkbaar voor Thomas
                employee = blEmp.GetEmployeeByEmail("*****@*****.**");
                if (employee == null)
                {
                    throw new System.Exception("E-mail adres van outlook account is niet gekend binnen TIS, gelieve de applicatiebeheerder te contacteren");
                }
                else
                {
                    taskPeople = ProcessEmployee(employee);
                    taskPeople.Task = task;
                    task.Reporters.Add(taskPeople);
                }
            }
            catch (System.Exception exception1)
            {
                System.Exception innerException = exception1;
                throw new System.Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
        }
Exemple #17
0
        private void CreateEmailAddress(TaskObject task, string emailAddress)
        {
            TIS.BL.Internal.Employee blEmp = new TIS.BL.Internal.Employee();
            TIS.BL.Internal.Supplier blSup = new TIS.BL.Internal.Supplier();
            TIS.BL.Internal.Unknown blUnk = new TIS.BL.Internal.Unknown();
            TIS.DL.Internal.Employee.EmployeeObject employee;
            TIS.DL.Internal.Supplier.SupplierObject supplier;
            TIS.DL.Internal.Unknown.UnknownObject unknown;
            TIS.DL.Internal.TaskPeople.TaskPeopleObject taskPeople;

            try
            {
                if (PROF_IT.Common.Functions.Functions.IsEmailAddress(emailAddress))
                {
                    employee = blEmp.GetEmployeeByEmail(emailAddress);
                    if (employee != null)
                    {
                        taskPeople = ProcessEmployee(employee);
                        taskPeople.Task = task;
                        task.AssigneesEmployee.Add(taskPeople);
                    }

                    supplier = blSup.GetSupplierByEmail(emailAddress);
                    if (supplier != null)
                    {
                        taskPeople = ProcessSupplier(supplier);
                        taskPeople.Task = task;
                        task.AssigneesSupplier.Add(taskPeople);
                    }

                    if (supplier == null & employee == null)
                    {
                        unknown = blUnk.GetUnknownByEmail(emailAddress);
                        if (unknown != null)
                        {
                            taskPeople = ProcessUnknown(unknown);
                            taskPeople.Task = task;
                            task.AssigneesUnknown.Add(taskPeople);
                        }
                        else
                        {
                            //Create Unknown record
                            unknown = new UnknownObject();
                            unknown.Email = emailAddress;
                            unknown.State = PROF_IT.Common.Enumerations.ObjectState.Created;
                            blUnk.Save(unknown);
                            taskPeople = ProcessUnknown(unknown);
                            taskPeople.Task = task;
                            task.AssigneesUnknown.Add(taskPeople);
                        }
                    }
                }
            }
            catch (System.Exception exception1)
            {
                System.Exception innerException = exception1;
                throw new System.Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
        }
 // Called by TaskObject when it changes
 internal void TaskObjectChanged(TaskObject task)
 {
     try
     {
         int index = List.IndexOf(task);
         OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, index));
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
 public void Remove(TaskObject value)
 {
     try
     {
         List.Remove(value);
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
 // Methods.
 object IBindingList.AddNew()
 {
     try
     {
         TaskObject task = new TaskObject();
         List.Add(task);
         return task;
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
 void IEditableObject.EndEdit()
 {
     try
     {
         if (inTxn)
         {
             _loadedTask = this.Task;
             _loadedEmployee = this.Employee;
             _loadedSupplier = this.Supplier;
             _loadedCustomer = this.Customer;
             _loadedUnknown = this.Unknown;
             _loadedAssignee = this.Assignee;
             _loadedReporter = this.Reporter;
             inTxn = false;
         }
     }
     catch (Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
Exemple #22
0
        private void Create(Microsoft.Office.Interop.Outlook.MailItem mailItem)
        {
            String messageClass;

            DevExpress.XtraRichEdit.RichEditControl    rtfControl = new DevExpress.XtraRichEdit.RichEditControl();
            TIS.DL.Internal.Task.TaskObject            taskObj;
            Microsoft.Office.Interop.Outlook.Inspector inspector;
            try
            {
                messageClass = mailItem.MessageClass;


                if (messageClass == "IPM.Note")
                {
                    taskObj = new TIS.DL.Internal.Task.TaskObject();
                    ProcessEmailAddresses(taskObj, mailItem);
                    //Get Reporter
                    Microsoft.Office.Interop.Outlook.NameSpace outNamespace;
                    outNamespace = Application.GetNamespace("MAPI");
                    Microsoft.Office.Interop.Outlook.Recipient reporter = outNamespace.CurrentUser;
                    ProcessEmailAddressReporter(taskObj, reporter.Address);

                    taskObj.CreationDate = PROF_IT.Common.Convert.DateFunctions.DateToStrDate(System.DateTime.Now);
                    //RTF BODY
                    inspector = mailItem.GetInspector;
                    inspector.Activate();
                    Microsoft.Office.Interop.Word.Document document = (Microsoft.Office.Interop.Word.Document)inspector.WordEditor;
                    document.Select();
                    document.Application.Selection.Copy();
                    rtfControl.Paste();
                    taskObj.Description = rtfControl.RtfText;

                    //Subject
                    taskObj.Tag = mailItem.Subject;
                    switch (mailItem.Importance)
                    {
                    case Microsoft.Office.Interop.Outlook.OlImportance.olImportanceHigh:
                        taskObj.Priority = TIS.Framework.Common.Enumeration.Task.Priority.High;
                        break;

                    case Microsoft.Office.Interop.Outlook.OlImportance.olImportanceLow:
                        taskObj.Priority = TIS.Framework.Common.Enumeration.Task.Priority.Low;
                        break;

                    case Microsoft.Office.Interop.Outlook.OlImportance.olImportanceNormal:
                        taskObj.Priority = TIS.Framework.Common.Enumeration.Task.Priority.Medium;
                        break;
                    }
                    taskObj.Effort = TIS.Framework.Common.Enumeration.Task.Effort.Low;
                    taskObj.Status = TIS.Framework.Common.Enumeration.Task.Status.Open;

                    Task task = new Task(PROF_IT.Common.Enumerations.TypeForm.PropertyForm, taskObj);
                    task.ShowDialog();

                    //Close document, inspector
                    if (inspector != null)
                    {
                        inspector.Close(Microsoft.Office.Interop.Outlook.OlInspectorClose.olDiscard);
                    }
                    document  = null;
                    inspector = null;
                    mailItem  = null;
                }
                else
                {
                    MessageBox.Show("Kan geen task creëren omdat het geselecteerde item geen e-mail is!");
                }
            }
            catch (System.Exception exception1)
            {
                System.Exception innerException = exception1;
                throw new System.Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
            finally
            {
                rtfControl.Dispose();
            }
        }
 void IEditableObject.EndEdit()
 {
     try
     {
         if (inTxn)
         {
             _loadedTask = this.Task;
             _loadedSchedule = this.Schedule;
             inTxn = false;
         }
     }
     catch (Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
Exemple #24
0
 private void ProcessEmailAddresses(TaskObject task, Microsoft.Office.Interop.Outlook.MailItem mail)
 {
     try
     {
         //Add Sender to task
         if (mail.SenderEmailAddress != null & mail.SenderEmailAddress != "")
             CreateEmailAddress(task, mail.SenderEmailAddress);
         //Add recipients (Employees and Suppliers) to task
         foreach (Microsoft.Office.Interop.Outlook.Recipient recipient in mail.Recipients)
         {
             if (recipient.Address != "" & recipient.Address != null)
             {
                 CreateEmailAddress(task, recipient.Address);
             }
         }
     }
     catch (System.Exception exception1)
     {
         System.Exception innerException = exception1;
         throw new System.Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
Exemple #25
0
 public bool Remove(TaskObject task)
 {
     SqlCommand cmd = null;
     try
     {
         ExecuteNonQuery(out cmd, false, "Task_DELETE",
             CreateParameter("@taskID", SqlDbType.UniqueIdentifier, task.TaskID, ParameterDirection.Input)
             );
         return true;
     }
     catch (Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
     finally
     {
         if (cmd != null)
         {
             cmd.Dispose();
         }
         cmd = null;
     }
 }
Exemple #26
0
        private void Create(Microsoft.Office.Interop.Outlook.MailItem mailItem)
        {
            String messageClass;
            DevExpress.XtraRichEdit.RichEditControl rtfControl = new DevExpress.XtraRichEdit.RichEditControl();
            TIS.DL.Internal.Task.TaskObject taskObj;
            Microsoft.Office.Interop.Outlook.Inspector inspector;
            try
            {
                messageClass = mailItem.MessageClass;

                if (messageClass == "IPM.Note")
                {
                    taskObj = new TIS.DL.Internal.Task.TaskObject();
                    ProcessEmailAddresses(taskObj, mailItem);
                    //Get Reporter
                    Microsoft.Office.Interop.Outlook.NameSpace outNamespace;
                    outNamespace = Application.GetNamespace("MAPI");
                    Microsoft.Office.Interop.Outlook.Recipient reporter = outNamespace.CurrentUser;
                    ProcessEmailAddressReporter(taskObj, reporter.Address);

                    taskObj.CreationDate = PROF_IT.Common.Convert.DateFunctions.DateToStrDate(System.DateTime.Now);
                    //RTF BODY
                    inspector = mailItem.GetInspector;
                    inspector.Activate();
                    Microsoft.Office.Interop.Word.Document document = (Microsoft.Office.Interop.Word.Document)inspector.WordEditor;
                    document.Select();
                    document.Application.Selection.Copy();
                    rtfControl.Paste();
                    taskObj.Description = rtfControl.RtfText;

                    //Subject
                    taskObj.Tag = mailItem.Subject;
                    switch (mailItem.Importance)
                    {
                        case Microsoft.Office.Interop.Outlook.OlImportance.olImportanceHigh:
                            taskObj.Priority = TIS.Framework.Common.Enumeration.Task.Priority.High;
                            break;
                        case Microsoft.Office.Interop.Outlook.OlImportance.olImportanceLow:
                            taskObj.Priority = TIS.Framework.Common.Enumeration.Task.Priority.Low;
                            break;
                        case Microsoft.Office.Interop.Outlook.OlImportance.olImportanceNormal:
                            taskObj.Priority = TIS.Framework.Common.Enumeration.Task.Priority.Medium;
                            break;
                    }
                    taskObj.Effort = TIS.Framework.Common.Enumeration.Task.Effort.Low;
                    taskObj.Status = TIS.Framework.Common.Enumeration.Task.Status.Open;

                    Task task = new Task(PROF_IT.Common.Enumerations.TypeForm.PropertyForm, taskObj);
                    task.ShowDialog();

                    //Close document, inspector
                    if (inspector != null) inspector.Close(Microsoft.Office.Interop.Outlook.OlInspectorClose.olDiscard);
                    document = null;
                    inspector = null;
                    mailItem = null;
                }
                else
                {
                    MessageBox.Show("Kan geen task creëren omdat het geselecteerde item geen e-mail is!");
                }
            }
            catch (System.Exception exception1)
            {
                System.Exception innerException = exception1;
                throw new System.Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
            finally
            {

                rtfControl.Dispose();
            }
        }
Exemple #27
0
 public void Save(TaskObject task)
 {
     SqlCommand cmd = null;
     try
     {
         ExecuteNonQuery(out cmd, false, "Task_SAVE",
             CreateParameter("@taskID", SqlDbType.UniqueIdentifier, task.TaskID, ParameterDirection.InputOutput),
             CreateParameter("@Tag", SqlDbType.VarChar, task.Tag),
             CreateParameter("@CreationDate", SqlDbType.VarChar, task.CreationDate),
             CreateParameter("@UpdateDate", SqlDbType.VarChar, task.UpdateDate),
             CreateParameter("@DueDate", SqlDbType.VarChar, task.DueDate),
             CreateParameter("@Description", SqlDbType.VarChar, task.Description),
             CreateParameter("@Status", SqlDbType.Int, task.Status),
             CreateParameter("@Priority", SqlDbType.Int, task.Priority),
             CreateParameter("@Effort", SqlDbType.Int, task.Effort)
             );
         task.TaskID = (Guid)cmd.Parameters["@taskID"].Value;
     }
     catch (Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
     finally
     {
         if (cmd != null)
         {
             cmd.Dispose();
         }
         cmd = null;
     }
 }