public ExportWindow(String objectId, Consts.ObjectEnum objectType, DataRow[] rows)
 {
     InitializeComponent();
     _objectId   = objectId;
     _objectType = objectType;
     _rows       = rows;
     DataContext = this;
 }
Example #2
0
        //*******************************************************************
        /// <summary>カレンダー稼働日の表示</summary>
        //*******************************************************************

        private void ShowCalendarDetail(Consts.ObjectEnum objectType)
        {
            if (Consts.ObjectEnum.CALENDAR == objectType)
            {
                // added by YAMA 2014/10/20    マネージャ内部時刻同期
                //int year = DateTime.Now.Year;
                int year = (DBUtil.GetSysTime()).Year;
                container.SetYearCalendarDetail(year.ToString());
            }
            else if (Consts.ObjectEnum.FILTER == objectType)
            {
                container.SetFilterCalendarDetail();
            }
        }
Example #3
0
        /// <summary>オブジェクトを選択</summary>
        /// <param name="sender">源</param>
        /// <param name="e">イベント</param>
        private void Item_Selected(object sender, RoutedEventArgs e)
        {
            TreeViewItem item = (TreeViewItem)sender;

            _objectId = ((TreeViewItem)sender).Header.ToString();

            _objectType = Consts.ObjectEnum.CALENDAR;
            if (item.Tag != null)
            {
                _objectType = (Consts.ObjectEnum)item.Tag;
            }
            else
            {
                return;
            }

            // 各テーブルのデータをコピー追加
            FillTables(_objectType, _objectId);
            // 情報エリアの表示
            SetInfoArea(_objectType);
            // カレンダー稼働日の表示
            ShowCalendarDetail(_objectType);
            btnRegist.IsEnabled = true;

            container.rbStartTime.IsEnabled  = true;
            container.rbCycleStart.IsEnabled = true;
            if (container.rbStartTime.IsChecked == true)
            {
                container.textBox_StartTime.IsEnabled       = true;
                container.textBox_CyclePeriodFrom.IsEnabled = false;
                container.textBox_CyclePeriodTo.IsEnabled   = false;
                container.textBox_CycleInterval.IsEnabled   = false;
            }
            else
            {
                container.textBox_StartTime.IsEnabled       = false;
                container.textBox_CyclePeriodFrom.IsEnabled = true;
                container.textBox_CyclePeriodTo.IsEnabled   = true;
                container.textBox_CycleInterval.IsEnabled   = true;
            }

            container.btnLeft.IsEnabled  = true;
            container.btnRight.IsEnabled = true;
            e.Handled = true;
        }
Example #4
0
        //*******************************************************************
        /// <summary>情報エリアをセット(編集、コピー新規用)</summary>
        //*******************************************************************
        private void SetInfoArea(Consts.ObjectEnum objectType)
        {
            DataRow row;

            if (Consts.ObjectEnum.CALENDAR == objectType)
            {
                row = container.CalendarControlTable.Select()[0];
                lblObjectId.Text   = Convert.ToString(row["calendar_id"]);
                lblObjectName.Text = Convert.ToString(row["calendar_name"]);
            }
            else if (Consts.ObjectEnum.FILTER == objectType)
            {
                row = container.FilterControlTable.Select()[0];
                lblObjectId.Text   = Convert.ToString(row["filter_id"]);
                lblObjectName.Text = Convert.ToString(row["filter_name"]);
            }
            else
            {
                return;
            }

            // 公開チェックボックス
            int openFlg = Convert.ToInt16(row["public_flag"]);

            if (openFlg == 0)
            {
                lblOpen.Text = "";
            }
            else if (openFlg == 1)
            {
                lblOpen.Text = "○";
            }

            // 説明
            lblComment.Text = Convert.ToString(row["memo"]);

            //更新日
            lblUpdDate.Text = (ConvertUtil.ConverIntYYYYMMDDHHMISS2Date(Convert.ToInt64(row["update_date"]))).ToString("yyyy/MM/dd HH:mm:ss");
            //ユーザー名
            lblUserName.Text = Convert.ToString(row["user_name"]);
        }
Example #5
0
        //*******************************************************************
        /// <summary> カレンダーデータの検索(編集、コピー新規用)</summary>
        /// <param name="objectId">`カレンダーID</param>
        /// <param name="updDate">`更新日</param>
        //*******************************************************************
        private void FillTables(Consts.ObjectEnum objectType, string objectId)
        {
            switch (objectType)
            {
            case Consts.ObjectEnum.CALENDAR:
                // カレンダー管理テーブル
                container.CalendarControlTable = _calendarControlDAO.GetValidORMaxUpdateDateEntityById(objectId);

                if (container.CalendarControlTable.Rows.Count > 0)
                {
                    // カレンダー稼働日テーブル
                    container.CalendarDetailTable = _calendarDetailDAO.GetEntityByCalendar(
                        container.CalendarControlTable.Rows[0]["calendar_id"],
                        container.CalendarControlTable.Rows[0]["update_date"]);
                }

                break;

            case Consts.ObjectEnum.FILTER:
                // フィルター管理テーブル
                container.FilterControlTable = _filterControlDAO.GetValidORMaxUpdateDateEntityById(objectId);

                // カレンダー管理テーブル
                container.CalendarControlTable = _calendarControlDAO.GetValidORMaxUpdateDateEntityById(
                    container.FilterControlTable.Rows[0]["base_calendar_id"]);

                if (container.CalendarControlTable.Rows.Count > 0)
                {
                    // カレンダー稼働日テーブル
                    container.CalendarDetailTable = _calendarDetailDAO.GetEntityByCalendar(
                        container.CalendarControlTable.Rows[0]["calendar_id"],
                        container.CalendarControlTable.Rows[0]["update_date"]);
                }

                break;
            }
        }