Beispiel #1
0
        /// <summary>
        /// 删除指定Id的公司信息
        /// </summary>
        /// <returns></returns>

        public ActionResult DeleteCompany(int id)
        {
            CompanyModel model = new CompanyModel();

            model.DeleteCompany(id);


            //创建删除日志
            LogModel logModel = new LogModel();

            logModel.Name    = User.Identity.Name;
            logModel.Date    = DateTime.Now;
            logModel.Content = "DeleteCompany";
            try
            {
                logModel.AddLog(logModel);
            }
            catch (Exception ex)
            {
                ModelState.AddModelError("", "日志创建失败");
            }
            return(RedirectToAction("Index", "Company"));
        }