async Task SendEmailAsync()
        {
            if (string.IsNullOrEmpty(ToAddress))
            {
                Message = "Please set a to address and try again ";
                return;
            }
            Email email = new Email();

            email.Subject   = Subject;
            email.ToAddress = ToAddress;
            if (Environment.MachineName == "DESKTOP-UROO8T1" || User.Identity.Name.ToLower() == "*****@*****.**")
            {
                email.ToAddress = "*****@*****.**";
            }
            if (!string.IsNullOrEmpty(EditorContent))
            {
                email.Body = await this.QuillHtml.GetHTML();
            }
            email.Body = $"{email.Body}<br>{EditorContentHtmlSuffix}";
            var response = await EmailService.SendEmailAsync(email);

            if (response.StatusCode == System.Net.HttpStatusCode.Accepted)
            {
                ToastService.ShowSuccess($"Email appears to have been sent correctly to {email.ToAddress}", "SUCCESS");
                await ModalInstance.CloseAsync(ModalResult.Ok <string>(Message));
            }
            else
            {
                ToastService.ShowError($"Email failed to send with the following status code {response.StatusCode}", "ERROR");
            }
        }
Esempio n. 2
0
        protected async Task HandleValidSubmit()
        {
            await EmployeeDataService.AddEmployee(Employee);

            await ModalInstance.CloseAsync(ModalResult.Ok(true));

            ToastService.ShowSuccess($"{Employee.FullName} Added successfully.", "Success");
        }
Esempio n. 3
0
        protected async Task HandleValidSubmit()
        {
            await TaskDataService.AddTask(Task);

            await ModalInstance.CloseAsync(ModalResult.Ok(true));

            ToastService.ShowSuccess($"{Task.Title} Added successfully.", "Success");
        }
        public async Task AddNewCloset(CreateClosetRequest ClosetRequest)
        {
            ClosetRequest.RoomId      = RoomId;
            ClosetRequest.BuildingId  = BuildingId;
            ClosetRequest.CarpetPrice = Carpet.Where(c => c.Id == ClosetRequest.CarpetId).FirstOrDefault().SquareYardPrice;

            await ClosetService.AddNewClosetAsync(ClosetRequest);

            await ModalInstance.CloseAsync();
        }
Esempio n. 5
0
        public async Task AddNewStaircase(CreateStaircaseRequest NewStaircase)
        {
            NewStaircase.BuildingId = BuildingId;

            NewStaircase.CarpetPrice = Carpet.Where(c => c.Id == NewStaircase.CarpetId).FirstOrDefault().SquareYardPrice;
            NewStaircase.Total       = CalculateTotal(NewStaircase);

            await StaircaseService.AddNewStaircaseAsync(NewStaircase);

            await ModalInstance.CloseAsync();
        }
