//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()); }
public JsonResult delProperties(string key, int id) { bool ret = false; pgsql conn = new pgsql(); if (conn.open()) { ret = conn.sqlDeleteProperties(key, id); } return(Json(ret)); }
public JsonResult listProperties(string key) { List <cat_general_sigla> props = new List <cat_general_sigla>(); pgsql conn = new pgsql(); if (conn.open()) { props = conn.sqlListProperties(key); } return(Json(props)); }
public JsonResult listRace() { List <cat_general_sigla> races = new List <cat_general_sigla>(); pgsql conn = new pgsql(); if (conn.open()) { races = conn.sqlListRace(); } return(Json(races)); }
public JsonResult pedigree(int id) { Pedigree pedigree = new Pedigree(); pgsql conn = new pgsql(); if (conn.open()) { pedigree = conn.sqlPedigree(id); } return(Json(pedigree)); }
public JsonResult saveCat(Cats cat) { bool catSaved = false; pgsql conn = new pgsql(); if (conn.open()) { catSaved = conn.sqlSaveCat(cat); } return(Json(catSaved)); }
public JsonResult peopleProfile(int id) { Person contact = new Person(); pgsql conn = new pgsql(); if (conn.open()) { contact = conn.sqlPersonProfile(id); } return(Json(contact)); }
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)); }
public JsonResult saveProperties(string key, int id, string description, string sigla, bool edit) { bool ret = false; pgsql conn = new pgsql(); if (conn.open()) { ret = conn.sqlSaveProperties(key, id, description, sigla, edit); } return(Json(ret)); }
public JsonResult savePerson(Person person) { bool ret = false; pgsql conn = new pgsql(); if (conn.open()) { ret = conn.savePerson(person); } return(Json(ret)); }
/* * public ActionResult CatCard(int id) * { * * ViewBag.Catcard_id = id; * return View(); * * } */ private Cats findACatById(int id) { Cats cat = null; pgsql conn = new pgsql(); if (conn.open()) { cat = conn.sqlCat(id); } return(cat); }
public string listCats() { List <Cats> cats = new List <Cats>(); pgsql conn = new pgsql(); if (conn.open()) { cats = conn.sqlListCats(""); } var serializer = new JavaScriptSerializer(); serializer.MaxJsonLength = Int32.MaxValue; return(serializer.Serialize(cats));; }
// GET: Pedigree public ActionResult Index(int id) { Pedigree pedigree = new Pedigree(); pgsql conn = new pgsql(); if (conn.open()) { pedigree = conn.sqlPedigree(id); } ViewBag.pedigree = pedigree; //return Json(pedigree); return(View()); }