Exemplo n.º 1
0
        //public void Register(VendorRegisterCommand command)
        //{
        //    Id = Common.Common.GenerateGuid();
        //    Code = Common.Common.GenerateCodeFromId(command.SystemNumericalOrder, 3);
        //    string passwordHash = EncryptionExtensions.Encryption(Code, command.Password, out string salt);
        //    CreatedDateUtc = command.CreatedDateUtc;
        //    CreatedUid = string.Empty;
        //    UpdatedDateUtc = command.CreatedDateUtc;
        //    UpdatedUid = string.Empty;
        //    Email = command.Email;
        //    PhoneNumber = command.Mobile;
        //    EmailConfirmed = false;
        //    IsTaxExempt = false;
        //    FailedLoginAttempts = 0;
        //    LastIpAddress = command.RegisterIp;
        //    Password = passwordHash;
        //    PasswordSalt = salt;
        //    PhoneNumberConfirmed = false;
        //    TwoFactorEnabled = EnumDefine.TwoFactorEnum.Disable;
        //    FullName = command.FullName;
        //    Gender = command.Gender;
        //    Birthday = command.Birthday;
        //    AddType(TypeEnum.IsVendor);
        //    Status = StatusEnum.New;
        //    RegisterEvent();
        //}

        public void Add(VendorAddCommand command)
        {
            Id   = Common.Common.GenerateGuid();
            Code = command.Code;

            Email          = command.Email ?? string.Empty;
            Name           = command.Name ?? string.Empty;
            CompanyName    = command.CompanyName ?? string.Empty;;
            Description    = command.Description ?? string.Empty;
            Logo           = command.Logo ?? string.Empty;;
            Phone          = command.Phone ?? string.Empty;
            Fax            = command.Fax ?? string.Empty;;
            Description    = command.Description ?? string.Empty;
            Website        = command.Website;
            Type           = command.Type;
            Status         = command.Status;
            CreatedDateUtc = command.CreatedDateUtc;
            UpdatedDateUtc = command.CreatedDateUtc;
            CreatedUid     = command.CreatedUid ?? string.Empty;
            UpdatedUid     = command.CreatedUid ?? string.Empty;
            Version        = command.Version;
        }
Exemplo n.º 2
0
        public async Task <CommandResult> SendCommand(VendorAddCommand command)
        {
            CommandResult commandResult = await _commandService.SendAndReceiveResult <CommandResult>(command);

            return(commandResult);
        }