Thank you page was initializing before server response.
Thanks alot
ngOnInit(): void {
const saleInvoiceId = this.route.snapshot.params.id;
if (!saleInvoiceId) {
this.getCreate();
} else {
this._saleInvoicesServiceProxy.getSaleInvoiceForEdit(saleInvoiceId).subscribe(result => {
this.saleInvoice = result.saleInvoice;
if (this.saleInvoice.dueDate) {
this.dueDate = this.saleInvoice.dueDate.toDate();
}
if (this.saleInvoice.approvedDate) {
this.approvedDate = this.saleInvoice.approvedDate.toDate();
}
});
}
}
this is the code . and one thing more is I'm getting this error only when I open form for edit.
Please reply @maliming
yes
_timeCardDetailCustomRepository variable an ITimeCardDetailRepository interface
` public interface ITimeCardDetailRepository : IRepository
decimal CalculateDaysremoval(DateTime startDate, DateTime endDate, int employeeCode);
}
**Above is the Interface and blew is the implimentation **
public class TimeCardDetailRepository : ApplicationRepositoryBase
public TimeCardDetailRepository(IDbContextProvider<ApplicationlDbContext> dbContextProvider)
: base(dbContextProvider)
{
}
public decimal CalculateDaysremoval(DateTime startDate,DateTime endDate,int employeeCode)
{
string sql = "SELECT ISNULL(SUM(CASE WHEN mark = 1 and TotalHours >= 4 THEN 0.5 WHEN mark = 1 and TotalHours < 4 THEN 1 end),0)as removalDays FROM dbo.tabel WHERE EID = @employeeId";
decimal result = 0;
using (var con=GetDbContext().Database.GetDbConnection())
{
using (var command = con.CreateCommand())
{
command.CommandText = sql;
command.Parameters.Add(new SqlParameter("@employeeId", employeeCode));
command.Parameters.Add(new SqlParameter("@fromDate", startDate));
command.Parameters.Add(new SqlParameter("@toDate", endDate));
using (var dr = command.ExecuteReader())
{
if (dr.Read())
{
result = Convert.ToDecimal(dr["removalDays"]);
}
}
}
}
return result;
}
}
}
public class PayrollManager : ApplicationServiceBase, IDomainService
{
public SalarySheet CreateSalary(int employeeCode,int periodId, int month, int year)
{
SalaryPeriod salaryPeriod = _salaryPeriodRepository.FirstOrDefault(x => x.Id == periodId);
int startDay = salaryPeriod.FromDate.Day;
int endDay = salaryPeriod.ToDate.Day;
decimal daysRemoval = _timeCardDetailCustomRepository.CalculateDaysremoval(startDate, endDate, employeeCode);
}
}
//Custom Repository
public class TimeCardDetailRepository : ApplicationRepositoryBase<TimeCardDetail>,ITimeCardDetailRepository
{
IConfigurationRoot configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder(), addUserSecrets: true);
public TimeCardDetailRepository(IDbContextProvider<ApplicationContext> dbContextProvider)
: base(dbContextProvider)
{
}
public decimal CalculateDaysremoval(DateTime startDate,DateTime endDate,int employeeCode)
{
string sql = "SELECT ISNULL(SUM(CASE WHEN mark = 1 and TotalHours >= 4 THEN 0.5 WHEN mark = 1 and TotalHours < 4 THEN 1 end),0)as removalDays FROM dbo.tabel WHERE EID = @employeeId";
decimal result = 0;
using (var con=GetDbContext().Database.GetDbConnection())
{
using (var command = con.CreateCommand())
{
command.CommandText = sql;
command.Parameters.Add(new SqlParameter("@employeeId", employeeCode));
using (var dr = command.ExecuteReader())
{
if (dr.Read())
{
result = Convert.ToDecimal(dr["removalDays"]);
}
}
}
}
return result;
}
}
It throws this exception.
My Question is that how can we Pass the transection from Domain Service to Custom repository Method ? In Cutome repository method we want to use Pure Ado.net because we have a alot of views from getting data and we can not map every view to EF Core keyless Entity type.
As Domain Services already Implemnet UnitOfWork by default in ABP and we jsut want to pass the transection used by UnitOfWork in Cutom repo methods or any work around to implement this behaviour?
Thanks.Issue solved.
work around
I've solved issue by changing .min.css to .css in dynamicresourceHelper.ts of these files.
It worked & That's great.Thanks alot dear .