Ejemplo n.º 1
0
 public DlgImportIsoReport(Wizard wizard)
     : base(wizard)
 {
     InitializeComponent();
       this.wizard = wizard;
       //lblFileName.Text = "Import ISO Report from " + wizard.FileName;
       rtb.Clear();
       rtbWrite(" Import ", false);
       rtbWrite("ISO Report", true);
       rtbWrite(" from " + wizard.JustFileName, false);
 }
Ejemplo n.º 2
0
        public DlgImportWizard(Wizard wizard)
            : base()
        {
            InitializeComponent();
              this.wizard = wizard;
              //lblFileName.Text = String.Format("Import {0} from {1}", wizard.getName(), wizard.FileName);
              rtb.Clear();
              rtbWrite("Import ", false);
              rtbWrite(wizard.getName(), true);
              rtbWrite(" form " + wizard.JustFileName, false);

              //rtb.SelectionAlignment = HorizontalAlignment.Center;
              //rtb.SelectionFont = new Font("Arial", 12f);
              //rtb.AppendText("Import ");
              //rtb.SelectionFont = new Font("Arial", 16f, FontStyle.Bold);
              //rtb.AppendText(wizard.getName());
              //rtb.SelectionFont = new Font("Arial", 12f, FontStyle.Regular);
              //rtb.AppendText(" from " + wizard.JustFileName);
        }
Ejemplo n.º 3
0
 public DlgValidation(Wizard wizard)
     : base(wizard)
 {
     InitializeComponent();
 }
Ejemplo n.º 4
0
        private void btnValidateExcel_Click(object sender, EventArgs e)
        {
            lstErrors.DataSource = null;
              try {
            String fileName = Path.Combine(edtExcelPath.Text, lblFileName.Text + XLS);
            DataRowView currentRow = (DataRowView)dgvExcelFile.CurrentRow.DataBoundItem;
            Wizard wizard = new Wizard(this, fileName, "", currentRow);
            wizard.currentImportState = Wizard.ImportState.Validation;
            wizard.showNextImport();

            //validator = Validator.GetInstance();
            //validator.validateFile(fileName);
            //lstErrors.DataSource = validator.getErrors();
              }
              catch (Exception ex) {
            MessageBox.Show(ex.Message);
              }
        }
Ejemplo n.º 5
0
 private void btnStam_Click(object sender, EventArgs e)
 {
     if (!Helper.isValidYYMM(edtYearMonth.Text))
     {
     MessageBox.Show(String.Format("'{0}' Is not a Valid YYMM String", edtYearMonth.Text));
     edtYearMonth.Focus();
     }
     else
     {
     DataRowView currentRow = (DataRowView)dgvExcelFile.CurrentRow.DataBoundItem;
     Wizard wizard = new Wizard(this, Path.Combine(edtExcelPath.Text, lblFileName.Text), edtYearMonth.Text, currentRow);
     wizard.start();
     getAllExcelFiles();
     }
 }
Ejemplo n.º 6
0
        public DataTable getNewIsoReports(Wizard wizard)
        {
            //Throws Exception
              DataTable newIsoTable;

              DataTable isoReportTable = getAccounts();

              //IValidator validator = new Validator(null);
              wizard.validateFile();
              DataView dataView = new DataView(wizard.validator.ExcelTable);
              newIsoTable = dataView.ToTable(true, new String[] { "accountno", "siccode", "dba" });
              //newAccountsTable.Columns[0].ReadOnly = true;
              DataColumn doImport = new DataColumn(IMPORT);
              doImport.DataType = typeof(Boolean);
              newIsoTable.Columns.Add(doImport);

              //Remove the rows where Code/Developer is not found
              DataRow row;
              int i = 0;
              Dictionary<String, object> dic = new Dictionary<String, object>();
              SqlConnection sqlConnection = DB.getSqlConnection();
              while (i < newIsoTable.Rows.Count) {
            row = newIsoTable.Rows[i];
            row[IMPORT] = true;
            dic.Clear();
            ///dic.Add("YearMonth", wizard.YearMonth);
            dic.Add("YearMonth", wizard.YearMonth);
            dic.Add("accountno", row["accountno"]);
            //Todo: Warn the user about rows that are removed because account is not found
            //Todo: Also remove the rows that have been imported
            if (findAccountInIsoReport(sqlConnection, dic))//If the account is not found, delete it
              newIsoTable.Rows[i].Delete();
            else
              i++;
              }
              DB.closeConnection(sqlConnection);

              return newIsoTable;
        }
Ejemplo n.º 7
0
        public DataTable getNewDevelopers(Wizard wizard)
        {
            //Throws Exception
              DataTable newDevelopersTable;

              DataTable developersTable = getDevelopers();

              //IValidator validator = Validator.GetInstance();
              wizard.validateFile();
              DataView dataView = new DataView(wizard.validator.ExcelTable);
              newDevelopersTable = dataView.ToTable(true, "siccode");
              newDevelopersTable.Columns[0].ReadOnly = true;
              newDevelopersTable.Columns.Add("Name", typeof(String));// System.Type.GetType("System.String"));
              newDevelopersTable.Columns.Add("DefaultPercent", typeof(double));
              DataColumn doImport = new DataColumn(IMPORT);
              doImport.DataType = typeof(Boolean);
              newDevelopersTable.Columns.Add(doImport);
              DataRow row;
              int i = 0;
              String value;
              while (i < newDevelopersTable.Rows.Count) {
            try {
              row = newDevelopersTable.Rows[i];
              row[IMPORT] = true;
              value = getValue(row, "siccode").Trim();
              if (Helper.isBlank(value) || findInTable(developersTable, "code", value))
            newDevelopersTable.Rows[i].Delete();
              else
            i++;
            }
            catch (Exception ex) {

              throw ex;
            }
              }

              return newDevelopersTable;
        }
Ejemplo n.º 8
0
        public DataTable getNewAccounts(Wizard wizard)
        {
            //Throws Exception
              DataTable newAccountsTable;

              DataTable accountsTable = getAccounts();

              //IValidator validator = new Validator(null);
              wizard.validateFile();
              DataView dataView = new DataView(wizard.validator.ExcelTable);
              newAccountsTable = dataView.ToTable(true, new String[]{"accountno", "siccode", "dba", Helper.QDR, Helper.MQDR, Helper.NQDR});
              //newAccountsTable.Columns[0].ReadOnly = true;
              DataColumn doImport = new DataColumn(IMPORT);
              doImport.DataType = typeof(Boolean);
              newAccountsTable.Columns.Add(doImport);
              DataRow row;
              int i = 0;
              while (i < newAccountsTable.Rows.Count) {
            row = newAccountsTable.Rows[i];
            row[IMPORT] = true;
            if (findInTable(accountsTable, "code", (String)row["accountno"]))
              newAccountsTable.Rows[i].Delete();
            else
              i++;
              }

              return newAccountsTable;
        }
Ejemplo n.º 9
0
 public DlgImportDevelopersW(Wizard wizard)
     : base(wizard)
 {
     InitializeComponent();
       btnTable.Text = "Developers Table";
 }
Ejemplo n.º 10
0
 public DlgImportAccountsW(Wizard wizard)
     : base(wizard)
 {
     InitializeComponent();
       btnTable.Text = "Accounts Table";
 }
Ejemplo n.º 11
0
 public DlgImportNewFieldsW(Wizard wizard)
     : base(wizard)
 {
     InitializeComponent();
       btnTable.Text = "Ignored Fields Table";
 }
Ejemplo n.º 12
0
 public DlgNewFields(Wizard wizard)
     : base(wizard)
 {
     InitializeComponent();
 }