Ejemplo n.º 1
0
        private void BookRoomButton_Click(object sender, EventArgs e)
        {
            if (RoomBox.SelectedValue == null)
            {
                return;
            }
            RoomBox.ValueMember = "RoomID";
            var Customer = new SearchCustomer();

            var B   = new Booking();
            var Add = new AdjustData();

            B.RoomID = int.Parse(RoomBox.SelectedValue.ToString());
            var Objekt = Customer.FindACustomer(_ID);

            B.CustomerID = int.Parse(Objekt.CustomerID.ToString());
            B.DateStart  = DateTime1.Value;
            B.DateEnd    = DateTime2.Value;
            B.Guests     = int.Parse(GuestsBox.SelectedValue.ToString());

            Add.BookARoom(B);
            Add.CreateInvoice(B);

            this.Close();
        }
Ejemplo n.º 2
0
        private void ChangeBooking_Load(object sender, EventArgs e)
        {
            var Data     = new GetData();
            var Customer = new SearchCustomer();
            var Name     = Customer.FindACustomer(Customer_ID);

            ExtraBedBox.Checked = false;
            NameLabel.Text      = Name.FullName.ToString();


            var BookingInfo = Data.GetBooking(_ID);
            var RoomInfo    = Data.GetRoom(int.Parse(BookingInfo.RoomID.ToString()));

            RoomNumber.Text += int.Parse(RoomInfo.RoomID.ToString());

            if (RoomInfo.RoomType == "1")
            {
                RoomType.Text += "Single";
            }
            else if (RoomInfo.RoomType == "2")
            {
                RoomType.Text += "Double";
            }

            List <BookRoom.Beds> BedList = new List <BookRoom.Beds>();

            if (RoomInfo.RoomType == "2" && BookingInfo.Guests > 2)
            {
                BedList             = Data.GetBeds(RoomInfo.Beds + 1);
                ExtraBedBox.Checked = true;
            }
            else
            {
                BedList = Data.GetBeds(RoomInfo.Beds);
            }


            RoomPrice.Text += RoomInfo.Price;
            RoomSize.Text  += RoomInfo.Size;

            if (RoomInfo.Size < 35)
            {
                ExtraBedBox.Enabled = false;
            }
            else
            {
                ExtraBedBox.Enabled = true;
            }
            BedsCount = RoomInfo.Beds;


            GuestsBox.DisplayMember = "Number";
            GuestsBox.ValueMember   = "Number";
            GuestsBox.DataSource    = BedList;
            GuestsBox.SelectedValue = BookingInfo.Guests;

            dateTimePicker1.Value = BookingInfo.DateStart;
            dateTimePicker2.Value = BookingInfo.DateEnd;
        }
Ejemplo n.º 3
0
        private void ChangeCustomercs_Load(object sender, EventArgs e)
        {
            var      Get = new SearchCustomer();
            Customer C   = Get.FindACustomer(_ID);

            FirstNameBox.Text = C.FirstName;
            LastNameBox.Text  = C.LastName;
            PersionIDBox.Text = C.PersonID.ToString();
        }
Ejemplo n.º 4
0
        private void SearchButton_Click(object sender, EventArgs e)
        {
            var Data         = new SearchCustomer();
            var PaymentCheck = new Payment();

            CustomerBox.DisplayMember = "FullName";
            CustomerBox.ValueMember   = "CustomerID";
            CustomerBox.DataSource    = Data.FindCustomer(CustomerText.Text);
        }
Ejemplo n.º 5
0
        private void BookRoom_Load(object sender, EventArgs e)
        {
            RoomTypeOG  = RoomType.Text;
            RoomPriceOG = RoomPrice.Text;
            RoomSizeOG  = RoomSize.Text;

            var Customer = new SearchCustomer();
            var C        = Customer.FindACustomer(_ID);

            NameLabel.Text += C.FullName;
        }
Ejemplo n.º 6
0
        private void CustomerBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            var Data   = new GetData();
            var Search = new SearchCustomer();


            BookingBox.DisplayMember = "BookingID";
            BookingBox.ValueMember   = "BookingID";
            if (CustomerBox.SelectedValue == null)
            {
                CustomerBox.ClearSelected();
            }
            else
            {
                Customer C = Search.FindACustomer(int.Parse(CustomerBox.SelectedValue.ToString()));
                BookingBox.DataSource = Data.GetBookings(C);
            }
        }
Ejemplo n.º 7
0
        private void Button1_Click(object sender, EventArgs e)
        {
            var      Update = new AdjustData();
            var      Search = new SearchCustomer();
            Customer C      = Search.FindACustomer(_ID);

            C.FirstName = FirstNameBox.Text;
            C.LastName  = LastNameBox.Text;
            C.PersonID  = int.Parse(PersionIDBox.Text);

            if (Search.CheckPersonID(C))
            {
                MessageBox.Show("ID Already Exists");
            }
            else
            {
                Update.ChangeCustomer(C);
                this.Close();
            }
        }
Ejemplo n.º 8
0
        private void Button1_Click(object sender, EventArgs e)
        {
            var Customer = new Customer();
            var Search   = new SearchCustomer();

            Customer.FirstName = FirstNameBox.Text;
            Customer.LastName  = LastNameBox.Text;
            Customer.PersonID  = int.Parse(PersionIDBox.Text);

            if (Search.CheckPersonID(Customer))
            {
                MessageBox.Show("ID Already Exists");
            }
            else
            {
                var Data = new AdjustData();
                Data.AddCustomer(Customer);

                this.Close();
            }
        }
Ejemplo n.º 9
0
        private void DeleteCustomerButton_Click(object sender, EventArgs e)
        {
            if (CustomerBox.SelectedValue == null)
            {
                return;
            }
            var      Delete = new AdjustData();
            var      Get    = new GetData();
            var      Search = new SearchCustomer();
            Customer C      = Search.FindACustomer(int.Parse(CustomerBox.SelectedValue.ToString()));
            var      List   = Get.GetBookings(C);

            if (List.Count > 0)
            {
                MessageBox.Show("Cannot Delete: Active Booking");
            }
            else
            {
                CustomerBox.ClearSelected();
                CustomerBox.DataSource = null;
                Delete.DeleteCustomer(C);
            }
        }