示例#1
0
 public HttpResponseMessage SetSend(Guid currentUserId, string value)
 {
     TakeDocService.Search.Interface.ISearch search = Utility.MyUnityHelper.UnityHelper.Resolve <TakeDocService.Search.Interface.ISearch>();
     try
     {
         ICollection <TakeDocModel.SearchUserTkFullText_Result> users = search.SearchUserFullText(currentUserId, value, Guid.Empty, true);
         var req = from user in users
                   select new
         {
             key  = user.UserTkId,
             text = user.UserTkFirstName + " " + user.UserTkLastName
         };
         return(Request.CreateResponse(req.ToList()));
     }
     catch (Exception ex)
     {
         return(Request.CreateResponse(HttpStatusCode.InternalServerError, ex.Message));
     }
 }
示例#2
0
        public HttpResponseMessage SearchUser([FromBody] string value)
        {
            TakeDocService.Search.Interface.ISearch search = Utility.MyUnityHelper.UnityHelper.Resolve <TakeDocService.Search.Interface.ISearch>();
            try
            {
                Newtonsoft.Json.Linq.JObject data = Newtonsoft.Json.Linq.JObject.Parse(value);
                string strSearchUserId            = data.Value <string>("userId");
                string firstName   = data.Value <string>("firstName");
                string lastName    = data.Value <string>("lastName");
                string email       = data.Value <string>("email");
                string strEntityId = data.Value <string>("entityId");

                Guid entityId = string.IsNullOrEmpty(strEntityId) ? Guid.Empty : new Guid(strEntityId);
                Guid userId   = string.IsNullOrEmpty(strSearchUserId) ? Guid.Empty : new Guid(strSearchUserId);

                return(Request.CreateResponse(search.SearchUser(userId, firstName, lastName, email, entityId)));
            }
            catch (Exception ex)
            {
                return(Request.CreateResponse(HttpStatusCode.InternalServerError, ex.Message));
            }
        }