public TableOperationsViewModel(MasaRepository tableRepo, MasaTipiRepository tableTypeRepo) { TableRepo = tableRepo; TableTypeRepo = tableTypeRepo; UpdateTableList(); UpdateTableTypeList(); SelectedTable = new Masa() { AcikKapali = false }; TableType = new MasaTipi(); AddTableCommand = new CustomCommand(AddTable, CanAddTable); RemoveTableCommand = new CustomCommand(RemoveTable, CanRemoveTable); UpdateTableCommand = new CustomCommand(UpdateTable, CanUpdateTable); AddTableTypeCommand = new CustomCommand(AddTableType, CanAddTableType); }
private void masaOlustur(Data.Masa masaGelen, Rezervasyon rezervasyon) { string arkaPlanRengi, yaziRengi, ikon, yazi; switch (masaGelen.masaDurumu) { case "Bos": { masaTipi = MasaTipi.Bos; arkaPlanRengi = "cyan lighten-3"; yaziRengi = "white-text"; yazi = "Boş"; ikon = "fas fa-calendar-check"; break; } case "Dolu": { masaTipi = MasaTipi.Dolu; arkaPlanRengi = "pink lighten-3"; yaziRengi = "white-text"; yazi = "Dolu"; ikon = "fas fa-calendar-times"; break; } case "Secildi": { masaTipi = MasaTipi.Secildi; arkaPlanRengi = "deep-purple lighten-3"; yaziRengi = "white-text"; yazi = "Seçildi"; ikon = "fas fa-mouse-pointer"; break; } case "Kapali": { masaTipi = MasaTipi.Kapali; arkaPlanRengi = "light-green darken-1"; yaziRengi = "white-text"; yazi = "Kapalı"; ikon = "fas fa-shield-virus"; break; } default: return; } masaID = masaGelen.masaID; masaAdi = masaGelen.masaAdi; masaButton.ID = masaID.ToString(); masaButton.CssClass = "col-md-4 col-sm-6 col-lg-3 mb-3"; kucukMasa = "<div class=' mb-2 text-center card " + arkaPlanRengi + " " + yaziRengi + "'>" + masaAdi + "</div>"; masaButton.Text = "<div class='card " + arkaPlanRengi + " " + yaziRengi + "'>" + "<div class='card-body d-flex justify-content-between align-items-center'>" + "<div>" + "<p class='h2-responsive font-weight-bold mt-n2 mb-0'>" + masaAdi + "</p>" + "<p class='mb-0'>" + (masaTipi == MasaTipi.Dolu ? rezervasyon.ad + " " + rezervasyon.soyAd : yazi) + "</p>" + "</div>" + "<div>" + "<i class='" + ikon + " fa-4x text-black-40'></i>" + "</div>" + "</div>" + (masaTipi == MasaTipi.Dolu? "<i class='text-center'>" + (rezervasyon.tarih.AddMinutes(1) - DateTime.UtcNow.AddHours(3)).TotalSeconds.ToString("F0") + " saniye kaldı.</i>":"") + "</div>"; }