Ejemplo n.º 1
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);
     }
 }
Ejemplo n.º 2
0
 internal Database(NotesAccessor accessor, Domino.NotesDatabase notesDb)
 {
     if (!notesDb.IsOpen)
     {
         notesDb.Open();
     }
     this._accessor   = accessor;
     this._notesDb    = notesDb;
     this._title      = notesDb.Title;
     this._server     = notesDb.Server;
     this._sourceType = (NotesDbType)(int)notesDb.type;
     this._targetType = MappingInfo.GetTagetDbType(this._sourceType);
     this._fileName   = notesDb.FileName;
     this._notesUrl   = notesDb.NotesURL;
     this._replicaId  = notesDb.ReplicaID;
     this._sourcePath = notesDb.FilePath;
 }
Ejemplo n.º 3
0
        /// <summary>
        /// NotesDateBaseの変換先のSPListタイプを取得する
        /// </summary>
        /// <param name="dbType"></param>
        /// <returns></returns>
        public static SPListType GetTagetDbType(NotesDbType dbType)
        {
            string typeName = dbType.ToString();
            var    result   = DbTypeMap.Where(row => row.NotesDbType == typeName);

            if (result.Count() == 0)
            {
                result = DbTypeMap.Where(row => row.NotesDbType == "DEFAULT");
            }
            SPListType type = SPListType.InvalidType;

            if (result.Count() > 0 && result.First().CanConvert)
            {
                if (Enum.TryParse(result.First().SPListType, out type))
                {
                    return(type);
                }
            }
            return(SPListType.InvalidType);
        }