added HTML5 date picker to input controls
This commit is contained in:
@ -38,7 +38,7 @@ else
|
|||||||
<Label For="effectiveDate" HelpText="The date that this role assignment is active" ResourceKey="EffectiveDate">Effective Date: </Label>
|
<Label For="effectiveDate" HelpText="The date that this role assignment is active" ResourceKey="EffectiveDate">Effective Date: </Label>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input id="effectiveDate" class="form-control" @bind="@effectivedate" />
|
<input type="date" id="effectiveDate" class="form-control" @bind="@effectivedate" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@ -46,7 +46,7 @@ else
|
|||||||
<Label For="expiryDate" HelpText="The date that this role assignment expires" ResourceKey="ExpiryDate">Expiry Date: </Label>
|
<Label For="expiryDate" HelpText="The date that this role assignment expires" ResourceKey="ExpiryDate">Expiry Date: </Label>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input id="expiryDate" class="form-control" @bind="@expirydate" />
|
<input type="date" id="expiryDate" class="form-control" @bind="@expirydate" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
@ -75,8 +75,8 @@ else
|
|||||||
private string name = string.Empty;
|
private string name = string.Empty;
|
||||||
private List<UserRole> users;
|
private List<UserRole> users;
|
||||||
private int userid = -1;
|
private int userid = -1;
|
||||||
private string effectivedate = string.Empty;
|
private DateTime? effectivedate = null;
|
||||||
private string expirydate = string.Empty;
|
private DateTime? expirydate = null;
|
||||||
private List<UserRole> userroles;
|
private List<UserRole> userroles;
|
||||||
|
|
||||||
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Admin;
|
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Admin;
|
||||||
@ -125,23 +125,8 @@ else
|
|||||||
var userrole = userroles.Where(item => item.UserId == userid && item.RoleId == roleid).FirstOrDefault();
|
var userrole = userroles.Where(item => item.UserId == userid && item.RoleId == roleid).FirstOrDefault();
|
||||||
if (userrole != null)
|
if (userrole != null)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(effectivedate))
|
userrole.EffectiveDate = effectivedate;
|
||||||
{
|
userrole.ExpiryDate = expirydate;
|
||||||
userrole.EffectiveDate = null;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
userrole.EffectiveDate = DateTime.Parse(effectivedate);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(expirydate))
|
|
||||||
{
|
|
||||||
userrole.ExpiryDate = null;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
userrole.ExpiryDate = DateTime.Parse(expirydate);
|
|
||||||
}
|
|
||||||
await UserRoleService.UpdateUserRoleAsync(userrole);
|
await UserRoleService.UpdateUserRoleAsync(userrole);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -149,24 +134,8 @@ else
|
|||||||
userrole = new UserRole();
|
userrole = new UserRole();
|
||||||
userrole.UserId = userid;
|
userrole.UserId = userid;
|
||||||
userrole.RoleId = roleid;
|
userrole.RoleId = roleid;
|
||||||
|
userrole.EffectiveDate = effectivedate;
|
||||||
if (string.IsNullOrEmpty(effectivedate))
|
userrole.ExpiryDate = expirydate;
|
||||||
{
|
|
||||||
userrole.EffectiveDate = null;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
userrole.EffectiveDate = DateTime.Parse(effectivedate);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(expirydate))
|
|
||||||
{
|
|
||||||
userrole.ExpiryDate = null;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
userrole.ExpiryDate = DateTime.Parse(expirydate);
|
|
||||||
}
|
|
||||||
|
|
||||||
await UserRoleService.AddUserRoleAsync(userrole);
|
await UserRoleService.AddUserRoleAsync(userrole);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user