コード例 #1
0
        public JsonResult Remove(string id)
        {
            var success = true;
            var message = "保存成功!";

            try
            {
                var costbll = new CostBLL();
                costbll.Remove(id);

                var filebll = new FileInfoBLL();
                var files   = filebll.DeleteByRecId(id);
                foreach (var item in files)
                {
                    System.IO.File.Delete(Server.MapPath(item.FilePath));
                }
            }
            catch (Exception e)
            {
                success = false;
                message = e.Message;
            }
            return(Json(new AjaxResult()
            {
                type = success ? ResultType.success : ResultType.error, message = message
            }));
        }