public ActionResult Delete(int id) { AjaxResult result = new AjaxResult(); try { ApplicationClass entity = m_FTISService.GetApplicationClassById(id); //檢查底下的Application數量 IDictionary <string, string> conditions = new Dictionary <string, string>(); conditions.Add("ApplicationClassId", id.ToString()); int subsCount = m_FTISService.GetApplicationCount(conditions); if (subsCount > 0) { return(this.Json(new AjaxResult(AjaxResultStatus.Fail, string.Format("{0}底下尚有企業社會責任資訊,不可刪除。", entity.Name)))); } m_FTISService.DeleteApplicationClass(entity); result.ErrorCode = AjaxResultStatus.Success; result.Message = string.Format("{0}刪除成功", entity.Name); } catch (Exception ex) { result.ErrorCode = AjaxResultStatus.Exception; result.Message = ex.Message; } return(this.Json(result)); }
private int GetGridTotal() { int total = m_FTISService.GetApplicationCount(m_Conditions); return(total); }