private void btnAddComment_Click(object sender, EventArgs e) { string commentContent = Interaction.InputBox("Yorum Girişi", "Lütfen Yorum Yapınız.", "", (Screen.PrimaryScreen.Bounds.Width / 2) - 175, (Screen.PrimaryScreen.Bounds.Height / 2) - 100); currentHotel = Singleton.Instance().hotels.PrintTree().Where(x => x.Id == Convert.ToInt32(dgwHotels.SelectedRows[0].Cells[0].Value)).ToList()[0]; currentHotel.Comments.Add(new Comment() { Content = commentContent, Customer = activeCustomer }); }
private void dgwHotels_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (dgwHotels.SelectedRows.Count > 0) { string Comments = ""; foreach (var item in Singleton.Instance().hotels.PrintTree().Where(x => x.Id == Convert.ToInt32(dgwHotels.SelectedRows[0].Cells[0].Value)).ToList()[0].Comments) { Comments += item.ToString() + "\n-------\n"; } MessageBox.Show(Comments); } }
public static Manager Login(string Username, string Password) { Manager manager = new Manager(); List <Manager> managers = new List <Manager>(); managers = Singleton.Instance().managers; if (Username != string.Empty && Password != string.Empty) { manager = (Manager)managers.Where(x => x.Username == Username && x.Password == Password).ToList()[0]; return(manager); } return(null); }
private void btnListStaffForDeparmant_Click(object sender, EventArgs e) { string department = Interaction.InputBox("Departman Bilgisi", "Departman İsmi Giriniz", "Örn:Mutfak", (Screen.PrimaryScreen.Bounds.Width / 2) - 175, (Screen.PrimaryScreen.Bounds.Height / 2) - 100); List <Staff> filterStaff = Singleton.Instance().hotels.PrintTree().Where(x => x.Id == selectedHotel.Id).ToList()[0].Staff.Where(x => x.Department == department).ToList(); if (filterStaff.Count != 0) { dgwStaff.DataSource = filterStaff; } else { MessageBox.Show("Bu Departmanda Çalışan Yoktur"); } }
private void ManagerPanel_Load(object sender, EventArgs e) { Singleton.Instance().hotels.InOrder(); dgwHotels.DataSource = Singleton.Instance().hotels.PrintTree(); #region Görüntü Ayarları dgwHotels.Columns[4].Visible = false; dgwHotels.Columns[7].Visible = false; dgwHotels.Columns[8].Visible = false; dgwHotels.Columns[9].ReadOnly = true; dgwHotels.Columns[0].Visible = false; dgwHotels.AllowUserToAddRows = false; dgwStaff.AllowUserToAddRows = false; dgwStaff.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.DisplayedCells; #endregion }
private void dgwHotels_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (dgwHotels.SelectedRows.Count > 0) { selectedHotel = Singleton.Instance().hotels.nodes[dgwHotels.CurrentCell.RowIndex]; #region Görüntü gbStaff.Text = selectedHotel.Name + " Otelinin Personelleri"; #endregion dgwStaff.DataSource = selectedHotel.Staff; dgwStaff.Columns[5].ReadOnly = true; gbHotels.Visible = false; gbStaff.Visible = true; } else { MessageBox.Show("Lütfen bir otel seçiniz."); } }
private void btnAddPersonel_Click(object sender, EventArgs e) { Staff newStaff = new Staff() { Contact = new ContactInformation() { Address = txtAddress.Text, EMail = txtEmail.Text, PhoneNumber = txtPhoneNumber.Text }, Department = txtDepartment.Text, FullName = txtName.Text + " " + txtSurname.Text, Position = txtPosition.Text, Rate = 0, TRId = txtTRId.Text }; Singleton.Instance().hotels.nodes.Where(x => x.Id == id).ToList()[0].Staff.Add(newStaff); this.Close(); }
private void btnHotelSave_Click(object sender, EventArgs e) { Hotel h = new Hotel() { Name = txtHotelName.Text, City = txtCity.Text, Town = txtTown.Text, Contact = new ContactInformation() { Address = txtAddress.Text, PhoneNumber = txtPhoneNumber.Text, EMail = txtEmail.Text }, Stars = int.Parse(txtStar.Text), NumRooms = int.Parse(txtNumRoom.Text) }; Singleton.Instance().hotels.Add(h); Singleton.Instance().hotels.InOrder(); dgwdgwHotels.DataSource = Singleton.Instance().hotels.PrintTree(); this.Close(); }
public Login() { InitializeComponent(); Singleton.Instance().Initialize(); WindowManager.OpenForm(this); }
private void btnTreeInformation_Click(object sender, EventArgs e) { MessageBox.Show("İkili ağaç eleman sayısı : " + Singleton.Instance().hotels.NodeCount().ToString() + "\nİkili ağaç derinliği : " + Singleton.Instance().hotels.getMaxDepth().ToString()); }
private void btnInOrder_Click(object sender, EventArgs e) { Singleton.Instance().hotels.InOrder(); dgwHotels.DataSource = Singleton.Instance().hotels.PrintTree(); }
private void btnStaffSortDescRate_Click(object sender, EventArgs e) { selectedHotel = Singleton.Instance().hotels.nodes[dgwHotels.CurrentCell.RowIndex]; dgwStaff.DataSource = selectedHotel.Staff.OrderByDescending(x => x.Rate).ToList(); }