last changes before removing from memory and adding to db
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
@page "/accounts"
|
||||
@inherits ActLogic
|
||||
|
||||
<PageTitle>Accounts</PageTitle>
|
||||
|
||||
@ -8,21 +9,21 @@
|
||||
<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>
|
||||
<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>
|
||||
@if (!string.IsNullOrWhiteSpace(accountSel))
|
||||
{
|
||||
@foreach (var tasks in accounts)
|
||||
{
|
||||
@ -32,7 +33,7 @@
|
||||
<input placeholder="Tasks Added" @bind="newTask" />
|
||||
<button @onclick="addTask">Add Task</button>
|
||||
<ul>
|
||||
@foreach (var task in tasks)
|
||||
@foreach (var task in )
|
||||
{
|
||||
<li>
|
||||
@task.TaskName
|
||||
@ -44,35 +45,45 @@
|
||||
</body>
|
||||
|
||||
@code {
|
||||
// Using Cascading Parameters
|
||||
[Parameter]
|
||||
public string? Account;
|
||||
[CascadingParameter]
|
||||
public string? AccountTask;
|
||||
[CascadingParameter]
|
||||
public string? TaskNote;
|
||||
private string? newAccount;
|
||||
private List<AllAccounts> allAccounts = new();
|
||||
private List<Account> accounts = new List<Account>();
|
||||
private Dictionary<string, string> tasks = new();
|
||||
private string? newTask;
|
||||
private string? accountSel;
|
||||
private bool accountboxvalue { get; set; }
|
||||
|
||||
private void toggle()
|
||||
{
|
||||
accountboxvalue = !accountboxvalue;
|
||||
}
|
||||
private void addAccount()
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(newAccount))
|
||||
{
|
||||
allAccounts.Add(new AllAccounts { AllActs = newAccount });
|
||||
new Account(){ AccountName = 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()
|
||||
{
|
||||
//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;
|
||||
if (Account.Equals(accountboxvalue));
|
||||
{
|
||||
tasks.Add(newTask, "");
|
||||
newTask = string.Empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
private void selectedAccount(string Account)
|
||||
{
|
||||
var accountSel = Account;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user