CompanyCardComponent fixes
This commit is contained in:
parent
e006509e5c
commit
b98bbc18be
|
|
@ -33,8 +33,8 @@
|
|||
<div class="row">
|
||||
<div class="col-12 col-md-6">
|
||||
<h4>Information</h4>
|
||||
@RenderDetailsItem("fa-solid fa-user", "Contact Name", companyProfile.FullName)
|
||||
@RenderDetailsItem("fa-solid fa-circle-info", "Description", companyProfile.Description)
|
||||
@RenderDetailsItem("fa-solid fa-user", "Contact Name", Company.Profile.Name)
|
||||
@RenderDetailsItem("fa-solid fa-circle-info", "Description", Company.Profile.Description ?? string.Empty)
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-md-6">
|
||||
|
|
@ -65,23 +65,23 @@
|
|||
}
|
||||
</div>
|
||||
|
||||
<p>@msg</p>
|
||||
<p>@_msg</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@code {
|
||||
[Parameter] public Company Company { get; set; }
|
||||
[Parameter] public required Company Company { get; set; }
|
||||
|
||||
[Parameter] public EventCallback<string> DataChanged { get; set; }
|
||||
|
||||
AccordionExpandMode ExpandMode { get; set; } = AccordionExpandMode.SingleOrNone;
|
||||
AccordionExpandCollapseAction ExpandCollapseAction { get; set; } = AccordionExpandCollapseAction.HeaderClick;
|
||||
|
||||
string msg;
|
||||
private bool isSaveActive = false;
|
||||
string _msg;
|
||||
private bool _isSaveActive = false;
|
||||
|
||||
private Profile companyProfile = new Profile();
|
||||
//private Profile _companyProfile = new Profile();
|
||||
|
||||
void OnPasswordConfirmed(string password)
|
||||
{
|
||||
|
|
@ -92,21 +92,23 @@
|
|||
protected async Task ChangeName()
|
||||
{
|
||||
|
||||
isSaveActive = false;
|
||||
_isSaveActive = false;
|
||||
|
||||
|
||||
await DataChanged.InvokeAsync(msg);
|
||||
await DataChanged.InvokeAsync(_msg);
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
var CompanyProfiles = await AdminSignalRClient.GetByIdAsync<List<Profile>>(SignalRTags.GetProfileById, Company.ProfileId);
|
||||
if (CompanyProfiles != null)
|
||||
{
|
||||
companyProfile = CompanyProfiles[0];
|
||||
}
|
||||
//_companyProfile = Company.Profile;
|
||||
// var companyProfiles = await AdminSignalRClient.GetByIdAsync<List<Profile>>(SignalRTags.GetProfileById, Company.ProfileId);
|
||||
// if (companyProfiles != null)
|
||||
// {
|
||||
// _companyProfile = companyProfiles[0];
|
||||
// }
|
||||
|
||||
await base.OnInitializedAsync();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -25,13 +25,13 @@
|
|||
|
||||
|
||||
@code {
|
||||
[Parameter] public Guid Id { get; set; }
|
||||
bool _isUserLoggedIn;
|
||||
int _userType = 0;
|
||||
[Parameter] public required Guid Id { get; set; }
|
||||
|
||||
// bool _isUserLoggedIn;
|
||||
// int _userType = 0;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
//check if Id matches with userproductmapping
|
||||
if (!_sessionService.IsAuthenticated) return;
|
||||
|
||||
var check = _sessionService.User?.UserModelDto.UserProductMappings.Any(x => x.ProductId == Id) ?? false;
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@
|
|||
ExpandCollapseAction="ExpandCollapseAction"
|
||||
AnimationType="LayoutAnimationType.Slide">
|
||||
<Items>
|
||||
@foreach (var company in companies)
|
||||
@foreach (var company in _companies)
|
||||
{
|
||||
|
||||
<DxAccordionItem CssClass="" Text=@($"{company.Name}")>
|
||||
|
|
@ -112,14 +112,14 @@
|
|||
private LoggerClient<MyServiceProviders> _logger = null!;
|
||||
|
||||
private CompanyGrid _gridCompany = null!;
|
||||
private List<Company> companies = [];
|
||||
public List<Company> Companies = [];
|
||||
public ServiceProviderWizardModel MyModel = new ServiceProviderWizardModel();
|
||||
private List<Company> _companies = [];
|
||||
//public List<Company> Companies = [];
|
||||
public ServiceProviderWizardModel MyModel = new();
|
||||
|
||||
bool EulaAccepted { get; set; }
|
||||
bool EulaVisible { get; set; }
|
||||
|
||||
private Guid[] _contextIds = new Guid[0];
|
||||
private readonly Guid[] _contextIds = new Guid[1];
|
||||
|
||||
void CancelCreateClick()
|
||||
{
|
||||
|
|
@ -147,33 +147,33 @@
|
|||
|
||||
void Grid_CustomizeEditModel(GridCustomizeEditModelEventArgs e)
|
||||
{
|
||||
if (e.IsNew)
|
||||
{
|
||||
var newEmployee = (Company)e.EditModel;
|
||||
newEmployee.Name = "Add a company name";
|
||||
newEmployee.OwnerId = SessionService.User!.UserId;
|
||||
newEmployee.AffiliateId = Guid.NewGuid();
|
||||
}
|
||||
if (!e.IsNew) return;
|
||||
|
||||
var newEmployee = (Company)e.EditModel;
|
||||
newEmployee.Name = "Add a company name";
|
||||
newEmployee.OwnerId = SessionService.User!.UserId;
|
||||
newEmployee.AffiliateId = Guid.NewGuid();
|
||||
}
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await base.OnInitializedAsync();
|
||||
_logger = new LoggerClient<MyServiceProviders>(LogWriters.ToArray());
|
||||
var myId = SessionService.User!.UserId;
|
||||
|
||||
_logger.Debug(companies.Count.ToString());
|
||||
_contextIds = new Guid[1];
|
||||
_contextIds[0] = myId;
|
||||
var result = await AdminSignalRClient.GetByIdAsync<List<Company>>(SignalRTags.GetCompaniesByContextId, myId);
|
||||
var userId = SessionService.User!.UserId;
|
||||
_contextIds[0] = userId;
|
||||
|
||||
_companies = (await AdminSignalRClient.GetByIdAsync<List<Company>>(SignalRTags.GetCompaniesByContextId, userId))!;
|
||||
|
||||
_logger.Debug($"companies.Count: {_companies.Count}");
|
||||
|
||||
//await AdminSignalRClient.GetAllIntoAsync<Company>(Companies, SignalRTags.GetCompaniesByContextId, new object[] { myId });
|
||||
companies = result;
|
||||
//companies = result;
|
||||
// ServiceProviderDataService.GetPropertiesByOwnerIdAsync(myId, companyPropertiesByOwner =>
|
||||
// {
|
||||
// _logger.DetailConditional($"companyPropertiesByOwner count: {companyPropertiesByOwner?.Count.ToString() ?? "NULL"}");
|
||||
// }).Forget();
|
||||
|
||||
|
||||
await base.OnInitializedAsync();
|
||||
}
|
||||
|
||||
void ColumnChooserButton_Click()
|
||||
|
|
|
|||
Loading…
Reference in New Issue