private void button1_Click(object sender, RibbonControlEventArgs e) { Outlook.Application application = new Outlook.Application(); Outlook.NameSpace ns = application.GetNamespace("MAPI"); try { //get selected mail item Object selectedObject = application.ActiveExplorer().Selection[1]; Outlook.MailItem selectedMail = (Outlook.MailItem)selectedObject; //create message Outlook.MailItem newMail = application.CreateItem(Outlook.OlItemType.olMailItem) as Outlook.MailItem; newMail.Recipients.Add(ReadFile()); newMail.Subject = "SPAM"; newMail.Attachments.Add(selectedMail, Microsoft.Office.Interop.Outlook.OlAttachmentType.olEmbeddeditem); newMail.Send(); selectedMail.Delete(); System.Windows.Forms.MessageBox.Show("Spam notification has been sent."); } catch { System.Windows.Forms.MessageBox.Show("You must select a message to report."); } }
private void filePathButton_Click(object sender, RibbonControlEventArgs e) { using (FormConfiguration form = new FormConfiguration()) { form.ShowDialog(); } }
private void AboutButton_Click (object sender, RibbonControlEventArgs e) { using (var aboutForm = new AboutForm()) { aboutForm.ShowDialog(); } }
private void ConvertMGRS_button_Click(object sender, RibbonControlEventArgs e) { try { MilitaryGridReferenceSystem militaryGridReferenceSystem = new MilitaryGridReferenceSystem(this.MGRS_editBox.Text); this.MGRS_editBox.Text = militaryGridReferenceSystem.Grid; switch (this.LatLonFromat_dropDown.SelectedItem.Label) { case "Decimal Degrees": DecimalDegrees decimalDegrees = militaryGridReferenceSystem.ToDecimalDegrees(); this.Latitude_editBox.Text = decimalDegrees.Latitude.ToString(); this.Longitude_editBox.Text = decimalDegrees.Longitude.ToString(); break; case "Degrees Decimal Minutes": DegreesDecimalMinutes degreesDecimalMinutes = militaryGridReferenceSystem.ToDegreesDecimalMinutes(); this.Latitude_editBox.Text = degreesDecimalMinutes.Latitude; this.Longitude_editBox.Text = degreesDecimalMinutes.Longitude; break; case "Degrees Minutes Seconds": DegreesMinutesSeconds degreesMinutesSeconds = militaryGridReferenceSystem.ToDegreesMinutesSeconds(); this.Latitude_editBox.Text = degreesMinutesSeconds.Latitude; this.Longitude_editBox.Text = degreesMinutesSeconds.Longitude; break; } } catch { MessageBox.Show("Invalid MGRS Input"); } }
private void btFuncMeta_Click(object sender, RibbonControlEventArgs e) { // SAPINTGUI.FormFunctionMetaEx formFunctionMetaEx = new SAPINTGUI.FormFunctionMetaEx(); // formFunctionMetaEx.Show(); FormFunctionMeta formFunctionMeta = new FormFunctionMeta(); formFunctionMeta.Show(); }
private void branchComboBox_TextChanged(object sender, RibbonControlEventArgs e) { btnExport_Refresh(); btnExportMonsterTable_Refresh(); btnExportMetaTable_Refresh(); branch = branchComboBox.Text; }
private void buttonSlideShowFullScreen_Click(object sender, RibbonControlEventArgs e) { try { thisApplication = Globals.ThisAddIn.Application; showWindow = thisApplication.ActivePresentation.SlideShowSettings.Run(); // If leap is not available, just run slideshow and quit while (true) { // LeapMotion이 꽂혀 있으면 밖으로 나감 if (setupLeapMotion()) break; // 만약에 Retry를 No 하면, 걍 종료 if (MessageBox.Show("Leap Motion is not connected. Check the connection.", "Leap Motion is missing.", MessageBoxButtons.RetryCancel) == DialogResult.Cancel) return; } thisApplication.SlideShowEnd += new Microsoft.Office.Interop.PowerPoint.EApplication_SlideShowEndEventHandler(thisApplication_SlideShowEnd); } catch (Exception ex) { MessageBox.Show(ex.StackTrace); } }
private void ConvertLatLon_button_Click(object sender, RibbonControlEventArgs e) { DecimalDegrees decimalDegrees; DegreesDecimalMinutes degreesDecimalMinutes; DegreesMinutesSeconds degreesMinutesSeconds; try { switch (this.LatLonFromat_dropDown.SelectedItem.Label) { case "Decimal Degrees": decimalDegrees = new DecimalDegrees(this.Longitude_editBox.Text, this.Latitude_editBox.Text); this.MGRS_editBox.Text = decimalDegrees.ToMilitaryGridReferenceSystem().Grid; break; case "Degrees Decimal Minutes": degreesDecimalMinutes = new DegreesDecimalMinutes(this.Longitude_editBox.Text, this.Latitude_editBox.Text); this.MGRS_editBox.Text = degreesDecimalMinutes.ToMilitaryGridReferenceSystem().Grid; break; case "Degrees Minutes Seconds": degreesMinutesSeconds = new DegreesMinutesSeconds(this.Longitude_editBox.Text, this.Latitude_editBox.Text); this.MGRS_editBox.Text = degreesMinutesSeconds.ToMilitaryGridReferenceSystem().Grid; break; } } catch { MessageBox.Show("Invalid " + this.LatLonFromat_dropDown.SelectedItem.Label + " input."); } }
private void AddFeedButton_Click(object sender, RibbonControlEventArgs e) { if (ViewModel.IsConnected) { ViewModel.AddFeed.Execute(FeedEditBox.Text as Object); } }
private void RefreshButton_Click(object sender, RibbonControlEventArgs e) { if (ViewModel.IsConnected) { ViewModel.RefreshFeeds.Execute(null); } }
private void button2_Click(object sender, RibbonControlEventArgs e) { Globals.ThisWorkbook.Application.DisplayDocumentActionTaskPane = true; actionsPane1.Hide(); actionsPane2.Show(); toggleButton1.Checked = false; }
private void btnReportCustom_Click(object sender, RibbonControlEventArgs e) { if (this.ddlReportTo.SelectedItem != null) { Reporting.SendReports(this.ddlReportTo.SelectedItem.Tag.ToString()); } }
private void button2_Click(object sender, RibbonControlEventArgs e) { Globals.ThisAddIn.Security.CloseSession(); button3.Visible = true; button2.Visible = false; button1.Enabled = false; }
private void editPoll_Click(object sender, RibbonControlEventArgs e) { // Get the current slide PowerPoint.Slide sld = Globals.ThisAddIn.Application.ActiveWindow.View.Slide; // Get access to the xml for that slide CustomXMLPart xml = sld.CustomerData._Index(1); string question = xml.SelectSingleNode("/CP3Poll/PollQuestion").Text; string type = xml.SelectSingleNode("/CP3Poll/PollType").Text; string correctAnswer = xml.SelectSingleNode("/CP3Poll/PollCorrectAnswer").Text; // Ensure we got valid results if (question != null && type != null && correctAnswer != null) { // If this is a multiple choice question // TODO: Change this question type thing to an enum if (type.ToLower().Contains("multiple choice")) { string[] answers = new string[5]; // Iterate through each possible correctAnswer for (int i = 1; i <= 5; ++i) { // Add the correctAnswer to the array answers[i-1] = xml.SelectSingleNode("/CP3Poll/PollAnswers/Answer" + i).Text; } Form1 editPoll = new Form1(question, correctAnswer, answers); editPoll.Show(); } else { // True / false Form1 editPoll = new Form1(question, correctAnswer); editPoll.Show(); } } }
private void btnPendingPayments_Click(object sender, RibbonControlEventArgs e) { //todo: create a command when more tests are needed //var commandManager = NinjectContainer.Kernel.Get<CommandManager>(); //commandManager.LoadAllTransactions(); //commandManager.ProcessTodayPayments(); }
private void Configure_Click(object sender, RibbonControlEventArgs e) { ThisAddIn addIn = Globals.ThisAddIn; NamedRangeProvider nrp = addIn.NamedRangeProvider; nrp.Clear(); var d = new ProjectConfigurationDialogue(addIn, nrp); if (m_bounds.HasValue) { d.Bounds = m_bounds.Value; d.StartPosition = FormStartPosition.Manual; } d.Mode = addIn.Mode; ProjectInvocationRule[] rules = addIn.Rules; d.SetRules(rules); var result = d.ShowDialog(); if (result == DialogResult.OK) { addIn.Mode = d.Mode; addIn.Rules = rules = d.GetRules(); addIn.WriteRules(); } else { /* It is possible that something has been changed in Excel - a range name, for example - * and this has had an effect on the validity of a project invocation rule. Even if the * user cancels the dialogue, we should take this opportunity to ensure that the Run * button's enabled state is set correctly. * */ foreach (ProjectInvocationRule rule in rules) { rule.UpdateValidity(); } addIn.UpdateExecutionState(); } m_bounds = d.Bounds; }
private void dropDownDiagrams_SelectionChanged(object sender, RibbonControlEventArgs e) { RibbonDropDown rb = (RibbonDropDown)sender; string searchstr = rb.SelectedItem.Label; using (var connection = new MySqlConnection(Properties.Settings.Default.pandidConnectionString)) { connection.Open(); using (var command = new MySqlCommand("SELECT type FROM diagrams where name=\"" + searchstr + "\"", connection)) { using (var reader = command.ExecuteReader()) { if (reader.HasRows) { while (reader.Read()) { string typestr = reader.GetString(0); foreach (RibbonDropDownItem li in dropDownFluid.Items) { if (li.Label.CompareTo(typestr) == 0) { dropDownFluid.SelectedItem = li; } } } } } } } BuildHeader(); }
private void selectButton_Click(object sender, RibbonControlEventArgs e) { Object val = Globals.Program.currUserKey.GetValue("Folder", ""); if (val != null && val.GetType() == this.openFile.Filter.GetType()) select.setSelectedFolder(val.ToString()); select.ShowDialog(); }
private void sharedPaneButton_Click(object sender, RibbonControlEventArgs e) { // Find the correct task pane for the currently active workbook var pane = Globals.ThisAddIn.TaskPanes[new Tuple<WorkbookModel, string>(DataModel.Instance.CurrentWorkbook, "shared Pane")]; pane.Visible = !pane.Visible; }
private void btnCommit_Click(object sender, RibbonControlEventArgs e) { //Get Active Project var pj = Globals.ThisAddIn.Application.ActiveProject; //Get Project Filename. var projectFile = pj.FullName; //Get Directory from File Name var directory = Path.GetDirectoryName(projectFile); //Create a new Git Repository Repository.Init(directory); //Open the git repository in a using context so its automatically disposed of. using (var repo = new Repository(directory)) { // Stage the file repo.Index.Stage(projectFile); // Create the committer's signature and commit var author = new Signature("Richard", "@ARM", DateTime.Now); var committer = author; // Commit to the repository var commit = repo.Commit("Initial commit", author, committer); } }
private void LoginButton_Click(object sender, RibbonControlEventArgs e) { Expiration expiration; if(!ButtonIdsToExpirationMap.TryGetValue(e.Control.Id, out expiration)) expiration = Expiration.Never; Globals.ThisAddIn.AuthorizePresenter.StartAuthorization(expiration); }
private void SyncJIRAButton_Click(object sender, RibbonControlEventArgs e) { if (Functions.ReadDocumentProperties(Params.JIRA_PROJECT_KEY) == null) { MessageBox.Show("Не указан код проекта"); return; } Functions.UpdateXml("C:\\Ceptah\\Sync.xml", Params.JIRA_PROJECT_KEY); string User = Functions.ReadDocumentProperties(Params.USER_NAME_PROP); foreach (Task t in Globals.ThisAddIn.Application.ActiveProject.Tasks) { if (HasAssignedSubTask(t) && t.HyperlinkHREF != "") { t.Text10 = "SKIP"; } else { if (HasAssignedSubTask(t) && t.HyperlinkHREF == "" && t.Text11 != "Проект") { t.Text10 = ""; t.Text11 = "Задача-группировка"; t.Text12 = User; } } } string PrFullName = Globals.ThisAddIn.Application.ActiveProject.FullName; //Functions.RunCeptah("s \"" + PrFullName + "\" /S:C:\\Ceptah\\Sync.xml"); }
private void button1_Click(object sender, RibbonControlEventArgs e) { if (ThisAddIn.GetAccessToken() == "") { try { FacebookClient fc = new FacebookClient(); LoginForm l = new LoginForm(fc.GetLoginUrl(new { client_id = ThisAddIn._appkey, response_type = "token", display = "touch", redirect_uri = "https://www.facebook.com/connect/login_success.html", scope = String.Join(",", PERMISSIONS) }).ToString(), this, true); l.Show(); } catch (Exception ex) { } } else { var fb = new FacebookClient(ThisAddIn.GetAccessToken()); dynamic me = fb.Get("me"); var url = me.link; Process.Start(url); } }
private void buttonGenerateData_Click(object sender, RibbonControlEventArgs e) { using (DataSchemaForm form = new DataSchemaForm()) { form.ShowDialog(); } }
private void button1_Click(object sender, RibbonControlEventArgs e) { if (settingsWindow.ShowDialog() == DialogResult.OK) { foreach (Workbook wb in Globals.ThisAddIn.Application.Workbooks) { if (IsWorkbookInBasePath(wb)) { var cfg = new ConfigManager(wb); dic_wb_cm.Add(wb, cfg); if (wb == Globals.ThisAddIn.Application.ActiveWorkbook) cfg.ShowUIPane(true); } else { ConfigManager cfg = null; if (dic_wb_cm.TryGetValue(wb, out cfg)) { cfg.Dispose(); dic_wb_cm.Remove(wb); } } } foreach (var cfg in dic_wb_cm.Values.ToArray()) { if (!IsWorkbookInBasePath(cfg.Wb)) { cfg.Dispose(); dic_wb_cm.Remove(cfg.Wb); } } } }
public static void btnHelp_Click(object sender, RibbonControlEventArgs e) { string baseurl = string.Empty; baseurl = System.Configuration.ConfigurationManager.AppSettings["helpurl"]; var module = ((RibbonButton)sender).Tag as AddinModule; System.Diagnostics.Process.Start(baseurl + module.HelpHref); }
//Botton "Export Data" private void button1_Click(object sender, RibbonControlEventArgs e) { try { int START_ROW = 9; int START_COL = 3; Excel.Worksheet active_worksheet = Globals.ThisAddIn.Application.ActiveSheet; //Acquire Target Data and Export Target TargetData = new Target(); TargetData.GetData(active_worksheet); TargetData.ExportData(); //Acquire Comparable Data and Export for (int col_index = START_COL; active_worksheet.Cells[START_ROW, col_index].Value != null ; col_index ++) { Comparable comparable_data = new Comparable(); comparable_data.GetData(active_worksheet, START_ROW, col_index); comparable_data.ExportData(); } MessageBox.Show("Successfully export data."); } catch (Exception exception) { Debug.WriteLine(exception.ToString()); } }
private async void ImportIcsData_Click (object sender, RibbonControlEventArgs e) { try { EnsureSynchronizationContext (); var dataInputWindow = CreateWindowWithTextBox(); dataInputWindow.Item1.ShowDialog(); var entitySynchronizationLogger = new EntitySynchronizationLogger (); await OutlookTestContext.EventRepository.Create ( async appointmentWrapper => await OutlookTestContext.EntityMapper.Map2To1 ( OutlookTestContext.DeserializeICalendar (dataInputWindow.Item2.Text), appointmentWrapper, entitySynchronizationLogger), NullEventSynchronizationContext.Instance); var reportWindow = CreateWindowWithTextBox(); reportWindow.Item2.Text = "SynchronizationReport:\r\n" + Serializer<EntitySynchronizationReport>.Serialize (entitySynchronizationLogger.GetReport()); reportWindow.Item1.ShowDialog(); } catch (Exception x) { ExceptionHandler.Instance.DisplayException (x, s_logger); } }
private void button3_Click(object sender, RibbonControlEventArgs e) { if (ThisAddIn.GetAccessToken() == "") { MessageBox.Show("請先登入!", "Facebook", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); return; } string select = ""; try { PowerPoint._Application myPPT = Globals.ThisAddIn.Application; var Sld = myPPT.ActiveWindow.View.Slide; select = myPPT.ActiveWindow.Selection.TextRange.Text; } catch (Exception ex) { MessageBox.Show("請選取文字!", "Facebook", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); return; } if (select != "") { FacebookClient facebook = new FacebookClient(ThisAddIn.GetAccessToken()); // 使用 Token 建立一個 FacebookClient var parameters = new Dictionary<String, Object>(); facebook.PostCompleted += OnFacebookPostCompleted; DateTime dt = DateTime.Now; parameters["message"] = select; facebook.PostAsync("me/feed", parameters); } else { MessageBox.Show("請選取文字!", "Facebook", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); } }
private void buttonLaunch_Click(object sender, RibbonControlEventArgs e) { //Reading the data. var rangePossibleValues = ((Excel.Range)Globals.ThisAddIn.Application.get_Range(this.editBoxPossibleValues.Text)); var rangeRulesMatrix = ((Excel.Range)Globals.ThisAddIn.Application.get_Range(this.editBoxRulesMatrix.Text)); var listPossibleValues = convertRangeToStringArrays(rangePossibleValues, true); var listRulesMatrix = convertRangeToStringArrays(rangeRulesMatrix, false); //Generating the solution. try { var model = new SmartPermutations(listPossibleValues, listRulesMatrix); string[,] permutationMatrix = model.ComputePermutationMatrix(); //Copying the data to a new sheet. Excel.Worksheet newWorksheet; newWorksheet = (Excel.Worksheet)Globals.ThisAddIn.Application.ActiveWorkbook.Worksheets.Add(); var startCell = (Excel.Range)newWorksheet.Cells[1, 1]; var endCell = (Excel.Range)newWorksheet.Cells[permutationMatrix.GetLength(0), permutationMatrix.GetLength(1)]; var writeRange = newWorksheet.Range[startCell, endCell]; writeRange.Value2 = permutationMatrix; } catch (ExceptionInvalidData ex) { MessageBox.Show(ex.Message); } }
private void toggleDisplayButton_Click(object sender, RibbonControlEventArgs e) { // Show or hide task pane Globals.ThisAddIn.ToggleTaskPaneDisplay(); }
private void btnWatchWindow_Click(object sender, RibbonControlEventArgs e) { DisplayWatchWindow(); }
private void zFacts_click(object sender, RibbonControlEventArgs e) { var inspector = Globals.ThisAddIn.Application.ActiveInspector(); var m = ((MailItem)inspector.CurrentItem); if (m != null) { if (inspector.EditorType != OlEditorType.olEditorWord) { MessageBox.Show("I only support Outlook 2010 with Word Editor " + inspector.EditorType); return; } this.StateForm.PullPropertyInfo(); if (!StateForm.Closed && StateForm.SearchResult != null) { var r = StateForm.SearchResult; //create a table var d = (Document)inspector.WordEditor; Range range = d.Application.Selection.Range; var t = d.Application.Selection.Tables.Add(range, 8, 2); t.ApplyStyleFirstColumn = true; int nrRow = 1; int nrColumn = 1; t.Cell(nrRow, nrColumn++).Range.Text = "Property Address"; t.Cell(nrRow, nrColumn++).Range.Text = r.getAddress(); nrRow++; nrColumn = 1; t.Cell(nrRow, nrColumn++).Range.Text = "Dwelling Type"; t.Cell(nrRow, nrColumn++).Range.Text = r.getUseCode(); nrRow++; nrColumn = 1; t.Cell(nrRow, nrColumn++).Range.Text = "Year Built"; t.Cell(nrRow, nrColumn++).Range.Text = r.getYearBuilt(); nrRow++; nrColumn = 1; t.Cell(nrRow, nrColumn++).Range.Text = "Lot Size"; t.Cell(nrRow, nrColumn++).Range.Text = r.getLotSizeSqFt(); nrRow++; nrColumn = 1; t.Cell(nrRow, nrColumn++).Range.Text = "Finished SqFt"; t.Cell(nrRow, nrColumn++).Range.Text = r.getFinishedSqFt(); nrRow++; nrColumn = 1; t.Cell(nrRow, nrColumn++).Range.Text = "Bedrooms"; t.Cell(nrRow, nrColumn++).Range.Text = r.getBedrooms(); nrRow++; nrColumn = 1; t.Cell(nrRow, nrColumn++).Range.Text = "BathRoom"; t.Cell(nrRow, nrColumn++).Range.Text = r.getBathrooms(); nrRow++; nrColumn = 1; t.Cell(nrRow, nrColumn++).Range.Text = "Tax"; t.Cell(nrRow, nrColumn++).Range.Text = r.getTaxAssessment() + " in " + r.getTaxAssessmentYear(); nrRow++; t.AutoFormat(); } //t } }
private void getCompTable_Click(object sender, RibbonControlEventArgs e) { var inspector = Globals.ThisAddIn.Application.ActiveInspector(); var m = ((MailItem)inspector.CurrentItem); if (m != null) { if (inspector.EditorType != OlEditorType.olEditorWord) { MessageBox.Show("I only support Outlook 2010 with Word Editor " + inspector.EditorType); return; } this.StateForm.PullComps(); if (!StateForm.Closed && StateForm.CompResult != null) { var r = StateForm.CompResult; //create a table var d = (Document)inspector.WordEditor; Range range = d.Application.Selection.Range; var t = d.Application.Selection.Tables.Add(range, 11, 11); t.ApplyStyleHeadingRows = true; int nrRow = 1; int nrColumn = 1; t.Cell(nrRow, nrColumn++).Range.Text = "Property Id"; t.Cell(nrRow, nrColumn++).Range.Text = "Address"; t.Cell(nrRow, nrColumn++).Range.Text = "YearBuilt"; t.Cell(nrRow, nrColumn++).Range.Text = "Lot Size"; t.Cell(nrRow, nrColumn++).Range.Text = "Livable Size"; t.Cell(nrRow, nrColumn++).Range.Text = "Bedrooms"; t.Cell(nrRow, nrColumn++).Range.Text = "Bathrooms"; t.Cell(nrRow, nrColumn++).Range.Text = "Last Sold Date"; t.Cell(nrRow, nrColumn++).Range.Text = "Last Sold Price"; t.Cell(nrRow, nrColumn++).Range.Text = "Zestimate"; //t.Cell(nrRow, nrColumn++).Range.Text = "Zillow HDP"; nrRow++; foreach (var c in r.GetComparables()) { nrColumn = 1; t.Cell(nrRow, nrColumn).Range.Hyperlinks.Add(t.Cell(nrRow, nrColumn).Range, c.Hdp, TextToDisplay: c.Id); //t.Cell(nrRow, nrColumn++).Range.Text = c.Id; nrColumn++; t.Cell(nrRow, nrColumn++).Range.Text = c.Address; t.Cell(nrRow, nrColumn++).Range.Text = c.YearBuilt; t.Cell(nrRow, nrColumn++).Range.Text = c.LotsizeSqft; t.Cell(nrRow, nrColumn++).Range.Text = c.FinishedSqft; t.Cell(nrRow, nrColumn++).Range.Text = c.Bedrooms; t.Cell(nrRow, nrColumn++).Range.Text = c.Bathrooms; t.Cell(nrRow, nrColumn++).Range.Text = c.LastsoldDate; t.Cell(nrRow, nrColumn++).Range.Text = c.LastsoldPricel; t.Cell(nrRow, nrColumn++).Range.Text = c.Zestimate; nrRow++; } t.AutoFormat(); } } }
private void btnInsert_Click(object sender, RibbonControlEventArgs e) { }
private void btnMain_Click(object sender, RibbonControlEventArgs e) => Globals.WordAddIn.Sidebar.Visible = !Globals.WordAddIn.Sidebar.Visible;
private void chkDisplayEvents_Click(object sender, RibbonControlEventArgs e) { Common.DisplayEvents = chkDisplayEvents.Checked; }
private void btnAddInInfo_Click(object sender, RibbonControlEventArgs e) { DisplayAddInInfo(); }
private void OnShowHelpPage(object sender, RibbonControlEventArgs e) { try { System.Diagnostics.Process.Start(Properties.Settings.Default.HelpPageUrl); } catch (Exception ex) { Console.WriteLine(ex.ToString()); } }
private void btnDeveloperMode_Click(object sender, RibbonControlEventArgs e) { ToggleDeveloperMode(); }
private void btnChooseInspector_Click(object sender, RibbonControlEventArgs e) { var lof = new WindowChooseFolder(_results, _item); lof.ShowDialog(); }
private void OnOpenSample(object sender, RibbonControlEventArgs e) { try { Globals.StackBuilderAddIn.OpenSampleFile(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
private void btnFileEmailInspector_Click(object sender, RibbonControlEventArgs e) { MainController.FileEmail(_item, _results.First().Key, false); //mailItem.Display(false); //------------------- UZAVRE VIEW, CHCI TO?---------------- }
private void btnChoose5_Click(object sender, RibbonControlEventArgs e) { MainController.FileEmail(_item, _results.ElementAt(4).Key, true); }
private void button1_Click(object sender, RibbonControlEventArgs e) { Globals.ThisAddIn.SearchForFilms(this.ebTitle.Text); }
private void btnRdOptInspector_Click(object sender, RibbonControlEventArgs e) { MainController.FileEmail(_item, _results.ElementAt(2).Key, true); }
private void btnIntroducereDate_Click(object sender, RibbonControlEventArgs e) { string value = Interaction.InputBox("INTRODUCEȚI CODUL NUMERIC PERSONAL", "CNP", "", 500, 300); if (value != "") { con.Open(); OleDbDataAdapter cmdInregistrari = new OleDbDataAdapter("SELECT Rezervari.NR_Inregistrare, Rezervari.Data_Inceput, Rezervari.Data_Sfarsit, (Pret_Noapte*(Data_Sfarsit-Data_Inceput)) AS TotalRez, Sum(Extraoptiuni.Pret_Extraoptiune) AS TotalEx " + "FROM Clienti INNER JOIN((Rezervari INNER JOIN(Camere INNER JOIN Camere_Rezervate ON Camere.Tip_Camera = Camere_Rezervate.Tip_Camera) ON Rezervari.NR_Inregistrare = Camere_Rezervate.NR_Inregistrare) INNER JOIN(Extraoptiuni INNER JOIN Extraoptiuni_Rezervare ON Extraoptiuni.Denumire_Extraoptiune = Extraoptiuni_Rezervare.Denumire_Extraoptiune) ON Rezervari.NR_Inregistrare = Extraoptiuni_Rezervare.NR_Inregistrare) ON Clienti.ID_Client = Rezervari.ID_Client " + "WHERE Clienti.[CNP] Like '" + value + "'" + "GROUP BY Rezervari.NR_Inregistrare, Rezervari.Data_Inceput, Rezervari.Data_Sfarsit, Camere.Pret_Noapte; ", con); DataTable dtInregistrari = new DataTable(); cmdInregistrari.Fill(dtInregistrari); Excel.Application excel = Globals.ThisAddIn.Application; Excel.Worksheet wsh = excel.ActiveSheet; Excel.Range rsh = excel.Selection; int nl = rsh.Rows.Count; int nc = rsh.Columns.Count; rsh.Cells[1, 1].Value = "Nr_Înregistrare"; wsh.Cells[1, 1].Interior.Color = System.Drawing.ColorTranslator.ToOle(System.Drawing.Color.Yellow); rsh.Cells[1, 2].Value = "Dată_Început"; wsh.Cells[1, 2].Interior.Color = System.Drawing.ColorTranslator.ToOle(System.Drawing.Color.Yellow); rsh.Cells[1, 3].Value = "Dată_Sfârșit"; wsh.Cells[1, 3].Interior.Color = System.Drawing.ColorTranslator.ToOle(System.Drawing.Color.Yellow); rsh.Cells[1, 4].Value = "Total_Rezervare"; wsh.Cells[1, 4].Interior.Color = System.Drawing.ColorTranslator.ToOle(System.Drawing.Color.Yellow); rsh.Cells[1, 5].Value = "Total_Extraopțiuni"; wsh.Cells[1, 5].Interior.Color = System.Drawing.ColorTranslator.ToOle(System.Drawing.Color.Yellow); int nr = 0; int i = 2; try { while (dtInregistrari.Rows[nr][0].ToString() != "") { rsh.Cells[i, 1].Value = dtInregistrari.Rows[nr][0].ToString(); rsh.Cells[i, 2].Value = dtInregistrari.Rows[nr][1].ToString(); rsh.Cells[i, 3].Value = dtInregistrari.Rows[nr][2].ToString(); rsh.Cells[i, 4].Value = dtInregistrari.Rows[nr][3].ToString(); rsh.Cells[i, 5].Value = dtInregistrari.Rows[nr][4].ToString(); i += 1; nr += 1; } } catch (Exception ex) { wsh.Columns.AutoFit(); wsh.Rows.AutoFit(); con.Close(); return; } } }
private void button2_Click(object sender, RibbonControlEventArgs e) { Globals.ThisAddIn.AddChart(); }
private void btnIntersection_Click(object sender, RibbonControlEventArgs e) { _Calculate(e, _CalculateIntersect); }
private void btnExcel_Click(object sender, RibbonControlEventArgs e) { factura = new Word.Application(); factura.Visible = true; Word.Document wdoc = factura.Documents.Add(); Word.Range wr = wdoc.Range(); wr.Text = "\n\n" + "FACTURĂ" + "\n\n\n"; wr.Font.Name = "Segoe UI"; wr.Font.Size = 14; wr.Font.Bold = -1; wdoc.Paragraphs.Alignment = Word.WdParagraphAlignment.wdAlignParagraphCenter; wr.Collapse(Word.WdCollapseDirection.wdCollapseEnd); Word.Table tabel = wr.Tables.Add(wr, 4, 2); wr.Collapse(Word.WdCollapseDirection.wdCollapseEnd); tabel.set_Style("Table Grid 8"); tabel.Borders.Enable = 1; tabel.Cell(1, 1).Range.Text = "DENUMIRE"; tabel.Cell(1, 1).Range.Font.Size = 17; tabel.Cell(1, 2).Range.Text = "DE PLĂTIT"; tabel.Cell(1, 2).Range.Font.Size = 17; tabel.Cell(2, 1).Range.Text = "REZERVARE"; tabel.Cell(3, 1).Range.Text = "ALTE CHELTUIELI"; tabel.Cell(4, 1).Range.Text = "TOTAL"; Excel.Application excel = Globals.ThisAddIn.Application; Excel.Worksheet wsh = excel.ActiveSheet; Excel.Range rsh = excel.Selection; con.Open(); OleDbDataAdapter cmdInregistrari = new OleDbDataAdapter("SELECT (Pret_Noapte*(Data_Sfarsit-Data_Inceput)) AS TotalRez, Sum(Extraoptiuni.Pret_Extraoptiune) AS TotalEx " + "FROM Clienti INNER JOIN((Rezervari INNER JOIN(Camere INNER JOIN Camere_Rezervate ON Camere.Tip_Camera = Camere_Rezervate.Tip_Camera) ON Rezervari.NR_Inregistrare = Camere_Rezervate.NR_Inregistrare) INNER JOIN(Extraoptiuni INNER JOIN Extraoptiuni_Rezervare ON Extraoptiuni.Denumire_Extraoptiune = Extraoptiuni_Rezervare.Denumire_Extraoptiune) ON Rezervari.NR_Inregistrare = Extraoptiuni_Rezervare.NR_Inregistrare) ON Clienti.ID_Client = Rezervari.ID_Client " + "WHERE Rezervari.NR_Inregistrare Like '" + rsh.Value2.ToString() + "'" + "GROUP BY Rezervari.NR_Inregistrare, Rezervari.Data_Inceput, Rezervari.Data_Sfarsit, Camere.Pret_Noapte; ", con); DataTable dtInregistrari = new DataTable(); cmdInregistrari.Fill(dtInregistrari); int a; int b; a = Int32.Parse(dtInregistrari.Rows[0][0].ToString()); b = Int32.Parse(dtInregistrari.Rows[0][1].ToString()); tabel.Cell(2, 2).Range.Text = dtInregistrari.Rows[0][0].ToString() + " LEI"; tabel.Cell(3, 2).Range.Text = dtInregistrari.Rows[0][1].ToString() + " LEI"; tabel.Cell(4, 2).Range.Text = (a + b).ToString() + " LEI"; con.Close(); }
private void btnUnion_Click(object sender, RibbonControlEventArgs e) { _Calculate(e, _CalculateUnion); }
private void searchButton_Click(object sender, RibbonControlEventArgs e) { SearchView searchView = new SearchView(); searchView.ShowDialog(); }
private void buttonSlideNoteToSpeech_Click(object sender, RibbonControlEventArgs e) { UpdateCurrentSlide(); }
private void btnNotSubset_Click(object sender, RibbonControlEventArgs e) { _Calculate(e, _CalculateNotSubset); }
private void ZeroNegativeButton_Click(object sender, RibbonControlEventArgs e) { Globals.ThisAddIn.ZeroNegative(); }
private void button1_Click(object sender, RibbonControlEventArgs e) { ConfigurazioneMessaggio c = new ConfigurazioneMessaggio(); c.Show(); }
private void group1_DialogLauncherClick(object sender, RibbonControlEventArgs e) { // Show or hide task pane Globals.ThisAddIn.ToggleTaskPaneDisplay(); }
private void BankRoundButton_Click(object sender, RibbonControlEventArgs e) { Globals.ThisAddIn.BankRound(); }
private void buttonLogin_Click(object sender, RibbonControlEventArgs e) { String file = Path.Combine(Folder.GetWatcherPath(), Folder.LOGIN_FILE_NAME); File.Create(file).Close(); }
private void pauseCheckBox_Click(object sender, RibbonControlEventArgs e) { // Pause timer Globals.ThisAddIn.PauseOrResumeTimer(pauseCheckBox.Checked); }