/// <summary> /// 画面初期化 /// </summary> private void InitControls() { //Notes設定 this.txtNotesPassword.Text = Config.NotesPassword; NotesAccessor nsAccessor = Accessor.AccessorFactory.GetNotesAccessor(); if (!string.IsNullOrEmpty(Config.NotesPassword) && nsAccessor.TryConnect(Config.NotesPassword)) { this.lblUserId.Text = nsAccessor.GetCurrentUser(); } //出力フォルダを this.txtOutputFolder.Text = Config.ExportFolder; //Sharepoint設定 this.txtSPWebSite.Text = Config.SPDefaultWebSite; this.txtSPUser.Text = Config.SPUserId; this.txtSPPassword.Text = Config.SPPassword; //SqlServer this.txtSqlServer.Text = Config.SqlServer; this.txtSqlServer.Tag = Config.SqlServer; AuthenticateMode mode = (AuthenticateMode)Config.DBAuthenticateMode; if (mode == AuthenticateMode.SqlServer) { this.txtDbUserId.Enabled = true; this.txtDBPassword.Enabled = true; this.txtDbUserId.Text = Config.DBUserId; this.txtDbUserId.Tag = Config.DBUserId; this.txtDBPassword.Text = Config.DBPassWord; this.txtDBPassword.Tag = Config.DBPassWord; } else { this.txtDbUserId.Enabled = false; this.txtDbUserId.Text = System.Security.Principal.WindowsIdentity.GetCurrent().Name; this.txtDBPassword.Clear(); this.txtDBPassword.Enabled = false; } InitAuthModeComb(); //Detabase List if (!string.IsNullOrEmpty(Config.DataBaseName) && !string.IsNullOrEmpty(Config.SqlServer)) { using (SqlAccessor sqlAccessor = Accessor.AccessorFactory.GetSqlAccessor()) { if (this.InitDatabaseList(sqlAccessor)) { this.cmbDataBase.SelectedItem = Config.DataBaseName; } } } }
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); } }
/// <summary> /// 入力情報をチェックする /// </summary> private bool ValidNotes() { //NotesPasswordが未入力の場合 if (string.IsNullOrEmpty(this.txtNotesPassword.Text)) { RSM.ShowMessage(this, RS.Exclamations.NotNotesPassword); FocusControl(this.txtNotesPassword); return(false); } //NotesPasswordが違います NotesAccessor nsAccessor = Accessor.AccessorFactory.GetNotesAccessor(); if (nsAccessor.TryConnect(this.txtNotesPassword.Text)) { this.lblUserId.Text = nsAccessor.GetCurrentUser(); } else { RSM.ShowMessage(this, RS.Exclamations.InvalidNotesPassword); FocusControl(this.txtNotesPassword); return(false); } //出力フォルダ if (string.IsNullOrEmpty(this.txtOutputFolder.Text)) { RSM.ShowMessage(this, RS.Exclamations.NotExportFolder); FocusControl(this.txtOutputFolder); return(false); } //出力フォルダの存在チェック if (!System.IO.Directory.Exists(this.txtOutputFolder.Text)) { RSM.ShowMessage(this, RS.Exclamations.ExportFolderNotExists); FocusControl(this.txtOutputFolder); return(false); } return(true); }