Exemplo n.º 1
0
        public ActionResult Delete(int id)
        {
            AjaxResult result = new AjaxResult();

            try
            {
                if (id.Equals(1))
                {
                    throw new Exception("admin不可刪除!");
                }

                MasterMember entity = m_FTISService.GetMasterMemberById(id);
                m_FTISService.DeleteMasterMember(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));
        }