protected void Page_Load(object sender, EventArgs e)
 {
     taskResultSettings = new TaskResultSettings(SPContext.Current.Site.ID);
     if (!IsPostBack)
     {
         switchView();
         loadData();
     }
 }
Exemple #2
0
 private void initialData_ExecuteCode(object sender, EventArgs e)
 {
     taskResultSettings = new TaskResultSettings(WorkflowProperties.Site.ID);
     // reassigned, requested or finished
     if (_previousTaskId != -1)
     {
         createNextTask();
         return;
     }
     createFirstTask();
 }
        private void initialValueApprovalData_ExecuteCode(object sender, EventArgs e)
        {
            taskResultSettings = new TaskResultSettings(__ActivationProperties.Site.ID);
            SPSecurity.RunWithElevatedPrivileges(delegate()
            {
                Guid approvalListGuiId = Guid.Empty;
                try
                {
                    approvalListGuiId = new Guid(ApprovalListId);
                }
                catch { };
                SPList approvalList = null;
                if (approvalListGuiId != Guid.Empty)
                    approvalList = __ActivationProperties.Web.Lists.GetList(approvalListGuiId, false);
                else
                    approvalList = __ActivationProperties.GetListFromURL(ApprovalListId);

                if (approvalList == null) throw new Exception();

                SPListItem approvalValueItem = GetApprovalValueItem(approvalList, Amount);
                if (approvalValueItem == null)
                {
                    _blnExistApprovalValueItem = false;
                    this.Status = SKIPPED_STATUS;
                    return;
                }

                GenerateOutputValue(approvalValueItem);

                _strApprovalConfigurationListURL = GetApprovalConfigurationListURL(approvalList, APPROVAL_COLUMN);
                SetValuesToListApprovalLevel(approvalValueItem);
            });
        }
 private void InitialData_ExecuteCode(object sender, EventArgs e)
 {
     taskResultSettings = new TaskResultSettings(__ActivationProperties.Site.ID);
     _isItemDocumentType = __ActivationProperties.List.BaseTemplate == SPListTemplateType.DocumentLibrary ? true : false;
     InitialApprovalConfiguration();
 }
        private void initialData_ExecuteCode(object sender, EventArgs e)
        {
            taskResultSettings = new TaskResultSettings(WorkflowProperties.Site.ID);
            TaskListId = WorkflowProperties.TaskList.ID.ToString();

            string assignee = ApprovalInfoTask.InitialAssignTo;
            ApprovalInfoTask = applyProxy(ApprovalInfoTask);

            logInfoProxy(assignee);

            if (SPUtility.IsLoginValid(WorkflowProperties.Site, ApprovalInfoTask.InitialAssignTo) && !string.IsNullOrEmpty(ApprovalInfoTask.AssignToEmail))
                AssingeeEmailsList.Add(ApprovalInfoTask.AssignToEmail);
            else
            {   //might be a group
                SPGroup groupApprover = null;
                foreach (SPGroup g in WorkflowProperties.Site.RootWeb.SiteGroups)
                {
                    if (string.Compare(g.Name, ApprovalInfoTask.InitialAssignTo, true) == 0)
                    {
                        groupApprover = g;
                        break;
                    }
                }

                if (groupApprover != null)
                {
                    foreach (SPUser user in groupApprover.Users)
                    {
                        AssingeeEmailsList.Add(user.Email);
                    }
                }
            }

            //_emailBody = SendEmailHelper.GetEmailBodyFromTemplate(Parameter.Context,
            //    Parameter.ListId,
            //    Parameter.ListItem,
            //    Parameter.ApprovalConfiguation.URLEmailTemplate,
            //    Parameter.ApprovalConfiguation.AssignmentEmailTemplate);
        }
        private void initialEntryApprovalData_ExecuteCode(object sender, EventArgs e)
        {
            taskResultSettings = new TaskResultSettings(__ActivationProperties.Site.ID);
            SPSecurity.RunWithElevatedPrivileges(delegate()
            {
                SPList approvalList = __ActivationProperties.Web.Lists.GetList(new Guid(ApprovalListId), false);

                SPListItem approvalValueItem = GetEntryApprovalItem(approvalList, ApprovalKey);
                if (approvalValueItem == null)
                {
                    _blnExistEntryApprovalItem = false;
                    this.Status = SKIPPED_STATUS;
                    return;
                }

                GenerateOutputValue(approvalValueItem);
                _strApprovalConfigurationListURL = GetApprovalConfigurationListURL(approvalList, APPROVAL_COLUMN);
                SetValuesToListApprovalLevel(approvalValueItem);

            });
        }