Esempio n. 6
0
        public async Task ShowRemoveInstallerConfirmationModal()
        {
            var RemoveInstallerConfirmationModal = Modal.Show <Confirmation>("Are you sure you want to remove this Installer");
            var result = await RemoveInstallerConfirmationModal.Result;

            if (!result.Cancelled)
            {
                await InstallerService.DeleteInstallerAsync(InstallerId);

                await ModalInstance.CloseAsync();
            }
        }
        protected async Task HandleValidSubmit()
        {
            DisplayLoadingSpinner = true;

            var response = await MovieListService.CreateMovieListAsync(User.Id, CreateListModel);

            if (response.Success)
            {
                DisplayLoadingSpinner = false;
                await ModalInstance.CloseAsync();
            }
        }
        protected async Task HandleValidSubmit()
        {
            DisplayLoadingSpinner = true;

            var response = await UserService.UpdateUserAsync(User.Id, EditModel);

            if (response.Success)
            {
                DisplayLoadingSpinner = false;
                await ModalInstance.CloseAsync();
            }
        }
        public async Task UpdatePurchaseAsync(CreatePurchaseRequest CreatePurchase)
        {
            var UpdatePurchase = new UpdatePurchaseRequest
            {
                Id              = CreatePurchase.Id,
                VendorId        = CreatePurchase.VendorId,
                Date            = CreatePurchase.Date,
                ReferenceNumber = CreatePurchase.ReferenceNumber
            };
            await PurchaseService.UpdatePurchaseAsync(UpdatePurchase);

            await ModalInstance.CloseAsync();
        }
        public async Task UpdatePurchaseItemAsync(CreatePurchaseItemRequest CreatePurchaseItem)
        {
            var UpdatePurchaseItem = new UpdatePurchaseItemRequest
            {
                Id         = CreatePurchaseItem.Id,
                ProductId  = CreatePurchaseItem.ProductId,
                PurchaseId = CreatePurchaseItem.PurchaseId,
                Notes      = CreatePurchaseItem.Notes,
                Price      = CreatePurchaseItem.Price,
                Quantity   = CreatePurchaseItem.Quantity,
                UOM        = CreatePurchaseItem.UOM
            };
            await PurchaseItemService.UpdatePurchaseItemAsync(UpdatePurchaseItem);

            await ModalInstance.CloseAsync();
        }
        public async Task AddNewInstallerAsync(CreateInstallerRequest InstallerRequest)
        {
            CreateInstallerRequest newInstaller = new CreateInstallerRequest
            {
                FirstName       = InstallerRequest.FirstName,
                LastName        = InstallerRequest.LastName,
                Area            = 0,
                PhoneNumber     = InstallerRequest.PhoneNumber,
                RetailerId      = RetailerId,
                SquareYardPrice = InstallerRequest.SquareYardPrice
            };

            await InstallerService.AddNewInstallerAsync(newInstaller);

            await ModalInstance.CloseAsync();
        }
        public async Task AddNewRoom(CreateRoomRequest RoomRequest)
        {
            NewRoom = new CreateRoomRequest
            {
                Id         = RoomRequest.Id,
                Length     = RoomRequest.Length,
                Width      = RoomRequest.Width,
                RoomName   = RoomRequest.RoomName,
                BuildingId = BuildingId,
                CarpetId   = RoomRequest.CarpetId
            };

            await RoomService.AddNewRoomAsync(NewRoom);

            await ModalInstance.CloseAsync();
        }
        public async Task Ok()
        {
            var content = new Model.TaskItem
            {
                Id          = TaskItem?.Id ?? 0,
                TaskListId  = TaskItem?.TaskListId ?? TaskListId,
                Name        = Name,
                Description = Description
            };

            var json = JsonSerializer.Serialize(content);

            await HttpClient.PostAsync($"http://taskboard.api/TaskItem/InsertOrEdit", new StringContent(json, Encoding.UTF8, "application/json"));

            await ModalInstance.CloseAsync(ModalResult.Ok(""));
        }
Esempio n. 14
0
        protected async Task HandleValidSubmit()
        {
            DisplayLoadingSpinner = true;

            var response = await AuthenticationService.LoginUser(LoginModel);

            if (response.Success)
            {
                DisplayLoadingSpinner = false;
                await ModalInstance.CloseAsync();
            }
            else
            {
                DisplayMessage        = true;
                Message               = response.Message;
                DisplayLoadingSpinner = false;
            }
        }
Esempio n. 15
0
        protected async Task HandleValidSubmit()
        {
            DisplayLoadingSpinner = true;

            var response = await AuthenticationService.RegisterUser(RegisterModel);

            if (response.Success)
            {
                DisplayLoadingSpinner = false;

                var loginResponse = await AuthenticationService.LoginUser(new LoginRequest { Email = response.Email, Password = response.Password });

                if (loginResponse.Success)
                {
                    await ModalInstance.CloseAsync();
                }
            }
            else
            {
                DisplayMessage        = true;
                Message               = response.Message;
                DisplayLoadingSpinner = false;
            }
        }
        public async Task AddPurchaseAsync(CreatePurchaseRequest CreatePurchase)
        {
            await PurchaseService.AddNewPurchaseAsync(CreatePurchase);

            await ModalInstance.CloseAsync();
        }
Esempio n. 17
0
        public async Task Ok()
        {
            await HttpClient.PostAsync($"http://taskboard.api/TaskItem/Transfer/{TaskItemId}/{SelectedTaskListId}", null);

            await ModalInstance.CloseAsync(ModalResult.Ok(SelectedTaskListId, typeof(int)));
        }
Esempio n. 18
0
        public async Task Ok()
        {
            await HttpClient.PostAsync($"http://taskboard.api/TaskList/{Name}", null);

            await ModalInstance.CloseAsync(ModalResult.Ok(""));
        }
        public async Task DeletePurchaseItemAsync(Guid Id)
        {
            await PurchaseItemService.DeletePurchaseItemAsync(Id);

            await ModalInstance.CloseAsync();
        }
 public void Confirm(UpdateInstallerRequest installerRequest)
 {
     InstallerService.UpdateInstallerAsync(installerRequest);
     ModalInstance.CloseAsync();
 }
 public void Confirm(UpdateCarpetRequest carpetRequest)
 {
     CarpetService.UpdateCarpetAsync(carpetRequest);
     ModalInstance.CloseAsync();
 }