示例#1
0
        public async Task <IActionResult> GetLabel(string identcode)
        {
            if (!ModelState.IsValid || identcode == null)
            {
                return(BadRequest());
            }

            var label = await _labelRepository.GetLabel(identcode);

            if (label == null)
            {
                return(NotFound());
            }

            return(Ok(label.Base64));
        }
示例#2
0
 /// <summary>
 /// Gets the label.
 /// </summary>
 /// <param name="userid">The userid.</param>
 /// <returns></returns>
 /// <exception cref="Exception"></exception>
 public List <LabelResponseModel> GetLabel(int userid)
 {
     try
     {
         if (userid != 0)
         {
             return(_labelRepository.GetLabel(userid));
         }
         else
         {
             return(null);
         }
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }