private void btnLogin_Click(object sender, EventArgs e) { LoginRequest request = null; LoginResponse response = null; request = new LoginRequest() { UserName = this.userName.Text, Password = this.password.Text }; try { realPropertyTaxProjectionManager = BusinessDelegateFactory.GetInstance().GetRealPropertyTaxProjectionService(); response = new LoginResponse(); response = realPropertyTaxProjectionManager.Login(request); if (response.IsLoginValid) { this.DialogResult = DialogResult.OK; } } catch (RealPropertyTaxProjectionException ex) { FormHelper.MessageShow(ex.Message); this.userName.Focus(); } catch (Exception ex) { FormHelper.MessageShow(ex.Message); this.userName.Focus(); } finally { realPropertyTaxProjectionManager = null; response = null; request = null; } }
private void btnExportData_Click(object sender, EventArgs e) { ExportBuildingDataAssessorFileRequest request = null; ExportBuildingDataAssessorFileResponse response = null; try { if (!(sfdExportData.ShowDialog() == DialogResult.OK)) { throw new RealPropertyTaxProjectionException(Program.SKIP_KEYWORD); } request = new ExportBuildingDataAssessorFileRequest() { SourceFilePath = this.sfdExportData.FileName, BuildingDataAssessors = this.DataSource }; Program.realPropertyTaxProjectionManager = BusinessDelegateFactory.GetInstance().GetRealPropertyTaxProjectionService(); response = Program.realPropertyTaxProjectionManager.ExportBuildingDataAssessorFile(request); if (response.Result.IsSuccess == true) { FormHelper.MessageShow(response.Result.Message); } } catch (RealPropertyTaxProjectionException ex) { if (!ex.Message.Equals(Program.SKIP_KEYWORD)) { FormHelper.MessageShow(ex.Message); } } finally { Program.realPropertyTaxProjectionManager = null; } }