コード例 #1
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            int currentMonth = DateTime.Now.Month;

            int[] monthArray = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 };
            cbMonth.ItemsSource  = monthArray;
            cbMonth.SelectedItem = currentMonth;
            int currentYear = DateTime.Now.Year;

            int[] yearArray = { currentYear - 1, currentYear, currentYear + 1 };
            cbYear.ItemsSource  = yearArray;
            cbYear.SelectedItem = currentYear;

            lineList            = LineController.Select();
            cbLine.ItemsSource  = lineList.Where(w => w.SectionId == "F").Select(s => s.LineId).ToList();
            cbLine.SelectedItem = lineList.Where(w => w.SectionId == "F").Select(s => s.LineId).FirstOrDefault();

            string lineId = "";

            lineId = cbLine.SelectedValue as string;

            int _month = 0, _year = 0;

            Int32.TryParse(cbMonth.SelectedValue.ToString(), out _month);
            Int32.TryParse(cbYear.SelectedValue.ToString(), out _year);
            requestList            = CieControlIncentiveController.Select(lineId, _month, _year);
            dgvRequest.ItemsSource = requestList;
        }
コード例 #2
0
        private void btnSearch_Click(object sender, RoutedEventArgs e)
        {
            dgvRequest.ItemsSource = null;
            string lineId = "";

            lineId = cbLine.SelectedValue as string;
            int _month = 0, _year = 0;

            Int32.TryParse(cbMonth.SelectedValue.ToString(), out _month);
            Int32.TryParse(cbYear.SelectedValue.ToString(), out _year);
            requestList            = CieControlIncentiveController.Select(lineId, _month, _year);
            dgvRequest.ItemsSource = requestList;
        }