//******************************************************************* /// <summary>検索項目の初期セット</summary> //******************************************************************* private void InitSearchData() { // added by YAMA 2014/10/20 マネージャ内部時刻同期 //DateTime now = System.DateTime.Now; DateTime now = DBUtil.GetSysTime(); tbxFromYear.Text = now.Year.ToString(); tbxToYear.Text = now.Year.ToString(); // 情報種別 Dictionary <string, string> dicMonth = new Dictionary <string, string>(); dicMonth.Add("", ""); for (int i = 1; i <= 12; i++) { dicMonth.Add(i.ToString(), i.ToString()); } combFromMonth.Items.Clear(); combFromMonth.ItemsSource = dicMonth; combFromMonth.DisplayMemberPath = "Value"; combFromMonth.SelectedValuePath = "Key"; combFromMonth.SelectedValue = now.Month.ToString(); combToMonth.Items.Clear(); combToMonth.ItemsSource = dicMonth; combToMonth.DisplayMemberPath = "Value"; combToMonth.SelectedValuePath = "Key"; combToMonth.SelectedValue = now.Month.ToString(); Dictionary <string, string> dicDay = new Dictionary <string, string>(); dicDay.Add("", ""); for (int i = 1; i <= 31; i++) { dicDay.Add(i.ToString(), i.ToString()); } combFromDay.Items.Clear(); combFromDay.ItemsSource = dicDay; combFromDay.DisplayMemberPath = "Value"; combFromDay.SelectedValuePath = "Key"; combFromDay.SelectedValue = now.Day.ToString(); combToDay.Items.Clear(); combToDay.ItemsSource = dicDay; combToDay.DisplayMemberPath = "Value"; combToDay.SelectedValuePath = "Key"; combToDay.SelectedValue = now.Day.ToString(); Dictionary <string, string> dicHour = new Dictionary <string, string>(); dicHour.Add("", ""); for (int i = 0; i <= 23; i++) { dicHour.Add(GetStringFromInt(i), GetStringFromInt(i)); } combFromHour.Items.Clear(); combFromHour.ItemsSource = dicHour; combFromHour.DisplayMemberPath = "Value"; combFromHour.SelectedValuePath = "Key"; combFromHour.SelectedValue = "00"; combToHour.Items.Clear(); combToHour.ItemsSource = dicHour; combToHour.DisplayMemberPath = "Value"; combToHour.SelectedValuePath = "Key"; combToHour.SelectedValue = "23"; Dictionary <string, string> dicMin = new Dictionary <string, string>(); dicMin.Add("", ""); for (int i = 0; i <= 59; i++) { dicMin.Add(GetStringFromInt(i), GetStringFromInt(i)); } combFromMin.Items.Clear(); combFromMin.ItemsSource = dicMin; combFromMin.DisplayMemberPath = "Value"; combFromMin.SelectedValuePath = "Key"; combFromMin.SelectedValue = "00"; combToMin.Items.Clear(); combToMin.ItemsSource = dicMin; combToMin.DisplayMemberPath = "Value"; combToMin.SelectedValuePath = "Key"; combToMin.SelectedValue = "59"; Dictionary <string, string> dicUser = new Dictionary <string, string>(); //ユーザー検索 _db.CreateSqlConnect(); DataTable dt = userDAO.GetAllEntity(); dicUser.Add("", ""); foreach (DataRow row in dt.Rows) { dicUser.Add(row["alias"].ToString(), row["alias"].ToString()); } combUserName.Items.Clear(); combUserName.ItemsSource = dicUser; combUserName.DisplayMemberPath = "Value"; combUserName.SelectedValuePath = "Key"; combUserName.SelectedIndex = 0; viewDt = runLogDAO.GetEmptyTable(); _db.CloseSqlConnect(); }