Beispiel #1
0
        public ActionResult Edit(int id, HR_Example.Models.Country country)
        {
            try
            {
                string sql = "UPDATE Country SET [country_Name] = N'{0}' WHERE country_ID = N'{1}'";
                func.fireSQL(String.Format(sql, country.Country_name, id));
                // TODO: Add update logic here

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
Beispiel #2
0
        public ActionResult Create(HR_Example.Models.Country country)
        {
            try
            {
                string sql = "INSERT INTO Country ([country_Name])VALUES(N'{0}')";
                func.fireSQL(String.Format(sql, country.Country_name));
                // TODO: Add insert logic here

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }