/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnCalc_Click(object sender, EventArgs e) { string code = SAS.Tasks.Toolkit.Helpers.UtilityFunctions.ReadFileFromAssembly("SAS.Tasks.DataCardinality.getcardinality.sas"); code += string.Format("%getcardinality({0}, {1},0);\n", SAS.Tasks.Toolkit.Helpers.TaskDataHelpers.GetSasCodeReference(Consumer.ActiveData as ISASTaskData2), "work._ds_cardinalities" ); SasSubmitter s = new SasSubmitter(Consumer.AssignedServer); if (!s.IsServerBusy()) { _savedCursor = Cursor.Current; Cursor.Current = Cursors.WaitCursor; s.SubmitSasProgramComplete += handle_SubmitSasProgramComplete; sasJobId = s.SubmitSasProgram(code); progressdlg = new SubmitProgressForm(); if (progressdlg.ShowDialog(this) == DialogResult.Cancel) { s.CancelJob(sasJobId); progressdlg = null; } } else { MessageBox.Show(string.Format("The server {0} is busy; cannot process cardinalities.", Consumer.AssignedServer)); } }
void handle_SubmitSasProgramComplete(object sender, SubmitCompleteEventArgs args) { BeginInvoke(new MethodInvoker(delegate() { if (progressdlg != null && progressdlg.Visible) { progressdlg.Close(); progressdlg = null; } sasJobId = -1; if (args.Success) { AddCardinalities(); } Cursor.Current = _savedCursor; } )); }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnCalc_Click(object sender, EventArgs e) { string code = SAS.Tasks.Toolkit.Helpers.UtilityFunctions.ReadFileFromAssembly("SAS.Tasks.DataCardinality.getcardinality.sas"); code += string.Format("%getcardinality({0}, {1},0);\n", SAS.Tasks.Toolkit.Helpers.TaskDataHelpers.GetSasCodeReference(Consumer.ActiveData as ISASTaskData2), "work._ds_cardinalities" ); SasSubmitter s = new SasSubmitter(Consumer.AssignedServer); if (!s.IsServerBusy()) { _savedCursor = Cursor.Current; Cursor.Current = Cursors.WaitCursor; s.SubmitSasProgramComplete += handle_SubmitSasProgramComplete; sasJobId = s.SubmitSasProgram(code); progressdlg = new SubmitProgressForm(); if (progressdlg.ShowDialog(this) == DialogResult.Cancel) { s.CancelJob(sasJobId); progressdlg = null; } } else MessageBox.Show(string.Format("The server {0} is busy; cannot process cardinalities.", Consumer.AssignedServer)); }