示例#1
0
        public object AssociateCRRARContactToUser(long UserSysID, long ContactId, long attnId = 0)
        {
            try
            {
                if (UserSysID == 0 || ContactId == 0)
                {
                    return(BadRequest("UserId and ContactId are required.  Attn is optional, leave as 0 for ALL attentionTo records."));
                }

                var newUC = new USER_CONTACT()
                {
                    USER_SYS_ID = UserSysID, CRRAR_CONTACT_ID = ContactId, CRRAR_ATTN_ID = attnId, AUDIT_REC_CREATE_APPL_USER_ID = "FOPS", AUDIT_REC_CREATE_DTS = DateTime.Now
                };

                _service.AssociateCRRARContactToUser(newUC);

                return(Ok(newUC));
            }
            catch (Exception e)
            {
                var msg = string.Format("CRRAR Contact/Attn association {1}/{2} failed.\n\nUserId:\n{0}.", UserSysID, ContactId, attnId);
                log.Error(e);

                return(BadRequest(msg));
            }
        }
 public object AssociateCRRARContactToUser(USER_CONTACT newUC)
 {
     return(_repository.AssociateCRRARContactToUser(newUC));
 }