예제 #1
0
        public JsonResult listContacts(string key)
        {
            List <Person> contacts = new List <Person>();
            pgsql         conn     = new pgsql();

            if (conn.open())
            {
                contacts = conn.sqlListPerson(key);
            }

            return(Json(contacts));
        }
예제 #2
0
        //public Util.Config config = new Util.Config();
        public ActionResult Index()
        {
            //List<Cats> gatos = listCats();
            //ViewBag.lastCats = gatos;

            List <Cats> cats = new List <Cats>();
            pgsql       conn = new pgsql();

            conn.host     = "localhost";
            conn.userName = "******";
            conn.password = "******";
            conn.database = "petgree";
            if (conn.open())
            {
                cats = conn.sqlListCats("limit 5");
            }

            ViewBag.lastCats = cats;
            //config.SetConfig();

            List <Person> contacts = new List <Person>();

            conn.host     = "localhost";
            conn.userName = "******";
            conn.password = "******";
            conn.database = "petgree";
            if (conn.open())
            {
                contacts = conn.sqlListPerson("limit 5");
            }


            ViewBag.lastPeoples = contacts;

            /*
             * var resxFile = @"C:\Onys\Petgree\lab\template\sbadmin\sb-admin-2-bootstrap-template-asp-mvc\sb-admin-2.Web\Resources\petgree.resx";
             * using (ResXResourceReader resxReader = new ResXResourceReader(resxFile))
             * {
             *  foreach (DictionaryEntry entry in resxReader)
             *  {
             *      Console.WriteLine( (string)entry.Key );
             *      //if (((string)entry.Key).StartsWith("EarlyAuto"))
             *      //    autos.Add((Automobile)entry.Value);
             *      //else if (((string)entry.Key).StartsWith("Header"))
             *      //    headers.Add((string)entry.Key, (string)entry.Value);
             *  }
             * }
             */



            return(View());
        }