示例#1
0
        public async Task <IActionResult> ChangeContactInfo(Guid id, [FromBody] ChangeContactInfoModel model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            await WorkerServices.ChangeContactInfoAsync(id, model);

            return(Ok());
        }
示例#2
0
        public async Task ChangeContactInfoAsync(Guid companyId, ChangeContactInfoModel model)
        {
            if (model == null)
            {
                throw new ArgumentNullException(nameof(model));
            }

            var userId = GetCurrentUserId();

            var cmd = new ChangeCompanyContactInfoCommand(userId, companyId, model.PhoneNumber, model.FaxNumber, model.WebsiteAddress, model.EmailAddress);

            await Bus.Send(cmd);
        }
示例#3
0
        public async Task ChangeContactInfoAsync(Guid personId, ChangeContactInfoModel model)
        {
            if (model == null)
            {
                throw new ArgumentNullException(nameof(model));
            }

            var userId = GetCurrentUserId();

            var cmd = new ChangePersonContactInfoCommand(
                userId,
                personId,
                model.PhoneNumber,
                model.MobileNumber,
                model.FaxNumber,
                model.WebsiteAddress,
                model.EmailAddress,
                model.InstantMessaging);

            await Bus.Send(cmd);
        }