Example #1
0
 private void Button_SearchCell_Click(object sender, EventArgs e)
 {
     try
     {
         UserInputValidations.EmptyInput(TB_FirstCell.Text);
         using (var _excel = new Excel(MainWindowFactors.ExcelFileFactors))
         {
             SpreadsheetValidations.EmptyCell(_excel.ReadCell(TB_FirstCell.Text), TB_FirstCell.Text);
             MainWindowFactors.Pesel         = new Pesel(_excel.ReadCell(TB_FirstCell.Text), TB_FirstCell.Text);
             MainWindowFactors.Pesele        = _excel.GetPesele(TB_FirstCell.Text, MainWindowFactors.Pesel);
             MainWindowFactors.ColumnFactors = new ColumnFactors()
             {
                 FirstPesel     = MainWindowFactors.Pesele.Single(x => x.Key == 1).Value.InNumber,
                 FirstPeselCell = TB_FirstCell.Text,
                 PeselAmount    = MainWindowFactors.Pesele.Count()
             };
             UpdateSummary();
             BUTTON_ShowPesele.Enabled = true;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Uwaga!");
     }
 }
Example #2
0
 private void Button_OpenFile_Click(object sender, EventArgs e)
 {
     try
     {
         UserInputValidations.EmptyInput(TB_ExcelPath.Text);
         UserInputValidations.EmptyInput(TB_ExcelName.Text);
         MainWindowFactors.ExcelFileFactors = new ExcelFileFactors
         {
             ExcelPath          = TB_ExcelPath.Text,
             ExcelName          = TB_ExcelName.Text,
             ExcelFileExtension = CB_excelFileExtensions.SelectedItem.ToString()
         };
         using (var _excel = new Excel(MainWindowFactors.ExcelFileFactors)) { }
         UpdateSummary();
         GB_Excel.Enabled        = false;
         GB_CellLocation.Enabled = true;
         GB_FileSummary.Visible  = true;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Uwaga!");
     }
 }