public async Task <object> GetMasjidSalaahTimesById(string id) { try { Masjid masjid = await _taqweemService.MasjidGetByIdIncludedAsync(id); SalaahTime times = _taqweemService.GetSalaahTime(masjid, DateTime.Now); if (times != null) { SalaahTimeDTO returnObject = new SalaahTimeDTO { MasjidId = times.MasjidId, Type = times.Type, IsATimeChange = times.IsATimeChange, TimeDate = times.TimeDate, DayNumber = times.DayNumber, FajrAdhaan = times.FajrAdhaan, FajrSalaah = times.FajrSalaah, DhuhrAdhaan = times.DhuhrAdhaan, DhuhrSalaah = times.DhuhrSalaah, JumuahAdhaan = times.JumuahAdhaan, JumuahSalaah = times.JumuahSalaah, SpecialDhuhrAdhaan = times.SpecialDhuhrAdhaan, SpecialDhuhrSalaah = times.SpecialDhuhrSalaah, AsrAdhaan = times.AsrAdhaan, AsrSalaah = times.AsrSalaah, IshaAdhaan = times.IshaAdhaan, IshaSalaah = times.IshaSalaah, }; return(returnObject); } return(null); } catch (Exception ex) { return(null); } }
public IActionResult MasjidInfo(string Id) { Masjid Info = _taqweemService.MasjidGetByIdIncluded(Id); MasjidInfoViewModel Model = new MasjidInfoViewModel(Info); Model.Markers.Marker = _taqweemService.MasjidGetAll().ToList(); Model.Users = _taqweemService.UsersGetByMasjidId(Id); Model.Notices = _taqweemService.NoticesGetByMasjidIdUnhidden(Id); //Get current salaah time for the masjid Model.SalaahTime = _taqweemService.GetSalaahTime(Info, DateTime.Now); //Get next salaah time change for the masjid Model.NextSalaahTime = _taqweemService.NextSalaahTime(Info, DateTime.Now); if (Model.NextSalaahTime != null) { DateTime val = new DateTime(DateTime.Now.Year, 1, 1); val = val.AddDays(Model.NextSalaahTime.DayNumber - 1); if (Model.NextSalaahTime.DayNumber < DateTime.Now.DayOfYear) { val = new DateTime(DateTime.Now.Year + 1, 1, 1); val = val.AddDays(Model.NextSalaahTime.DayNumber - 1); } Model.NextPerpetualTime = new cPerpetualTime(val, Info, false); Model.NextSalaahTime.IsFajrTimeChange = IsTimeDifferent( Model.SalaahTime.FajrAdhaan, Model.SalaahTime.FajrSalaah, Model.NextSalaahTime.FajrAdhaan, Model.NextSalaahTime.FajrSalaah); Model.NextSalaahTime.IsDhuhrTimeChange = IsTimeDifferent( Model.SalaahTime.DhuhrAdhaan, Model.SalaahTime.DhuhrSalaah, Model.NextSalaahTime.DhuhrAdhaan, Model.NextSalaahTime.DhuhrSalaah); Model.NextSalaahTime.IsSpecialDhuhrTimeChange = IsTimeDifferent( Model.SalaahTime.SpecialDhuhrAdhaan, Model.SalaahTime.SpecialDhuhrSalaah, Model.NextSalaahTime.SpecialDhuhrAdhaan, Model.NextSalaahTime.SpecialDhuhrSalaah); Model.NextSalaahTime.IsJumuahTimeChange = IsTimeDifferent( Model.SalaahTime.JumuahAdhaan, Model.SalaahTime.JumuahSalaah, Model.NextSalaahTime.JumuahAdhaan, Model.NextSalaahTime.JumuahSalaah); Model.NextSalaahTime.IsAsrTimeChange = IsTimeDifferent( Model.SalaahTime.AsrAdhaan, Model.SalaahTime.AsrSalaah, Model.NextSalaahTime.AsrAdhaan, Model.NextSalaahTime.AsrSalaah); Model.NextSalaahTime.IsIshaTimeChange = IsTimeDifferent( Model.SalaahTime.IshaAdhaan, Model.SalaahTime.IshaSalaah, Model.NextSalaahTime.IshaAdhaan, Model.NextSalaahTime.IshaSalaah); } return(View(Model)); }