public ActionResult Delete(FormCollection collection) { string returnValue = string.Empty; string[] deleteId = collection["query"].GetString().Split(','); if (deleteId != null && deleteId.Length > 0) { SMLOG _SMLOG = new SMLOG { OPERATION_TYPE = "D", FUNC_CODE = "010023", USER_ID = UserId, CLASSNAME = this.GetType().ToString() + strDelete }; if (deleteId.Length == 1) { int delId = int.Parse(deleteId[0]); var entity = SMFIELDService.LoadEntities(x => x.ID == delId).FirstOrDefault(); if (SMFIELDService.DeleteEntity(entity)) { _SMLOG.REMARK = "数据字典信息的Id为" + deleteId[0] + Suggestion.DeleteSucceed; SMLOGService.AddEntity(_SMLOG);//写入日志 return(Json("OK")); } else { _SMLOG.REMARK = "数据字典信息的Id为" + deleteId[0] + Suggestion.DeleteSucceed; } SMLOGService.AddEntity(_SMLOG);//写入日志 } #region 批量删除 //if (SMFIELDService.DeleteCollection(ref validationErrors, deleteId)) //{ // LogClassModels.WriteServiceLog(Suggestion.DeleteSucceed + ",信息的Id为" + string.Join(",", deleteId), "消息" // );//删除成功,写入日志 // return Json("OK"); //} //else //{ // if (validationErrors != null && validationErrors.Count > 0) // { // validationErrors.All(a => // { // returnValue += a.ErrorMessage; // return true; // }); // } // LogClassModels.WriteServiceLog(Suggestion.DeleteFail + ",信息的Id为" + string.Join(",", deleteId) + "," + returnValue, "消息" // );//删除失败,写入日志 //} #endregion } return(Json(returnValue)); }
/// <summary> /// 查看详细 /// </summary> /// <param name="id"></param> /// <returns></returns> public ActionResult Details(int id) { SMFIELD item = SMFIELDService.LoadEntities(x => x.ID == id).FirstOrDefault(); return(View(item)); }