示例#1
0
        public IActionResult GetNoticeCategoryAll(string uuid)
        {
            long logId = 0;

            try
            {
                logId = BaseApiManager.SaveLogs(uuid);
                if (!IsUuid(uuid))
                {
                    return(Error(logId, "verify uuid fail!"));
                }
                var    entityInterfaceAccount = GetInterfaceAccountByUuid(uuid);
                string companyId = entityInterfaceAccount.CompanyID;
                string state     = "true";
                var    lists     = NoticeCategoryService.GetNoticeCategoryByState(SystemID, companyId, state);
                var    data      = from m in lists
                                   select new
                {
                    id   = m.CategoryID,
                    name = m.CategoryName
                };
                return(Success(logId, "ok", data));
            }
            catch (Exception ex)
            {
                return(Error(logId, ex.Message));
            }
        }
示例#2
0
 public JsonResult GetNoticeCategory()
 {
     try
     {
         bool state = true;
         var  lists = NoticeCategoryService.GetNoticeCategoryByState(SystemID, CompanyID, state.ToString());
         if (lists == null)
         {
             return(Error("not data!"));
         }
         var data = from m in lists
                    select new
         {
             id   = m.CategoryID,
             name = m.CategoryName
         };
         return(Success("ok", data));
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }