Beispiel #1
0
        public void EditTaskListFileVisibility(TaskListFile fileTaskLink, Boolean visibleForModule, Boolean visibleForRepository)
        {
            Person person = Manager.GetPerson(UC.CurrentUserID);

            if (person != null && fileTaskLink != null)
            {
                try
                {
                    Manager.BeginTransaction();
                    fileTaskLink.UpdateMetaInfo(person, UC.IpAddress, UC.ProxyIpAddress);
                    fileTaskLink.isVisible = visibleForModule;
                    if (fileTaskLink.File != null & !fileTaskLink.File.IsInternal)
                    {
                        fileTaskLink.File.isVisible  = visibleForRepository;
                        fileTaskLink.File.ModifiedBy = person;
                        fileTaskLink.File.ModifiedOn = fileTaskLink.ModifiedOn;
                        Manager.SaveOrUpdate(fileTaskLink.File);
                    }

                    Manager.SaveOrUpdate(fileTaskLink);
                    fileTaskLink.TaskOwner.MetaInfo.ModifiedBy = fileTaskLink.ModifiedBy;
                    fileTaskLink.TaskOwner.MetaInfo.ModifiedOn = fileTaskLink.ModifiedOn.Value;
                    Manager.SaveOrUpdate(fileTaskLink.TaskOwner);
                    Manager.Commit();
                }
                catch (Exception ex)
                {
                    Manager.RollBack();
                }
            }
        }
Beispiel #2
0
        private void EditFileTaskVisibility(TaskListFile fileTaskLink)
        {
            Person person = Manager.GetPerson(UC.CurrentUserID);

            if (person != null && fileTaskLink != null)
            {
                try
                {
                    Manager.BeginTransaction();
                    fileTaskLink.UpdateMetaInfo(person, UC.IpAddress, UC.ProxyIpAddress);
                    fileTaskLink.isVisible = !fileTaskLink.isVisible;
                    Manager.SaveOrUpdate(fileTaskLink);
                    fileTaskLink.TaskOwner.MetaInfo.ModifiedBy = fileTaskLink.ModifiedBy;
                    fileTaskLink.TaskOwner.MetaInfo.ModifiedOn = fileTaskLink.ModifiedOn.Value;
                    Manager.SaveOrUpdate(fileTaskLink.TaskOwner);
                    Manager.Commit();
                }
                catch (Exception ex)
                {
                    Manager.RollBack();
                }
            }
        }
Beispiel #3
0
        //------------------------------------------------------------------------------------------------------------------------------------------------------------------
        private void SetVirtualDeleteFileTaskLink(long taskfileID, Boolean delete)
        {
            Person       person       = Manager.GetPerson(UC.CurrentUserID);
            TaskListFile fileTaskLink = Manager.Get <TaskListFile>(taskfileID);

            if (person != null && fileTaskLink != null)
            {
                try
                {
                    Manager.BeginTransaction();
                    fileTaskLink.UpdateMetaInfo(person, UC.IpAddress, UC.ProxyIpAddress);
                    fileTaskLink.Deleted = delete ? BaseStatusDeleted.Manual : BaseStatusDeleted.None;
                    fileTaskLink.TaskOwner.MetaInfo.ModifiedBy = fileTaskLink.ModifiedBy;
                    fileTaskLink.TaskOwner.MetaInfo.ModifiedOn = fileTaskLink.ModifiedOn.Value;
                    Manager.SaveOrUpdate(fileTaskLink.TaskOwner);
                    Manager.SaveOrUpdate(fileTaskLink);
                    Manager.Commit();
                }
                catch (Exception ex)
                {
                    Manager.RollBack();
                }
            }
        }