Esempio n. 1
0
        public static ISimplexRepository GetRepository(string repositoryType)
        {
            ISimplexRepository repo = null;

            switch (repositoryType)
            {
            case "SQL": repo = new SQLRepository();
                break;

            case "CSV": repo = new CVSRepository();
                break;

            default: throw new ArgumentException("Tipo de repositorio invalido!");
                break;
            }
            return(repo);
        }
Esempio n. 2
0
        private void FetchData(string repositoryType)
        {
            ISimplexRepository qry = RepositoryFactor.GetRepository(repositoryType);
            var output             = qry.GetEcuacion();

            txt_output.Text = "";
            var oldE = 1;

            foreach (var q in output)
            {
                if (oldE == q.Nro_Ecu)
                {
                    txt_output.Text += " + ";
                }
                else
                {
                    txt_output.Text += "\r";
                    oldE             = (int)q.Nro_Ecu;
                }
                txt_output.Text += q.Valor + q.Variable;
            }
        }