figuring our lists and classes
This commit is contained in:
@ -4,29 +4,75 @@
|
||||
|
||||
<h1>Accounts</h1>
|
||||
|
||||
<ul>
|
||||
@foreach (var account in accounts)
|
||||
{
|
||||
<li>
|
||||
<input type="checkbox" @bind="account.LastContacted" />
|
||||
<input @bind="account.AccountName" />
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
|
||||
<input placeholder="Accounts Added" @bind="newAccount" />
|
||||
<button @onclick="AddAccount">Add Account</button>
|
||||
<body>
|
||||
<div class="box-wrapper">
|
||||
<div class="left-column">
|
||||
<p>Assigned Company Names</p>
|
||||
<RadzenSelectBarItem Text="This Is a Test" />
|
||||
<input placeholder="Accounts Added" @bind="newAccount" />
|
||||
<button @onclick="addAccount">Add Account</button>
|
||||
<ul>
|
||||
@foreach (var account in accounts)
|
||||
{
|
||||
<td>
|
||||
<button @onclick="() => selectedAccount(account.AccountName) ">@account.AccountName</button>
|
||||
</td>
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
<div class="middle-column">
|
||||
<h3>Tasks</h3>
|
||||
@if (!string.IsNullOrWhiteSpace(accountSel))
|
||||
{
|
||||
@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 tasks)
|
||||
{
|
||||
<li>
|
||||
@task.TaskName
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@code {
|
||||
private List<AccountItem> accounts = new();
|
||||
private string? newAccount;
|
||||
private List<AllAccounts> allAccounts = new();
|
||||
private string? newTask;
|
||||
private string? accountSel;
|
||||
|
||||
private void AddAccount()
|
||||
private void addAccount()
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(newAccount))
|
||||
{
|
||||
accounts.Add(new AccountItem{ AccountName = newAccount });
|
||||
allAccounts.Add(new AllAccounts { AllActs = newAccount });
|
||||
new Account(){ AccountName = newAccount};
|
||||
newAccount = string.Empty;
|
||||
}
|
||||
}
|
||||
private void addTask()
|
||||
{
|
||||
//string accounts = allAccounts.Single(s => s == accountSel);
|
||||
IEnumerable<string> accounts = allAccounts.Where(s => s == accountSel );
|
||||
//if (accounts == accountSel)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(newTask))
|
||||
{
|
||||
new Tasks(){ TaskName = newTask};
|
||||
newTask = string.Empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
private void selectedAccount(string Account)
|
||||
{
|
||||
var accountSel = Account;
|
||||
}
|
||||
}
|
||||
@ -11,6 +11,7 @@
|
||||
<link rel="stylesheet" href="css/bootstrap/bootstrap.min.css" />
|
||||
<link href="css/site.css" rel="stylesheet" />
|
||||
<link href="TodoList.styles.css" rel="stylesheet" />
|
||||
<link rel="stylesheet" href="_content/Radzen.Blazor/css/default-base.css">
|
||||
<component type="typeof(HeadOutlet)" render-mode="ServerPrerendered" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
Reference in New Issue
Block a user