86 lines
2.7 KiB
Plaintext
86 lines
2.7 KiB
Plaintext
@page "/accounts"
|
|
@using SqliteWasmHelper
|
|
@using BlazorWasmExample.Data
|
|
@using Microsoft.EntityFrameworkCore
|
|
@inject ISqliteWasmDbContextFactory<ThingContext> Factory
|
|
|
|
<PageTitle>Accounts</PageTitle>
|
|
|
|
<h1>Accounts</h1>
|
|
|
|
<body>
|
|
<div class="box-wrapper">
|
|
<div class="left-column">
|
|
<p>Assigned Company Names</p>
|
|
<input placeholder="Accounts Added" @bind="newAccount" />
|
|
<button @onclick="addAccount">Add Account</button>
|
|
<ul>
|
|
@foreach (var account in accounts)
|
|
{
|
|
<td>
|
|
<input type="checkbox" bind="@accountboxvalue" /> @account.AccountName<br />
|
|
Boolvalue: @accountboxvalue<br />
|
|
<button onclick="@toggle">toggle</button>
|
|
</td>
|
|
}
|
|
</ul>
|
|
</div>
|
|
<div class="middle-column">
|
|
<h3>Tasks</h3>
|
|
{
|
|
@foreach (var tasks in accounts)
|
|
{
|
|
<li>@tasks.Tasks</li>
|
|
}
|
|
}
|
|
<input placeholder="Tasks Added" @bind="newTask" />
|
|
<button @onclick="addTask">Add Task</button>
|
|
<ul>
|
|
@foreach (var task in )
|
|
{
|
|
<li>
|
|
@task.TaskName
|
|
</li>
|
|
}
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
|
|
@code {
|
|
public string? TaskNote;
|
|
private string? newAccount;
|
|
private List<Account> accounts = new List<Account>();
|
|
private Dictionary<string, string> tasks = new();
|
|
private string? newTask;
|
|
private bool accountboxvalue { get; set; }
|
|
|
|
private void toggle()
|
|
{
|
|
accountboxvalue = !accountboxvalue;
|
|
}
|
|
private void addAccount()
|
|
{
|
|
if (!string.IsNullOrWhiteSpace(newAccount))
|
|
{
|
|
Account accounts = new Account(AccountName, tasks, LastContacted);
|
|
accounts.Add(accounts);
|
|
Account newAccount = new Account{newAccount};
|
|
accounts.Add(new Account { AccountName = newAccount });
|
|
newAccount = string.Empty;
|
|
}
|
|
}
|
|
private void addTask()
|
|
{
|
|
{
|
|
if (!string.IsNullOrWhiteSpace(newTask))
|
|
{
|
|
if (Account.Equals(accountboxvalue));
|
|
{
|
|
tasks.Add(newTask, "");
|
|
newTask = string.Empty;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |