Beispiel #1
0
        private void Order_Click(object sender, EventArgs e)
        {
            var ctx = new ChungCateringDatabase2Entities();

            if (iscustomer == false)
            {
                Userloginshow();
            }
            else
            {
                OrderForm order = new OrderForm();
                order.MdiParent = this;
                order.Show();
            }
        }
        private void ReservationReports_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'chungCateringDatabase2DataSet.ReservationUser' table. You can move, or remove it, as needed.
            this.reservationUserTableAdapter.Fill(this.chungCateringDatabase2DataSet.ReservationUser);
            // TODO: This line of code loads data into the 'chungCateringDatabase2DataSet.ReservationStatus' table. You can move, or remove it, as needed.
            this.reservationStatusTableAdapter.Fill(this.chungCateringDatabase2DataSet.ReservationStatus);
            // TODO: This line of code loads data into the 'chungCateringDatabase2DataSet.ReservationDescription' table. You can move, or remove it, as needed.
            this.reservationDescriptionTableAdapter.Fill(this.chungCateringDatabase2DataSet.ReservationDescription);
            // TODO: This line of code loads data into the 'chungCateringDatabase2DataSet1.ReservationStatus' table. You can move, or remove it, as needed.
            //this.reservationStatusTableAdapter.Fill(this.chungCateringDatabase2DataSet1.ReservationStatus);
            // TODO: This line of code loads data into the 'chungCateringDatabase2DataSet.ReservationDescription' table. You can move, or remove it, as needed.
            //this.reservationDescriptionTableAdapter.Fill(this.chungCateringDatabase2DataSet.ReservationDescription);

            /*
             * // TODO: This line of code loads data into the 'chungCateringDatabase2DataSet2.ReservationStatus' table. You can move, or remove it, as needed.
             * this.reservationStatusTableAdapter.Fill(this.chungCateringDatabase2DataSet2.ReservationStatus);
             * // TODO: This line of code loads data into the 'chungCateringDatabase2DataSet1.ReservationDescription' table. You can move, or remove it, as needed.
             * this.reservationDescriptionTableAdapter.Fill(this.chungCateringDatabase2DataSet1.ReservationDescription);
             * // TODO: This line of code loads data into the 'chungCateringDatabase2DataSet.ReservationDescription' table. You can move, or remove it, as needed.
             * this.reservationDescriptionTableAdapter.Fill(this.chungCateringDatabase2DataSet.ReservationDescription);
             * // TODO: This line of code loads data into the 'chungsDatabaseDataSet.SeatStatus' table. You can move, or remove it, as needed.
             * this.seatStatusTableAdapter.Fill(this.chungsDatabaseDataSet.SeatStatus);
             * // TODO: This line of code loads data into the 'chungsDatabaseDataSet.ReservationStatus' table. You can move, or remove it, as needed.
             * this.reservationStatusTableAdapter.Fill(this.chungsDatabaseDataSet.ReservationStatus);
             * // TODO: This line of code loads data into the 'chungsDatabaseDataSet.ReservationDescription' table. You can move, or remove it, as needed.
             * this.reservationDescriptionTableAdapter.Fill(this.chungsDatabaseDataSet.ReservationDescription);
             */
            try
            {
                rawdata = new ChungCateringDatabase2Entities();

                //Populate the Gender Dropdown
                //Get The Reservation Status from the database
                var restate   = rawdata.ReservationStatus.ToList();
                var redescrip = rawdata.ReservationDescriptions.ToList();
                //var seat = rawdata.SeatStatus.ToList();
                //Set the datasource of the combobox to the records
                //being retrieved from the database
                cbResStatus.DataSource      = restate;
                cbResDescription.DataSource = redescrip;

                //cbSeatStatus.DataSource = seat;



                //Set the data member and value member to the values
                //that correspond with the columns coming back from
                //our data source.
                cbResStatus.DisplayMember = "name";
                cbResStatus.ValueMember   = "id";

                cbResDescription.DisplayMember = "name";
                cbResDescription.ValueMember   = "id";

                cbSeatStatus.DisplayMember = "name";
                cbSeatStatus.ValueMember   = "id";



                //Populate The Grid View
                RefreshGridView();

                gvUsers.Columns["FirstName"].HeaderText              = "First Name";
                gvUsers.Columns["LastName"].HeaderText               = "Last Name";
                gvUsers.Columns["Email"].HeaderText                  = "Email Address";
                gvUsers.Columns["CustomersAddress"].HeaderText       = "Customer Address";
                gvUsers.Columns["ReservationDescription"].HeaderText = "Reservation Description";
                gvUsers.Columns["ReservationCreateDate"].HeaderText  = "Reservation Date";
                gvUsers.Columns["ReservationStatus"].HeaderText      = "Reservation Status";
                gvUsers.Columns["Telephone"].HeaderText              = "Telephone";
                gvUsers.Columns["SeatStatus"].HeaderText             = "Seat Status";


                //Hide columns that you do not want to display for users
                gvUsers.Columns[0].Visible = false;

                //Set the first row as selected by default
                gvUsers.Rows[0].Selected = true;
            }
            catch (Exception ex)

            {
                //throw ex;
            }
        }