示例#1
0
        private List<string> GetApprovers(ApprovalLevelInfo approvalLevelInfo)
        {
            //TOTO - Modify this function to allow get dynamic user as a setting inputed from initiation form

            return approvalLevelInfo.SpecificUserGroup;
        }
        // This method is called when the user clicks the button to start the workflow.
        private string GetInitiationData()
        {
            IModel.ApprovalWFInitiationData initData = new IModel.ApprovalWFInitiationData();

            foreach (RepeaterItem item in this.cdcatalog.Items)
            {
                PeopleEditor peSpecificUsesGroup = item.FindControl("peSpecificUsesGroup") as PeopleEditor;
                TextBox txtDueDate = item.FindControl("txtDueDate") as TextBox;
                TextBox txtDuration = item.FindControl("txtDuration") as TextBox;
                EncodedLiteral level = item.FindControl("targetAppAdminDescription") as EncodedLiteral;
                TextBox txtMessage = item.FindControl("txtMessage") as TextBox;
                TextBox txtMessageTitle = item.FindControl("txtMessageTitle") as TextBox;
                InputFormTextBox rtfMessage = item.FindControl("rtfMessage") as InputFormTextBox;

                IModel.ApprovalLevelInfo objInitiation = new IModel.ApprovalLevelInfo();
                objInitiation.LevelName = level.Text;
                foreach (PickerEntity entity in peSpecificUsesGroup.ResolvedEntities)
                {
                    objInitiation.SpecificUserGroup.Add(entity.Key);
                }
                if (peSpecificUsesGroup.ResolvedEntities.Count == 0)
                {
                    objInitiation.SpecificUserGroup = this.assData.ApproverData[item.ItemIndex].SpecificUserGroup;
                }

                objInitiation.DueDate = String.IsNullOrEmpty(txtDueDate.Text) ? DateTime.MinValue : Convert.ToDateTime(txtDueDate.Text);
                objInitiation.DurationPerTask = String.IsNullOrEmpty(txtDuration.Text) ? 0 : int.Parse(txtDuration.Text);
                objInitiation.TaskInstruction = txtMessage.Text.Trim();
                objInitiation.Message = rtfMessage.Text;
                objInitiation.MessageTitle = txtMessageTitle.Text.Trim();
                objInitiation.TaskContenType = this.assData.ApproverData[item.ItemIndex].TaskContenType;
                objInitiation.TaskTitle = this.assData.ApproverData[item.ItemIndex].TaskTitle;
                objInitiation.AppendTitle = this.assData.ApproverData[item.ItemIndex].AppendTitle;
                objInitiation.TaskSequenceType = this.assData.ApproverData[item.ItemIndex].TaskSequenceType;

                objInitiation.ExpendGroup = this.assData.ApproverData[item.ItemIndex].ExpendGroup;
                objInitiation.EnableEmail = this.assData.ApproverData[item.ItemIndex].EnableEmail;
                objInitiation.EmailTemplate = this.assData.ApproverData[item.ItemIndex].EmailTemplate;
                objInitiation.AllowChangeMessage = this.assData.ApproverData[item.ItemIndex].AllowChangeMessage;
                objInitiation.UpdatedProperties = this.assData.ApproverData[item.ItemIndex].UpdateProperties;
                objInitiation.TaskEvents = this.assData.ApproverData[item.ItemIndex].TaskEvents;
                objInitiation.ApproverSetting = this.assData.ApproverData[item.ItemIndex];
                initData.ApprovalLevels.Add(objInitiation);
            }

            string dataSer = SerializationHelper.SerializeToXml<IModel.ApprovalWFInitiationData>(initData);
            return dataSer;
        }