private void btnSiparisKaydet_Click(object sender, EventArgs e) { if (layoutView1.RowCount == 0) { btnGarsonSecim.Visible = false; btnMusteri.Visible = false; navigationMain.SelectedPage = pageMasa; btnMusteri.Clear(); return; } if (btnGarsonSecim.GarsonId == Guid.Empty) { MessageBox.Show("Lütfen Bir Garson Seçiniz"); return; } btnGarsonSecim.Visible = false; btnMusteri.Visible = false; secilenAdisyon.GarsonId = btnGarsonSecim.GarsonId; if (btnMusteri.MusteriId != Guid.Empty) { secilenAdisyon.MusteriId = btnMusteri.MusteriId; } btnGarsonSecim.Clear(); btnMusteri.Clear(); secilenAdisyon.Tutar = txtUrunhareketOdenecekTutar.Value; btnGarsonSecim.Visible = false; btnMusteri.Visible = false; worker.AdisyonService.AddOrUpdate(secilenAdisyon); ControlMasaButton button = (ControlMasaButton)flowMasalar.Controls.Find(secilenMasa.Id.ToString(), true)[0]; if (secilenAdisyon.AdisyonDurum != AdisyonDurum.Iptal) { if (txtKalanTutar.Value <= 0) { button.MasaDurum = MasaDurum.Bos; secilenAdisyon.AdisyonDurum = AdisyonDurum.Kapali; btnSiparisKaydet.Text = "Değişiklikleri\nKaydet"; btnSiparisKaydet.ImageOptions.ImageIndex = 0; } else { button.MasaDurum = MasaDurum.Dolu; secilenAdisyon.AdisyonDurum = AdisyonDurum.Acik; } } else { button.MasaDurum = MasaDurum.Bos; } worker.Commit(); worker = new RestaurantWorker(); gridControl1.DataSource = worker.UrunHareketService.BindingList(); gridControlOdeme.DataSource = worker.OdemeHareketService.BindingList(); lblMesaj.Visible = false; navigationMain.SelectedPage = pageMasa; }
public static RestaurantWorkerForm MapToForm(RestaurantWorker worker) { return(new RestaurantWorkerForm { RestaurantWorkerId = worker.Id, Position = worker.Position, Firstname = worker.Firstname, Lastname = worker.Lastname, Nick = worker.Nick, RestaurantId = worker.Restaurant?.Id, RestaurantName = worker.Restaurant != null ? worker.Restaurant.Name : String.Empty, Active = worker.Active, AppUserId = worker.AppUser.UserId }); }
private void ShowTable() { List <Restaurant> ItemList = new RestaurantWorker().GetDemoRestaurants(new IOSWorker()); //collect shop data // UITableViewSource var tableSource = new UserTableSource(ItemList); tableUser.Source = tableSource; // Table內的點擊事件,預先宣告接收到事件後要做的事 tableSource.UserSelected += delegate(object sender, UserSelectedEventArgs e) { //Console.WriteLine(e.SelectedUser.Name); this.SelectedItem = e.SelectedItem; InvokeOnMainThread(() => { PerformSegue("moveToDetailViewSegue", this); }); }; tableUser.ReloadData(); //預計在main thread呼叫 }