Exemplo n.º 1
0
 /// <summary>
 /// 保存
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void SaveButton_Click(object sender, EventArgs e)
 {
     try
     {
         if (!ValidateInputs())
         {
             return;
         }
         //入力値を変更
         //表示名
         this._targetView.DisplayName = this.txtViewTitle.Text;
         //変換対象
         this._targetView.IsTarget = this.rdbConvert.Checked;
         //アイテム数
         this._targetView.RowLimit = (int)this.numLimitRow.Value;
         //既定のビュー
         this._targetView.IsTarget = this.chkDefault.Checked;
         //チェックボックス表示
         this._targetView.ShowChecked = this.chkDefault.Checked;
         using (SqlAccessor sqlAccessor = Accessor.AccessorFactory.GetSqlAccessor())
         {
             sqlAccessor.UpdateMigrateView(this._targetView);
         }
         Log.Write(this.TargetView.TaskId, RSM.GetMessage(RS.Informations.ViewSetted, this.TargetView.Name));
         this.DialogResult = System.Windows.Forms.DialogResult.OK;
         this.Close();
     }
     catch (Exception ex)
     {
         Log.Write(ex);
         RSM.ShowMessage(this, ex);
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// データ保存する
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnSave_Click(object sender, EventArgs e)
 {
     try
     {
         if (!this.ValidateInputs())
         {
             return;
         }
         //入力値を設定する
         this._taskInfo.TaskName         = this.txtTaskName.Text;
         this._taskInfo.DisplayName      = this.txtDisplayName.Text;
         this._taskInfo.ListName         = this.txtListName.Text;
         this._taskInfo.Description      = this.txtDescription.Text;
         this._taskInfo.IsUseDefaultIcon = this.rdoDefaultIcon.Checked;
         string     strType = Convert.ToString(this.cmbSPType.SelectedValue);
         SPListType sptype  = SPListType.GenericList;
         if (Enum.TryParse(strType, true, out sptype))
         {
             this._taskInfo.ListType = sptype;
         }
         using (SqlAccessor sqlAccessor = Accessor.AccessorFactory.GetSqlAccessor())
         {
             sqlAccessor.InsertMigrate(this._taskInfo);
         }
         this.DialogResult = System.Windows.Forms.DialogResult.OK;
         Log.Write(this._taskInfo.TaskId,
                   RSM.GetMessage(RS.Informations.DataBaseSetted, this._taskInfo.TaskName, this._taskInfo.TaskId));
         this.Close();
     }
     catch (Exception ex)
     {
         Log.Write(ex);
         RSM.ShowMessage(this, ex);
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// ロジックタイプ変更
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnSetLogicType_Click(object sender, EventArgs e)
 {
     try
     {
         if (this.treeCondition.Nodes.Count == 0)
         {
             return;
         }
         TreeNode  root    = this.treeCondition.Nodes[0];
         LogicItem logitem = (LogicItem)root.Tag;
         if (this.rdbAnd.Checked)
         {
             logitem.Type = LogicType.And;
         }
         else
         {
             logitem.Type = LogicType.Or;
         }
         root.Text = logitem.TagName;
     }
     catch (Exception ex)
     {
         Log.Write(ex);
         RSM.ShowMessage(this, ex);
     }
 }
Exemplo n.º 4
0
 /// <summary>
 /// DB接続テスト
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnTryAccessDB_Click(object sender, EventArgs e)
 {
     if (this.ValidDatabase())
     {
         RSM.ShowMessage(this, RS.Informations.TryConnectOK);
     }
 }
Exemplo n.º 5
0
 /// <summary>
 /// フィルター条件削除
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnDeleteFilter_Click(object sender, EventArgs e)
 {
     try
     {
         if (this.treeCondition.SelectedNode == null ||
             this.treeCondition.SelectedNode.Tag == null)
         {
             return;
         }
         object selectedItem = this.treeCondition.SelectedNode.Tag;
         if (selectedItem is LogicItem)
         {
             return;
         }
         else if (selectedItem is ConditionItem)
         {
             ConditionItem condiItem = (ConditionItem)selectedItem;
             this._targetView.ViewCondition.Nodes.Remove(condiItem);
         }
         InitConditionTree();
     }
     catch (Exception ex)
     {
         Log.Write(ex);
         RSM.ShowMessage(this, ex);
     }
 }
Exemplo n.º 6
0
 /// <summary>
 /// フィルター条件追加
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnAddFilter_Click(object sender, EventArgs e)
 {
     try
     {
         if (this.cmbFields.SelectedItem == null)
         {
             return;
         }
         if (this.cmbOperator.SelectedItem == null)
         {
             return;
         }
         EnumNameAttribute selectedItem = (EnumNameAttribute)this.cmbOperator.SelectedItem;
         OperatorType      op           = (OperatorType)selectedItem.EnumValue;
         ConditionItem     condiItem    = new ConditionItem(op);
         condiItem.FieldRef = (IFieldRef)this.cmbFields.SelectedItem;
         condiItem.Value    = this.txtValue.Text;
         this._targetView.ViewCondition.Nodes.Add(condiItem);
         InitConditionTree();
     }
     catch (Exception ex)
     {
         Log.Write(ex);
         RSM.ShowMessage(this, ex);
     }
 }
Exemplo n.º 7
0
 /// <summary>
 /// 削除ボタンを押す処理
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void DeleteButton_Click(object sender, EventArgs e)
 {
     if (this.TaskList.SelectedRows == null || this.TaskList.SelectedRows.Count == 0)
     {
         return;
     }
     try
     {
         var seleRow = this.TaskList.SelectedRows[0];
         var item    = seleRow.DataBoundItem as DataRowView;
         if (item == null)
         {
             return;
         }
         string taskId   = item["TASK_ID"] as string;
         string taskName = item["TASK_NAME"] as string;
         using (SqlAccessor accessor = Accessor.AccessorFactory.GetSqlAccessor())
         {
             accessor.DeleteMigrateTask(taskId);
         }
         Log.Write(taskId, RSM.GetMessage(RS.Informations.DatabaseDeleted, taskName, taskId));
         InitNotesSettingList();
     }
     catch (Exception ex)
     {
         Log.Write(ex);
         RSM.ShowMessage(this, ex);
     }
 }
Exemplo n.º 8
0
        /// <summary>
        /// 検索結果を表示する
        /// </summary>
        /// <param name="logType"></param>
        /// <param name="sdate"></param>
        /// <param name="edate"></param>
        private void BindLogList(LogType logType, DateTime?sdate, DateTime?edate)
        {
            DataSet result = null;

            using (SqlAccessor accessor = Accessor.AccessorFactory.GetSqlAccessor())
            {
                result = accessor.GetLogList(logType, sdate, edate);
            }
            if (result != null || result.Tables.Count > 1)
            {
                //件数
                int count = Utility.DBToInteger(result.Tables[0].Rows[0]["LOGCOUNT"]);
                if (count > MAX_DISPLAY_NUM)
                {
                    RSM.ShowMessage(this, RS.Exclamations.MaxDisplayNumOvered);
                }
                DataTable datasource = result.Tables[1];
                if (logType == LogType.System)
                {
                    this.dtgSystemLog.DataSource = datasource;
                    this.dtgEventLog.DataSource  = null;
                    this.dtgEventLog.Visible     = false;
                    this.dtgSystemLog.Visible    = true;
                }
                else
                {
                    this.dtgEventLog.DataSource  = datasource;
                    this.dtgSystemLog.DataSource = null;
                    this.dtgSystemLog.Visible    = false;
                    this.dtgEventLog.Visible     = true;
                }
            }
        }
Exemplo n.º 9
0
 private void cmbTaskList_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (this.cmbTaskList.SelectedItem == null)
     {
         return;
     }
     try
     {
         DataRowView row    = (DataRowView)this.cmbTaskList.SelectedItem;
         string      taskId = Utility.DBToString(row["TASK_ID"]);
         MigrateTask task   = null;
         using (SqlAccessor accessor = Accessor.AccessorFactory.GetSqlAccessor())
         {
             task = accessor.GetMigrateTaskById(taskId, SqlAccessor.DataKind.ViewOnly);
         }
         if (task == null)
         {
             return;
         }
         this._selectedTask = task;
         this.InitViewList(task);
     }
     catch (Exception ex)
     {
         Log.Write(ex);
         RSM.ShowMessage(this, ex);
     }
 }
Exemplo n.º 10
0
 /// <summary>
 /// SP接続テスト
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnTryAccessSP_Click(object sender, EventArgs e)
 {
     if (ValidSP())
     {
         RSM.ShowMessage(this, RS.Informations.TryConnectOK);
     }
 }
Exemplo n.º 11
0
 /// <summary>
 /// ログを削除する
 /// </summary>
 /// <param name="type"></param>
 /// <param name="sdate"></param>
 /// <param name="edate"></param>
 private void DeleteLog(LogType type, DateTime?sdate, DateTime?edate)
 {
     using (SqlAccessor accessor = Accessor.AccessorFactory.GetSqlAccessor())
     {
         accessor.DeleteLog(type, sdate, edate);
     }
     RSM.ShowMessage(this, RS.Informations.LogDataDeleted);
     this.BindLogList(type, sdate, edate);
 }
Exemplo n.º 12
0
 /// <summary>
 /// フォームロードイベント処理
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void ViewSetting_Load(object sender, EventArgs e)
 {
     try
     {
         this.InitControls();
     }
     catch (Exception ex)
     {
         Log.Write(ex);
         RSM.ShowMessage(this, ex);
     }
 }
Exemplo n.º 13
0
 private void NotesSettingList_Load(object sender, EventArgs e)
 {
     try
     {
         InitNotesSettingList();
     }
     catch (Exception ex)
     {
         Log.Write(ex);
         RSM.ShowMessage(this, ex);
     }
 }
Exemplo n.º 14
0
 private void PreViewForm_Load(object sender, EventArgs e)
 {
     try
     {
         InitHtml(this.NotesForm);
     }
     catch (Exception ex)
     {
         Log.Write(ex);
         RSM.ShowMessage(this, ex);
     }
 }
Exemplo n.º 15
0
 private void NotesSettingList_Load(object sender, EventArgs e)
 {
     try
     {
         this.ProgressPanel.Visible = false;
         InitNotesSettingList();
     }
     catch (Exception ex)
     {
         Log.Write(ex);
         RSM.ShowMessage(this, ex);
     }
 }
Exemplo n.º 16
0
 private void CloseButton_Click(object sender, EventArgs e)
 {
     try
     {
         this.Close();
         this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
     }
     catch (Exception ex)
     {
         Log.Write(ex);
         RSM.ShowMessage(this, ex);
     }
 }
Exemplo n.º 17
0
 private void ViewSelectDialog_Load(object sender, EventArgs e)
 {
     try
     {
         this.btnOK.Enabled = false;
         InitTaskList();
     }
     catch (Exception ex)
     {
         Log.Write(ex);
         RSM.ShowMessage(this, ex);
     }
 }
Exemplo n.º 18
0
 /// <summary>
 /// ワーカー処理完了
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void TaskWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
 {
     this.ProgressPanel.Visible = false;
     this.TaskList.Enabled      = true;
     this.btnRun.Enabled        = true;
     this.btnClose.Enabled      = true;
     if (e.Error != null)
     {
         Log.Write(e.Error);
         RSM.ShowMessage(this, e.Error);
     }
     InitNotesSettingList();
 }
Exemplo n.º 19
0
        private void btnTryAccessNotes_Click(object sender, EventArgs e)
        {
            string        password   = this.txtNotesPassword.Text;
            NotesAccessor nsAccessor = Accessor.AccessorFactory.GetNotesAccessor();

            if (nsAccessor.TryConnect(password))
            {
                this.lblUserId.Text = nsAccessor.GetCurrentUser();
                RSM.ShowMessage(this, RS.Informations.TryConnectOK);
            }
            else
            {
                RSM.ShowMessage(this, RS.Exclamations.InvalidNotesPassword);
            }
        }
Exemplo n.º 20
0
 /// <summary>
 /// ログを削除する
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnDelete_Click(object sender, EventArgs e)
 {
     try
     {
         if (!ValidateInputs())
         {
             return;
         }
         SearchArgs args = GetSearchArgs();
         this.DeleteLog(args.Type, args.StartDate, args.EndDate);
     }
     catch (Exception ex)
     {
         Log.Write(ex);
         RSM.ShowMessage(this, ex);
     }
 }
Exemplo n.º 21
0
 /// <summary>
 /// グループ項目追加
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnAddGroup_Click(object sender, EventArgs e)
 {
     try
     {
         if (this.lsvFieldForGroup.SelectedItems.Count == 0)
         {
             return;
         }
         IFieldRef fld = this.lsvFieldForGroup.SelectedItems[0].Tag as IFieldRef;
         this._targetView.GroupColumns.Add(new ViewColumn(fld));
         InitGroupColumnTab();
     }
     catch (Exception ex)
     {
         Log.Write(ex);
         RSM.ShowMessage(this, ex);
     }
 }
Exemplo n.º 22
0
 /// <summary>
 /// グループ項目削除
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnDeleteGroup_Click(object sender, EventArgs e)
 {
     try
     {
         if (this.lsvGroupColumns.SelectedItems.Count == 0)
         {
             return;
         }
         IViewColumn column = this.lsvGroupColumns.SelectedItems[0].Tag as IViewColumn;
         this._targetView.GroupColumns.Remove(column);
         InitGroupColumnTab();
     }
     catch (Exception ex)
     {
         Log.Write(ex);
         RSM.ShowMessage(this, ex);
     }
 }
Exemplo n.º 23
0
        /// <summary>
        /// 入力内容チェック
        /// </summary>
        /// <returns></returns>
        private bool ValidateInputs()
        {
            //ビュータイトル
            if (string.IsNullOrWhiteSpace(this.txtViewTitle.Text))
            {
                RSM.ShowMessage(this, RS.Exclamations.NotViewTitle);
                FocusControl(this.txtViewTitle);
                return(false);
            }
            //ビュー表示列
            if (this.lsvColumns.Items.Count == 0)
            {
                RSM.ShowMessage(this, RS.Exclamations.NotDisplayColumn);
                FocusControl(this.txtViewTitle);
                return(false);
            }

            return(true);
        }
Exemplo n.º 24
0
        private bool ValidateInputs()
        {
            if (this.cmbLogType.SelectedIndex == -1)
            {
                RSM.ShowMessage(this, RS.Exclamations.NotSelectLogType);
                this.cmbLogType.Focus();
                return(false);
            }
            DateTime?sdate = null;
            DateTime?edate = null;

            //開始日
            if (dtpStartDate.Checked)
            {
                sdate = dtpStartDate.Value.Date;
                if (sdate.Value > SqlDateTime.MaxValue || sdate.Value < SqlDateTime.MinValue)
                {
                    RSM.ShowMessage(this, RS.Exclamations.InvalidateDateRang);
                    this.dtpStartDate.Focus();
                    return(false);
                }
            }
            //終了日
            if (dtpEndDate.Checked)
            {
                edate = dtpEndDate.Value.Date;
                if (edate.Value > SqlDateTime.MaxValue || edate.Value < SqlDateTime.MinValue)
                {
                    RSM.ShowMessage(this, RS.Exclamations.InvalidateDateRang);
                    this.dtpEndDate.Focus();
                    return(false);
                }
            }
            //日付範囲
            if (sdate.HasValue && edate.HasValue && sdate.Value > edate.Value)
            {
                RSM.ShowMessage(this, RS.Exclamations.InvalidateDateRang);
                this.dtpStartDate.Focus();
                return(false);
            }
            return(true);
        }
Exemplo n.º 25
0
 /// <summary>
 /// データベース選択
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void SelectDb_Click(object sender, EventArgs e)
 {
     try
     {
         NsfPicker nsfPicker = new NsfPicker();
         nsfPicker.NotesPassword = Config.NotesPassword;
         if (nsfPicker.ShowNsfPicker(this, false) == System.Windows.Forms.DialogResult.OK)
         {
             NsfInfo   dbInfo = nsfPicker.SelectNsfDb;
             IDatabase db     = GetDatabase(dbInfo.Server, dbInfo.FilePath);
             this._taskInfo.ResetNotesDatabase(db);
             InitDatabaseInfo();
         }
     }
     catch (Exception ex)
     {
         Log.Write(ex);
         RSM.ShowMessage(this, ex);
     }
 }
Exemplo n.º 26
0
 /// <summary>
 /// ソート種別設定
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnSortType_Click(object sender, EventArgs e)
 {
     try
     {
         if (this.lsvSortColumn.SelectedItems.Count == 0)
         {
             return;
         }
         ListViewItem lvItem = this.lsvSortColumn.SelectedItems[0];
         IViewColumn  column = lvItem.Tag as IViewColumn;
         column.IsSortDescending = this.rdbDesc.Checked;
         string desc = column.IsSortDescending ? "降順" : "昇順";
         lvItem.SubItems[2].Text = desc;
     }
     catch (Exception ex)
     {
         Log.Write(ex);
         RSM.ShowMessage(this, ex);
     }
 }
Exemplo n.º 27
0
        /// <summary>
        /// 入力情報をチェックする
        /// </summary>
        private bool ValidSP()
        {
            //SPWebSiteが未入力の場合
            if (string.IsNullOrEmpty(this.txtSPWebSite.Text))
            {
                RSM.ShowMessage(this, RS.Exclamations.NotSPWebSite);
                FocusControl(this.txtSPWebSite);
                return(false);
            }

            //SPUserIDが未入力の場合
            if (string.IsNullOrEmpty(this.txtSPUser.Text))
            {
                RSM.ShowMessage(this, RS.Exclamations.NotSPUserID);
                FocusControl(this.txtSPUser);
                return(false);
            }

            //SPPasswordが未入力の場合
            if (string.IsNullOrEmpty(this.txtSPPassword.Text))
            {
                RSM.ShowMessage(this, RS.Exclamations.NotSPPassword);
                FocusControl(this.txtSPPassword);
                return(false);
            }
            string website = this.txtSPWebSite.Text;
            string userId  = this.txtSPUser.Text;
            string psw     = this.txtSPPassword.Text;

            //SP接続できない
            SpAccessor spAccessor = Accessor.AccessorFactory.GetSpAccessor(website, userId, psw);

            if (!spAccessor.TryConnect())
            {
                RSM.ShowMessage(this, RS.Exclamations.SPConnectFailed);
                FocusControl(this.txtSPPassword);
                return(false);
            }

            return(true);
        }
Exemplo n.º 28
0
 /// <summary>
 /// 設定を保存する
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void SaveButton_Click(object sender, EventArgs e)
 {
     try
     {
         if (!ValidateInputs())
         {
             return;
         }
         using (SqlAccessor sqlAccessor = Accessor.AccessorFactory.GetSqlAccessor())
         {
             sqlAccessor.UpdateMigrateForm(this.TargetForm);
         }
         Log.Write(RSM.GetMessage(RS.Informations.FormSetted, this.TargetForm.Name));
         this.DialogResult = System.Windows.Forms.DialogResult.OK;
         this.Close();
     }
     catch (Exception ex)
     {
         Log.Write(ex);
         RSM.ShowMessage(this, ex);
     }
 }
Exemplo n.º 29
0
 /// <summary>
 /// 対象フォームを削除する
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void RemoveForm_Click(object sender, EventArgs e)
 {
     try
     {
         if (this.listFormTarget.SelectedItems == null || this.listFormTarget.SelectedItems.Count == 0)
         {
             return;
         }
         IForm formItem = this.listFormTarget.SelectedItems[0].Tag as IForm;
         if (formItem != null)
         {
             formItem.IsTarget = false;
             this._taskInfo.TargetForms.Remove(formItem);
         }
         this.InitForms();
     }
     catch (Exception ex)
     {
         Log.Write(ex);
         RSM.ShowMessage(this, ex);
     }
 }
Exemplo n.º 30
0
 /// <summary>
 /// 対象ビューを削除する
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void RemoveView_Click(object sender, EventArgs e)
 {
     try
     {
         if (this.listViewTarget.SelectedItems == null || this.listViewTarget.SelectedItems.Count == 0)
         {
             return;
         }
         IView viewItem = this.listViewTarget.SelectedItems[0].Tag as IView;
         if (viewItem != null)
         {
             viewItem.IsTarget = false;
             this._taskInfo.TargetViews.Remove(viewItem);
         }
         this.InitViews();
     }
     catch (Exception ex)
     {
         Log.Write(ex);
         RSM.ShowMessage(this, ex);
     }
 }