示例#1
0
        public ActionResult Delete(Employee employee)
        {
            try
            {
                SqlRepository repository = new SqlRepository(_LocalFileConnectionString);
                string        sql        = String.Format($"DELETE FROM Employee WHERE Id={employee.Id}");

                repository.DeleteEmplyee(sql);
                return(RedirectToAction("Index"));
            }
            catch (Exception ex)
            {
                ViewBag.ErrorText = ex.ToString();
                return(View("Error"));
            }
        }