Beispiel #1
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     try
     {
         SBFAApi agent = new SBFAApi();
         using (new OperationContextScope(agent.context))
         {
             long wrk = agent.operation.CreateWorkFlowStagesAutoDocument(ManageStages.currentWorkFlowStage, cmbTemplate.SelectedValue.ToString(), Globals.GetComboBoxValue(cmbEmail), Globals.GetComboBoxValue(cmbSMS), chkActive.Checked);
             if (wrk > -1)
             {
                 lstDocuments.Items.Clear();
                 sbfa.WorkFlowStagesAutoDocuments[] response = agent.operation.GetWorkFlowStagesAutoDocuments(ManageStages.currentWorkFlowStage);
                 foreach (sbfa.WorkFlowStagesAutoDocuments wrkFlow in response)
                 {
                     string[] row          = { wrkFlow.Id.ToString(), wrkFlow.FK_AutoDocumentName, ((wrkFlow.SendEmail) == -1 ? "No" : ((wrkFlow.SendEmail) == 0 ? "On Enter" : "On Leave")), ((wrkFlow.SendSMS) == -1 ? "No" : ((wrkFlow.SendSMS) == 0 ? "On Enter" : "On Leave")) };
                     var      listViewItem = new ListViewItem(row);
                     lstDocuments.Items.Add(listViewItem);
                 }
             }
         }
     }
     catch
     {
         ShowErrorMessage("Error saving your stage document config");
     }
 }