This commit is contained in:
chapal 2024-09-17 14:30:13 +06:00
commit 09624e7363
2577 changed files with 1115972 additions and 0 deletions

751
.gitignore vendored Normal file
View File

@ -0,0 +1,751 @@
# Created by https://www.toptal.com/developers/gitignore/api/csharp,angular,aspnetcore,visualstudio,visualstudiocode
# Edit at https://www.toptal.com/developers/gitignore?templates=csharp,angular,aspnetcore,visualstudio,visualstudiocode
### Angular ###
## Angular ##
# compiled output
dist/
tmp/
app/**/*.js
app/**/*.js.map
# dependencies
node_modules/
bower_components/
bin/
obj/
# IDEs and editors
.idea/
# misc
.sass-cache/
connect.lock/
coverage/
libpeerconnection.log/
npm-debug.log
testem.log
typings/
.angular/
# e2e
e2e/*.js
e2e/*.map
# System Files
.DS_Store/
### ASPNETCore ###
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
# Visual Studio 2015 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUNIT
*.VisualState.xml
TestResult.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# DNX
project.lock.json
project.fragment.lock.json
artifacts/
*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# JustCode is a .NET coding add-in
.JustCode
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# TODO: Comment the next line if you want to checkin your web deploy settings
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config
# NuGet v3's project.json files produces more ignoreable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
# SQL Server files
*.mdf
*.ldf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# JetBrains Rider
*.sln.iml
# CodeRush
.cr/
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/
### Csharp ###
##
## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
# User-specific files
*.rsuser
# User-specific files (MonoDevelop/Xamarin Studio)
# Mono auto generated files
mono_crash.*
# Build results
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
[Ll]ogs/
# Visual Studio 2015/2017 cache/options directory
# Uncomment if you have tasks that create the project's static files in wwwroot
# Visual Studio 2017 auto generated files
Generated\ Files/
# MSTest test Results
# NUnit
nunit-*.xml
# Build Results of an ATL Project
# Benchmark Results
BenchmarkDotNet.Artifacts/
# .NET Core
# ASP.NET Scaffolding
ScaffoldingReadMe.txt
# StyleCop
StyleCopReport.xml
# Files built by Visual Studio
*_h.h
*.iobj
*.ipdb
*_wpftmp.csproj
*.tlog
# Chutzpah Test files
# Visual C++ cache files
# Visual Studio profiler
# Visual Studio Trace Files
*.e2e
# TFS 2012 Local Workspace
# Guidance Automation Toolkit
# ReSharper is a .NET coding add-in
# TeamCity is a build add-in
# DotCover is a Code Coverage Tool
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Coverlet is a free, cross platform Code Coverage Tool
coverage*.json
coverage*.xml
coverage*.info
# Visual Studio code coverage results
# NCrunch
# MightyMoose
# Web workbench (sass)
# Installshield output folder
# DocProject is a documentation generator add-in
# Click-Once directory
# Publish Web Output
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
# NuGet Packages
# NuGet Symbol Packages
*.snupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
# Microsoft Azure Build Output
# Microsoft Azure Emulator
# Windows Store app package directories and files
*.appx
*.appxbundle
*.appxupload
# Visual Studio cache files
# files ending in .cache can be ignored
# but keep track of directories ending in .cache
!?*.[Cc]ache/
# Others
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
# RIA/Silverlight projects
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
ServiceFabricBackup/
*.rptproj.bak
# SQL Server files
*.ndf
# Business Intelligence projects
*.rptproj.rsuser
*- [Bb]ackup.rdl
*- [Bb]ackup ([0-9]).rdl
*- [Bb]ackup ([0-9][0-9]).rdl
# Microsoft Fakes
# GhostDoc plugin setting file
# Node.js Tools for Visual Studio
# Visual Studio 6 build log
# Visual Studio 6 workspace options file
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio 6 auto-generated project file (contains which files were open etc.)
*.vbp
# Visual Studio 6 workspace and project file (working project files containing files to include in project)
*.dsw
*.dsp
# Visual Studio 6 technical files
# Visual Studio LightSwitch build output
# Paket dependency manager
# FAKE - F# Make
# CodeRush personal settings
.cr/personal
# Python Tools for Visual Studio (PTVS)
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
*.tss
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
# OpenCover UI analysis results
OpenCover/
# Azure Stream Analytics local run output
ASALocalRun/
# MSBuild Binary and Structured Log
*.binlog
# NVidia Nsight GPU debugger configuration file
*.nvuser
# MFractors (Xamarin productivity tool) working folder
.mfractor/
# Local History for Visual Studio
.localhistory/
# Visual Studio History (VSHistory) files
.vshistory/
# BeatPulse healthcheck temp database
healthchecksdb
# Backup folder for Package Reference Convert tool in Visual Studio 2017
MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/
# Fody - auto-generated XML schema
FodyWeavers.xsd
# VS Code files for those working on multiple tools
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace
# Local History for Visual Studio Code
.history/
# Windows Installer files from build outputs
*.cab
*.msi
*.msix
*.msm
*.msp
# JetBrains Rider
### VisualStudioCode ###
!.vscode/*.code-snippets
# Local History for Visual Studio Code
# Built Visual Studio Code Extensions
*.vsix
### VisualStudioCode Patch ###
# Ignore all local history of files
.history
.ionide
### VisualStudio ###
# User-specific files
# User-specific files (MonoDevelop/Xamarin Studio)
# Mono auto generated files
# Build results
# Visual Studio 2015/2017 cache/options directory
# Uncomment if you have tasks that create the project's static files in wwwroot
# Visual Studio 2017 auto generated files
# MSTest test Results
# NUnit
# Build Results of an ATL Project
# Benchmark Results
# .NET Core
# ASP.NET Scaffolding
# StyleCop
# Files built by Visual Studio
# Chutzpah Test files
# Visual C++ cache files
# Visual Studio profiler
# Visual Studio Trace Files
# TFS 2012 Local Workspace
# Guidance Automation Toolkit
# ReSharper is a .NET coding add-in
# TeamCity is a build add-in
# DotCover is a Code Coverage Tool
# AxoCover is a Code Coverage Tool
# Coverlet is a free, cross platform Code Coverage Tool
# Visual Studio code coverage results
# NCrunch
# MightyMoose
# Web workbench (sass)
# Installshield output folder
# DocProject is a documentation generator add-in
# Click-Once directory
# Publish Web Output
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
# NuGet Packages
# NuGet Symbol Packages
# The packages folder can be ignored because of Package Restore
# except build/, which is used as an MSBuild target.
# Uncomment if necessary however generally it will be regenerated when needed
# NuGet v3's project.json files produces more ignorable files
# Microsoft Azure Build Output
# Microsoft Azure Emulator
# Windows Store app package directories and files
# Visual Studio cache files
# files ending in .cache can be ignored
# but keep track of directories ending in .cache
# Others
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
# RIA/Silverlight projects
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
# SQL Server files
# Business Intelligence projects
# Microsoft Fakes
# GhostDoc plugin setting file
# Node.js Tools for Visual Studio
# Visual Studio 6 build log
# Visual Studio 6 workspace options file
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
# Visual Studio 6 auto-generated project file (contains which files were open etc.)
# Visual Studio 6 workspace and project file (working project files containing files to include in project)
# Visual Studio 6 technical files
# Visual Studio LightSwitch build output
# Paket dependency manager
# FAKE - F# Make
# CodeRush personal settings
# Python Tools for Visual Studio (PTVS)
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
# Telerik's JustMock configuration file
# BizTalk build output
# OpenCover UI analysis results
# Azure Stream Analytics local run output
# MSBuild Binary and Structured Log
# NVidia Nsight GPU debugger configuration file
# MFractors (Xamarin productivity tool) working folder
# Local History for Visual Studio
# Visual Studio History (VSHistory) files
# BeatPulse healthcheck temp database
# Backup folder for Package Reference Convert tool in Visual Studio 2017
# Ionide (cross platform F# VS Code tools) working folder
# Fody - auto-generated XML schema
# VS Code files for those working on multiple tools
# Local History for Visual Studio Code
# Windows Installer files from build outputs
# JetBrains Rider
### VisualStudio Patch ###
# Additional files built by Visual Studio
# End of https://www.toptal.com/developers/gitignore/api/csharp,angular,aspnetcore,visualstudio,visualstudiocode

146
CEL Payroll.sln Normal file
View File

@ -0,0 +1,146 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30804.86
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Library", "Library", "{1433A717-1C65-4660-9462-90E42FF9125B}"
ProjectSection(SolutionItems) = preProject
Library\Ease Query Analyzer.dll = Library\Ease Query Analyzer.dll
Library\Ease.Controls.dll = Library\Ease.Controls.dll
Library\Ease.Controls.Win.dll = Library\Ease.Controls.Win.dll
Library\Ease.Core.dll = Library\Ease.Core.dll
Library\Ease.CoreV35.dll = Library\Ease.CoreV35.dll
Library\Ease.Excel.dll = Library\Ease.Excel.dll
Library\Ease.Printing.dll = Library\Ease.Printing.dll
Library\Ease.Report.dll = Library\Ease.Report.dll
Library\Ease.ScalablePictureBox.dll = Library\Ease.ScalablePictureBox.dll
Library\Ease.SearchTools.Objects.dll = Library\Ease.SearchTools.Objects.dll
Library\Ease.SearchTools.Services.dll = Library\Ease.SearchTools.Services.dll
Library\Ease.SearchTools.UI.dll = Library\Ease.SearchTools.UI.dll
Library\Ease.UICreator.dll = Library\Ease.UICreator.dll
Library\ExtendedRichTextBox.dll = Library\ExtendedRichTextBox.dll
Library\GSMCommServer.dll = Library\GSMCommServer.dll
Library\GSMCommShared.dll = Library\GSMCommShared.dll
Library\GSMCommunication.dll = Library\GSMCommunication.dll
Library\Microsoft.Exchange.WebServices.dll = Library\Microsoft.Exchange.WebServices.dll
Library\Microsoft.ReportViewer.Common.dll = Library\Microsoft.ReportViewer.Common.dll
Library\Microsoft.ReportViewer.ProcessingObjectModel.DLL = Library\Microsoft.ReportViewer.ProcessingObjectModel.DLL
Library\Microsoft.ReportViewer.WinForms.dll = Library\Microsoft.ReportViewer.WinForms.dll
Library\PdfSharp.dll = Library\PdfSharp.dll
Library\PDUConverter.dll = Library\PDUConverter.dll
Library\SpreadsheetGear.dll = Library\SpreadsheetGear.dll
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Payroll.UI", "Payroll.UI\Payroll.UI\Payroll.UI.csproj", "{20895D44-FCD4-46ED-9292-67B2AD85B850}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Payroll.BO", "Payroll.BO\Payroll.BO.csproj", "{05C1AC33-E175-48E9-A062-B8BB633A8227}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Payroll.Service", "Payroll.Service\Payroll.Service.csproj", "{4EE4A9A2-5E83-4F19-A162-D4A7169B3976}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Payroll.Controls", "Payroll.Controls\Payroll.Controls.csproj", "{F0B1872F-96B1-41E0-956D-C75CF255672C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ease.UICreator", "Ease.UICreator\Ease.UICreator.csproj", "{2A8DD5FD-3F1D-4FBC-94B6-BCBDCCAC4CC2}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Payroll.Report", "Payroll.Report\Payroll.Report.csproj", "{4D5240E6-ACC2-4A92-8F90-5F5C0A229C80}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Payroll.NotifProcessInterface", "Payroll.NotifProcessInterface\Payroll.NotifProcessInterface.csproj", "{CC4C3066-7261-4DA2-BACF-6C241745A0A5}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ease.SvcHost", "Ease.SvcHost\Ease.SvcHost.csproj", "{D86975F4-B295-4EC5-8478-834246545BEB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
CD_ROM|Any CPU = CD_ROM|Any CPU
Debug|Any CPU = Debug|Any CPU
DVD-5|Any CPU = DVD-5|Any CPU
Release|Any CPU = Release|Any CPU
SingleImage|Any CPU = SingleImage|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{20895D44-FCD4-46ED-9292-67B2AD85B850}.CD_ROM|Any CPU.ActiveCfg = Release|Any CPU
{20895D44-FCD4-46ED-9292-67B2AD85B850}.CD_ROM|Any CPU.Build.0 = Release|Any CPU
{20895D44-FCD4-46ED-9292-67B2AD85B850}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{20895D44-FCD4-46ED-9292-67B2AD85B850}.Debug|Any CPU.Build.0 = Debug|Any CPU
{20895D44-FCD4-46ED-9292-67B2AD85B850}.DVD-5|Any CPU.ActiveCfg = Debug|Any CPU
{20895D44-FCD4-46ED-9292-67B2AD85B850}.DVD-5|Any CPU.Build.0 = Debug|Any CPU
{20895D44-FCD4-46ED-9292-67B2AD85B850}.Release|Any CPU.ActiveCfg = Release|Any CPU
{20895D44-FCD4-46ED-9292-67B2AD85B850}.Release|Any CPU.Build.0 = Release|Any CPU
{20895D44-FCD4-46ED-9292-67B2AD85B850}.SingleImage|Any CPU.ActiveCfg = Release|Any CPU
{20895D44-FCD4-46ED-9292-67B2AD85B850}.SingleImage|Any CPU.Build.0 = Release|Any CPU
{05C1AC33-E175-48E9-A062-B8BB633A8227}.CD_ROM|Any CPU.ActiveCfg = Release|Any CPU
{05C1AC33-E175-48E9-A062-B8BB633A8227}.CD_ROM|Any CPU.Build.0 = Release|Any CPU
{05C1AC33-E175-48E9-A062-B8BB633A8227}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{05C1AC33-E175-48E9-A062-B8BB633A8227}.Debug|Any CPU.Build.0 = Debug|Any CPU
{05C1AC33-E175-48E9-A062-B8BB633A8227}.DVD-5|Any CPU.ActiveCfg = Debug|Any CPU
{05C1AC33-E175-48E9-A062-B8BB633A8227}.DVD-5|Any CPU.Build.0 = Debug|Any CPU
{05C1AC33-E175-48E9-A062-B8BB633A8227}.Release|Any CPU.ActiveCfg = Release|Any CPU
{05C1AC33-E175-48E9-A062-B8BB633A8227}.Release|Any CPU.Build.0 = Release|Any CPU
{05C1AC33-E175-48E9-A062-B8BB633A8227}.SingleImage|Any CPU.ActiveCfg = Release|Any CPU
{05C1AC33-E175-48E9-A062-B8BB633A8227}.SingleImage|Any CPU.Build.0 = Release|Any CPU
{4EE4A9A2-5E83-4F19-A162-D4A7169B3976}.CD_ROM|Any CPU.ActiveCfg = Release|Any CPU
{4EE4A9A2-5E83-4F19-A162-D4A7169B3976}.CD_ROM|Any CPU.Build.0 = Release|Any CPU
{4EE4A9A2-5E83-4F19-A162-D4A7169B3976}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4EE4A9A2-5E83-4F19-A162-D4A7169B3976}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4EE4A9A2-5E83-4F19-A162-D4A7169B3976}.DVD-5|Any CPU.ActiveCfg = Debug|Any CPU
{4EE4A9A2-5E83-4F19-A162-D4A7169B3976}.DVD-5|Any CPU.Build.0 = Debug|Any CPU
{4EE4A9A2-5E83-4F19-A162-D4A7169B3976}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4EE4A9A2-5E83-4F19-A162-D4A7169B3976}.Release|Any CPU.Build.0 = Release|Any CPU
{4EE4A9A2-5E83-4F19-A162-D4A7169B3976}.SingleImage|Any CPU.ActiveCfg = Release|Any CPU
{4EE4A9A2-5E83-4F19-A162-D4A7169B3976}.SingleImage|Any CPU.Build.0 = Release|Any CPU
{F0B1872F-96B1-41E0-956D-C75CF255672C}.CD_ROM|Any CPU.ActiveCfg = Release|Any CPU
{F0B1872F-96B1-41E0-956D-C75CF255672C}.CD_ROM|Any CPU.Build.0 = Release|Any CPU
{F0B1872F-96B1-41E0-956D-C75CF255672C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F0B1872F-96B1-41E0-956D-C75CF255672C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F0B1872F-96B1-41E0-956D-C75CF255672C}.DVD-5|Any CPU.ActiveCfg = Debug|Any CPU
{F0B1872F-96B1-41E0-956D-C75CF255672C}.DVD-5|Any CPU.Build.0 = Debug|Any CPU
{F0B1872F-96B1-41E0-956D-C75CF255672C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F0B1872F-96B1-41E0-956D-C75CF255672C}.Release|Any CPU.Build.0 = Release|Any CPU
{F0B1872F-96B1-41E0-956D-C75CF255672C}.SingleImage|Any CPU.ActiveCfg = Release|Any CPU
{F0B1872F-96B1-41E0-956D-C75CF255672C}.SingleImage|Any CPU.Build.0 = Release|Any CPU
{2A8DD5FD-3F1D-4FBC-94B6-BCBDCCAC4CC2}.CD_ROM|Any CPU.ActiveCfg = Release|Any CPU
{2A8DD5FD-3F1D-4FBC-94B6-BCBDCCAC4CC2}.CD_ROM|Any CPU.Build.0 = Release|Any CPU
{2A8DD5FD-3F1D-4FBC-94B6-BCBDCCAC4CC2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2A8DD5FD-3F1D-4FBC-94B6-BCBDCCAC4CC2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2A8DD5FD-3F1D-4FBC-94B6-BCBDCCAC4CC2}.DVD-5|Any CPU.ActiveCfg = Debug|Any CPU
{2A8DD5FD-3F1D-4FBC-94B6-BCBDCCAC4CC2}.DVD-5|Any CPU.Build.0 = Debug|Any CPU
{2A8DD5FD-3F1D-4FBC-94B6-BCBDCCAC4CC2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2A8DD5FD-3F1D-4FBC-94B6-BCBDCCAC4CC2}.Release|Any CPU.Build.0 = Release|Any CPU
{2A8DD5FD-3F1D-4FBC-94B6-BCBDCCAC4CC2}.SingleImage|Any CPU.ActiveCfg = Release|Any CPU
{2A8DD5FD-3F1D-4FBC-94B6-BCBDCCAC4CC2}.SingleImage|Any CPU.Build.0 = Release|Any CPU
{4D5240E6-ACC2-4A92-8F90-5F5C0A229C80}.CD_ROM|Any CPU.ActiveCfg = Release|Any CPU
{4D5240E6-ACC2-4A92-8F90-5F5C0A229C80}.CD_ROM|Any CPU.Build.0 = Release|Any CPU
{4D5240E6-ACC2-4A92-8F90-5F5C0A229C80}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4D5240E6-ACC2-4A92-8F90-5F5C0A229C80}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4D5240E6-ACC2-4A92-8F90-5F5C0A229C80}.DVD-5|Any CPU.ActiveCfg = Debug|Any CPU
{4D5240E6-ACC2-4A92-8F90-5F5C0A229C80}.DVD-5|Any CPU.Build.0 = Debug|Any CPU
{4D5240E6-ACC2-4A92-8F90-5F5C0A229C80}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4D5240E6-ACC2-4A92-8F90-5F5C0A229C80}.Release|Any CPU.Build.0 = Release|Any CPU
{4D5240E6-ACC2-4A92-8F90-5F5C0A229C80}.SingleImage|Any CPU.ActiveCfg = Release|Any CPU
{4D5240E6-ACC2-4A92-8F90-5F5C0A229C80}.SingleImage|Any CPU.Build.0 = Release|Any CPU
{CC4C3066-7261-4DA2-BACF-6C241745A0A5}.CD_ROM|Any CPU.ActiveCfg = Release|Any CPU
{CC4C3066-7261-4DA2-BACF-6C241745A0A5}.CD_ROM|Any CPU.Build.0 = Release|Any CPU
{CC4C3066-7261-4DA2-BACF-6C241745A0A5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CC4C3066-7261-4DA2-BACF-6C241745A0A5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CC4C3066-7261-4DA2-BACF-6C241745A0A5}.DVD-5|Any CPU.ActiveCfg = Debug|Any CPU
{CC4C3066-7261-4DA2-BACF-6C241745A0A5}.DVD-5|Any CPU.Build.0 = Debug|Any CPU
{CC4C3066-7261-4DA2-BACF-6C241745A0A5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CC4C3066-7261-4DA2-BACF-6C241745A0A5}.Release|Any CPU.Build.0 = Release|Any CPU
{CC4C3066-7261-4DA2-BACF-6C241745A0A5}.SingleImage|Any CPU.ActiveCfg = Release|Any CPU
{CC4C3066-7261-4DA2-BACF-6C241745A0A5}.SingleImage|Any CPU.Build.0 = Release|Any CPU
{D86975F4-B295-4EC5-8478-834246545BEB}.CD_ROM|Any CPU.ActiveCfg = Release|Any CPU
{D86975F4-B295-4EC5-8478-834246545BEB}.CD_ROM|Any CPU.Build.0 = Release|Any CPU
{D86975F4-B295-4EC5-8478-834246545BEB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D86975F4-B295-4EC5-8478-834246545BEB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D86975F4-B295-4EC5-8478-834246545BEB}.DVD-5|Any CPU.ActiveCfg = Debug|Any CPU
{D86975F4-B295-4EC5-8478-834246545BEB}.DVD-5|Any CPU.Build.0 = Debug|Any CPU
{D86975F4-B295-4EC5-8478-834246545BEB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D86975F4-B295-4EC5-8478-834246545BEB}.Release|Any CPU.Build.0 = Release|Any CPU
{D86975F4-B295-4EC5-8478-834246545BEB}.SingleImage|Any CPU.ActiveCfg = Release|Any CPU
{D86975F4-B295-4EC5-8478-834246545BEB}.SingleImage|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {AC3A3940-86A5-432F-BBE4-0831992F383C}
EndGlobalSection
EndGlobal

144
Ease.SvcHost/App.config Normal file
View File

@ -0,0 +1,144 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="Ease.svcHost" type="Ease.SvcHost.HostConfig, Ease.SvcHost"/>
<section name="dbSettings" type="Ease.CoreV35.DataAccess.DbConfig, Ease.CoreV35"/>
<section name="cacheConfiguration" type="Ease.CoreV35.Caching.CacheConfig, Ease.CoreV35"/>
<section name="customizedMessaging" type="Ease.CoreV35.Message.MessageConfig,Ease.CoreV35"/>
</configSections>
<Ease.svcHost port="40404" errorMode="Off">
<containers assembly="Payroll.Service" activation="SingleCall"/>
</Ease.svcHost>
<dbSettings>
<connection name="conn" provider="sql" connectionString="server=CEL80;Database=GPPayroll_Test;User ID=sa;Password=;" sqlSyntax="SQL"/>
</dbSettings>
<appSettings>
<add key="checkMITData" value="no"/>
<add key="newMITProcess" value="yes"/>
<add key="prcsOnIssueDate" value="yes"/>
<add key="prcsBnsBySingleGroup" value="yes"/>
<add key="handleAuditTrail" value="true"/>
<add key="SPAIN" value="EFT.Services/rc1"/>
<add key="ITALY" value="EFT.Services/rc"/>
<add key="uicOpx" value="EFT.Services/Opx"/>
<add key="uicData" value="EFT.Services/uic"/>
<add key="serviceHandler" value="Payroll.Service/conn"/>
<add key="spainCBData" value="EFT.Services.dll/spn"/>
<add key="exceptionHandler" value="mode=File; source=Log; maxFileSize=5; maxFiles=10"/>
<add key="refContext" value="ctxRef1,ctxRef2"/>
<!--Exchange Server/SMTP=ExchangeServer, Outlook=Outlook, Outlook Express=Outlook_Express,
Eudora=Eudora else Write excutable name.-->
<add key="mailGateway" value="ExchangeServer"/>
<!--If mailGateway is ExchangeServer add keys (esHost, esPort, esCredentials, esSender)
otherwise remove keys (esHost, esPort, esCredentials, esSender)-->
<add key="esPort" value="25"/>
<add key="esHost" value="vhost.bdcom.com"/>
<add key="ClientSettingsProvider.ServiceUri" value=""/>
<add key="esSender" value="Russel,smrussel@celimited.com"/>
<add key="esCredentials" value="smrussel@celimited.com,your password"/>
</appSettings>
<cacheConfiguration cacheClearInterval="3600">
<!--<cache type="EFT.Services.AccountTypeService" duration="3600"/>
<cache type="EFT.Services.BankBranchService" duration="3600"/>
<cache type="EFT.Services.BankService" duration="3600"/>
<cache type="EFT.Services.BeneficiaryComplainService" duration="3600"/>
<cache type="EFT.Services.BeneficiaryDocumentService" duration="3600"/>
<cache type="EFT.Services.BeneficiarySetupService" duration="3600"/>
<cache type="EFT.Services.CompanyService" duration="3600"/>
<cache type="EFT.Services.ComplainTypeService" duration="3600"/>
<cache type="EFT.Services.CountryService" duration="3600"/>
<cache type="EFT.Services.CurrencyService" duration="3600"/>
<cache type="EFT.Services.DocumentService" duration="3600"/>
<cache type="EFT.Services.ExchangeCardInfoService" duration="3600"/>
<cache type="EFT.Services.ExchangeService" duration="3600"/>
<cache type="EFT.Services.FranchiseCardInfoService" duration="3600"/>
<cache type="EFT.Services.FranchiseGroupService" duration="3600"/>
<cache type="EFT.Services.FranchiseService" duration="3600"/>
<cache type="EFT.Services.GroupService" duration="3600"/>
<cache type="EFT.Services.IncomeSourceService" duration="3600"/>
<cache type="EFT.Services.InstrumentTypeService" duration="3600"/>
<cache type="EFT.Services.MacAddressService" duration="3600"/>
<cache type="EFT.Services.PaymentModeService" duration="3600"/>
<cache type="EFT.Services.PointBasedCommSetupService" duration="3600"/>
<cache type="EFT.Services.PurposeService" duration="3600"/>
<cache type="EFT.Services.RelationService" duration="3600"/>
<cache type="EFT.Services.RemitterSetupService" duration="3600"/>
<cache type="EFT.Services.RemitterTypeService" duration="3600"/>
<cache type="EFT.Services.SubCompanyBranchService" duration="3600"/>
<cache type="EFT.Services.SubCompanyService" duration="3600"/>
<cache type="EFT.Services.SysParamService" duration="3600"/>
<cache type="EFT.Services.ThisSystemService" duration="3600"/>
<cache type="EFT.Services.UserService" duration="3600"/>
<cache type="EFT.Services.ConsumerPromotionService" duration="3600"/>
<cache type="EFT.Services.DealingAccountService" duration="3600"/>
<cache type="EFT.Services.DebitCardService" duration="3600"/>
<cache type="EFT.Services.DebitCardTranService" duration="3600"/>
<cache type="EFT.Services.ExchangeTradePromotionService" duration="3600"/>
<cache type="EFT.Services.ChargeSetupService" duration="3600"/>
<cache type="EFT.Services.CommissionShareByExchangeService" duration="3600"/>
<cache type="EFT.Services.CommissionShareByFranchiseService" duration="3600"/>
<cache type="EFT.Services.CompanyChargeService" duration="3600"/>
<cache type="EFT.Services.CustomerCommissionService" duration="3600"/>
<cache type="EFT.Services.ExchangeEarningShareByExchangeService" duration="3600"/>
<cache type="EFT.Services.ExchangeEarningShareByFranchiseService" duration="3600"/>
<cache type="EFT.Services.RemitterPointCalSetupService" duration="3600"/>
<cache type="EFT.Services.SharingSetupService" duration="3600"/>
<cache type="EFT.Services.UserSPService" duration="3600"/>
<cache type="EFT.Services.DayEndTranService" duration="3600"/>
<cache type="EFT.Services.DCApplicationService" duration="3600"/>
<cache type="EFT.Services.MonthEndTranService" duration="3600"/>
<cache type="EFT.Services.ComplainSetupService" duration="3600"/>
<cache type="EFT.Services.ExchangePayConfirmFileService" duration="3600"/>
<cache type="EFT.Services.ExportConfirmFileService" duration="3600"/>
<cache type="EFT.Services.ExportFileService" duration="3600"/>
<cache type="EFT.Services.FileInformationService" duration="3600"/>
<cache type="EFT.Services.ImportConfirmFileService" duration="3600"/>
<cache type="EFT.Services.ImportFileService" duration="3600"/>
<cache type="EFT.Services.ImportOrderService" duration="3600"/>
<cache type="EFT.Services.OrderSetupService" duration="3600"/>
<cache type="EFT.Services.PaymentConfirmationService" duration="3600"/>
<cache type="EFT.Services.GLHeadIdentifyService" duration="3600"/>
<cache type="EFT.Services.GLService" duration="3600"/>
<cache type="EFT.Services.BeneficiaryLimitService" duration="3600"/>
<cache type="EFT.Services.CompanyLimitService" duration="3600"/>
<cache type="EFT.Services.SvcCompanyService" duration="3600"/>
<cache type="EFT.Services.TestKeyService" duration="3600"/>
<cache type="EFT.Services.BlackListService" duration="3600"/>
<cache type="EFT.Services.CityService" duration="3600"/>
<cache type="EFT.Services.LinkBetweenTPService" duration="3600"/>
<cache type="EFT.Services.SBSectorService" duration="3600"/>
<cache type="EFT.Services.SectorService" duration="3600"/>
<cache type="EFT.Services.SubGroupService" duration="3600"/>
<cache type="EFT.Services.TbTipdocService" duration="3600"/>
<cache type="EFT.Services.UICMiscService" duration="3600"/>
<cache type="EFT.Services.GLService" duration="3600" />
<cache type="EFT.Services.GLHeadIdentifyService" duration="3600" />-->
</cacheConfiguration>
<customizedMessaging>
<relation relating="Users" related="Users;CreatedBy" message="Cannot delete user because this user is owner of other user(s)."/>
<relation relating="Currencies" related="SubCompanyCurrencies;CurrencyID" message="Cannot delete currency because this currency is used in other table(s)."/>
<relation relating="Currencies" related="Companies;CFCurrencyID" message="Cannot delete currency because this currency is used in other table(s)."/>
<relation relating="Currencies" related="Companies;LocalCurrencyID" message="Cannot delete currency because this currency is used in other table(s)."/>
<relation relating="ExportFiles" related="TTMessageItem;FileID" message="Cannot delete export file because it is already exist in message."/>
</customizedMessaging>
<system.web>
<membership defaultProvider="ClientAuthenticationMembershipProvider">
<providers>
<add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri=""/>
</providers>
</membership>
<roleManager defaultProvider="ClientRoleProvider" enabled="true">
<providers>
<add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400"/>
</providers>
</roleManager>
</system.web>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/></startup></configuration>

View File

@ -0,0 +1,158 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{D86975F4-B295-4EC5-8478-834246545BEB}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Ease.SvcHost</RootNamespace>
<AssemblyName>Ease.SvcHost</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SccProjectName>
</SccProjectName>
<SccLocalPath>
</SccLocalPath>
<SccAuxPath>
</SccAuxPath>
<SccProvider>
</SccProvider>
<ApplicationIcon>Resources\eft.ico</ApplicationIcon>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>3.5</OldToolsVersion>
<TargetFrameworkProfile />
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<UseVSHostingProcess>false</UseVSHostingProcess>
<PlatformTarget>AnyCPU</PlatformTarget>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<UseVSHostingProcess>false</UseVSHostingProcess>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="Ease.CoreV35">
<HintPath>..\Library\Ease.CoreV35.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.configuration" />
<Reference Include="System.Configuration.Install" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Runtime.Remoting" />
<Reference Include="System.ServiceProcess" />
<Reference Include="System.Web.Extensions">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data.DataSetExtensions">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="HostConfig.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="RegistryHelper.cs" />
<Compile Include="RemotingHost.cs" />
<Compile Include="HostService.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="ServiceInstaller.cs">
<SubType>Component</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="HostService.resx">
<DependentUpon>HostService.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="ServiceInstaller.resx">
<DependentUpon>ServiceInstaller.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<Content Include="Resources\eft.ico" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Payroll.BO\Payroll.BO.csproj">
<Project>{05c1ac33-e175-48e9-a062-b8bb633a8227}</Project>
<Name>Payroll.BO</Name>
</ProjectReference>
<ProjectReference Include="..\Payroll.Service\Payroll.Service.csproj">
<Project>{4ee4a9a2-5e83-4f19-a162-d4a7169b3976}</Project>
<Name>Payroll.Service</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.5">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.5 %28x86 and x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

133
Ease.SvcHost/HostConfig.cs Normal file
View File

@ -0,0 +1,133 @@
using System;
using System.Xml;
using System.Reflection;
using Ease.CoreV35.Model;
using Ease.CoreV35.Utility;
using System.Runtime.Remoting;
using System.Collections.Generic;
namespace Ease.SvcHost
{
public class HostConfig : ConfigElementTemplate<HostConfig>
{
private int _port;
private CustomErrorsModes _errorModes;
private List<ContainersNode> _containers = new List<ContainersNode>();
public IList<ContainersNode> Containers
{
get { return _containers.AsReadOnly(); }
}
public int Port
{
get { return _port; }
}
public CustomErrorsModes ErrorModes
{
get { return _errorModes; }
}
public static HostConfig GetConfig()
{
return GetConfig("Ease.svcHost");
}
protected override void Parse(XmlElement node)
{
this.CheckRequiredAttributes(node, "port");
if (!int.TryParse(node.GetAttribute("port"), out _port))
RaiseError(node, "Invalid value for attribute port: {0}", node.GetAttribute("port"));
string errorMode = node.GetAttribute("errorMode");
if (string.IsNullOrEmpty(errorMode))
_errorModes = CustomErrorsModes.Off;
else
if (Enum.IsDefined(typeof(CustomErrorsModes), errorMode))
_errorModes = (CustomErrorsModes)Enum.Parse(typeof(CustomErrorsModes), errorMode);
base.AddChildren<ContainersNode>(node, "containers", _containers);
}
public class ContainersNode : ConfigChildElementTemplate<ContainersNode, HostConfig>
{
private Assembly _assembly;
private WellKnownObjectMode _activationMode;
private List<Type> _types = new List<Type>();
private List<MethodNode> _finalizers = new List<MethodNode>();
private List<MethodNode> _initializers = new List<MethodNode>();
public WellKnownObjectMode ActivationMode
{
get { return _activationMode; }
}
public IList<Type> Types
{
get { return _types; }
}
public Assembly Assembly
{
get { return _assembly; }
}
public IList<MethodNode> Initializers
{
get { return _initializers; }
}
public IList<MethodNode> Finalizers
{
get { return _finalizers; }
}
protected override void Parse(XmlElement node)
{
this.CheckRequiredAttributes(node, "assembly");
_assembly = Assembly.Load(node.GetAttribute("assembly"));
this.AddChildren<MethodNode>(node, "initializer", _initializers);
this.AddChildren<MethodNode>(node, "finalizer", _finalizers);
this.CheckRequiredAttributes(node, "activation");
string activation = node.GetAttribute("activation");
if (!Enum.IsDefined(typeof(WellKnownObjectMode), activation))
RaiseError(node, "Invalid value :{0} for activation (expecting SingleCall or Singleton)", activation);
_activationMode = (WellKnownObjectMode)Enum.Parse(typeof(WellKnownObjectMode), activation);
foreach (Type type in _assembly.GetTypes())
{
if (type.IsMarshalByRef && type.BaseType == typeof(ServiceTemplate))
_types.Add(type);
}
}
}
public class MethodNode : ConfigChildElementTemplate<MethodNode, ContainersNode>
{
private MethodInfo _method;
public MethodInfo Method
{
get { return _method; }
}
protected override void Parse(XmlElement node)
{
CheckRequiredAttributes(node, "type", "method");
string typeName = node.GetAttribute("type") + "," + _parent.Assembly.FullName;
Type type = Type.GetType(typeName);
if (type == null)
RaiseError(node, "Type not found: {0}", typeName);
_method = type.GetMethod(node.GetAttribute("method"), BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static);
if (_method == null)
RaiseError(node, "Specified (static) method not found: {0}.{1}()", type.FullName, node.GetAttribute("method"));
}
}
}
}

View File

@ -0,0 +1,75 @@
using System;
using System.Diagnostics;
using System.ServiceProcess;
using System.ComponentModel;
namespace Ease.SvcHost
{
[ToolboxItem(false)]
public class HostService : ServiceBase
{
/// <summary>
/// Required designer variable.
/// </summary>
private RemotingHost _host;
private System.ComponentModel.Container components = null;
public HostService(string name)
{
// This call is required by the Windows.Forms Component Designer.
InitializeComponent();
base.ServiceName = name;
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
//
// RemotingHostService
//
this.ServiceName = "ServiceHost";
}
#endregion
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
/// <summary>
/// Set things in motion so your service can do its work.
/// </summary>
protected override void OnStart(string[] args)
{
_host = new RemotingHost();
_host.Start();
EventLog.WriteEntry(_host.Status);
}
/// <summary>
/// Stop this service.
/// </summary>
protected override void OnStop()
{
_host.Stop();
EventLog.WriteEntry(_host.Status);
}
}
}

View File

@ -0,0 +1,109 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 1.3
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">1.3</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1">this is my long string</data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
[base64 mime encoded serialized .NET Framework object]
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
[base64 mime encoded string representing a byte array form of the .NET Framework object]
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used forserialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="$this.Name">
<value>RemotingHostService</value>
</data>
</root>

119
Ease.SvcHost/Program.cs Normal file
View File

@ -0,0 +1,119 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration.Install;
using System.ServiceProcess;
namespace Ease.SvcHost
{
class Program
{
private const string Help =
"Ease.SvcHost Usage:\n"
+ "------------------------------------------------------\n"
+ "Ease.SvcHost -r[un]\n"
+ "Ease.SvcHost -i[nstall] name [\"... description ...\"]\n"
+ "Ease.SvcHost -u[ninstall] name\n\n"
+ "Notes:\n"
+ "Use quotes around name if name contains spaces.\n"
+ "Use -r option to verify host configuration in interactive mode.";
/// <summary>
/// Entry Point
///
/// </summary>
/// <param name="args"></param>
static void Main(string[] args)
{
if (args.Length > 0)
{
switch (args[0].ToLower())
{
case "-i":
case "-install":
if (args.Length < 2 || args.Length > 3)
{
MessageWait("Wrong number of Arguments\n\n{0}", Help);
return;
}
string n = "-name=" + args[1];
string d = "-desc=" + (args.Length > 2 ? args[2] : "");
try
{
ManagedInstallerClass.InstallHelper(new string[] { n, d, "Ease.SvcHost.exe" });
}
catch (Exception ex)
{
MessageWait("Exception:\n{0}", ex.ToString());
return;
}
MessageWait("");
break;
case "-u":
case "-uninstall":
if (args.Length < 2)
{
MessageWait("Wrong number of Arguments\n\n{0}", Help);
return;
}
try
{
ManagedInstallerClass.InstallHelper(new string[] { "-u", "-name=" + args[1], "Ease.SvcHost.exe" });
}
catch (Exception ex)
{
MessageWait("Exception:\n{0}", ex.ToString());
return;
}
MessageWait("");
break;
case "-r":
case "-run":
RemotingHost host = new RemotingHost();
host.Start();
Console.WriteLine(host.Status);
MessageWait("");
host.Stop();
MessageWait(host.Status);
break;
case "-start":
if (args.Length >= 2)
{
ServiceBase.Run(new HostService(args[1]));
}
break;
case "-?":
case "-h":
MessageWait(Help);
break;
default:
MessageWait("Invalid Arguments\n\n{0}", Help);
break;
}
}
else
{
MessageWait(Help);
}
}
static void MessageWait(string msg, params object[] args)
{
Console.WriteLine("");
Console.WriteLine(string.Format(msg, args));
Console.WriteLine("");
Console.WriteLine("Press Enter to continue ...");
Console.ReadLine();
}
}
}

View File

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Ease.SvcHost")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Computer Ease Limited")]
[assembly: AssemblyProduct("Ease.SvcHost")]
[assembly: AssemblyCopyright("Copyright © Computer Ease Limited 2011")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("f042d93a-0ef3-4950-ad88-8014e32ba44b")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("3.3.1.1")]
[assembly: AssemblyFileVersion("3.3.1.1")]

View File

@ -0,0 +1,28 @@
using System;
using Microsoft.Win32;
using System.Reflection;
namespace Ease.SvcHost
{
public class RegistryHelper
{
public static RegistryKey GetServiceKey(string name)
{
RegistryKey system = Registry.LocalMachine.OpenSubKey("System");
RegistryKey currentControlSet = system.OpenSubKey("CurrentControlSet");
RegistryKey services = currentControlSet.OpenSubKey("Services");
return services.OpenSubKey(name, true);
}
public static RegistryKey GetParameterKey(string name)
{
RegistryKey system = Registry.LocalMachine.OpenSubKey("System");
RegistryKey currentControlSet = system.OpenSubKey("CurrentControlSet");
RegistryKey services = currentControlSet.OpenSubKey("Services");
RegistryKey service = services.OpenSubKey(name);
return service.OpenSubKey("Parameters");
}
private RegistryHelper() {}
}
}

View File

@ -0,0 +1,138 @@
using System;
using System.Configuration;
using System.Runtime.Remoting;
using System.Collections.Generic;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Tcp;
namespace Ease.SvcHost
{
/// <summary>
/// Summary description for RemotingHost.
/// </summary>
public class RemotingHost
{
private HostConfig _config;
private List<IChannelReceiver> _channels = new List<IChannelReceiver>();
private string _status = "";
public string Status
{
get { return _status; }
}
private void Log(string format, params object[] args)
{
if (_status.Length > 0)
_status += Environment.NewLine;
_status += string.Format(format, args);
}
public RemotingHost()
{
_config = HostConfig.GetConfig();
if (_config == null)
throw new ConfigurationErrorsException("ServiceHost configuration missing.");
}
private void InvokeMethod(HostConfig.MethodNode node)
{
try
{
Log("Invoking method: " + node.Method.DeclaringType.FullName + "." + node.Method.Name + "()");
node.Method.Invoke(null, null);
Log("Method Executed.");
}
catch (Exception e)
{
Log("Error: {0}", e.ToString());
}
}
public void Start()
{
_status = "";
if (_config.Port != 0)
{
try
{
TcpServerChannel channel = new TcpServerChannel("RemotingListener", _config.Port);
ChannelServices.RegisterChannel(channel, false);
Log("Tcp channel registered on port {0}.", _config.Port);
Log("Custome Errors: {0}", _config.ErrorModes);
Log("");
_channels.Add(channel);
}
catch (Exception e)
{
Log("Error Registering Channel: {0}.", e.Message);
}
}
// Turn off custom errors (comment if required)
RemotingConfiguration.CustomErrorsMode = _config.ErrorModes;
//container assemblies
foreach (HostConfig.ContainersNode containers in _config.Containers)
{
Log("Loading Containers Assembly: {0}", containers.Assembly.FullName);
// initializers
foreach (HostConfig.MethodNode node in containers.Initializers)
{
InvokeMethod(node);
}
Log("Activation Mode: {0}", containers.ActivationMode);
Log("");
Log("Start-Assembly >>");
foreach (Type type in containers.Types)
{
WellKnownServiceTypeEntry entry = new WellKnownServiceTypeEntry(type, type.FullName, containers.ActivationMode);
RemotingConfiguration.RegisterWellKnownServiceType(type, type.FullName, containers.ActivationMode);
Log("Service -> {0}", type.FullName);
}
Log("<< End-Assembly");
}
}
public void Stop()
{
_status = "";
if (_channels.Count > 0)
{
Log("Stopping channels ...");
foreach (IChannelReceiver channel in _channels)
{
try
{
channel.StopListening(null);
}
catch (Exception e)
{
Log("Error stopping channel: {0}. {1}", channel.ChannelName, e.Message);
}
}
}
foreach (HostConfig.ContainersNode assembly in _config.Containers)
{
if (assembly.Finalizers.Count > 0)
{
Log("{0} Finalizers ...", assembly.Assembly.GetName().Name);
foreach (HostConfig.MethodNode node in assembly.Finalizers)
{
InvokeMethod(node);
}
}
}
Log("Host Stopped.");
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

@ -0,0 +1,67 @@
using System;
using Microsoft.Win32;
using System.Collections;
using System.ComponentModel;
using System.ServiceProcess;
using System.Configuration.Install;
namespace Ease.SvcHost
{
/// <summary>
/// Summary description for Installer.
/// </summary>
[RunInstaller(true), ToolboxItem(false)]
public class HostServiceInstaller : Installer
{
private ServiceInstaller _serviceInstaller;
public HostServiceInstaller()
{
_serviceInstaller = new ServiceInstaller();
_serviceInstaller.StartType = ServiceStartMode.Automatic;
ServiceProcessInstaller processInstaller = new ServiceProcessInstaller();
processInstaller.Account = ServiceAccount.LocalSystem;
Installers.AddRange(new System.Configuration.Install.Installer[] { _serviceInstaller, processInstaller });
}
private string GetServiceName(string name)
{
return string.Format("Ease.SvcHost{0}{1}", (name.Length > 0 ? "_" : ""), name.Replace(" ", "_")).Trim();
}
public override void Install(IDictionary stateSaver)
{
string name = string.Empty, desc = string.Empty;
if (Context.Parameters.ContainsKey("name"))
name = Context.Parameters["name"];
if (Context.Parameters.ContainsKey("desc"))
desc = Context.Parameters["desc"];
_serviceInstaller.DisplayName = string.Format("Ease.SvcHost{0} {1}", (name.Length > 0 ? ":" : ""), name).Trim();
_serviceInstaller.ServiceName = this.GetServiceName(name);
base.Install(stateSaver);
RegistryKey key = RegistryHelper.GetServiceKey(_serviceInstaller.ServiceName);
key.SetValue("ImagePath", (string)key.GetValue("ImagePath") + " -start " + _serviceInstaller.ServiceName);
key.SetValue("Description", desc.Length == 0 ? "Ease Service Host" : desc);
key.Close();
}
public override void Uninstall(IDictionary savedState)
{
string name = string.Empty;
if (Context.Parameters.ContainsKey("name"))
name = Context.Parameters["name"];
_serviceInstaller.ServiceName = this.GetServiceName(name);
base.Uninstall(savedState);
}
}
}

View File

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8" ?>
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="ResMimeType">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="Version">
<value>1.0.0.0</value>
</resheader>
<resheader name="Reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="Writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -0,0 +1,53 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using Ease.Printing;
using Ease.Report;
using Ease.CoreV35.Model;
using Ease.CoreV35.Caching;
using System.Windows.Forms;
namespace Ease.UICreator
{
public class BasicReport
{
ListView.ListViewItemCollection _oCollections = null;
public BasicReport()
{
}
public DataTable CommonReport(ListView.ListViewItemCollection oLSVCollection)
{
DataTable oDT = new DataTable();
DataRow dr = null;
oDT = GetTableForCommon();
_oCollections = oLSVCollection;
try
{
foreach (ListViewItem oLVItem in _oCollections)
{
dr = oDT.NewRow();
dr["Code"] = oLVItem.SubItems[0].Text;
dr["Description"] = oLVItem.SubItems[1].Text;
oDT.Rows.Add(dr);
}
}
catch(Exception ex)
{
MessageBox.Show("Error: " + ex.Message, "For Devloper:");
}
return oDT;
}
private DataTable GetTableForCommon()
{
DataTable table = new DataTable();
table.Columns.AddRange(new DataColumn[] { new DataColumn("Code"),
new DataColumn("Description")});
return table;
}
}
}

View File

@ -0,0 +1,76 @@
using System;
using System.Collections.Generic;
using System.Text;
using Ease.CoreV35.Model;
using Ease.CoreV35.Caching;
using System.Windows.Forms;
namespace Ease.UICreator
{
public delegate void UIConfiguration(System.Windows.Forms.Form form);
public enum enumUIType
{
Tabular = 1,
TreeView = 2
}
public class UICreator
{
public event Ease.UICreator.UIConfiguration IncpUIConfig;
public UICreator(enumUIType uiType)
{
_uiType = uiType;
}
private MasterForm _msterForm;
public MasterForm MasterForm
{
get
{
if (_msterForm == null)
_msterForm = new MasterForm();
return _msterForm;
}
set
{
_msterForm = value;
}
}
private enumUIType _uiType;
public enumUIType UIType
{
get
{
return _uiType;
}
set
{
_uiType = value;
}
}
public void CreatForm()
{
if (_uiType == enumUIType.Tabular)
{
FrmMasterForm oMForm = new FrmMasterForm();
oMForm.UpdateUIDesign += new UIConfiguration(this.UIConfiguration);
oMForm.showDLg(_msterForm);
}
else
{
FrmMasterTreeView oTForm = new FrmMasterTreeView();
oTForm.UpdateUIDesign += new UIConfiguration(this.UIConfiguration);
oTForm.showDLg(_msterForm);
}
}
public void UIConfiguration(System.Windows.Forms.Form form)
{
if (IncpUIConfig != null)
{
IncpUIConfig(form);
}
}
}
}

View File

@ -0,0 +1,251 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="12.0">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{2A8DD5FD-3F1D-4FBC-94B6-BCBDCCAC4CC2}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Ease.UICreator</RootNamespace>
<AssemblyName>Ease.UICreator</AssemblyName>
<SccProjectName>
</SccProjectName>
<SccLocalPath>
</SccLocalPath>
<SccAuxPath>
</SccAuxPath>
<SccProvider>
</SccProvider>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>3.5</OldToolsVersion>
<PublishUrl>http://localhost/Matador.CLSUI/</PublishUrl>
<Install>true</Install>
<InstallFrom>Web</InstallFrom>
<UpdateEnabled>true</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>true</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="Ease.Controls, Version=1.0.1587.34936, Culture=neutral">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Library\Ease.Controls.dll</HintPath>
</Reference>
<Reference Include="Ease.Controls.Win, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Library\Ease.Controls.Win.dll</HintPath>
</Reference>
<Reference Include="Ease.CoreV35, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Library\Ease.CoreV35.dll</HintPath>
</Reference>
<Reference Include="Ease.Excel, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Library\Ease.Excel.dll</HintPath>
</Reference>
<Reference Include="Ease.Printing, Version=1.0.2325.24211, Culture=neutral">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Library\Ease.Printing.dll</HintPath>
</Reference>
<Reference Include="Ease.Report, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Library\Ease.Report.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ReportViewer.Common, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<Reference Include="Microsoft.ReportViewer.WinForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Library\Microsoft.ReportViewer.WinForms.dll</HintPath>
</Reference>
<Reference Include="PdfSharp, Version=0.9.653.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Library\PdfSharp.dll</HintPath>
</Reference>
<Reference Include="SpreadsheetGear, Version=1.4.0.16, Culture=neutral, PublicKeyToken=39c186f5904944ec">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Library\SpreadsheetGear.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Web" />
<Reference Include="System.Web.Services" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="BasicReport.cs" />
<Compile Include="MasterFormTreeView.cs" />
<Compile Include="FrmMasterTreeView.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FrmMasterTreeView.designer.cs">
<DependentUpon>FrmMasterTreeView.cs</DependentUpon>
</Compile>
<Compile Include="CreatForm.cs" />
<Compile Include="SingleFormComboBox.cs" />
<Compile Include="MasterForm.cs" />
<Compile Include="MasterFormListView.cs" />
<Compile Include="SingleForm.cs" />
<Compile Include="SingleFormControl.cs" />
<Compile Include="FrmBasicEntryForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FrmBasicEntryForm.designer.cs">
<DependentUpon>FrmBasicEntryForm.cs</DependentUpon>
</Compile>
<Compile Include="FrmMasterForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FrmMasterForm.designer.cs">
<DependentUpon>FrmMasterForm.cs</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Report.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<Content Include="Resources\Activate.png" />
<None Include="Resources\AddTable1.png" />
<None Include="Resources\AddTable.png" />
<None Include="Resources\Cancel_16x16.png" />
<None Include="Resources\Check_16x16.png" />
<None Include="Resources\Copy_16x16.png" />
<None Include="Resources\cross.gif" />
<None Include="Resources\Cut_16x16.png" />
<None Include="Resources\DataTransfer1.png" />
<Content Include="Resources\Delete.png" />
<None Include="Resources\Desktop.png" />
<None Include="Resources\Edit_16x16.png" />
<Content Include="Resources\Exit.png" />
<None Include="Resources\Exit1.png" />
<None Include="Resources\Find_16x16.png" />
<None Include="Resources\Folder_16x16.png" />
<None Include="Resources\Group.png" />
<None Include="Resources\GStat.png" />
<Content Include="Resources\Help.png" />
<None Include="Resources\Help_48x48.png" />
<Content Include="Resources\Info.png" />
<None Include="Resources\keyring1.png" />
<None Include="Resources\keyring.png" />
<None Include="Resources\Library Folder graphite.png" />
<None Include="Resources\Logo.bmp" />
<Content Include="Resources\MatadorEdit.png" />
<Content Include="Resources\MatadorIconEdit1.png" />
<Content Include="Resources\MatadorIconEdit2.png" />
<None Include="Resources\Mobile.png" />
<None Include="Resources\New Folder.png" />
<None Include="Resources\New_16x16.png" />
<None Include="Resources\Paste_16x16.png" />
<Content Include="Resources\Preview.png" />
<None Include="Resources\Preview1.png" />
<Content Include="Resources\Print.png" />
<None Include="Resources\Print1.png" />
<None Include="Resources\Refresh_16x16.png" />
<None Include="Resources\Remove_16x16.png" />
<Content Include="Resources\Save.png" />
<None Include="Resources\Save_16x16.png" />
<Content Include="Resources\Search.png" />
<None Include="Resources\user.png" />
<None Include="Resources\Upload_16x16.png" />
<None Include="Resources\System Setup.png" />
<None Include="Resources\Stock Index Up_16x16.png" />
<None Include="Resources\Stock Index Down_16x16.png" />
<None Include="Resources\Search_16x16.png" />
<None Include="Resources\Search1.png" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="FrmMasterTreeView.resx">
<DependentUpon>FrmMasterTreeView.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="FrmBasicEntryForm.resx">
<DependentUpon>FrmBasicEntryForm.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="FrmMasterForm.resx">
<DependentUpon>FrmMasterForm.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<SubType>Designer</SubType>
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Framework.2.0">
<Visible>False</Visible>
<ProductName>.NET Framework 2.0 %28x86%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.0">
<Visible>False</Visible>
<ProductName>.NET Framework 3.0 %28x86%29</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Payroll.BO\Payroll.BO.csproj">
<Project>{05C1AC33-E175-48E9-A062-B8BB633A8227}</Project>
<Name>Payroll.BO</Name>
</ProjectReference>
<ProjectReference Include="..\Payroll.Report\Payroll.Report.csproj">
<Project>{4d5240e6-acc2-4a92-8f90-5f5c0a229c80}</Project>
<Name>Payroll.Report</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@ -0,0 +1,799 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Reflection;
using System.Security;
using System.Drawing.Drawing2D;
using Ease.CoreV35.Model;
using Ease.CoreV35.Caching;
namespace Ease.UICreator
{
internal partial class FrmBasicEntryForm : Form
{
#region Declaration
private SingleForm _singleForm;
private ObjectTemplate _Source;
private ObjectTemplate _parentSource;
public event System.EventHandler RefreshParent;
public Ease.UICreator.UIConfiguration IncpUIConfig;
#endregion
#region Function
public FrmBasicEntryForm()
{
InitializeComponent();
_parentSource = null;
}
public bool ShowDialog(SingleForm UIBESF, ObjectTemplate SourceObject)
{
try
{
_singleForm = UIBESF;
_Source = SourceObject;
System.Reflection.PropertyInfo dispMem = (_Source.GetType()).GetProperty("IsNew");
bool isNew = Convert.ToBoolean(dispMem.GetValue(_Source, null).ToString());
if (isNew == true)
{
this.Text = " Add New " + _singleForm.Caption;
}
else
{
this.Text = " Edit " + _singleForm.Caption;
}
_singleForm.Controls.IsDuplicateCtlName();
if (CheckSpell())
{
DesignControl();
RefreshControl();
ResizeFrom();
if (IncpUIConfig != null)
{
this.Name = _singleForm.FormName;
IncpUIConfig(this);
}
this.ShowDialog();
}
return true;
}
catch (Exception e)
{
MessageBox.Show("Error: " + e.Message, "For Developer:");
return false;
}
}
public ObjectTemplate ParentObject
{
set
{
_parentSource = value;
}
}
private void TreeViewUpdate()
{
try
{
if (_parentSource == null) return;
object ovalue = new object();
ovalue = _parentSource.ID;
_Source.GetType().GetProperty("ParentID").SetValue(_Source, ovalue, null);
ovalue = _parentSource.GetType().GetProperty("Tier").GetValue(_parentSource, null);
ovalue = Convert.ToInt32(ovalue) + 1;
_Source.GetType().GetProperty("Tier").SetValue(_Source, ovalue, null);
}
catch (Exception ex)
{
MessageBox.Show("falied to load object from controls. Check control and object datatypes are same. Error:" + ex.Message, "Tree view refresh object", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
public void ResizeFrom()
{
//int nControlCount = 1;
int controlIndex = 0;
int prospectWidth = 0;
//int formWidth = this.Controls[controlIndex].Width + this.Controls[controlIndex + 1].Width;
//int formHeight = this.Controls[controlIndex+1].Height;
//while(nControlCount <this.Controls.Count)
//{
// if (nControlCount != 1)
// {
// prospectWidth=this.Controls[controlIndex].Width + this.Controls[controlIndex + 1].Width;
// if (prospectWidth > formWidth)
// {
// formWidth = prospectWidth;
// }
// formHeight += this.Controls[controlIndex+1].Height;
// }
// nControlCount++;
// controlIndex++;
//}
int formWidth = 0;
int formHeight = 0;
while (controlIndex < this.Controls.Count - 1)
{
if (controlIndex % 2 == 1)
{
prospectWidth = this.Controls[controlIndex].Width + this.Controls[controlIndex + 1].Width;
if (prospectWidth > formWidth)
{
formWidth = prospectWidth;
}
//Old Code for Form Height
//formHeight += 12;
//New Code for Form Height. Updated by Ashifur Rahaman. Date: 21 Dec 2008
formHeight += 7;
}
else
{
formHeight += this.Controls[controlIndex].Height;
}
controlIndex++;
}
this.FormBorderStyle = FormBorderStyle.Sizable;
//Old code for form height
//this.Height = 35 + formHeight;
//New code for form height. Upadted by Ashifur Rahaman. Date: 21 Dec 2008
this.Height = 100 + _singleForm.Controls[_singleForm.Controls.Count - 1].PositionY;
// this.Width = 45 + formWidth;
this.FormBorderStyle = FormBorderStyle.FixedDialog;
this.StartPosition = FormStartPosition.CenterParent;
}
public void DesignControl()
{
int TabIndex = 0;
foreach (SingleFormControl UIBESFItem in _singleForm.Controls)
{
switch (UIBESFItem.ControlType)
{
case BESFControlEnum.Lebel:
System.Windows.Forms.Label label = new Label();
label.Text = UIBESFItem.Caption;
label.Name = UIBESFItem.Name;
label.BackColor = Color.Transparent;
label.AutoSize = true;
label.Location = new System.Drawing.Point(UIBESFItem.PositionX, UIBESFItem.PositionY);
label.Size = new System.Drawing.Size(UIBESFItem.Width, UIBESFItem.Height);
label.BorderStyle = System.Windows.Forms.BorderStyle.None;
label.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
label.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
label.AutoSize = false;
this.Controls.Add(label);
break;
case BESFControlEnum.Text:
System.Windows.Forms.TextBox txtBox = new TextBox();
//Old code for textBox Caption
//txtBox.Text = "";
//New Code for TextBox Caption. Updated by Ashifur Rahaman. Date: 21 Dec 2008
txtBox.Text = UIBESFItem.Caption;
txtBox.Name = UIBESFItem.Name;
if (txtBox.Name.ToLower().Contains("Qty") || txtBox.Name.ToLower().Contains("Quantity") || txtBox.Name.ToLower().Contains("amount"))
{
txtBox.TextAlign = HorizontalAlignment.Right;
}
if (UIBESFItem.Height > 20)
txtBox.Multiline = true;
txtBox.BorderStyle = BorderStyle.FixedSingle;
txtBox.Location = new System.Drawing.Point(UIBESFItem.PositionX, UIBESFItem.PositionY);
txtBox.Size = new System.Drawing.Size(UIBESFItem.Width, UIBESFItem.Height);
txtBox.ReadOnly = UIBESFItem.IsReadOnly;
txtBox.MaxLength = UIBESFItem.MaxLength;
//updated by Ashifur Rahaman. Date: 21 Dec 2008
//for setting background color and tab stop to a control
if (txtBox.ReadOnly)
{
//txtBox.BackColor = UIBESFItem.BackColor;
txtBox.BackColor = Color.Ivory;
}
if (UIBESFItem.IsTabStop) txtBox.TabStop = true;
if (UIBESFItem.IsFocused) txtBox.Focus();
this.Controls.Add(txtBox);
break;
case BESFControlEnum.Combo:
System.Windows.Forms.ComboBox cboBox = new ComboBox();
cboBox.Name = UIBESFItem.Name;
cboBox.Location = new System.Drawing.Point(UIBESFItem.PositionX, UIBESFItem.PositionY);
cboBox.Size = new System.Drawing.Size(UIBESFItem.Width, UIBESFItem.Height);
cboBox.DropDownStyle = (UIBESFItem.CboBox.ComboType == enmComboType.CBTDropDown) ?
System.Windows.Forms.ComboBoxStyle.DropDown : System.Windows.Forms.ComboBoxStyle.DropDownList;
cboBox.FormattingEnabled = true;
// Type type = UIBESFItem.CboBox.ComboSource.GetType();
if (UIBESFItem.CboBox.PopulatedFrom == enmCboPopulatedFrom.Enum)
{
char[] delimiter = new char[1];
delimiter[0] = '|';
string strEnum = UIBESFItem.CboBox.DisplayName.ToString();
string[] strValues = strEnum.Split(delimiter);
foreach (string strItem in strValues)
{
cboBox.Items.Add(strItem.Substring(0, strItem.IndexOf('=')));
}
}
else
{
foreach (var item in UIBESFItem.CboBox.ComboSource)
{
string str = "";
System.Reflection.PropertyInfo dispMem = item.GetType().GetProperty(UIBESFItem.CboBox.DisplayName);
str = dispMem.GetValue(item, null).ToString();
cboBox.Items.Add(str);
}
}
this.Controls.Add(cboBox);
break;
case BESFControlEnum.Check:
System.Windows.Forms.CheckBox ochkBox = new CheckBox();
ochkBox.Text = UIBESFItem.Caption;
ochkBox.Name = UIBESFItem.Name;
ochkBox.BackColor = Color.Transparent;
ochkBox.Location = new System.Drawing.Point(UIBESFItem.PositionX, UIBESFItem.PositionY);
ochkBox.Size = new System.Drawing.Size(UIBESFItem.Width, UIBESFItem.Height);
ochkBox.UseVisualStyleBackColor = true;
this.Controls.Add(ochkBox);
break;
case BESFControlEnum.DTPicker:
System.Windows.Forms.DateTimePicker dtPicker = new DateTimePicker();
dtPicker.CustomFormat = "dd MMM yyyy";
dtPicker.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
dtPicker.Location = new System.Drawing.Point(UIBESFItem.PositionX, UIBESFItem.PositionY);
dtPicker.Name = UIBESFItem.Name;
dtPicker.Size = new System.Drawing.Size(UIBESFItem.Width, UIBESFItem.Height);
//dtPicker.Value = DateTime.Now;
this.Controls.Add(dtPicker);
break;
case BESFControlEnum.NumText:
Ease.Controls.EaseNum ctlNum = new Ease.Controls.EaseNum();
ctlNum.Format = "0.00";
ctlNum.InputType = Ease.Controls.NumberType.Currency;
ctlNum.Location = new System.Drawing.Point(UIBESFItem.PositionX, UIBESFItem.PositionY);
ctlNum.Name = UIBESFItem.Name;
ctlNum.Size = new System.Drawing.Size(UIBESFItem.Width, UIBESFItem.Height);
ctlNum.Value = new decimal(new int[] { 0, 0, 0, 131072 });
this.Controls.Add(ctlNum);
break;
case BESFControlEnum.IntNumText:
Ease.Controls.EaseNum ctlNum1 = new Ease.Controls.EaseNum();
ctlNum1.Format = "0";
ctlNum1.InputType = Ease.Controls.NumberType.Integer;
ctlNum1.Location = new System.Drawing.Point(UIBESFItem.PositionX, UIBESFItem.PositionY);
ctlNum1.Name = UIBESFItem.Name;
ctlNum1.Size = new System.Drawing.Size(UIBESFItem.Width, UIBESFItem.Height);
ctlNum1.Value = new decimal(new int[] { 0, 0, 0, 131072 });
this.Controls.Add(ctlNum1);
break;
}
this.Controls[UIBESFItem.Name].TabIndex = TabIndex;
TabIndex = TabIndex + 1;
}
tstrBottom.TabIndex = TabIndex;
TabIndex = TabIndex + 1;
this.Refresh();
}
public bool CheckSpell()
{
bool correct = true;
//int count = 0;
foreach (SingleFormControl UIBESFItem in _singleForm.Controls)
{
System.Reflection.PropertyInfo dispMem = (_Source.GetType()).GetProperty(UIBESFItem.PropertyName);
switch (UIBESFItem.ControlType)
{
case BESFControlEnum.Text:
if (dispMem == null)
{
MessageBox.Show("The property name " + UIBESFItem.PropertyName.ToString() + "\n" + "does not belong to the object " + (_Source.GetType()).Name.ToString());
correct = false;
}
break;
case BESFControlEnum.DTPicker:
if (dispMem == null)
{
MessageBox.Show("The property name " + UIBESFItem.PropertyName.ToString() + "\n" + "does not belong to the object " + (_Source.GetType()).Name.ToString());
correct = false;
}
break;
case BESFControlEnum.Combo:
if (dispMem == null)
{
MessageBox.Show("The property name " + UIBESFItem.PropertyName.ToString() + "\n" + "does not belong to the object " + (_Source.GetType()).Name.ToString());
correct = false;
}
break;
case BESFControlEnum.Check:
if (dispMem == null)
{
MessageBox.Show("The property name " + UIBESFItem.PropertyName.ToString() + "\n" + "does not belong to the object " + (_Source.GetType()).Name.ToString());
correct = false;
}
break;
case BESFControlEnum.NumText:
if (dispMem == null)
{
MessageBox.Show("The property name " + UIBESFItem.PropertyName.ToString() + "\n" + "does not belong to the object " + (_Source.GetType()).Name.ToString());
correct = false;
}
break;
case BESFControlEnum.IntNumText:
if (dispMem == null)
{
MessageBox.Show("The property name " + UIBESFItem.PropertyName.ToString() + "\n" + "does not belong to the object " + (_Source.GetType()).Name.ToString());
correct = false;
}
break;
}
if (correct == false)
{
break;
}
}
return correct;
}
public void RefreshControl()
{
foreach (SingleFormControl UIBESFItem in _singleForm.Controls)
{
System.Reflection.PropertyInfo dispMem = (_Source.GetType()).GetProperty(UIBESFItem.PropertyName);
string str = "";
bool Istierfound = false;
int tier = 0;
ID ParentID = ID.FromInteger(0);
switch (UIBESFItem.ControlType)
{
case BESFControlEnum.Text:
#region Text Box
//str = dispMem.GetValue(_Source, null).ToString();
//this.Controls[UIBESFItem.Name].Text = str;
//check Auto code generate required
// if object state is new, get max code from database through object
// else get value from object property
System.Reflection.PropertyInfo IsNewdispMem = (_Source.GetType()).GetProperty("IsNew");
bool isNew = Convert.ToBoolean(IsNewdispMem.GetValue(_Source, null).ToString());
if (isNew == true && UIBESFItem.IsCodeAutoGenerated == true)
{
try
{
PropertyInfo myPropInfo = _Source.GetType().GetProperty("Tier");
if (myPropInfo != null)
{
if (_parentSource != null)
{
tier = Convert.ToInt32(_parentSource.GetType().GetProperty("Tier").GetValue(_parentSource, null));
tier = tier + 1;
ParentID = (ID)_parentSource.GetType().GetProperty("ID").GetValue(_parentSource, null);
}
else
{
tier = 1;
}
object[] obj = new object[2];
obj[0] = tier;
obj[1] = ParentID.Integer;
Type[] types = new Type[2];
types[0] = ((int)obj[1]).GetType();
types[1] = tier.GetType();
System.Reflection.MethodInfo methodInfo = (_Source.GetType()).GetMethod("GetNextCode", types);
if (methodInfo == null) MessageBox.Show("Method not found in the object", "method not exist", MessageBoxButtons.OK, MessageBoxIcon.Information);
str = (string)methodInfo.Invoke(_Source, obj);
this.Controls[UIBESFItem.Name].Enabled = false;
}
else
{
System.Reflection.MethodInfo methodInfo = (_Source.GetType()).GetMethod("GetNextCode", new Type[0]);
if (methodInfo == null) MessageBox.Show("Method not found in the object", "method not exist", MessageBoxButtons.OK, MessageBoxIcon.Information);
str = (string)methodInfo.Invoke(_Source, null);
this.Controls[UIBESFItem.Name].Enabled = false;
}
}
catch (NullReferenceException ex) { }
}
else
{
if (UIBESFItem.IsCodeAutoGenerated == true)
this.Controls[UIBESFItem.Name].Enabled = false;
object ovalue = dispMem.GetValue(_Source, null);
str = "";
if (ovalue != null)
str = ovalue.ToString();
}
this.Controls[UIBESFItem.Name].Text = str;
#endregion
break;
case BESFControlEnum.DTPicker:
#region Date-Time Picker
str = dispMem.GetValue(_Source, null).ToString();
if (Convert.ToDateTime(str) == DateTime.MinValue)
{
str = DateTime.Now.ToString();
}
((System.Windows.Forms.DateTimePicker)this.Controls[UIBESFItem.Name]).Value = Convert.ToDateTime(str);
#endregion
break;
case BESFControlEnum.Combo:
#region Combo Box
if (UIBESFItem.CboBox.PopulatedFrom == enmCboPopulatedFrom.Enum)
{
#region Enum
// Get value from the object
int nValue = Convert.ToInt32((dispMem.GetValue(_Source, null)));
char[] delimiter = new char[1];
delimiter[0] = '|';
string strEnum = UIBESFItem.CboBox.DisplayName.ToString();
string[] strValues = strEnum.Split(delimiter);
int index = -1;
foreach (string strItem in strValues)
{
index = index + 1;
int nEnumValue = Convert.ToInt32(strItem.Substring(strItem.IndexOf('=') + 1, strItem.Length - strItem.IndexOf('=') - 1));
if (nEnumValue == nValue) break;
}
if (index > -1)
{
((System.Windows.Forms.ComboBox)this.Controls[UIBESFItem.Name]).SelectedIndex = index;
}
#endregion
}
else
{
//ObjectTemplate otmp = UIBESFItem.CboBox.ComboSource.GetItem(cboIndex);
//PropertyValue = otmp.GetType().GetProperty(UIBESFItem.CboBox.DataPropertyName).GetValue(otmp, null);
#region Combo populated from a collection
// extract property value throuth the reflextion
object[] obj = new object[1];
obj[0] = dispMem.GetValue(_Source, null);
//if object type is ID then convert it to int
if (obj[0] is int)
{
obj[0] = ID.FromInteger(Convert.ToInt32(obj[0].ToString()));
}
int index = 0;
// Find the number of items in the combo source to give the selected index
System.Reflection.PropertyInfo oCountProperty = (UIBESFItem.CboBox.ComboSource.GetType()).GetProperty("Count");
index = Convert.ToInt32(oCountProperty.GetValue(UIBESFItem.CboBox.ComboSource, null));
if (index == 0)
{
index = -1;
}
else index = 0;
// If property value not zero it's mean form is edited mode
// and combo selected index should come from source collection
try
{
if (Convert.ToInt32(obj[0].ToString()) != 0)
{
System.Reflection.MethodInfo methodInfo = (UIBESFItem.CboBox.ComboSource.GetType()).GetMethod("GetIndex");
if (methodInfo != null)
{
index = Convert.ToInt32(methodInfo.Invoke(UIBESFItem.CboBox.ComboSource, obj).ToString());
}
}
if (index > -1)
{
((System.Windows.Forms.ComboBox)this.Controls[UIBESFItem.Name]).SelectedIndex = index;
}
}
catch (Exception ex)
{
}
#endregion
}
#endregion
break;
case BESFControlEnum.Check:
#region Check Box
bool bol = Convert.ToBoolean(dispMem.GetValue(_Source, null));
((System.Windows.Forms.CheckBox)this.Controls[UIBESFItem.Name]).Checked = bol;
#endregion
break;
case BESFControlEnum.NumText:
#region Numeric Text Control
if (((Ease.Controls.EaseNum)this.Controls[UIBESFItem.Name]).InputType == Ease.Controls.NumberType.Currency)
{
((Ease.Controls.EaseNum)this.Controls[UIBESFItem.Name]).Value = dispMem.GetValue(_Source, null).ToString();
}
else if (((Ease.Controls.EaseNum)this.Controls[UIBESFItem.Name]).InputType == Ease.Controls.NumberType.Decimal)
{
decimal dbl = Convert.ToDecimal(dispMem.GetValue(_Source, null).ToString());
((Ease.Controls.EaseNum)this.Controls[UIBESFItem.Name]).Value = dbl;
}
else if (((Ease.Controls.EaseNum)this.Controls[UIBESFItem.Name]).InputType == Ease.Controls.NumberType.Double)
{
double dbl = Convert.ToDouble(dispMem.GetValue(_Source, null).ToString());
((Ease.Controls.EaseNum)this.Controls[UIBESFItem.Name]).Value = dbl;
}
else if (((Ease.Controls.EaseNum)this.Controls[UIBESFItem.Name]).InputType == Ease.Controls.NumberType.Integer)
{
Int32 dbl = Convert.ToInt32(dispMem.GetValue(_Source, null).ToString());
((Ease.Controls.EaseNum)this.Controls[UIBESFItem.Name]).Value = dbl;
}
else if (((Ease.Controls.EaseNum)this.Controls[UIBESFItem.Name]).InputType == Ease.Controls.NumberType.LargeInteger)
{
Int64 dbl = Convert.ToInt64(dispMem.GetValue(_Source, null).ToString());
((Ease.Controls.EaseNum)this.Controls[UIBESFItem.Name]).Value = dbl;
}
else if (((Ease.Controls.EaseNum)this.Controls[UIBESFItem.Name]).InputType == Ease.Controls.NumberType.Single)
{
Single dbl = Convert.ToSingle(dispMem.GetValue(_Source, null).ToString());
((Ease.Controls.EaseNum)this.Controls[UIBESFItem.Name]).Value = dbl;
}
else if (((Ease.Controls.EaseNum)this.Controls[UIBESFItem.Name]).InputType == Ease.Controls.NumberType.SmallInteger)
{
Int16 dbl = Convert.ToInt16(dispMem.GetValue(_Source, null).ToString());
((Ease.Controls.EaseNum)this.Controls[UIBESFItem.Name]).Value = dbl;
}
#endregion
break;
case BESFControlEnum.IntNumText:
#region Numeric Text Control
if (((Ease.Controls.EaseNum)this.Controls[UIBESFItem.Name]).InputType == Ease.Controls.NumberType.Currency)
{
((Ease.Controls.EaseNum)this.Controls[UIBESFItem.Name]).Value = dispMem.GetValue(_Source, null).ToString();
}
else if (((Ease.Controls.EaseNum)this.Controls[UIBESFItem.Name]).InputType == Ease.Controls.NumberType.Decimal)
{
decimal dbl = Convert.ToDecimal(dispMem.GetValue(_Source, null).ToString());
((Ease.Controls.EaseNum)this.Controls[UIBESFItem.Name]).Value = dbl;
}
else if (((Ease.Controls.EaseNum)this.Controls[UIBESFItem.Name]).InputType == Ease.Controls.NumberType.Double)
{
double dbl = Convert.ToDouble(dispMem.GetValue(_Source, null).ToString());
((Ease.Controls.EaseNum)this.Controls[UIBESFItem.Name]).Value = dbl;
}
else if (((Ease.Controls.EaseNum)this.Controls[UIBESFItem.Name]).InputType == Ease.Controls.NumberType.Integer)
{
Int32 dbl = Convert.ToInt32(dispMem.GetValue(_Source, null).ToString());
((Ease.Controls.EaseNum)this.Controls[UIBESFItem.Name]).Value = dbl;
}
else if (((Ease.Controls.EaseNum)this.Controls[UIBESFItem.Name]).InputType == Ease.Controls.NumberType.LargeInteger)
{
Int64 dbl = Convert.ToInt64(dispMem.GetValue(_Source, null).ToString());
((Ease.Controls.EaseNum)this.Controls[UIBESFItem.Name]).Value = dbl;
}
else if (((Ease.Controls.EaseNum)this.Controls[UIBESFItem.Name]).InputType == Ease.Controls.NumberType.Single)
{
Single dbl = Convert.ToSingle(dispMem.GetValue(_Source, null).ToString());
((Ease.Controls.EaseNum)this.Controls[UIBESFItem.Name]).Value = dbl;
}
else if (((Ease.Controls.EaseNum)this.Controls[UIBESFItem.Name]).InputType == Ease.Controls.NumberType.SmallInteger)
{
Int16 dbl = Convert.ToInt16(dispMem.GetValue(_Source, null).ToString());
((Ease.Controls.EaseNum)this.Controls[UIBESFItem.Name]).Value = dbl;
}
#endregion
break;
}
if (UIBESFItem.IsFocused)
{
this.Controls[UIBESFItem.Name].Focus();
}
}
}
public void RefreshObject()
{
try
{
foreach (SingleFormControl UIBESFItem in _singleForm.Controls)
{
System.Reflection.PropertyInfo dispMem = (_Source.GetType()).GetProperty(UIBESFItem.PropertyName);
switch (UIBESFItem.ControlType)
{
case BESFControlEnum.Text:
dispMem.SetValue(_Source, this.Controls[UIBESFItem.Name].Text, null);
break;
case BESFControlEnum.DTPicker:
dispMem.SetValue(_Source, ((System.Windows.Forms.DateTimePicker)this.Controls[UIBESFItem.Name]).Value, null);
break;
case BESFControlEnum.Combo:
int cboIndex = ((System.Windows.Forms.ComboBox)this.Controls[UIBESFItem.Name]).SelectedIndex;
object PropertyValue;
if (UIBESFItem.CboBox.PopulatedFrom == enmCboPopulatedFrom.Enum)
{
char[] delimiter = new char[1];
delimiter[0] = '|';
string strEnum = UIBESFItem.CboBox.DisplayName.ToString();
string[] strValues = strEnum.Split(delimiter);
int nEnumValue = Convert.ToInt32(strValues[cboIndex].Substring(strValues[cboIndex].IndexOf('=') + 1,
strValues[cboIndex].Length - strValues[cboIndex].IndexOf('=') - 1));
Type EnumType = dispMem.PropertyType;
PropertyValue = Enum.Parse(EnumType, nEnumValue.ToString());
}
else
{
ObjectTemplate otmp = UIBESFItem.CboBox.ComboSource.GetItem(cboIndex);
PropertyValue = otmp.GetType().GetProperty(UIBESFItem.CboBox.DataPropertyName).GetValue(otmp, null);
}
dispMem.SetValue(_Source, PropertyValue, null);
break;
case BESFControlEnum.Check:
int boolValue = Convert.ToInt32(((CheckBox)this.Controls[UIBESFItem.Name]).Checked);
dispMem.SetValue(_Source, ((CheckBox)this.Controls[UIBESFItem.Name]).Checked, null);
//Type EnumPrpType = dispMem.PropertyType;
//object desiredPropertyValue = Enum.Parse(EnumPrpType, boolValue.ToString());
//dispMem.SetValue(_Source, desiredPropertyValue, null);
break;
case BESFControlEnum.NumText:
dispMem.SetValue(_Source, Convert.ToDouble((((Ease.Controls.EaseNum)this.Controls[UIBESFItem.Name]).Value)), null);
break;
case BESFControlEnum.IntNumText:
dispMem.SetValue(_Source, Convert.ToInt32((((Ease.Controls.EaseNum)this.Controls[UIBESFItem.Name]).Value)), null);
break;
}
}
}
catch (Exception ex)
{
MessageBox.Show("falied to load object from controls. Check control and object datatypes are same. Error:" + ex.Message, "refresh object", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private bool InputValidation()
{
string[] inputValidation = new string[2];
System.Reflection.MethodInfo methodInfo = (_Source.GetType()).GetMethod("InputValidator");
if (methodInfo == null) MessageBox.Show("'InputValidator' function not exist in the source object.", "Input validator", MessageBoxButtons.OK, MessageBoxIcon.Information);
inputValidation = (string[])methodInfo.Invoke(_Source, null);
if (inputValidation != null)
{
//this.Controls[_singleForm.Controls.GetControl(inputValidation[1]).Name].Focus();
MessageBox.Show(inputValidation[0], this.Text + ": Validation Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
return false;
}
return true;
}
#endregion
#region Events
private void btnSave_Click(object sender, EventArgs e)
{
try
{
this.RefreshObject();
this.TreeViewUpdate();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, ":Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
try
{
if (this.InputValidation() == false)
{
return;
}
System.Reflection.MethodInfo methodInfo = (_Source.GetType()).GetMethod("Save");
methodInfo.Invoke(_Source, null);
}
catch (Exception Ex)
{
Type[] types = new Type[1];
ConstructorInfo constructorInfoObj = _Source.GetType().GetConstructor(new Type[0]);
constructorInfoObj.Invoke(_Source, null);
MessageBox.Show("Failed to save into database: Error:" + Ex.InnerException.Message, ":Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
try
{
System.Reflection.PropertyInfo dispMem = (_Source.GetType()).GetProperty("IsNew");
bool isNew = Convert.ToBoolean(dispMem.GetValue(_Source, null).ToString());
if (isNew == true)
{
RefreshParent(_Source, e);
Type[] types = new Type[1];
ConstructorInfo constructorInfoObj = _Source.GetType().GetConstructor(new Type[0]);
constructorInfoObj.Invoke(_Source, null);
if (_singleForm.PropertyValue != null)
{
for (int i = 0; i <= _singleForm.PropertyValue.GetUpperBound(0); i++)
{
System.Reflection.PropertyInfo oProperty = (_Source.GetType()).GetProperty(_singleForm.PropertyValue[i, 0]);
if (oProperty.PropertyType.ToString() == "System.Int32")
{
oProperty.SetValue(_Source, Convert.ToInt32(_singleForm.PropertyValue[i, 1]), null);
}
}
}
this.RefreshControl();
}
else
{
this.Close();
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, ":Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
private void btnCncl_Click(object sender, EventArgs e)
{
this.Close();
}
#endregion
/// <summary>
/// Paint the bottom of the panel
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void pnlBottom_Paint(object sender, PaintEventArgs e)
{
Rectangle BaseRectangle = new Rectangle(0, 0, this.pnlBottom.Width, this.pnlBottom.Height);
Brush Gradient_Brush = new LinearGradientBrush(BaseRectangle, System.Drawing.Color.DarkBlue, System.Drawing.Color.LightBlue, LinearGradientMode.Horizontal);
e.Graphics.FillRectangle(Gradient_Brush, BaseRectangle);
}
private void FrmBasicEntryForm_Paint(object sender, PaintEventArgs e)
{
//Rectangle BaseRectangle = new Rectangle(0, 0, this.Width, this.Height);
//Brush Gradient_Brush = new LinearGradientBrush(BaseRectangle, System.Drawing.Color.WhiteSmoke, System.Drawing.Color.Gainsboro, LinearGradientMode.Horizontal);
//e.Graphics.FillRectangle(Gradient_Brush, BaseRectangle);
}
private void FrmBasicEntryForm_Load(object sender, EventArgs e)
{
}
}
}

View File

@ -0,0 +1,126 @@
namespace Ease.UICreator
{
partial class FrmBasicEntryForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.pnlBottom = new System.Windows.Forms.Panel();
this.tstrBottom = new System.Windows.Forms.ToolStrip();
this.tlbClose = new System.Windows.Forms.ToolStripButton();
this.tlbSave = new System.Windows.Forms.ToolStripButton();
this.pnlBottom.SuspendLayout();
this.tstrBottom.SuspendLayout();
this.SuspendLayout();
//
// pnlBottom
//
this.pnlBottom.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.pnlBottom.Controls.Add(this.tstrBottom);
this.pnlBottom.Location = new System.Drawing.Point(-2, 228);
this.pnlBottom.Name = "pnlBottom";
this.pnlBottom.Size = new System.Drawing.Size(506, 35);
this.pnlBottom.TabIndex = 101;
this.pnlBottom.Paint += new System.Windows.Forms.PaintEventHandler(this.pnlBottom_Paint);
//
// tstrBottom
//
this.tstrBottom.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.tstrBottom.AutoSize = false;
this.tstrBottom.BackColor = System.Drawing.Color.Transparent;
this.tstrBottom.BackgroundImage = global::Ease.UICreator.Properties.Resources.MatadorEdit;
this.tstrBottom.Dock = System.Windows.Forms.DockStyle.None;
this.tstrBottom.GripMargin = new System.Windows.Forms.Padding(0);
this.tstrBottom.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
this.tstrBottom.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.tlbClose,
this.tlbSave});
this.tstrBottom.Location = new System.Drawing.Point(240, 2);
this.tstrBottom.Name = "tstrBottom";
this.tstrBottom.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
this.tstrBottom.Size = new System.Drawing.Size(263, 38);
this.tstrBottom.TabIndex = 100;
this.tstrBottom.Text = "toolStrip1";
//
// tlbClose
//
this.tlbClose.AutoSize = false;
this.tlbClose.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.tlbClose.ForeColor = System.Drawing.Color.DarkSlateGray;
this.tlbClose.Image = global::Ease.UICreator.Properties.Resources.Exit;
this.tlbClose.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;
this.tlbClose.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tlbClose.Name = "tlbClose";
this.tlbClose.Size = new System.Drawing.Size(75, 35);
this.tlbClose.Text = "&Close";
this.tlbClose.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage;
this.tlbClose.Click += new System.EventHandler(this.btnCncl_Click);
//
// tlbSave
//
this.tlbSave.AutoSize = false;
this.tlbSave.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.tlbSave.ForeColor = System.Drawing.Color.DarkSlateGray;
this.tlbSave.Image = global::Ease.UICreator.Properties.Resources.Save;
this.tlbSave.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;
this.tlbSave.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tlbSave.Name = "tlbSave";
this.tlbSave.Size = new System.Drawing.Size(75, 35);
this.tlbSave.Text = "&Save";
this.tlbSave.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage;
this.tlbSave.Click += new System.EventHandler(this.btnSave_Click);
//
// FrmBasicEntryForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.GhostWhite;
this.ClientSize = new System.Drawing.Size(501, 267);
this.Controls.Add(this.pnlBottom);
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "FrmBasicEntryForm";
this.ShowIcon = false;
this.ShowInTaskbar = false;
this.Text = "Caption";
this.Load += new System.EventHandler(this.FrmBasicEntryForm_Load);
this.Paint += new System.Windows.Forms.PaintEventHandler(this.FrmBasicEntryForm_Paint);
this.pnlBottom.ResumeLayout(false);
this.tstrBottom.ResumeLayout(false);
this.tstrBottom.PerformLayout();
this.ResumeLayout(false);
}
#endregion
protected System.Windows.Forms.Panel pnlBottom;
protected System.Windows.Forms.ToolStrip tstrBottom;
protected System.Windows.Forms.ToolStripButton tlbClose;
protected System.Windows.Forms.ToolStripButton tlbSave;
}
}

View File

@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="tstrBottom.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View File

@ -0,0 +1,981 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Drawing2D;
using Ease.CoreV35.Model;
using Ease.CoreV35.Caching;
using Payroll.Report;
using Payroll.BO;
namespace Ease.UICreator
{
internal partial class FrmMasterForm : Form
{
#region variables
private MasterForm _masterForm;
private int _totColWid;
public event Ease.UICreator.UIConfiguration UpdateUIDesign;
#endregion
#region Constructor
public FrmMasterForm()
{
InitializeComponent();
}
#endregion
#region Property
public MasterForm UIBEMF
{
get
{
if (_masterForm == null)
{
_masterForm = new MasterForm();
}
return _masterForm;
}
set
{
_masterForm = value;
}
}
//public object[] RefreshMethodParams
//{
// get { return _refreshMethodParams; }
// set { _refreshMethodParams = value; }
//}
//public string RefreshMethodName
//{
// get { return _refreshMethod; }
// set { _refreshMethod = value; }
//}
#endregion
#region Functions
#region showDLg
public void showDLg(MasterForm UIBEMF)
{
try
{
_masterForm = UIBEMF;
_masterForm.Listviewcloumns.IsDuplicateCtlName();
if (CheckSpellListView())
{
this.Text = _masterForm.Caption;
CreateListView();
RefreshListview();
if (UpdateUIDesign != null)
{
this.Name = _masterForm.FormName;
UpdateUIDesign(this);
}
this.ShowDialog();
}
}
catch(Exception e)
{
MessageBox.Show("Error: " + e.Message, "For Devloper:");
}
}
public void showDLg()
{
try
{
_masterForm.Listviewcloumns.IsDuplicateCtlName();
if (CheckSpellListView())
{
this.Text = _masterForm.Caption;
CreateListView();
RefreshListview();
this.ShowDialog();
}
}
catch (Exception e)
{
MessageBox.Show("Error: " + e.Message, "For Devloper:");
}
}
#endregion
#region CreateListView
private void CreateListView()
{
_totColWid = 0;
int noOfCol = 0;
foreach (MasterFormlvw UIBEMFitem in _masterForm.Listviewcloumns)
{
_totColWid += UIBEMFitem.Width;
noOfCol++;
}
int imageIndex = 0;
if (_totColWid< this.lvwBEMF.Width-15)
{
int extraWidth = (this.lvwBEMF.Width-15) - _totColWid;
int devidedExtraWidth = (int)extraWidth / noOfCol;
foreach (MasterFormlvw UIBEMFitem in _masterForm.Listviewcloumns)
{
this.lvwBEMF.Columns.Add(UIBEMFitem.PropertyName, UIBEMFitem.Caption, UIBEMFitem.Width + devidedExtraWidth, UIBEMFitem.ColumnAlignment, imageIndex);
}
}
else
{
foreach (MasterFormlvw UIBEMFitem in _masterForm.Listviewcloumns)
{
this.lvwBEMF.Columns.Add(UIBEMFitem.PropertyName, UIBEMFitem.Caption, UIBEMFitem.Width, UIBEMFitem.ColumnAlignment, imageIndex);
}
}
}
#endregion
#region CheckSpellListView
private bool CheckSpellListView()
{
bool correct = true;
lvwBEMF.Items.Clear();
foreach (var item in _masterForm.SourceCollection)
{
int count = 0;
foreach (MasterFormlvw UIBEMFitem in _masterForm.Listviewcloumns)
{
count++;
System.Reflection.PropertyInfo dispMem = item.GetType().GetProperty(UIBEMFitem.PropertyName);
if (dispMem == null)
{
MessageBox.Show("The property name " + UIBEMFitem.PropertyName.ToString() + "\n" + "does not belong to the object " + (item.GetType()).Name.ToString());
correct = false;
break;
}
if (correct == false)
{
break;
}
}
}
return correct;
}
#endregion
#region RefreshListview
private void RefreshSourceCollection()
{
try
{
Type EnumPrpType = _masterForm.SingleForm.Source.GetType().GetProperty("Status").PropertyType;
object enumValue = Enum.Parse(EnumPrpType, Convert.ToString(0));
System.Type[] pararemterTypes = new System.Type[1];
pararemterTypes[0] = EnumPrpType;
System.Reflection.MethodInfo methodInfo=null;
if(_masterForm.GetFunctionName=="")
methodInfo = (_masterForm.SingleForm.Source.GetType()).GetMethod("Get", pararemterTypes);
else
methodInfo = (_masterForm.SingleForm.Source.GetType()).GetMethod(_masterForm.GetFunctionName, pararemterTypes);
object[] parameterValue = new object[1];
parameterValue[0] = enumValue;
object ox = methodInfo.Invoke(_masterForm.SingleForm.Source, parameterValue);
IList il = ox as IList;
this._masterForm.SourceCollection = new ObjectsTemplate<ObjectTemplate>();
foreach (var item in il)
{
this._masterForm.SourceCollection.Add((ObjectTemplate)item);
}
}
catch (Exception ex)
{
MessageBox.Show("failed to call the function: get(status). Actual reason:" + ex.Message, "failed to call", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
//this._masterForm.CopyCollList((ObjectsTemplate< ObjectTemplate > )ox);
//if (this.RefreshMethodName == "")
//{
// System.Reflection.MethodInfo methodInfo = (_masterForm.SingleForm.GetType()).GetMethod("Get", new Type[0]);
// object ox = methodInfo.Invoke(_masterForm.SingleForm, null);
// List<ObjectTemplate> items = (List < ObjectTemplate >) ox;
//}
//else
//{
// try
// {
// //System.Reflection.MethodInfo methodInfo = (_masterForm.SourceCollection.GetType()).GetMethod(RefreshMethodName);
// //_masterForm.SourceCollection = methodInfo.Invoke(_masterForm.SourceCollection, RefreshMethodParams);
// }
// catch (Exception e)
// {
// MessageBox.Show(e.Message + "For Developer");
// }
//}
}
private void RefreshListview()
{
lvwBEMF.Items.Clear();
foreach (var item in _masterForm.SourceCollection)
{
ListViewItem ListItem = null;
int i = 0;
foreach (MasterFormlvw UIBEMFitem in _masterForm.Listviewcloumns)
{
string str="";
if (UIBEMFitem.SourceCollection == null)
{
System.Reflection.PropertyInfo dispMem = item.GetType().GetProperty(UIBEMFitem.PropertyName);
if (dispMem.GetValue(item, null).GetType().FullName == "System.DateTime")
str =((DateTime)dispMem.GetValue(item, null)).ToString("dd MMM yyyy");
else str = dispMem.GetValue(item, null).ToString();
//lvwBEMF..BackColor = Color.Navy;
}
else
{
str = "";
}
str = str.Replace("\r\n", ", ");
str = str.Replace(",,", ",");
if (i == 0)
{
ListItem = new ListViewItem(str, 0);
}
else
{
ListItem.SubItems.Add(str);
}
i++;
}
ListItem.Tag = item;
this.lvwBEMF.Items.Add(ListItem);
}
}
#endregion
#endregion
#region Events
private void btnAdd_Click(object sender, EventArgs e)
{
FrmBasicEntryForm form = new FrmBasicEntryForm();
form.RefreshParent += new System.EventHandler(this.AddToColl);
form.IncpUIConfig += new UIConfiguration(this.SingleFormUIConfiguration);
form.ShowDialog(_masterForm.SingleForm, _masterForm.SingleForm.Source);
}
private void SingleFormUIConfiguration(System.Windows.Forms.Form frm)
{
if (UpdateUIDesign != null)
{
UpdateUIDesign(frm);
}
}
private void AddToColl(object sender, EventArgs e)
{
if (sender != null)
{
ObjectTemplate oTemplate = (ObjectTemplate)sender;
//_masterForm.SourceCollection.Add(oTemplate);
//RefreshSourceCollection();
//RefreshListview();
CollectAndLoadListView();
}
}
private void btnEdit_Click(object sender, EventArgs e)
{
if (!btnEdit.Enabled)
return;
if (lvwBEMF.SelectedItems.Count <=0)
{
MessageBox.Show("Select an Item", "Edit", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
ObjectTemplate oLocked = (ObjectTemplate)lvwBEMF.SelectedItems[0].Tag;
//object item = oLocked.GetType().GetProperty("Locked").GetValue(oLocked, null);
//object itemLocked = oLocked.GetType().GetProperty("Locked").GetValue(oLocked, null);
//if (!(bool)itemLocked)
//{
// MessageBox.Show("Inorder to edit first lock the record.", "Cannot Edit", MessageBoxButtons.OK, MessageBoxIcon.Stop);
// return;
//}
FrmBasicEntryForm form = new FrmBasicEntryForm();
form.IncpUIConfig += new UIConfiguration(this.SingleFormUIConfiguration);
form.ShowDialog(_masterForm.SingleForm,(ObjectTemplate)lvwBEMF.SelectedItems[0].Tag);
CollectAndLoadListView();
//RefreshSourceCollection();
//RefreshListview();
}
private void btnDel_Click(object sender, EventArgs e)
{
if (lvwBEMF.SelectedItems.Count <= 0)
{
MessageBox.Show("Select an Item", "Delete", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
if (MessageBox.Show("Are you sure to delete selected item.!", "Confirm Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
{
return;
}
try
{
ObjectTemplate oDele =(ObjectTemplate) lvwBEMF.SelectedItems[0].Tag;
object[] obj = new object[1];
obj[0] = oDele.ID;
System.Reflection.MethodInfo methodInfoDel = (oDele.GetType()).GetMethod("Delete");
methodInfoDel.Invoke(oDele, obj);
_masterForm.SourceCollection.Remove(oDele.ID);
ListViewItem oLItem = lvwBEMF.SelectedItems[0];
lvwBEMF.Items.Remove(oLItem);
lvwBEMF.Refresh();
CollectAndLoadListView();
//RefreshSourceCollection();
//RefreshListview();
MessageBox.Show("Data deleted successfully. ", "Deleted", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
catch (Exception exp)
{
MessageBox.Show(exp.InnerException.Message, "Can't Delete", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void Active(object sender, EventArgs e)
{
//if (lvwBEMF.SelectedItems.Count <= 0)
//{
// MessageBox.Show("Select an Item", "Delete", MessageBoxButtons.OK, MessageBoxIcon.Information);
// return;
//}
//if (MessageBox.Show("Are you sure to delete selected item.!", "Confirm Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
//{
// return;
//}
//try
//{
// ObjectTemplate oDele = (ObjectTemplate)lvwBEMF.SelectedItems[0].Tag;
// object[] obj = new object[1];
// obj[0] = oDele.ID;
// Type EnumPrpType = _masterForm.SingleForm.Source.GetType().GetProperty("Status").PropertyType;
// object enumValue = Enum.Parse(EnumPrpType, Convert.ToString(1)); // 1 mean Active
// System.Reflection.PropertyInfo pinfo = (oDele.GetType()).GetProperty("Status");
// pinfo.SetValue(oDele, enumValue,null);
// System.Reflection.MethodInfo methodInfoDel = (oDele.GetType()).GetMethod("Save");
// methodInfoDel.Invoke(oDele, obj);
// _masterForm.SourceCollection.Remove(oDele.ID);
// lvwBEMF.Refresh();
// RefreshSourceCollection();
// RefreshListview();
// MessageBox.Show("Data deleted successfully. ", "Deleted", MessageBoxButtons.OK, MessageBoxIcon.Information);
//}
//catch (Exception exp)
//{
// MessageBox.Show(exp.InnerException.Message, "Can't Delete", MessageBoxButtons.OK, MessageBoxIcon.Error);
//}
}
#endregion
private void btnClose_Click(object sender, EventArgs e)
{
this.Close();
}
private void lvwBEMF_ColumnClick(object sender, ColumnClickEventArgs e)
{
try
{
//object[] param = new object[2];
//param[0] = _masterForm.Listviewcloumns[e.Column].PropertyName;
//param[1] = System.Windows.Forms.SortOrder.Descending;
//System.Reflection.MethodInfo methodInfoDel = (_masterForm.SourceCollection.GetType()).GetMethod("Sort");
//if (methodInfoDel != null)
// methodInfoDel.Invoke(_masterForm.SourceCollection, param);
//RefreshListview();
ListViewSorter Sorter = new ListViewSorter();
lvwBEMF.ListViewItemSorter = Sorter;
if (!(lvwBEMF.ListViewItemSorter is ListViewSorter))
return;
Sorter = (ListViewSorter)lvwBEMF.ListViewItemSorter;
if (lvwBEMF.Sorting == SortOrder.Ascending)
lvwBEMF.Sorting = SortOrder.Descending;
else
lvwBEMF.Sorting = SortOrder.Ascending;
Sorter.ByColumn = e.Column;
lvwBEMF.Sort();
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void lvwBEMF_SelectedIndexChanged(object sender, EventArgs e)
{
ObjectTemplate oDele = null;
try
{
if (lvwBEMF.SelectedItems.Count > 0)
{
oDele = (ObjectTemplate)lvwBEMF.SelectedItems[0].Tag;
object[] obj = new object[1];
obj[0] = oDele.ID;
object status = oDele.GetType().GetProperty("Status").GetValue(oDele, null);
//object oLocked = oDele.GetType().GetProperty("Locked").GetValue(oDele, null);
if (status.ToString() == "Active")
{
btnActive.Text = "InActive";
}
else
{
btnActive.Text = "Active";
}
//if (Convert.ToBoolean(oLocked))
//{
// btnLock.Text = "Unlock";
//}
//else
//{
// btnLock.Text = "Lock";
//}
}
}
catch (Exception exp)
{
MessageBox.Show(exp.InnerException.Message, "Active", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
//private void btnPreview_Click(object sender, EventArgs e)
//{
// Report report = new Report(_masterForm);
// report.ReportOutput(Ease.Report.Designer.OutputType.OutPutTypePreview);
//}
//private void btnPrint_Click(object sender, EventArgs e)
//{
// Report report = new Report(_masterForm);
// report.ReportOutput(Ease.Report.Designer.OutputType.OutPutTypePrint);
//}
//private void btnExport_Click(object sender, EventArgs e)
//{
// Report report = new Report(_masterForm);
// report.ReportOutput(Ease.Report.Designer.OutputType.OutPutTypeExportXL);
//}
private void FrmMasterForm_Load(object sender, EventArgs e)
{
}
/// <summary>
/// Paint the bottom of the panel
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void pnlBottom_Paint(object sender, PaintEventArgs e)
{
Rectangle BaseRectangle = new Rectangle(0, 0, this.pnlBottom.Width, this.pnlBottom.Height);
Brush Gradient_Brush = new LinearGradientBrush(BaseRectangle, System.Drawing.Color.LightBlue, System.Drawing.Color.DarkBlue, LinearGradientMode.Vertical);
e.Graphics.FillRectangle(Gradient_Brush, BaseRectangle);
}
private void FrmMasterForm_Paint(object sender, PaintEventArgs e)
{
//Rectangle BaseRectangle = new Rectangle(0, 0, this.Width, this.Height);
//Brush Gradient_Brush = new LinearGradientBrush(BaseRectangle, System.Drawing.Color.WhiteSmoke, System.Drawing.Color.Gainsboro, LinearGradientMode.Horizontal);
//e.Graphics.FillRectangle(Gradient_Brush, BaseRectangle);
}
private void btnActive_Click(object sender, EventArgs e)
{
if (lvwBEMF.SelectedItems.Count <= 0)
{
MessageBox.Show("Select an Item", "Active/InActive", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
if (MessageBox.Show("Are you sure to status change selected item.!", "Confirm Active/InActive", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
{
return;
}
try
{
ObjectTemplate oActive = (ObjectTemplate)lvwBEMF.SelectedItems[0].Tag;
object[] obj = new object[1];
obj[0] = oActive.ID;
object status = oActive.GetType().GetProperty("Status").GetValue(oActive, null);
object enumValue = null;
if(status.ToString()=="Active")
{
Type EnumPrpType = _masterForm.SingleForm.Source.GetType().GetProperty("Status").PropertyType;
enumValue = Enum.Parse(EnumPrpType, Convert.ToString(2));
System.Reflection.PropertyInfo pinfo = (oActive.GetType()).GetProperty("Status");
pinfo.SetValue(oActive, enumValue, null);
System.Reflection.MethodInfo methodInfoDel = (oActive.GetType()).GetMethod("Save");
methodInfoDel.Invoke(oActive, null);
lvwBEMF.Refresh();
//RefreshSourceCollection();
//RefreshListview();
CollectAndLoadListView();
MessageBox.Show("Data InActive successfully. ", "InActive", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else
{
//Modified By Chapal
//if (this._masterForm.FormName.ToLower() == "froles")
//{
// object createdBy = oActive.GetType().GetProperty("CreatedBy").GetValue(oActive, null);
// if (createdBy.ToString() == Payroll.BO.User.CurrentUser.ID.Integer.ToString())
// {
// MessageBox.Show("You cannot active this role.", "Failed to active", MessageBoxButtons.OK, MessageBoxIcon.Error);
// return;
// }
// System.Reflection.PropertyInfo pinfo1 = (oActive.GetType()).GetProperty("AuthorizedBy");
// pinfo1.SetValue(oActive, Payroll.BO.User.CurrentUser.ID, null);
//}
Type EnumPrpType = _masterForm.SingleForm.Source.GetType().GetProperty("Status").PropertyType;
enumValue = Enum.Parse(EnumPrpType, Convert.ToString(1));
System.Reflection.PropertyInfo pinfo = (oActive.GetType()).GetProperty("Status");
pinfo.SetValue(oActive, enumValue, null);
System.Reflection.MethodInfo methodInfoDel = (oActive.GetType()).GetMethod("Save");
methodInfoDel.Invoke(oActive, null);
lvwBEMF.Refresh();
//RefreshSourceCollection();
//RefreshListview();
CollectAndLoadListView();
MessageBox.Show("Data Activated successfully. ", "Activated", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
catch (Exception exp)
{
MessageBox.Show(exp.InnerException.Message, "Can't Active", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void btnUp_Click(object sender, EventArgs e)
{
try
{
if (lvwBEMF.SelectedItems.Count <= 0)
{
MessageBox.Show("Select an item to set sequence", "Can't Set Sequenct", MessageBoxButtons.OK, MessageBoxIcon.Warning);
lvwBEMF.Focus();
return;
}
if (lvwBEMF.Items.Count <= 1)
{
return;
}
int selectedRowIndex = lvwBEMF.Items.IndexOf(lvwBEMF.SelectedItems[0]);
if (selectedRowIndex < 1)
return;
ObjectTemplate oUp = (ObjectTemplate)lvwBEMF.SelectedItems[0].Tag;
ObjectTemplate oDown = (ObjectTemplate)lvwBEMF.Items[selectedRowIndex - 1].Tag;
//For Up Position
object UpsequenceNo = oUp.GetType().GetProperty("Sequence").GetValue(oUp, null);
object DWsequenceNo = oDown.GetType().GetProperty("Sequence").GetValue(oDown, null);
object TempSeq = UpsequenceNo;
UpsequenceNo = DWsequenceNo;
DWsequenceNo = TempSeq;
System.Reflection.PropertyInfo UPpinfo = (oUp.GetType()).GetProperty("Sequence");
UPpinfo.SetValue(oUp, UpsequenceNo, null);
System.Reflection.MethodInfo methodInfoUp = (oUp.GetType()).GetMethod("Save");
methodInfoUp.Invoke(oUp, null);
System.Reflection.PropertyInfo DWpinfo = (oDown.GetType()).GetProperty("Sequence");
UPpinfo.SetValue(oDown, DWsequenceNo, null);
System.Reflection.MethodInfo methodInfoDW = (oDown.GetType()).GetMethod("Save");
methodInfoDW.Invoke(oDown, null);
lvwBEMF.Refresh();
RefreshSourceCollection();
RefreshListview();
lvwBEMF.Items[selectedRowIndex - 1].Selected = true;
lvwBEMF.SelectedItems[0].BackColor = Color.Navy;
lvwBEMF.SelectedItems[0].ForeColor = Color.White;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Cannot Set Sequence", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
}
private void btnDown_Click(object sender, EventArgs e)
{
try
{
if (lvwBEMF.SelectedItems.Count <= 0)
{
MessageBox.Show("Select an item to set sequence", "Can't Set Sequenct", MessageBoxButtons.OK, MessageBoxIcon.Warning);
lvwBEMF.Focus();
return;
}
if (lvwBEMF.Items.Count <= 1)
{
return;
}
int selectedRowIndex = lvwBEMF.Items.IndexOf(lvwBEMF.SelectedItems[0]);
if (selectedRowIndex >= (lvwBEMF.Items.Count - 1))
return;
ObjectTemplate oUp = (ObjectTemplate)lvwBEMF.Items[selectedRowIndex + 1].Tag;
ObjectTemplate oDown = (ObjectTemplate)lvwBEMF.SelectedItems[0].Tag;
//For Down Position
object UpsequenceNo = oUp.GetType().GetProperty("Sequence").GetValue(oUp, null);
object DWsequenceNo = oDown.GetType().GetProperty("Sequence").GetValue(oDown, null);
object TempSeq = UpsequenceNo;
UpsequenceNo = DWsequenceNo;
DWsequenceNo = TempSeq;
System.Reflection.PropertyInfo UPpinfo = (oUp.GetType()).GetProperty("Sequence");
UPpinfo.SetValue(oUp, UpsequenceNo, null);
System.Reflection.MethodInfo methodInfoUp = (oUp.GetType()).GetMethod("Save");
methodInfoUp.Invoke(oUp, null);
System.Reflection.PropertyInfo DWpinfo = (oDown.GetType()).GetProperty("Sequence");
UPpinfo.SetValue(oDown, DWsequenceNo, null);
System.Reflection.MethodInfo methodInfoDW = (oDown.GetType()).GetMethod("Save");
methodInfoDW.Invoke(oDown, null);
lvwBEMF.Refresh();
RefreshSourceCollection();
RefreshListview();
lvwBEMF.Items[selectedRowIndex + 1].Selected = true;
lvwBEMF.SelectedItems[0].BackColor = Color.Navy;
lvwBEMF.SelectedItems[0].ForeColor = Color.White;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Cannot Set Sequence", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
}
private void CollectAndLoadListView()
{
Type EnumPrpType = _masterForm.SingleForm.Source.GetType().GetProperty("Status").PropertyType;
object enumValue;
if(chkActive.Checked==true)
enumValue = Enum.Parse(EnumPrpType, ((int)EnumStatus.Active).ToString());
else
enumValue = Enum.Parse(EnumPrpType, ((int)EnumStatus.Inactive).ToString());
System.Type[] pararemterTypes = new System.Type[1];
pararemterTypes[0] = EnumPrpType;
System.Reflection.MethodInfo methodInfo = null;
if (_masterForm.GetFunctionName == "")
{
methodInfo = (_masterForm.SingleForm.Source.GetType()).GetMethod("Get", pararemterTypes);
}
else
{
methodInfo = (_masterForm.SingleForm.Source.GetType()).GetMethod(_masterForm.GetFunctionName, pararemterTypes);
}
object[] parameterValue = new object[1];
parameterValue[0] = enumValue;
object ox = methodInfo.Invoke(_masterForm.SingleForm.Source, parameterValue);
IList il = ox as IList;
this._masterForm.SourceCollection = new ObjectsTemplate<ObjectTemplate>();
foreach (var item in il)
{
this._masterForm.SourceCollection.Add((ObjectTemplate)item);
}
RefreshListview();
}
private void chkActive_CheckedChanged(object sender, EventArgs e)
{
CollectAndLoadListView();
}
private void btnPreview_Click(object sender, EventArgs e)
{
DataSet dSet = new DataSet();
String RDLC = string.Empty;
ListView.ListViewItemCollection lsvCollection = this.lvwBEMF.Items;
DataTable oDataTable = null;
BasicReport oBasicReport = new BasicReport();
oDataTable = oBasicReport.CommonReport(lsvCollection);
oDataTable.TableName = "PayrollDataSet_BasicReport";
RDLC = "Payroll.Report.RDLC.BasicReport.rdlc";
dSet.Tables.Add(oDataTable);
fReportViewer form = new fReportViewer();
//_item = ReportItem.GetByReportType(Convert.ToInt32(_reportType));
//PrepareData();
form.ShowDlg(dSet, RDLC);
}
private void bttnClose_Click(object sender, EventArgs e)
{
this.Close();
}
private void btnLock_Click(object sender, EventArgs e)
{
//if (lvwBEMF.SelectedItems.Count <= 0)
//{
// MessageBox.Show("Select an Item", "Lock/Unlock", MessageBoxButtons.OK, MessageBoxIcon.Information);
// return;
//}
//if (MessageBox.Show("Are you sure to lock selected item.!", "Confirm Lock/Unlock", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
//{
// return;
//}
//try
//{
// ObjectTemplate oLocked = (ObjectTemplate)lvwBEMF.SelectedItems[0].Tag;
// object[] obj = new object[1];
// obj[0] = oLocked.ID;
// object item = oLocked.GetType().GetProperty("Locked").GetValue(oLocked, null);
// object itemUSer = oLocked.GetType().GetProperty("ModifiedBy").GetValue(oLocked, null);
// object enumValue = null;
// if ((Boolean)item)
// {
// if (User.CurrentUser.ID.Integer ==Convert.ToInt16(itemUSer.ToString()))
// {
// Type EnumPrpType = _masterForm.SingleForm.Source.GetType().GetProperty("Locked").PropertyType;
// enumValue = false;
// System.Reflection.PropertyInfo pinfo = (oLocked.GetType()).GetProperty("Locked");
// pinfo.SetValue(oLocked, enumValue, null);
// System.Reflection.MethodInfo methodInfoDel = (oLocked.GetType()).GetMethod("Save");
// methodInfoDel.Invoke(oLocked, null);
// lvwBEMF.Refresh();
// RefreshSourceCollection();
// RefreshListview();
// MessageBox.Show("Data unlocked successfully. ", "Unlocked", MessageBoxButtons.OK, MessageBoxIcon.Information);
// }
// else
// {
// MessageBox.Show("This record is locked by another user\nYou cannot unlock this record. ", "Unlock Faild", MessageBoxButtons.OK, MessageBoxIcon.Error);
// }
// }
// else
// {
// Type EnumPrpType = _masterForm.SingleForm.Source.GetType().GetProperty("Locked").PropertyType;
// enumValue = true;
// System.Reflection.PropertyInfo pinfo = (oLocked.GetType()).GetProperty("Locked");
// pinfo.SetValue(oLocked, enumValue, null);
// System.Reflection.MethodInfo methodInfoDel = (oLocked.GetType()).GetMethod("Save");
// methodInfoDel.Invoke(oLocked, null);
// lvwBEMF.Refresh();
// RefreshSourceCollection();
// RefreshListview();
// MessageBox.Show("Data locked successfully. ", "Locked", MessageBoxButtons.OK, MessageBoxIcon.Information);
// }
//}
//catch (Exception exp)
//{
// MessageBox.Show(exp.InnerException.Message, "Can't Lock", MessageBoxButtons.OK, MessageBoxIcon.Error);
//}
}
private void btnAuthorized_Click(object sender, EventArgs e)
{
//if (lvwBEMF.SelectedItems.Count <= 0)
//{
// MessageBox.Show("Select an Item", "Authorize", MessageBoxButtons.OK, MessageBoxIcon.Information);
// return;
//}
//if (MessageBox.Show("Are you sure to authorize change selected item.!", "Confirm Authorize", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
//{
// return;
//}
//try
//{
// ObjectTemplate oAuthorizeed = (ObjectTemplate)lvwBEMF.SelectedItems[0].Tag;
// object[] obj = new object[1];
// obj[0] = oAuthorizeed.ID;
// object item = oAuthorizeed.GetType().GetProperty("Authorized").GetValue(oAuthorizeed, null);
// object itemLocked = oAuthorizeed.GetType().GetProperty("Locked").GetValue(oAuthorizeed, null);
// object enumValue = null;
// if ((bool)itemLocked)
// {
// MessageBox.Show("Selected item is locked,you canott authorize", "Authorization Failed", MessageBoxButtons.OK, MessageBoxIcon.Stop);
// return;
// }
// enumValue = true;
// System.Reflection.PropertyInfo pinfo = (oAuthorizeed.GetType()).GetProperty("Authorized");
// pinfo.SetValue(oAuthorizeed, enumValue, null);
// System.Reflection.MethodInfo methodInfoDel = (oAuthorizeed.GetType()).GetMethod("Save");
// methodInfoDel.Invoke(oAuthorizeed, null);
// lvwBEMF.Refresh();
// RefreshSourceCollection();
// RefreshListview();
// MessageBox.Show("Data authorized successfully. ", "Authorized", MessageBoxButtons.OK, MessageBoxIcon.Information);
//}
//catch (Exception exp)
//{
// MessageBox.Show(exp.InnerException.Message, "Can't Active", MessageBoxButtons.OK, MessageBoxIcon.Error);
//}
}
private void chkAuthorized_CheckedChanged(object sender, EventArgs e)
{
if (chkAuthorized.Checked == true)
{
chkAuthorized.Text = "Only Authorized";
Type EnumPrpType = _masterForm.SingleForm.Source.GetType().GetProperty("Authorized").PropertyType;
object enumValue = true;
System.Type[] pararemterTypes = new System.Type[1];
pararemterTypes[0] = EnumPrpType;
System.Reflection.MethodInfo methodInfo = null;
if (_masterForm.GetFunctionName == "")
{
methodInfo = (_masterForm.SingleForm.Source.GetType()).GetMethod("Get", pararemterTypes);
}
else
{
methodInfo = (_masterForm.SingleForm.Source.GetType()).GetMethod(_masterForm.GetFunctionName, pararemterTypes);
}
object[] parameterValue = new object[1];
parameterValue[0] = enumValue;
object ox = methodInfo.Invoke(_masterForm.SingleForm.Source, parameterValue);
IList il = ox as IList;
this._masterForm.SourceCollection = new ObjectsTemplate<ObjectTemplate>();
foreach (var item in il)
{
this._masterForm.SourceCollection.Add((ObjectTemplate)item);
}
}
else
{
chkAuthorized.Text = "All Data";
Type EnumPrpType = _masterForm.SingleForm.Source.GetType().GetProperty("Authorized").PropertyType;
object enumValue = false;
System.Type[] pararemterTypes = new System.Type[1];
pararemterTypes[0] = EnumPrpType;
System.Reflection.MethodInfo methodInfo = null;
if (_masterForm.GetFunctionName == "")
{
methodInfo = (_masterForm.SingleForm.Source.GetType()).GetMethod("Get", pararemterTypes);
}
else
{
methodInfo = (_masterForm.SingleForm.Source.GetType()).GetMethod(_masterForm.GetFunctionName, pararemterTypes);
}
object[] parameterValue = new object[1];
parameterValue[0] = enumValue;
object ox = methodInfo.Invoke(_masterForm.SingleForm.Source, parameterValue);
IList il = ox as IList;
this._masterForm.SourceCollection = new ObjectsTemplate<ObjectTemplate>();
foreach (var item in il)
{
this._masterForm.SourceCollection.Add((ObjectTemplate)item);
}
}
RefreshListview();
}
}
}
public class ListViewSorter : System.Collections.IComparer
{
public int Compare(object o1, object o2)
{
if (!(o1 is ListViewItem))
return (0);
if (!(o2 is ListViewItem))
return (0);
ListViewItem lvi1 = (ListViewItem)o2;
string str1 = lvi1.SubItems[ByColumn].Text;
ListViewItem lvi2 = (ListViewItem)o1;
string str2 = lvi2.SubItems[ByColumn].Text;
int result;
if (lvi1.ListView.Sorting == SortOrder.Ascending)
result = String.Compare(str1, str2);
else
result = String.Compare(str2, str1);
LastSort = ByColumn;
return (result);
}
public int ByColumn
{
get { return Column; }
set { Column = value; }
}
int Column = 0;
public int LastSort
{
get { return LastColumn; }
set { LastColumn = value; }
}
int LastColumn = 0;
}

379
Ease.UICreator/FrmMasterForm.designer.cs generated Normal file
View File

@ -0,0 +1,379 @@
namespace Ease.UICreator
{
partial class FrmMasterForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.panel1 = new System.Windows.Forms.Panel();
this.lvwBEMF = new System.Windows.Forms.ListView();
this.bttnClose = new System.Windows.Forms.Button();
this.pnlBottom = new System.Windows.Forms.Panel();
this.chkAuthorized = new System.Windows.Forms.CheckBox();
this.toolStrip1 = new System.Windows.Forms.ToolStrip();
this.btnAdd = new System.Windows.Forms.ToolStripButton();
this.btnLock = new System.Windows.Forms.ToolStripButton();
this.btnEdit = new System.Windows.Forms.ToolStripButton();
this.btnAuthorized = new System.Windows.Forms.ToolStripButton();
this.btnDelete = new System.Windows.Forms.ToolStripButton();
this.btnActive = new System.Windows.Forms.ToolStripButton();
this.btnUp = new System.Windows.Forms.ToolStripButton();
this.btnDown = new System.Windows.Forms.ToolStripButton();
this.btnPreview = new System.Windows.Forms.ToolStripButton();
this.tSBrrnClose = new System.Windows.Forms.ToolStripButton();
this.tsActive = new System.Windows.Forms.ToolStripLabel();
this.chkActive = new System.Windows.Forms.CheckBox();
this.panel1.SuspendLayout();
this.pnlBottom.SuspendLayout();
this.toolStrip1.SuspendLayout();
this.SuspendLayout();
//
// panel1
//
this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panel1.Controls.Add(this.lvwBEMF);
this.panel1.Controls.Add(this.bttnClose);
this.panel1.Location = new System.Drawing.Point(7, 7);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(647, 442);
this.panel1.TabIndex = 0;
//
// lvwBEMF
//
this.lvwBEMF.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.lvwBEMF.BackColor = System.Drawing.Color.GhostWhite;
this.lvwBEMF.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.lvwBEMF.FullRowSelect = true;
this.lvwBEMF.GridLines = true;
this.lvwBEMF.Location = new System.Drawing.Point(7, 3);
this.lvwBEMF.Name = "lvwBEMF";
this.lvwBEMF.Size = new System.Drawing.Size(630, 433);
this.lvwBEMF.Sorting = System.Windows.Forms.SortOrder.Ascending;
this.lvwBEMF.TabIndex = 0;
this.lvwBEMF.UseCompatibleStateImageBehavior = false;
this.lvwBEMF.View = System.Windows.Forms.View.Details;
this.lvwBEMF.SelectedIndexChanged += new System.EventHandler(this.lvwBEMF_SelectedIndexChanged);
this.lvwBEMF.DoubleClick += new System.EventHandler(this.btnEdit_Click);
this.lvwBEMF.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.lvwBEMF_ColumnClick);
//
// bttnClose
//
this.bttnClose.BackColor = System.Drawing.Color.Transparent;
this.bttnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.bttnClose.Location = new System.Drawing.Point(431, 292);
this.bttnClose.Name = "bttnClose";
this.bttnClose.Size = new System.Drawing.Size(87, 32);
this.bttnClose.TabIndex = 1;
this.bttnClose.Text = "&Close";
this.bttnClose.UseVisualStyleBackColor = false;
this.bttnClose.Click += new System.EventHandler(this.bttnClose_Click);
//
// pnlBottom
//
this.pnlBottom.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.pnlBottom.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.pnlBottom.Controls.Add(this.chkAuthorized);
this.pnlBottom.Controls.Add(this.toolStrip1);
this.pnlBottom.Location = new System.Drawing.Point(649, 7);
this.pnlBottom.Name = "pnlBottom";
this.pnlBottom.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.pnlBottom.Size = new System.Drawing.Size(118, 442);
this.pnlBottom.TabIndex = 8;
this.pnlBottom.Paint += new System.Windows.Forms.PaintEventHandler(this.pnlBottom_Paint);
//
// chkAuthorized
//
this.chkAuthorized.AutoSize = true;
this.chkAuthorized.BackColor = System.Drawing.Color.Transparent;
this.chkAuthorized.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.chkAuthorized.ForeColor = System.Drawing.Color.Black;
this.chkAuthorized.Location = new System.Drawing.Point(30, 404);
this.chkAuthorized.Name = "chkAuthorized";
this.chkAuthorized.Size = new System.Drawing.Size(63, 17);
this.chkAuthorized.TabIndex = 8;
this.chkAuthorized.Text = "All Data";
this.chkAuthorized.UseVisualStyleBackColor = false;
this.chkAuthorized.Visible = false;
this.chkAuthorized.CheckedChanged += new System.EventHandler(this.chkAuthorized_CheckedChanged);
//
// toolStrip1
//
this.toolStrip1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.toolStrip1.AutoSize = false;
this.toolStrip1.BackColor = System.Drawing.Color.Transparent;
this.toolStrip1.Dock = System.Windows.Forms.DockStyle.None;
this.toolStrip1.GripMargin = new System.Windows.Forms.Padding(0);
this.toolStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
this.toolStrip1.ImageScalingSize = new System.Drawing.Size(23, 23);
this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.btnAdd,
this.btnLock,
this.btnEdit,
this.btnAuthorized,
this.btnDelete,
this.btnActive,
this.btnUp,
this.btnDown,
this.btnPreview,
this.tSBrrnClose,
this.tsActive});
this.toolStrip1.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.VerticalStackWithOverflow;
this.toolStrip1.Location = new System.Drawing.Point(4, -1);
this.toolStrip1.Name = "toolStrip1";
this.toolStrip1.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
this.toolStrip1.Size = new System.Drawing.Size(110, 437);
this.toolStrip1.TabIndex = 7;
this.toolStrip1.TabStop = true;
this.toolStrip1.Text = "toolStrip1";
//
// btnAdd
//
this.btnAdd.AutoSize = false;
this.btnAdd.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnAdd.ForeColor = System.Drawing.Color.Black;
this.btnAdd.Image = global::Ease.UICreator.Properties.Resources.Exit;
this.btnAdd.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btnAdd.Name = "btnAdd";
this.btnAdd.Size = new System.Drawing.Size(85, 35);
this.btnAdd.Tag = "btnAdd";
this.btnAdd.Text = "&Add";
this.btnAdd.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage;
this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click);
//
// btnLock
//
this.btnLock.AutoSize = false;
this.btnLock.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnLock.ForeColor = System.Drawing.Color.Black;
this.btnLock.Image = global::Ease.UICreator.Properties.Resources.AddTable;
this.btnLock.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btnLock.Name = "btnLock";
this.btnLock.Size = new System.Drawing.Size(85, 35);
this.btnLock.Text = "&Lock";
this.btnLock.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage;
this.btnLock.Visible = false;
this.btnLock.Click += new System.EventHandler(this.btnLock_Click);
//
// btnEdit
//
this.btnEdit.AutoSize = false;
this.btnEdit.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnEdit.ForeColor = System.Drawing.Color.Black;
this.btnEdit.Image = global::Ease.UICreator.Properties.Resources.Save;
this.btnEdit.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btnEdit.Name = "btnEdit";
this.btnEdit.Size = new System.Drawing.Size(85, 35);
this.btnEdit.Tag = "btnEdit";
this.btnEdit.Text = "&Edit";
this.btnEdit.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage;
this.btnEdit.Click += new System.EventHandler(this.btnEdit_Click);
//
// btnAuthorized
//
this.btnAuthorized.AutoSize = false;
this.btnAuthorized.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnAuthorized.ForeColor = System.Drawing.Color.Black;
this.btnAuthorized.Image = global::Ease.UICreator.Properties.Resources.Check_16x16;
this.btnAuthorized.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.btnAuthorized.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btnAuthorized.Name = "btnAuthorized";
this.btnAuthorized.Size = new System.Drawing.Size(88, 27);
this.btnAuthorized.Text = "A&uthorize";
this.btnAuthorized.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage;
this.btnAuthorized.Visible = false;
this.btnAuthorized.Click += new System.EventHandler(this.btnAuthorized_Click);
//
// btnDelete
//
this.btnDelete.AutoSize = false;
this.btnDelete.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnDelete.ForeColor = System.Drawing.Color.Black;
this.btnDelete.Image = global::Ease.UICreator.Properties.Resources.Delete;
this.btnDelete.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btnDelete.Name = "btnDelete";
this.btnDelete.Size = new System.Drawing.Size(85, 35);
this.btnDelete.Tag = "btnDelete";
this.btnDelete.Text = "&Delete";
this.btnDelete.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage;
this.btnDelete.Click += new System.EventHandler(this.btnDel_Click);
//
// btnActive
//
this.btnActive.AutoSize = false;
this.btnActive.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnActive.ForeColor = System.Drawing.Color.Black;
this.btnActive.Image = global::Ease.UICreator.Properties.Resources.Exit;
this.btnActive.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btnActive.Name = "btnActive";
this.btnActive.Size = new System.Drawing.Size(85, 35);
this.btnActive.Tag = "btnActive";
this.btnActive.Text = "A&ctive";
this.btnActive.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage;
this.btnActive.Click += new System.EventHandler(this.btnActive_Click);
//
// btnUp
//
this.btnUp.AutoSize = false;
this.btnUp.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnUp.ForeColor = System.Drawing.Color.Black;
this.btnUp.Image = global::Ease.UICreator.Properties.Resources.Stock_Index_Up_16x16;
this.btnUp.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btnUp.Name = "btnUp";
this.btnUp.Size = new System.Drawing.Size(85, 35);
this.btnUp.Tag = "btnUp";
this.btnUp.Text = "&Up";
this.btnUp.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage;
this.btnUp.Visible = false;
this.btnUp.Click += new System.EventHandler(this.btnUp_Click);
//
// btnDown
//
this.btnDown.AutoSize = false;
this.btnDown.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnDown.ForeColor = System.Drawing.Color.Black;
this.btnDown.Image = global::Ease.UICreator.Properties.Resources.Stock_Index_Down_16x16;
this.btnDown.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btnDown.Name = "btnDown";
this.btnDown.Size = new System.Drawing.Size(85, 35);
this.btnDown.Tag = "btnDown";
this.btnDown.Text = "D&own";
this.btnDown.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage;
this.btnDown.Visible = false;
this.btnDown.Click += new System.EventHandler(this.btnDown_Click);
//
// btnPreview
//
this.btnPreview.AutoSize = false;
this.btnPreview.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
this.btnPreview.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnPreview.ForeColor = System.Drawing.Color.Black;
this.btnPreview.Image = global::Ease.UICreator.Properties.Resources.Preview;
this.btnPreview.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btnPreview.Name = "btnPreview";
this.btnPreview.Size = new System.Drawing.Size(85, 35);
this.btnPreview.Text = "&Preview";
this.btnPreview.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage;
this.btnPreview.Click += new System.EventHandler(this.btnPreview_Click);
//
// tSBrrnClose
//
this.tSBrrnClose.AutoSize = false;
this.tSBrrnClose.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
this.tSBrrnClose.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.tSBrrnClose.ForeColor = System.Drawing.Color.Black;
this.tSBrrnClose.Image = global::Ease.UICreator.Properties.Resources.Exit;
this.tSBrrnClose.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tSBrrnClose.Name = "tSBrrnClose";
this.tSBrrnClose.Size = new System.Drawing.Size(85, 35);
this.tSBrrnClose.Text = "&Close";
this.tSBrrnClose.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage;
this.tSBrrnClose.Click += new System.EventHandler(this.btnClose_Click);
//
// tsActive
//
this.tsActive.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.tsActive.ForeColor = System.Drawing.Color.Black;
this.tsActive.Name = "tsActive";
this.tsActive.Size = new System.Drawing.Size(108, 0);
this.tsActive.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage;
this.tsActive.Click += new System.EventHandler(this.chkActive_CheckedChanged);
//
// chkActive
//
this.chkActive.AutoSize = true;
this.chkActive.Checked = true;
this.chkActive.CheckState = System.Windows.Forms.CheckState.Checked;
this.chkActive.Location = new System.Drawing.Point(680, 312);
this.chkActive.Name = "chkActive";
this.chkActive.Size = new System.Drawing.Size(56, 17);
this.chkActive.TabIndex = 8;
this.chkActive.Text = "Active";
this.chkActive.UseVisualStyleBackColor = true;
this.chkActive.CheckedChanged += new System.EventHandler(this.chkActive_CheckedChanged);
//
// FrmMasterForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.AutoSize = true;
this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.BackColor = System.Drawing.Color.GhostWhite;
this.CancelButton = this.bttnClose;
this.ClientSize = new System.Drawing.Size(772, 457);
this.Controls.Add(this.chkActive);
this.Controls.Add(this.pnlBottom);
this.Controls.Add(this.panel1);
this.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "FrmMasterForm";
this.ShowIcon = false;
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Caption";
this.Load += new System.EventHandler(this.FrmMasterForm_Load);
this.Paint += new System.Windows.Forms.PaintEventHandler(this.FrmMasterForm_Paint);
this.panel1.ResumeLayout(false);
this.pnlBottom.ResumeLayout(false);
this.pnlBottom.PerformLayout();
this.toolStrip1.ResumeLayout(false);
this.toolStrip1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.ListView lvwBEMF;
protected System.Windows.Forms.Panel pnlBottom;
private System.Windows.Forms.CheckBox chkActive;
protected System.Windows.Forms.ToolStrip toolStrip1;
protected System.Windows.Forms.ToolStripButton btnEdit;
private System.Windows.Forms.ToolStripButton btnDelete;
protected System.Windows.Forms.ToolStripButton btnActive;
protected System.Windows.Forms.ToolStripButton btnUp;
private System.Windows.Forms.ToolStripButton btnDown;
private System.Windows.Forms.ToolStripButton btnPreview;
private System.Windows.Forms.ToolStripLabel tsActive;
protected System.Windows.Forms.ToolStripButton btnAdd;
private System.Windows.Forms.Button bttnClose;
private System.Windows.Forms.ToolStripButton tSBrrnClose;
protected System.Windows.Forms.ToolStripButton btnLock;
protected System.Windows.Forms.ToolStripButton btnAuthorized;
private System.Windows.Forms.CheckBox chkAuthorized;
}
}

View File

@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View File

@ -0,0 +1,907 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Drawing2D;
using Ease.CoreV35.Model;
using Ease.CoreV35.Caching;
using Payroll.BO;
namespace Ease.UICreator
{
internal partial class FrmMasterTreeView : Form
{
#region variables
private MasterForm _masterForm;
public event Ease.UICreator.UIConfiguration UpdateUIDesign;
#endregion
#region Constructor
public FrmMasterTreeView()
{
InitializeComponent();
}
#endregion
#region Property
public MasterForm UIBEMF
{
get
{
if (_masterForm == null)
{
_masterForm = new MasterForm();
}
return _masterForm;
}
set
{
_masterForm = value;
}
}
#endregion
#region Functions
#region showDLg
public void showDLg(MasterForm UIBEMF)
{
try
{
_masterForm = UIBEMF;
_masterForm.Listviewcloumns.IsDuplicateCtlName();
if (CheckSpellListView())
{
this.Text = _masterForm.Caption;
RefreshListview();
if (UpdateUIDesign != null)
{
this.Name = _masterForm.FormName;
UpdateUIDesign(this);
}
this.ShowDialog();
}
}
catch (Exception e)
{
MessageBox.Show("Error: " + e.Message, "For Devloper:");
}
}
public void showDLg()
{
try
{
_masterForm.Listviewcloumns.IsDuplicateCtlName();
if (CheckSpellListView())
{
this.Text = _masterForm.Caption;
CreateListView();
RefreshListview();
this.ShowDialog();
}
}
catch (Exception e)
{
MessageBox.Show("Error: " + e.Message, "For Devloper:");
}
}
#endregion
#region CreateListView
private void CreateListView()
{
//_totColWid = 0;
//int noOfCol = 0;
//foreach (MasterFormlvw UIBEMFitem in _masterForm.Listviewcloumns)
//{
// _totColWid += UIBEMFitem.Width;
// noOfCol++;
//}
//int imageIndex = 0;
//if (_totColWid< this.lvwBEMF.Width-15)
//{
// int extraWidth = (this.lvwBEMF.Width-15) - _totColWid;
// int devidedExtraWidth = (int)extraWidth / noOfCol;
// foreach (MasterFormlvw UIBEMFitem in _masterForm.Listviewcloumns)
// {
// this.lvwBEMF.Columns.Add(UIBEMFitem.PropertyName, UIBEMFitem.Caption, UIBEMFitem.Width + devidedExtraWidth, UIBEMFitem.ColumnAlignment, imageIndex);
// }
//}
//else
//{
// foreach (MasterFormlvw UIBEMFitem in _masterForm.Listviewcloumns)
// {
// this.lvwBEMF.Columns.Add(UIBEMFitem.PropertyName, UIBEMFitem.Caption, UIBEMFitem.Width, UIBEMFitem.ColumnAlignment, imageIndex);
// }
//}
}
#endregion
#region CheckSpellListView
private bool CheckSpellListView()
{
bool correct = true;
//lvwBEMF.Items.Clear();
//foreach (var item in _masterForm.SourceCollection)
//{
// int count = 0;
// foreach (MasterFormlvw UIBEMFitem in _masterForm.Listviewcloumns)
// {
// count++;
// System.Reflection.PropertyInfo dispMem = item.GetType().GetProperty(UIBEMFitem.PropertyName);
// if (dispMem == null)
// {
// MessageBox.Show("The property name " + UIBEMFitem.PropertyName.ToString() + "\n" + "does not belong to the object " + (item.GetType()).Name.ToString());
// correct = false;
// break;
// }
// if (correct == false)
// {
// break;
// }
// }
//}
return correct;
}
#endregion
#region RefreshListview
private void RefreshSourceCollection()
{
//System.Reflection.MethodInfo methodInfo = (_masterForm.SingleForm.Source.GetType()).GetMethod("GetParents", new Type[0]);
//object ox = methodInfo.Invoke(_masterForm.SingleForm.Source, null);
//List<ObjectTemplate> items = (List<ObjectTemplate>)ox;
//tvMaster.Nodes.Clear();
//object[] parameters = new object[1];
//parameters[0] = parentID;
//System.Reflection.MethodInfo methodInfo = (_masterForm.SingleForm.Source.GetType()).GetMethod("GetParents");
//object ox = methodInfo.Invoke(_masterForm.SingleForm.Source, parameters);
//if (ox == null) return;
//IList il = ox as IList;
//foreach (var item in il)
//{
// TreeNode node = new TreeNode();
// System.Reflection.PropertyInfo dispMem = item.GetType().GetProperty(_masterForm.TreeView.PropertyNames);
// string str = dispMem.GetValue(item, null).ToString();
// System.Reflection.PropertyInfo dispMem1 = item.GetType().GetProperty("Status");
// string str1 = dispMem1.GetValue(item, null).ToString();
// node.Text = str;
// //node.Text = str + "(" + str1 + ")";
// node.Tag = ((ObjectTemplate)item).ID;
// parent.Nodes.Add(node);
//}
try
{
Type EnumPrpType = _masterForm.SingleForm.Source.GetType().GetProperty("Status").PropertyType;
object enumValue = Enum.Parse(EnumPrpType, Convert.ToString(2));
System.Type[] pararemterTypes = new System.Type[1];
pararemterTypes[0] = EnumPrpType;
System.Reflection.MethodInfo methodInfo = null;
if (_masterForm.GetFunctionName == "")
methodInfo = (_masterForm.SingleForm.Source.GetType()).GetMethod("GetParents", pararemterTypes);
else
methodInfo = (_masterForm.SingleForm.Source.GetType()).GetMethod(_masterForm.GetFunctionName, pararemterTypes);
object[] parameterValue = new object[1];
parameterValue[0] = enumValue;
object ox = methodInfo.Invoke(_masterForm.SingleForm.Source, parameterValue);
IList il = ox as IList;
this._masterForm.SourceCollection = new ObjectsTemplate<ObjectTemplate>();
foreach (var item in il)
{
this._masterForm.SourceCollection.Add((ObjectTemplate)item);
}
}
catch (Exception ex)
{
MessageBox.Show("failed to call the function: get(status). Actual reason:" + ex.Message, "failed to call", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void RefreshListview()
{
tvMaster.Nodes.Clear();
TreeNode rootNode = new TreeNode();
rootNode.Text = (_masterForm.TreeView.RootNodeText == "") ? _masterForm.Caption : _masterForm.TreeView.RootNodeText;
tvMaster.Nodes.Add(rootNode);
foreach (var item in _masterForm.SourceCollection)
{
TreeNode NodeItem = new TreeNode();
string str = "";
string sStatus = "";
string sCode = "";
System.Reflection.PropertyInfo dispMem = item.GetType().GetProperty(_masterForm.TreeView.PropertyNames);
str = dispMem.GetValue(item, null).ToString();
System.Reflection.PropertyInfo dispMem1 = item.GetType().GetProperty("Status");
sStatus = dispMem1.GetValue(item, null).ToString();
if (sStatus.Trim() != EnumStatus.Active.ToString())
{
NodeItem.BackColor = Color.Red;
NodeItem.ForeColor = Color.White;
}
System.Reflection.PropertyInfo dispMem2 = item.GetType().GetProperty("Code");
if (dispMem2 != null)
{
sCode = dispMem2.GetValue(item, null).ToString();
str = str + " [" + sCode + "]";
}
str = str.Replace("\r\n", ", ");
str = str.Replace(",,", ",");
sCode = sCode.Replace("\r\n", ", ");
sCode = sCode.Replace(",,", ",");
NodeItem.Text = str;
//NodeItem.Text = str + "(" + sCode + ")";
//NodeItem.Text = str + "(" + str1 + ")";
NodeItem.Tag = item.ID;
//NodeItem.Tag = item;
rootNode.Nodes.Add(NodeItem);
}
}
#endregion
#endregion
#region Events
public void UpdateSingleFormCaption(ObjectTemplate tmp, bool fromAdd)
{
int tier = 0;
if (tmp != null)
{
if (tmp.GetType().GetProperty("Tier") == null)
throw new ServiceException("Object does not has the property; name: Tier");
tier = Convert.ToInt32(tmp.GetType().GetProperty("Tier").GetValue(tmp, null));
}
if (fromAdd == true) tier = tier + 1;
if (_masterForm.TreeView.Tiers.Count >= tier)
_masterForm.SingleForm.Caption = _masterForm.TreeView.Tiers.GetTierName(tier);
}
private void btnAdd_Click(object sender, EventArgs e)
{
if (tvMaster.SelectedNode == null)
{
MessageBox.Show("Select a Node first to add child", "Input validation", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
try
{
FrmBasicEntryForm form = new FrmBasicEntryForm();
form.RefreshParent += new System.EventHandler(this.AddToColl);
form.IncpUIConfig += new UIConfiguration(this.SingleFormUIConfiguration);
ObjectTemplate ot = null;
if (tvMaster.SelectedNode.Tag != null)
{
object[] parameters = new object[1];
parameters[0] = (ID)tvMaster.SelectedNode.Tag;
Type[] oType = new Type[1];
oType[0] = parameters[0].GetType();
System.Reflection.MethodInfo methodInfo = (_masterForm.SingleForm.Source.GetType()).GetMethod("Get", oType);
ot = (ObjectTemplate)methodInfo.Invoke(_masterForm.SingleForm.Source, parameters);
if (ot == null) return;
form.ParentObject = ot;
this.UpdateSingleFormCaption(ot, true);
}
else this.UpdateSingleFormCaption(null, true);
form.ShowDialog(_masterForm.SingleForm, _masterForm.SingleForm.Source);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
private void AddToColl(object sender, EventArgs e)
{
if (sender != null)
{
ObjectTemplate oTemplate = (ObjectTemplate)sender;
TreeNode oNode = new TreeNode();
oNode.Text = Convert.ToString(oTemplate.GetType().GetProperty(_masterForm.TreeView.PropertyNames).GetValue(oTemplate, null));
System.Reflection.PropertyInfo dispMem1 = oTemplate.GetType().GetProperty("Status");
string sStatus = dispMem1.GetValue(oTemplate, null).ToString();
if (sStatus.Trim() != EnumStatus.Active.ToString())
{
oNode.BackColor = Color.Red;
oNode.ForeColor = Color.White;
}
System.Reflection.PropertyInfo dispMem2 = oTemplate.GetType().GetProperty("Code");
if (dispMem2 != null)
{
string sCode = dispMem2.GetValue(oTemplate, null).ToString();
oNode.Text = oNode.Text + " [" + sCode + "]";
}
oNode.Tag = oTemplate.ID;
tvMaster.SelectedNode.Nodes.Add(oNode);
//RefreshListview();
}
}
private void btnEdit_Click(object sender, EventArgs e)
{
if (tvMaster.SelectedNode.Tag == null)
{
MessageBox.Show("Select an Item", "Edit", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
try
{
object[] parameters = new object[1];
parameters[0] = (ID)tvMaster.SelectedNode.Tag;
Type[] oType = new Type[1];
oType[0] = parameters[0].GetType();
System.Reflection.MethodInfo methodInfo = (_masterForm.SingleForm.Source.GetType()).GetMethod("Get", oType);
ObjectTemplate oTemplate = (ObjectTemplate)methodInfo.Invoke(_masterForm.SingleForm.Source, parameters);
if (oTemplate == null) MessageBox.Show("Object ID not found in the Tree view Tab", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information); ;
//object itemLocked = oTemplate.GetType().GetProperty("Locked").GetValue(oTemplate, null);
//if (!(bool)itemLocked)
//{
// MessageBox.Show("Inorder to edit first lock the record.", "Cannot Edit", MessageBoxButtons.OK, MessageBoxIcon.Stop);
// return;
//}
FrmBasicEntryForm form = new FrmBasicEntryForm();
form.IncpUIConfig += new UIConfiguration(this.SingleFormUIConfiguration);
this.UpdateSingleFormCaption(oTemplate, false);
form.ShowDialog(_masterForm.SingleForm, oTemplate);
TreeNode oNode = tvMaster.SelectedNode;
oNode.Text = Convert.ToString(oTemplate.GetType().GetProperty(
_masterForm.TreeView.PropertyNames).GetValue(oTemplate, null));
oNode.Tag = oTemplate.ID;
System.Reflection.PropertyInfo dispMem2 = oTemplate.GetType().GetProperty("Code");
if (dispMem2 != null)
{
string sCode = dispMem2.GetValue(oTemplate, null).ToString();
oNode.Text = oNode.Text + " [" + sCode + "]";
}
// RefreshListview();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void DecorateNode()
{
ObjectTemplate oTemplate = (ObjectTemplate)tvMaster.SelectedNode.Tag;
System.Reflection.PropertyInfo dispMem = oTemplate.GetType().GetProperty(_masterForm.TreeView.PropertyNames);
string str = dispMem.GetValue(oTemplate, null).ToString();
tvMaster.SelectedNode.Text = str;
}
private void btnDel_Click(object sender, EventArgs e)
{
if (tvMaster.SelectedNode.Tag == null)
{
MessageBox.Show("Select an Item", "Delete", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
if (MessageBox.Show("Are you sure to delete selected item.!", "Confirm Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
{
return;
}
try
{
ID oDeledID = (ID)tvMaster.SelectedNode.Tag;
object[] obj = new object[1];
obj[0] = oDeledID;
System.Reflection.MethodInfo methodInfoDel = (_masterForm.SingleForm.Source.GetType()).GetMethod("Delete");
methodInfoDel.Invoke(_masterForm.SingleForm.Source, obj);
tvMaster.SelectedNode.Remove();
MessageBox.Show("Data deleted successfully. ", "Deleted", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
catch (Exception exp)
{
MessageBox.Show(exp.InnerException.Message, "Can't Delete", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
#endregion
private void btnClose_Click(object sender, EventArgs e)
{
this.Close();
}
private void SingleFormUIConfiguration(System.Windows.Forms.Form frm)
{
if (UpdateUIDesign != null)
{
UpdateUIDesign(frm);
}
}
private void lvwBEMF_ColumnClick(object sender, ColumnClickEventArgs e)
{
try
{
object[] param = new object[2];
param[0] = _masterForm.Listviewcloumns[e.Column].PropertyName;
param[1] = System.Windows.Forms.SortOrder.Descending;
System.Reflection.MethodInfo methodInfoDel = (_masterForm.SourceCollection.GetType()).GetMethod("Sort");
if (methodInfoDel != null)
methodInfoDel.Invoke(_masterForm.SourceCollection, param);
RefreshListview();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void lvwBEMF_SelectedIndexChanged(object sender, EventArgs e)
{
}
//private void btnPreview_Click(object sender, EventArgs e)
//{
// Report report = new Report(_masterForm);
// report.ReportOutput(Ease.Report.Designer.OutputType.OutPutTypePreview);
//}
//private void btnPrint_Click(object sender, EventArgs e)
//{
// Report report = new Report(_masterForm);
// report.ReportOutput(Ease.Report.Designer.OutputType.OutPutTypePrint);
//}
//private void btnExport_Click(object sender, EventArgs e)
//{
// Report report = new Report(_masterForm);
// report.ReportOutput(Ease.Report.Designer.OutputType.OutPutTypeExportXL);
//}
private void FrmMasterForm_Load(object sender, EventArgs e)
{
}
/// <summary>
/// Paint the bottom of the panel
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void pnlBottom_Paint(object sender, PaintEventArgs e)
{
Rectangle BaseRectangle = new Rectangle(0, 0, this.pnlBottom.Width, this.pnlBottom.Height);
Brush Gradient_Brush = new LinearGradientBrush(BaseRectangle, System.Drawing.Color.LightBlue, System.Drawing.Color.DarkBlue, LinearGradientMode.Vertical);
e.Graphics.FillRectangle(Gradient_Brush, BaseRectangle);
}
private void FrmMasterForm_Paint(object sender, PaintEventArgs e)
{
//Rectangle BaseRectangle = new Rectangle(0, 0, this.Width, this.Height);
//Brush Gradient_Brush = new LinearGradientBrush(BaseRectangle, System.Drawing.Color.WhiteSmoke, System.Drawing.Color.Gainsboro, LinearGradientMode.Horizontal);
//e.Graphics.FillRectangle(Gradient_Brush, BaseRectangle);
}
private void tvMaster_AfterSelect(object sender, TreeViewEventArgs e)
{
//btnAdd.Enabled = true;
if (tvMaster.SelectedNode.Tag != null)
{
if (tvMaster.SelectedNode.Level == _masterForm.TreeView.NumberOfTier)
{
btnAdd.Enabled = false;
}
else
{
btnAdd.Enabled = true;
}
if (e.Node.Nodes.Count == 0)
RefreshTree(e.Node, (ID)tvMaster.SelectedNode.Tag);
}
}
private void RefreshTree(TreeNode parent, ID parentID)
{
try
{
parent.Nodes.Clear();
object[] parameters = new object[1];
parameters[0] = parentID;
System.Reflection.MethodInfo methodInfo = (_masterForm.SingleForm.Source.GetType()).GetMethod("GetChilds");
object ox = methodInfo.Invoke(_masterForm.SingleForm.Source, parameters);
if (ox == null) return;
IList il = ox as IList;
foreach (var item in il)
{
TreeNode node = new TreeNode();
System.Reflection.PropertyInfo dispMem = item.GetType().GetProperty(_masterForm.TreeView.PropertyNames);
string str = dispMem.GetValue(item, null).ToString();
//System.Reflection.PropertyInfo dispMem1 = item.GetType().GetProperty("Status");
//string sStatus = dispMem1.GetValue(item, null).ToString();
dispMem = item.GetType().GetProperty("Code");
if (dispMem != null)
{
str = str + "[" + dispMem.GetValue(item, null).ToString() + "]";
}
System.Reflection.PropertyInfo dispMem1 = item.GetType().GetProperty("Status");
string sStatus = dispMem1.GetValue(item, null).ToString();
if (sStatus.Trim() != EnumStatus.Active.ToString())
{
node.BackColor = Color.Red;
node.ForeColor = Color.White;
}
node.Text = str;
//node.Text = str + "(" + str1 + ")";
node.Tag = ((ObjectTemplate)item).ID;
parent.Nodes.Add(node);
}
}
catch (ServiceException ex)
{
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
private void btnActive_Click(object sender, EventArgs e)
{
if (tvMaster.SelectedNode.Tag == null)
{
MessageBox.Show("Select an Item", "Active/InActive", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
if (MessageBox.Show("Are you sure to status change selected item.!", "Confirm Active/InActive", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
{
return;
}
try
{
object[] parameters = new object[1];
parameters[0] = (ID)tvMaster.SelectedNode.Tag;
Type[] oType = new Type[1];
oType[0] = parameters[0].GetType();
System.Reflection.MethodInfo methodInfo = (_masterForm.SingleForm.Source.GetType()).GetMethod("Get", oType);
ObjectTemplate oActive = (ObjectTemplate)methodInfo.Invoke(_masterForm.SingleForm.Source, parameters);
if (oActive == null) MessageBox.Show("Object ID not found in the Tree view Tab", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
object status = oActive.GetType().GetProperty("Status").GetValue(oActive, null);
object enumValue = null;
if (status.ToString() == "Active")
{
Type EnumPrpType = _masterForm.SingleForm.Source.GetType().GetProperty("Status").PropertyType;
enumValue = Enum.Parse(EnumPrpType, Convert.ToString(2));
System.Reflection.PropertyInfo pinfo = (oActive.GetType()).GetProperty("Status");
pinfo.SetValue(oActive, enumValue, null);
System.Reflection.MethodInfo methodInfoDel = (oActive.GetType()).GetMethod("Save");
methodInfoDel.Invoke(oActive, null);
tvMaster.Refresh();
RefreshSourceCollection();
RefreshListview();
MessageBox.Show("Data InActive successfully. ", "InActive", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else
{
Type EnumPrpType = _masterForm.SingleForm.Source.GetType().GetProperty("Status").PropertyType;
enumValue = Enum.Parse(EnumPrpType, Convert.ToString(1));
System.Reflection.PropertyInfo pinfo = (oActive.GetType()).GetProperty("Status");
pinfo.SetValue(oActive, enumValue, null);
System.Reflection.MethodInfo methodInfoDel = (oActive.GetType()).GetMethod("Save");
methodInfoDel.Invoke(oActive, null);
tvMaster.Refresh();
RefreshSourceCollection();
RefreshListview();
MessageBox.Show("Data Activated successfully. ", "Activated", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
catch (Exception exp)
{
MessageBox.Show(exp.InnerException.Message, "Can't Active", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void btnUp_Click(object sender, EventArgs e)
{
if(tvMaster.SelectedNode.Tag == null)
{
MessageBox.Show("Select a node first", "Selection", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
try
{
//tvMaster.
}
catch(Exception ex)
{
MessageBox.Show(ex.InnerException.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void btnDown_Click(object sender, EventArgs e)
{
if (tvMaster.SelectedNode.Tag == null)
{
MessageBox.Show("Select a node first", "Selection", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void tvMaster_Click(object sender, EventArgs e)
{
if (tvMaster.SelectedNode.Tag == null)
{
return;
}
try
{
ObjectTemplate oTemplate = null;
object[] parameters = new object[1];
parameters[0] = (ID)tvMaster.SelectedNode.Tag;
Type[] oType = new Type[1];
oType[0] = parameters[0].GetType();
System.Reflection.MethodInfo methodInfo = (_masterForm.SingleForm.Source.GetType()).GetMethod("Get", oType);
oTemplate = (ObjectTemplate)methodInfo.Invoke(_masterForm.SingleForm.Source, parameters);
if (oTemplate == null) MessageBox.Show("Object ID not found in the Tree view Tab", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
object status = oTemplate.GetType().GetProperty("Status").GetValue(oTemplate, null);
//object locked = oTemplate.GetType().GetProperty("Locked").GetValue(oTemplate, null);
if (status.ToString() == "Active")
{
btnActive.Text = "InActive";
}
else
{
btnActive.Text = "Active";
}
//if (Convert.ToBoolean(locked))
//{
// btnLock.Text = "Unlock";
//}
//else
//{
// btnLock.Text = "Lock";
//}
}
catch (Exception exp)
{
MessageBox.Show(exp.InnerException.Message, "Active", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void chkActive_CheckedChanged(object sender, EventArgs e)
{
//if (chkActive.Checked == true)
//{
// chkActive.Text = "Only Active";
// Type EnumPrpType = _masterForm.SingleForm.Source.GetType().GetProperty("Status").PropertyType;
// object enumValue = Enum.Parse(EnumPrpType, Convert.ToString(1));
// System.Type[] pararemterTypes = new System.Type[1];
// pararemterTypes[0] = EnumPrpType;
// System.Reflection.MethodInfo methodInfo = (_masterForm.SingleForm.Source.GetType()).GetMethod("GetParents", pararemterTypes);
// object[] parameterValue = new object[1];
// parameterValue[0] = enumValue;
// object ox = methodInfo.Invoke(_masterForm.SingleForm.Source, parameterValue);
// IList il = ox as IList;
// this._masterForm.SourceCollection = new ObjectsTemplate<ObjectTemplate>();
// foreach (var item in il)
// {
// this._masterForm.SourceCollection.Add((ObjectTemplate)item);
// }
//}
//else
//{
// chkActive.Text = "All";
// Type EnumPrpType = _masterForm.SingleForm.Source.GetType().GetProperty("Status").PropertyType;
// object enumValue = Enum.Parse(EnumPrpType, Convert.ToString(2));
// System.Type[] pararemterTypes = new System.Type[1];
// pararemterTypes[0] = EnumPrpType;
// System.Reflection.MethodInfo methodInfo = (_masterForm.SingleForm.Source.GetType()).GetMethod("GetParents", pararemterTypes);
// object[] parameterValue = new object[1];
// parameterValue[0] = enumValue;
// object ox = methodInfo.Invoke(_masterForm.SingleForm.Source, parameterValue);
// IList il = ox as IList;
// this._masterForm.SourceCollection = new ObjectsTemplate<ObjectTemplate>();
// foreach (var item in il)
// {
// this._masterForm.SourceCollection.Add((ObjectTemplate)item);
// }
//}
//RefreshListview();
}
private void chkAuthorized_CheckedChanged(object sender, EventArgs e)
{
//if (chkAuthorized.Checked == true)
//{
// chkActive.Text = "Only Authorized";
// Type EnumPrpType = _masterForm.SingleForm.Source.GetType().GetProperty("Authorized").PropertyType;
// object enumValue = true;
// System.Type[] pararemterTypes = new System.Type[1];
// pararemterTypes[0] = EnumPrpType;
// System.Reflection.MethodInfo methodInfo = (_masterForm.SingleForm.Source.GetType()).GetMethod("Get", pararemterTypes);
// object[] parameterValue = new object[1];
// parameterValue[0] = enumValue;
// object ox = methodInfo.Invoke(_masterForm.SingleForm.Source, parameterValue);
// IList il = ox as IList;
// this._masterForm.SourceCollection = new ObjectsTemplate<ObjectTemplate>();
// foreach (var item in il)
// {
// this._masterForm.SourceCollection.Add((ObjectTemplate)item);
// }
//}
//else
//{
// chkActive.Text = "All Data";
// Type EnumPrpType = _masterForm.SingleForm.Source.GetType().GetProperty("Authorized").PropertyType;
// object enumValue = false;
// System.Type[] pararemterTypes = new System.Type[1];
// pararemterTypes[0] = EnumPrpType;
// System.Reflection.MethodInfo methodInfo = (_masterForm.SingleForm.Source.GetType()).GetMethod("GetParents", pararemterTypes);
// object[] parameterValue = new object[1];
// parameterValue[0] = enumValue;
// object ox = methodInfo.Invoke(_masterForm.SingleForm.Source, parameterValue);
// IList il = ox as IList;
// this._masterForm.SourceCollection = new ObjectsTemplate<ObjectTemplate>();
// foreach (var item in il)
// {
// this._masterForm.SourceCollection.Add((ObjectTemplate)item);
// }
//}
//RefreshListview();
}
private void btnLock_Click(object sender, EventArgs e)
{
//if (tvMaster.SelectedNode.Tag == null)
//{
// MessageBox.Show("Select an Item", "Active/InActive", MessageBoxButtons.OK, MessageBoxIcon.Information);
// return;
//}
//if (MessageBox.Show("Are you sure to status change selected item.!", "Confirm Active/InActive", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
//{
// return;
//}
//try
//{
// object[] parameters = new object[1];
// parameters[0] = (ID)tvMaster.SelectedNode.Tag;
// Type[] oType = new Type[1];
// oType[0] = parameters[0].GetType();
// System.Reflection.MethodInfo methodInfo = (_masterForm.SingleForm.Source.GetType()).GetMethod("Get", oType);
// ObjectTemplate oLocked = (ObjectTemplate)methodInfo.Invoke(_masterForm.SingleForm.Source, parameters);
// if (oLocked == null) MessageBox.Show("Object ID not found in the Tree view Tab", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
// object item = oLocked.GetType().GetProperty("Locked").GetValue(oLocked, null);
// object itemUSer = oLocked.GetType().GetProperty("ModifiedBy").GetValue(oLocked, null);
// object enumValue = null;
// if ((Boolean)item)
// {
// if (User.CurrentUser.ID.Integer == Convert.ToInt16(itemUSer.ToString()))
// {
// enumValue = false;
// System.Reflection.PropertyInfo pinfo = (oLocked.GetType()).GetProperty("Locked");
// pinfo.SetValue(oLocked, enumValue, null);
// System.Reflection.MethodInfo methodInfoDel = (oLocked.GetType()).GetMethod("Save");
// methodInfoDel.Invoke(oLocked, null);
// tvMaster.Refresh();
// RefreshSourceCollection();
// MessageBox.Show("Data unlocked successfully. ", "Unlocked", MessageBoxButtons.OK, MessageBoxIcon.Information);
// }
// else
// {
// MessageBox.Show("This record is locked by another user\nYou cannot unlock this record. ", "Unlock Faild", MessageBoxButtons.OK, MessageBoxIcon.Error);
// }
// }
// else
// {
// enumValue = true;
// System.Reflection.PropertyInfo pinfo = (oLocked.GetType()).GetProperty("Locked");
// pinfo.SetValue(oLocked, enumValue, null);
// System.Reflection.MethodInfo methodInfoDel = (oLocked.GetType()).GetMethod("Save");
// methodInfoDel.Invoke(oLocked, null);
// tvMaster.Refresh();
// RefreshSourceCollection();
// MessageBox.Show("Data locked successfully. ", "Locked", MessageBoxButtons.OK, MessageBoxIcon.Information);
// }
//}
//catch (Exception exp)
//{
// MessageBox.Show(exp.InnerException.Message, "Can't Lock", MessageBoxButtons.OK, MessageBoxIcon.Error);
//}
}
private void btnAuthorized_Click(object sender, EventArgs e)
{
//if (tvMaster.SelectedNode.Tag == null)
//{
// MessageBox.Show("Select an Item", "Active/InActive", MessageBoxButtons.OK, MessageBoxIcon.Information);
// return;
//}
//if (MessageBox.Show("Are you sure to status change selected item.!", "Confirm Active/InActive", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
//{
// return;
//}
//try
//{
// object[] parameters = new object[1];
// parameters[0] = (ID)tvMaster.SelectedNode.Tag;
// Type[] oType = new Type[1];
// oType[0] = parameters[0].GetType();
// System.Reflection.MethodInfo methodInfo = (_masterForm.SingleForm.Source.GetType()).GetMethod("Get", oType);
// ObjectTemplate oLocked = (ObjectTemplate)methodInfo.Invoke(_masterForm.SingleForm.Source, parameters);
// if (oLocked == null) MessageBox.Show("Object ID not found in the Tree view Tab", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
// object itemLocked = oLocked.GetType().GetProperty("Locked").GetValue(oLocked, null);
// object item = oLocked.GetType().GetProperty("Authorized").GetValue(oLocked, null);
// object enumValue = null;
// if ((bool)itemLocked)
// {
// MessageBox.Show("Selected item is locked,you canott authorize", "Authorization Failed", MessageBoxButtons.OK, MessageBoxIcon.Stop);
// return;
// }
// enumValue = true;
// System.Reflection.PropertyInfo pinfo = (oLocked.GetType()).GetProperty("Authorized");
// pinfo.SetValue(oLocked, enumValue, null);
// System.Reflection.MethodInfo methodInfoDel = (oLocked.GetType()).GetMethod("Save");
// methodInfoDel.Invoke(oLocked, null);
// tvMaster.Refresh();
// RefreshSourceCollection();
// MessageBox.Show("Data authorized successfully. ", "Authorized", MessageBoxButtons.OK, MessageBoxIcon.Information);
//}
//catch (Exception exp)
//{
// MessageBox.Show(exp.InnerException.Message, "Can't Lock", MessageBoxButtons.OK, MessageBoxIcon.Error);
//}
}
}
}

View File

@ -0,0 +1,328 @@
namespace Ease.UICreator
{
partial class FrmMasterTreeView
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.Windows.Forms.TreeNode treeNode9 = new System.Windows.Forms.TreeNode("Node4");
System.Windows.Forms.TreeNode treeNode10 = new System.Windows.Forms.TreeNode("Node3", new System.Windows.Forms.TreeNode[] {
treeNode9});
System.Windows.Forms.TreeNode treeNode11 = new System.Windows.Forms.TreeNode("Node2", new System.Windows.Forms.TreeNode[] {
treeNode10});
System.Windows.Forms.TreeNode treeNode12 = new System.Windows.Forms.TreeNode("Node0", new System.Windows.Forms.TreeNode[] {
treeNode11});
System.Windows.Forms.TreeNode treeNode13 = new System.Windows.Forms.TreeNode("Node5");
System.Windows.Forms.TreeNode treeNode14 = new System.Windows.Forms.TreeNode("Node6");
System.Windows.Forms.TreeNode treeNode15 = new System.Windows.Forms.TreeNode("Node7");
System.Windows.Forms.TreeNode treeNode16 = new System.Windows.Forms.TreeNode("Node1", new System.Windows.Forms.TreeNode[] {
treeNode13,
treeNode14,
treeNode15});
this.panel1 = new System.Windows.Forms.Panel();
this.tvMaster = new System.Windows.Forms.TreeView();
this.bttnClose = new System.Windows.Forms.Button();
this.toolStrip1 = new System.Windows.Forms.ToolStrip();
this.btnAdd = new System.Windows.Forms.ToolStripButton();
this.btnLock = new System.Windows.Forms.ToolStripButton();
this.btnEdit = new System.Windows.Forms.ToolStripButton();
this.btnAuthorized = new System.Windows.Forms.ToolStripButton();
this.btnDelete = new System.Windows.Forms.ToolStripButton();
this.btnActive = new System.Windows.Forms.ToolStripButton();
this.btnClose = new System.Windows.Forms.ToolStripButton();
this.pnlBottom = new System.Windows.Forms.Panel();
this.chkAuthorized = new System.Windows.Forms.CheckBox();
this.chkActive = new System.Windows.Forms.CheckBox();
this.panel1.SuspendLayout();
this.toolStrip1.SuspendLayout();
this.pnlBottom.SuspendLayout();
this.SuspendLayout();
//
// panel1
//
this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panel1.Controls.Add(this.tvMaster);
this.panel1.Controls.Add(this.bttnClose);
this.panel1.Location = new System.Drawing.Point(7, 7);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(404, 483);
this.panel1.TabIndex = 0;
//
// tvMaster
//
this.tvMaster.Location = new System.Drawing.Point(4, 3);
this.tvMaster.Name = "tvMaster";
treeNode9.Name = "Node4";
treeNode9.Text = "Node4";
treeNode10.Name = "Node3";
treeNode10.Text = "Node3";
treeNode11.Name = "Node2";
treeNode11.Text = "Node2";
treeNode12.Name = "Node0";
treeNode12.Text = "Node0";
treeNode13.Name = "Node5";
treeNode13.Text = "Node5";
treeNode14.Name = "Node6";
treeNode14.Text = "Node6";
treeNode15.Name = "Node7";
treeNode15.Text = "Node7";
treeNode16.Name = "Node1";
treeNode16.Text = "Node1";
this.tvMaster.Nodes.AddRange(new System.Windows.Forms.TreeNode[] {
treeNode12,
treeNode16});
this.tvMaster.Size = new System.Drawing.Size(399, 478);
this.tvMaster.TabIndex = 0;
this.tvMaster.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.tvMaster_AfterSelect);
this.tvMaster.Click += new System.EventHandler(this.tvMaster_Click);
//
// bttnClose
//
this.bttnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.bttnClose.Location = new System.Drawing.Point(307, 332);
this.bttnClose.Name = "bttnClose";
this.bttnClose.Size = new System.Drawing.Size(75, 23);
this.bttnClose.TabIndex = 1;
this.bttnClose.Text = "Close";
this.bttnClose.UseVisualStyleBackColor = true;
//
// toolStrip1
//
this.toolStrip1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.toolStrip1.AutoSize = false;
this.toolStrip1.BackColor = System.Drawing.Color.Transparent;
this.toolStrip1.BackgroundImage = global::Ease.UICreator.Properties.Resources.MatadorEdit;
this.toolStrip1.Dock = System.Windows.Forms.DockStyle.None;
this.toolStrip1.GripMargin = new System.Windows.Forms.Padding(0);
this.toolStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
this.toolStrip1.ImageScalingSize = new System.Drawing.Size(23, 23);
this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.btnAdd,
this.btnLock,
this.btnEdit,
this.btnAuthorized,
this.btnDelete,
this.btnActive,
this.btnClose});
this.toolStrip1.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.VerticalStackWithOverflow;
this.toolStrip1.Location = new System.Drawing.Point(7, 2);
this.toolStrip1.Name = "toolStrip1";
this.toolStrip1.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
this.toolStrip1.Size = new System.Drawing.Size(93, 456);
this.toolStrip1.TabIndex = 7;
this.toolStrip1.TabStop = true;
this.toolStrip1.Text = "toolStrip1";
//
// btnAdd
//
this.btnAdd.AutoSize = false;
this.btnAdd.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnAdd.ForeColor = System.Drawing.Color.Black;
this.btnAdd.Image = global::Ease.UICreator.Properties.Resources.Exit;
this.btnAdd.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btnAdd.Name = "btnAdd";
this.btnAdd.Size = new System.Drawing.Size(85, 35);
this.btnAdd.Tag = "btnAdd";
this.btnAdd.Text = "&Add";
this.btnAdd.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage;
this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click);
//
// btnLock
//
this.btnLock.AutoSize = false;
this.btnLock.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnLock.ForeColor = System.Drawing.Color.Black;
this.btnLock.Image = global::Ease.UICreator.Properties.Resources.AddTable;
this.btnLock.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btnLock.Name = "btnLock";
this.btnLock.Size = new System.Drawing.Size(85, 35);
this.btnLock.Text = "&Lock";
this.btnLock.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage;
this.btnLock.Visible = false;
this.btnLock.Click += new System.EventHandler(this.btnLock_Click);
//
// btnEdit
//
this.btnEdit.AutoSize = false;
this.btnEdit.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnEdit.ForeColor = System.Drawing.Color.Black;
this.btnEdit.Image = global::Ease.UICreator.Properties.Resources.Save;
this.btnEdit.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btnEdit.Name = "btnEdit";
this.btnEdit.Size = new System.Drawing.Size(85, 35);
this.btnEdit.Tag = "btnEdit";
this.btnEdit.Text = "&Edit";
this.btnEdit.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage;
this.btnEdit.Click += new System.EventHandler(this.btnEdit_Click);
//
// btnAuthorized
//
this.btnAuthorized.AutoSize = false;
this.btnAuthorized.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnAuthorized.ForeColor = System.Drawing.Color.Black;
this.btnAuthorized.Image = global::Ease.UICreator.Properties.Resources.Check_16x16;
this.btnAuthorized.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.btnAuthorized.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btnAuthorized.Name = "btnAuthorized";
this.btnAuthorized.Size = new System.Drawing.Size(88, 27);
this.btnAuthorized.Text = "A&uthorize";
this.btnAuthorized.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage;
this.btnAuthorized.Visible = false;
this.btnAuthorized.Click += new System.EventHandler(this.btnAuthorized_Click);
//
// btnDelete
//
this.btnDelete.AutoSize = false;
this.btnDelete.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnDelete.ForeColor = System.Drawing.Color.Black;
this.btnDelete.Image = global::Ease.UICreator.Properties.Resources.Delete;
this.btnDelete.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btnDelete.Name = "btnDelete";
this.btnDelete.Size = new System.Drawing.Size(85, 35);
this.btnDelete.Tag = "btnDelete";
this.btnDelete.Text = "&Delete";
this.btnDelete.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage;
this.btnDelete.Click += new System.EventHandler(this.btnDel_Click);
//
// btnActive
//
this.btnActive.AutoSize = false;
this.btnActive.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnActive.ForeColor = System.Drawing.Color.Black;
this.btnActive.Image = global::Ease.UICreator.Properties.Resources.Exit;
this.btnActive.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btnActive.Name = "btnActive";
this.btnActive.Size = new System.Drawing.Size(85, 35);
this.btnActive.Tag = "btnActive";
this.btnActive.Text = "A&ctive";
this.btnActive.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage;
this.btnActive.Click += new System.EventHandler(this.btnActive_Click);
//
// btnClose
//
this.btnClose.AutoSize = false;
this.btnClose.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
this.btnClose.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnClose.ForeColor = System.Drawing.Color.Black;
this.btnClose.Image = global::Ease.UICreator.Properties.Resources.Exit;
this.btnClose.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btnClose.Name = "btnClose";
this.btnClose.Size = new System.Drawing.Size(85, 35);
this.btnClose.Text = "&Close";
this.btnClose.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage;
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
//
// pnlBottom
//
this.pnlBottom.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.pnlBottom.Controls.Add(this.chkAuthorized);
this.pnlBottom.Controls.Add(this.chkActive);
this.pnlBottom.Controls.Add(this.toolStrip1);
this.pnlBottom.Location = new System.Drawing.Point(417, 12);
this.pnlBottom.Name = "pnlBottom";
this.pnlBottom.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.pnlBottom.Size = new System.Drawing.Size(104, 474);
this.pnlBottom.TabIndex = 8;
this.pnlBottom.Paint += new System.Windows.Forms.PaintEventHandler(this.pnlBottom_Paint);
//
// chkAuthorized
//
this.chkAuthorized.AutoSize = true;
this.chkAuthorized.BackColor = System.Drawing.Color.Transparent;
this.chkAuthorized.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.chkAuthorized.ForeColor = System.Drawing.Color.Black;
this.chkAuthorized.Location = new System.Drawing.Point(23, 298);
this.chkAuthorized.Name = "chkAuthorized";
this.chkAuthorized.Size = new System.Drawing.Size(63, 17);
this.chkAuthorized.TabIndex = 10;
this.chkAuthorized.Text = "All Data";
this.chkAuthorized.UseVisualStyleBackColor = false;
this.chkAuthorized.Visible = false;
this.chkAuthorized.CheckedChanged += new System.EventHandler(this.chkAuthorized_CheckedChanged);
//
// chkActive
//
this.chkActive.AutoSize = true;
this.chkActive.Location = new System.Drawing.Point(23, 277);
this.chkActive.Name = "chkActive";
this.chkActive.Size = new System.Drawing.Size(37, 17);
this.chkActive.TabIndex = 9;
this.chkActive.Text = "All";
this.chkActive.UseVisualStyleBackColor = true;
this.chkActive.CheckedChanged += new System.EventHandler(this.chkActive_CheckedChanged);
//
// FrmMasterTreeView
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.AutoSize = true;
this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.BackColor = System.Drawing.Color.GhostWhite;
this.CancelButton = this.bttnClose;
this.ClientSize = new System.Drawing.Size(533, 498);
this.Controls.Add(this.pnlBottom);
this.Controls.Add(this.panel1);
this.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "FrmMasterTreeView";
this.ShowIcon = false;
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Caption";
this.Load += new System.EventHandler(this.FrmMasterForm_Load);
this.Paint += new System.Windows.Forms.PaintEventHandler(this.FrmMasterForm_Paint);
this.panel1.ResumeLayout(false);
this.toolStrip1.ResumeLayout(false);
this.toolStrip1.PerformLayout();
this.pnlBottom.ResumeLayout(false);
this.pnlBottom.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Panel panel1;
protected System.Windows.Forms.ToolStrip toolStrip1;
protected System.Windows.Forms.ToolStripButton btnAdd;
protected System.Windows.Forms.ToolStripButton btnEdit;
private System.Windows.Forms.ToolStripButton btnDelete;
protected System.Windows.Forms.ToolStripButton btnActive;
private System.Windows.Forms.ToolStripButton btnClose;
protected System.Windows.Forms.Panel pnlBottom;
private System.Windows.Forms.TreeView tvMaster;
private System.Windows.Forms.CheckBox chkActive;
private System.Windows.Forms.Button bttnClose;
protected System.Windows.Forms.ToolStripButton btnLock;
protected System.Windows.Forms.ToolStripButton btnAuthorized;
private System.Windows.Forms.CheckBox chkAuthorized;
}
}

View File

@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View File

@ -0,0 +1,141 @@
using System;
using System.Collections.Generic;
using System.Text;
using Ease.CoreV35.Model;
using Ease.CoreV35.Caching;
using System.Collections;
namespace Ease.UICreator
{
public class MasterForm
{
#region Variables
private string _formName;
private int _height;
private int _width;
private string _caption;
private bool _max;
private bool _min;
private ObjectsTemplate<ObjectTemplate> _sourceCollection;
private MasterFormlvws _listviewcloumns;
private MasterFormTreeView _TreeView;
private SingleForm _singleForm;
private string _GetFunctionName;
#endregion
#region Constructor
public MasterForm()
{
_formName = "";
_height = 1000;
_width = 1000;
_caption = "";
_max = true;
_min = true;
_listviewcloumns = new MasterFormlvws();
_singleForm = new SingleForm();
_TreeView = new MasterFormTreeView();
_GetFunctionName = "";
}
#endregion
#region Properties
#region Height
public int Height
{
get { return _height; }
set { _height = value; }
}
#endregion
#region FormName
public string FormName
{
get { return _formName; }
set { _formName = value; }
}
#endregion
#region GetFunctionName
public string GetFunctionName
{
get { return _GetFunctionName; }
set { _GetFunctionName = value; }
}
#endregion
#region Width
public int Width
{
get { return _width; }
set { _width = value; }
}
#endregion
#region Caption
public string Caption
{
get { return _caption; }
set { _caption = value; }
}
#endregion
#region Max
public bool Max
{
get { return _max; }
set { _max = value; }
}
#endregion
#region Min
public bool Min
{
get { return _min; }
set { _min = value; }
}
#endregion
#region SourceCollection
public ObjectsTemplate<ObjectTemplate> SourceCollection
{
get { return _sourceCollection; }
set { _sourceCollection = value; }
}
public void CopyCollList<T>(List<T> source) where T : ObjectTemplate
{
_sourceCollection = new ObjectsTemplate<ObjectTemplate>();
foreach (var item in source)
_sourceCollection.Add(item);
}
#endregion
#region Listviewcloumns
public MasterFormlvws Listviewcloumns
{
get { return _listviewcloumns; }
set { _listviewcloumns = value; }
}
#endregion
#region Tree View
public MasterFormTreeView TreeView
{
get { return _TreeView; }
set { _TreeView = value; }
}
#endregion
#region Basic Entry Form
public SingleForm SingleForm
{
get { return _singleForm; }
set { _singleForm = value; }
}
#endregion
#endregion
}
}

View File

@ -0,0 +1,270 @@
using System;
using System.Collections.Generic;
using System.Collections;
using System.Text;
using System.Windows.Forms;
using Ease.CoreV35;
namespace Ease.UICreator
{
#region Class
public class MasterFormlvw
{
#region variables
private string _caption;
private string _propertyName;
private int _height;
private int _width;
private string _format;
private object _sourceCollection;
private string _sourceRelationProperty;
private HorizontalAlignment _columnAlignment = HorizontalAlignment.Left;
#endregion
#region constructor
public MasterFormlvw()
{
_caption = "";
_propertyName = "";
_height = 100;
_width = 100;
_format = "";
_sourceCollection = null;
_sourceRelationProperty = "";
}
#endregion
#region Properties
#region Caption
public string Caption
{
get { return _caption; }
set { _caption = value; }
}
#endregion
#region Source
public string PropertyName
{
get { return _propertyName; }
set { _propertyName = value; }
}
#endregion
#region Source Object Property
public string sourceRelationProperty
{
get { return _sourceRelationProperty; }
set { _sourceRelationProperty = value; }
}
#endregion
#region Height
public int Height
{
get { return _height; }
set { _height = value; }
}
#endregion
#region Width
public int Width
{
get { return _width; }
set { _width = value; }
}
#endregion
#region Format
public string Format
{
get { return _format; }
set { _format = value; }
}
#endregion
#region SourceCollection
public object SourceCollection
{
get { return _sourceCollection; }
set { _sourceCollection = value; }
}
#endregion
/// <summary>
/// Gets or Sets Column Alignment
/// </summary>
public HorizontalAlignment ColumnAlignment
{
get { return _columnAlignment; }
set { _columnAlignment = value; }
}
#endregion
}
#endregion
#region Collection
public class MasterFormlvws : CollectionBase
{
#region Methods
#region Indexer
public MasterFormlvw this[int index]
{
get
{
return ((MasterFormlvw)List[index]);
}
set
{
List[index] = value;
}
}
#endregion
#region Indexer
public MasterFormlvw this[string PropertyName]
{
get
{
foreach (MasterFormlvw oItem in this)
{
if (oItem.PropertyName == PropertyName)
{
return oItem;
}
}
throw new Exception("Property not exist in the collection");
}
//set
//{
// bool bValid =false ;
// foreach (MasterFormlvw oItem in this)
// {
// if (oItem.PropertyName == PropertyName)
// {
// oItem =value;
// bValid = true;
// }
// }
// if (bValid == false)
// {
// throw new ServiceException("Property not exist in the collection");
// }
//}
}
#endregion
#region Add
public int Add(MasterFormlvw value)
{
return (List.Add(value));
}
public int Add(string caption, string propertyName)
{
MasterFormlvw item = new MasterFormlvw();
item.Caption = caption;
item.PropertyName = propertyName;
return (List.Add(item));
}
public int Add(string caption, string propertyName, int nHeight, int nWidth)
{
MasterFormlvw item = new MasterFormlvw();
item.Caption = caption;
item.PropertyName = propertyName;
item.Height = nHeight;
item.Width = nWidth;
return (List.Add(item));
}
public int Add(string caption, string propertyName, int nHeight, int nWidth, string sFormat)
{
MasterFormlvw item = new MasterFormlvw();
item.Caption = caption;
item.PropertyName = propertyName;
item.Height = nHeight;
item.Width = nWidth;
item.Format = sFormat;
return (List.Add(item));
}
#endregion
#region IndexOf
public int IndexOf(MasterFormlvw value)
{
return (List.IndexOf(value));
}
#endregion
#region Insert
public void Insert(int index, MasterFormlvw value)
{
List.Insert(index, value);
}
#endregion
#region Remove
public void Remove(MasterFormlvw value)
{
List.Remove(value);
}
#endregion
public void IsDuplicateCtlName()
{
int nIndex = -1;
foreach (MasterFormlvw item in this)
{
nIndex = nIndex + 1;
for (int i = 0; i < this.Count; i++)
{
if (nIndex != i)
{
if (this[nIndex].PropertyName == this[i].PropertyName)
{
throw new Exception("Duplicate Control Name Exist:" + this[nIndex].PropertyName);
}
}
}
}
}
#region Contains
public bool Contains(MasterFormlvw value)
{
// If value is not of type MasterFormlvw, this will return false.
return (List.Contains(value));
}
#endregion
#region Migth be needed
//protected override void OnInsert(int index, Object value)
//{
// // Insert additional code to be run only when inserting values.
//}
//protected override void OnRemove(int index, Object value)
//{
// // Insert additional code to be run only when removing values.
//}
//protected override void OnSet(int index, Object oldValue, Object newValue)
//{
// // Insert additional code to be run only when setting values.
//}
//protected override void OnValidate(Object value)
//{
// if (value.GetType() != typeof(MasterFormlvw))
// throw new ArgumentException("value must be of type List view column.", "value");
//}
#endregion
#endregion
}
#endregion
}

View File

@ -0,0 +1,201 @@
using System;
using System.Collections.Generic;
using System.Collections;
using System.Text;
using System.Windows.Forms;
namespace Ease.UICreator
{
#region Class
public class MasterFormTreeView
{
#region variables
// Node text can be multiple property concatation
// Tier Name
// Parent
// Childs
private string _seperator;
private string _propertyNames;
private string _rootNodeText;
private int _numberOfTier;
private FormTreeViewTiers _tiers;
private string _configNode;
#endregion
#region constructor
public MasterFormTreeView()
{
_seperator = "";
_propertyNames = "";
_numberOfTier = 10;
_tiers = null;
_rootNodeText = "";
_configNode = "";
}
#endregion
#region Properties
#region _configuration Node
public string ConfigNodeName
{
get { return _configNode; }
set { _configNode = value; }
}
#endregion
#region _seperator
public string Seperator
{
get { return _seperator; }
set { _seperator = value; }
}
#endregion
#region Source
public string PropertyNames
{
get { return _propertyNames; }
set { _propertyNames = value; }
}
#endregion
#region Source
public int NumberOfTier
{
get { return _numberOfTier; }
set { _numberOfTier = value; }
}
#endregion
#region Root Node Text
public string RootNodeText
{
get { return _rootNodeText; }
set { _rootNodeText = value; }
}
#endregion
#region Source
public FormTreeViewTiers Tiers
{
get {
if (_tiers == null)
{
_tiers = new FormTreeViewTiers();
}
return _tiers; }
set { _tiers = value; }
}
#endregion
#endregion
}
#endregion
#region Collection
public class FormTreeViewTier
{
#region variables
// Node text can be multiple property concatation
// Tier Name
// Parent
// Childs
private string _tierName;
private int _sequence;
#endregion
#region constructor
public FormTreeViewTier()
{
_tierName = "";
_sequence =0;
}
#endregion
#region Properties
#region TierName
public string TierName
{
get { return _tierName; }
set { _tierName = value; }
}
#endregion
#region Source
public int Sequence
{
get { return _sequence; }
set { _sequence = value; }
}
#endregion
#endregion
}
public class FormTreeViewTiers : CollectionBase
{
#region Methods
#region Indexer
public FormTreeViewTier this[int index]
{
get
{
return ((FormTreeViewTier)List[index]);
}
set
{
List[index] = value;
}
}
#endregion
#region Add
public int Add(FormTreeViewTier value)
{
return (List.Add(value));
}
public int Add(string tierName, int sequence)
{
FormTreeViewTier item = new FormTreeViewTier();
item.TierName = tierName;
item.Sequence = sequence;
return (List.Add(item));
}
public string GetTierName(int sequence)
{
foreach (FormTreeViewTier item in this)
{
if(item.Sequence == sequence)
return item.TierName;
}
return "";
}
#endregion
#region IndexOf
public int IndexOf(FormTreeViewTier value)
{
return (List.IndexOf(value));
}
#endregion
#region Insert
public void Insert(int index, FormTreeViewTier value)
{
List.Insert(index, value);
}
#endregion
#region Remove
public void Remove(MasterFormTreeView value)
{
List.Remove(value);
}
#endregion
#endregion
}
#endregion
}

View File

@ -0,0 +1,35 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Ease.UICreator")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("CEL")]
[assembly: AssemblyProduct("Ease.UICreator")]
[assembly: AssemblyCopyright("Copyright © CEL 2008")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("f803e67e-186f-4d82-a43d-fb7e18586255")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.2")]
[assembly: AssemblyFileVersion("1.0.0.2")]

View File

@ -0,0 +1,543 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Ease.UICreator.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Ease.UICreator.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Activate {
get {
object obj = ResourceManager.GetObject("Activate", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap AddTable {
get {
object obj = ResourceManager.GetObject("AddTable", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap AddTable1 {
get {
object obj = ResourceManager.GetObject("AddTable1", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Cancel_16x16 {
get {
object obj = ResourceManager.GetObject("Cancel_16x16", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Check_16x16 {
get {
object obj = ResourceManager.GetObject("Check_16x16", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Copy_16x16 {
get {
object obj = ResourceManager.GetObject("Copy_16x16", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap cross {
get {
object obj = ResourceManager.GetObject("cross", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Cut_16x16 {
get {
object obj = ResourceManager.GetObject("Cut_16x16", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap DataTransfer1 {
get {
object obj = ResourceManager.GetObject("DataTransfer1", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Delete {
get {
object obj = ResourceManager.GetObject("Delete", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Desktop {
get {
object obj = ResourceManager.GetObject("Desktop", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Edit_16x16 {
get {
object obj = ResourceManager.GetObject("Edit_16x16", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Exit {
get {
object obj = ResourceManager.GetObject("Exit", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Exit1 {
get {
object obj = ResourceManager.GetObject("Exit1", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Find_16x16 {
get {
object obj = ResourceManager.GetObject("Find_16x16", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Folder_16x16 {
get {
object obj = ResourceManager.GetObject("Folder_16x16", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Group {
get {
object obj = ResourceManager.GetObject("Group", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap GStat {
get {
object obj = ResourceManager.GetObject("GStat", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Help {
get {
object obj = ResourceManager.GetObject("Help", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Help_48x48 {
get {
object obj = ResourceManager.GetObject("Help_48x48", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Info {
get {
object obj = ResourceManager.GetObject("Info", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap keyring {
get {
object obj = ResourceManager.GetObject("keyring", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap keyring1 {
get {
object obj = ResourceManager.GetObject("keyring1", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Library_Folder_graphite {
get {
object obj = ResourceManager.GetObject("Library Folder graphite", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Logo {
get {
object obj = ResourceManager.GetObject("Logo", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap MatadorEdit {
get {
object obj = ResourceManager.GetObject("MatadorEdit", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap MatadorIconEdit1 {
get {
object obj = ResourceManager.GetObject("MatadorIconEdit1", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap MatadorIconEdit2 {
get {
object obj = ResourceManager.GetObject("MatadorIconEdit2", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Mobile {
get {
object obj = ResourceManager.GetObject("Mobile", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap New_16x16 {
get {
object obj = ResourceManager.GetObject("New_16x16", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap New_Folder {
get {
object obj = ResourceManager.GetObject("New Folder", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Paste_16x16 {
get {
object obj = ResourceManager.GetObject("Paste_16x16", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Preview {
get {
object obj = ResourceManager.GetObject("Preview", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Preview1 {
get {
object obj = ResourceManager.GetObject("Preview1", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Print {
get {
object obj = ResourceManager.GetObject("Print", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Print1 {
get {
object obj = ResourceManager.GetObject("Print1", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Refresh_16x16 {
get {
object obj = ResourceManager.GetObject("Refresh_16x16", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Remove_16x16 {
get {
object obj = ResourceManager.GetObject("Remove_16x16", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Save {
get {
object obj = ResourceManager.GetObject("Save", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Save_16x16 {
get {
object obj = ResourceManager.GetObject("Save_16x16", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Search {
get {
object obj = ResourceManager.GetObject("Search", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Search_16x16 {
get {
object obj = ResourceManager.GetObject("Search_16x16", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Search1 {
get {
object obj = ResourceManager.GetObject("Search1", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Stock_Index_Down_16x16 {
get {
object obj = ResourceManager.GetObject("Stock Index Down_16x16", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Stock_Index_Up_16x16 {
get {
object obj = ResourceManager.GetObject("Stock Index Up_16x16", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap System_Setup {
get {
object obj = ResourceManager.GetObject("System Setup", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Upload_16x16 {
get {
object obj = ResourceManager.GetObject("Upload_16x16", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap user {
get {
object obj = ResourceManager.GetObject("user", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
}
}

View File

@ -0,0 +1,265 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="Save" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Save.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Activate" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Activate.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Info" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Info.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Exit" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Exit.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="MatadorIconEdit1" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\MatadorIconEdit1.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Delete" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Delete.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Search" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Search.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="MatadorIconEdit2" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\MatadorIconEdit2.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="MatadorEdit" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\MatadorEdit.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Print" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Print.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Help" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Help.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Preview" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Preview.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="AddTable1" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\AddTable1.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="AddTable" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\AddTable.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Cancel_16x16" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Cancel_16x16.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Check_16x16" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Check_16x16.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Copy_16x16" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Copy_16x16.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="cross" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\cross.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Cut_16x16" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Cut_16x16.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="DataTransfer1" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\DataTransfer1.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Desktop" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Desktop.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Edit_16x16" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Edit_16x16.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Exit1" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Exit1.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Find_16x16" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Find_16x16.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Folder_16x16" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Folder_16x16.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Group" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Group.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="GStat" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\GStat.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Help_48x48" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Help_48x48.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="keyring1" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\keyring1.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="keyring" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\keyring.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Library Folder graphite" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Library Folder graphite.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Logo" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Logo.bmp;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Mobile" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Mobile.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="New Folder" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\New Folder.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="New_16x16" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\New_16x16.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Paste_16x16" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Paste_16x16.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Preview1" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Preview1.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Print1" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Print1.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Refresh_16x16" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Refresh_16x16.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Remove_16x16" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Remove_16x16.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Save_16x16" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Save_16x16.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Search1" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Search1.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Search_16x16" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Search_16x16.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Stock Index Down_16x16" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Stock Index Down_16x16.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Stock Index Up_16x16" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Stock Index Up_16x16.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="System Setup" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\System Setup.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Upload_16x16" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Upload_16x16.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="user" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\user.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

74
Ease.UICreator/Report.cs Normal file
View File

@ -0,0 +1,74 @@
using System;
using System.Collections.Generic;
using System.Collections;
using System.Text;
using Ease.Printing;
using Ease.Report;
namespace Ease.UICreator
{
internal class Report
{
private Ease.Report.Designer.ReportDesigner _report;
private MasterForm _master;
public Report(MasterForm master)
{
_report = new Ease.Report.Designer.ReportDesigner();
_report.ReportName = master.Caption;
_report.ReportFormat.PaperSetup(System.Drawing.Printing.PaperKind.A4, EPOrientation.EPOPortrait);
_master = master;
//global.PrepareReportTitle(_report, 19);
//Global.PrepareReportHeader(_report, "Branch & Ship wise Sailor Count", "", 19);
//Global.PrepareReportFooter(_report, 19);
PrepareReport();
}
public Ease.Report.Designer.ReportDesigner ReportDesigner
{
get { return _report; }
}
public void ReportOutput(Ease.Report.Designer.OutputType outputType)
{
_report.ReportOutput(outputType);
}
private void PrepareReport()
{
//_report.CreateTable();
//_report.CurrentTable.Name = _master.Caption;
//_report.CurrentTable.CreateHeaderRow();
//Ease.Report.Designer.Row row = new Ease.Report.Designer.Row();
//foreach (MasterFormlvw UIBEMFitem in _master.Listviewcloumns)
//{
// _report.CurrentTable.CurrentHeaderRow.Columns.AddItem(UIBEMFitem.PropertyName, UIBEMFitem.Caption, 18 / _master.Listviewcloumns.Count , "");
// _report.CurrentTable.CurrentHeaderRow.Columns[UIBEMFitem.PropertyName].ReportTextStyle.Font.Bold = true;
// _report.CurrentTable.CurrentHeaderRow.Columns[UIBEMFitem.PropertyName].ReportTextStyle.Font.Size = 12;
//}
//foreach (MasterFormlvw UIBEMFitem in _master.Listviewcloumns)
//{
// row.Columns.AddItem(UIBEMFitem.PropertyName, UIBEMFitem.Caption, 18 / _master.Listviewcloumns.Count, "");
//}
//CollectionBase list = (CollectionBase)_master.SourceCollection;
//System.Collections.IEnumerator enumerator = list.GetEnumerator();
//while (enumerator.MoveNext())
//{
// _report.CurrentTable.CreateRow(row);
// foreach (MasterFormlvw UIBEMFitem in _master.Listviewcloumns)
// {
// System.Reflection.PropertyInfo dispMem = (enumerator.Current.GetType()).GetProperty(UIBEMFitem.PropertyName);
// string sStr = dispMem.GetValue(enumerator.Current, null).ToString();
// _report.CurrentTable.CurrentRow.Columns[UIBEMFitem.PropertyName].Caption = sStr;
// }
//}
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 807 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 682 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 309 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 511 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 330 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 417 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 567 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 227 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 240 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 469 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 502 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 829 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 385 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 697 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 479 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 524 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 650 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 944 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@ -0,0 +1,88 @@
using System;
using System.Collections.Generic;
using System.Text;
using Ease.CoreV35.Model;
using Ease.CoreV35.Caching;
namespace Ease.UICreator
{
public class SingleForm
{
#region Variables
private string _formName;
private string _caption;
private ObjectTemplate _source;
private SingleFormControls _controls;
private ObjectsTemplate<ObjectTemplate> _comboSource;
private string[,] _properties;
#endregion
#region Constructor
public SingleForm()
{
_caption = "";
_source = null;
_controls = new SingleFormControls();
_comboSource = null;
_properties = null;
}
#endregion
#region Properties
#region Caption
public string Caption
{
get { return _caption; }
set { _caption = value; }
}
#endregion
#region Form Name
public string FormName
{
get { return _formName; }
set { _formName = value; }
}
#endregion
#region Caption
public string[,] PropertyValue
{
get { return _properties; }
set { _properties = value; }
}
#endregion
#region Source
public ObjectTemplate Source
{
get { return _source; }
set
{
_source = value;
}
}
#endregion
#region ComboSource
public ObjectsTemplate<ObjectTemplate> ComboSource
{
get { return _comboSource; }
set { _comboSource = value; }
}
#endregion
#region Listviewcloumns
public SingleFormControls Controls
{
get { return _controls; }
set { _controls = value; }
}
#endregion
#endregion
}
}

View File

@ -0,0 +1,130 @@
using System;
using System.Collections.Generic;
using System.Text;
using Ease.CoreV35.Model;
using Ease.CoreV35.Caching;
namespace Ease.UICreator
{
#region enum
public enum enmComboType
{
CBTDropDownList = 1,
CBTDropDown = 2
}
public enum enmCboPopulatedFrom
{
Enum = 1,
Collection = 2
}
#endregion
#region class
public class SingleFormComboBox
{
#region variables
private ObjectsTemplate<ObjectTemplate> _comboSource;
private bool _hasDefaultItem;
private string _defaultItemName;
private string _dataPropertyName;
private string _DataSourcePropertyName;
private string _displayName;
private enmComboType _comboType;
private enmCboPopulatedFrom _populatedFrom;
#endregion
#region constructor
public SingleFormComboBox()
{
//_comboSource = new object();
_hasDefaultItem = false;
_defaultItemName = "";
_dataPropertyName = "";
_DataSourcePropertyName = "";
_displayName = "";
_comboType = enmComboType.CBTDropDownList;
_populatedFrom = enmCboPopulatedFrom.Enum;
}
#endregion
public void AddComboSource<T>(List<T> source) where T : ObjectTemplate
{
_comboSource = new ObjectsTemplate<ObjectTemplate>();
foreach (var item in source)
_comboSource.Add(item);
}
#region properties
#region ComboSource
public ObjectsTemplate<ObjectTemplate> ComboSource
{
get { return _comboSource; }
set { _comboSource = value; }
}
#endregion
#region Combo Populated From
public enmCboPopulatedFrom PopulatedFrom
{
get { return _populatedFrom; }
set { _populatedFrom = value; }
}
#endregion
#region Source
public string DefaultItemName
{
get { return _defaultItemName; }
set { _defaultItemName = value; }
}
#endregion
#region HasDefaultItem
public bool HasDefaultItem
{
get { return _hasDefaultItem; }
set { _hasDefaultItem = value; }
}
#endregion
#region DataPropertyName
public string DataPropertyName
{
get { return _dataPropertyName; }
set { _dataPropertyName = value; }
}
#endregion
#region Data Source PropertyName
public string DataSourcePropertyName
{
get { return _DataSourcePropertyName; }
set { _DataSourcePropertyName = value; }
}
#endregion
#region ComboType
public enmComboType ComboType
{
get { return _comboType; }
set { _comboType = value; }
}
#endregion
#region DisplayName
public string DisplayName
{
get { return _displayName; }
set { _displayName = value; }
}
#endregion
#endregion
}
#endregion
}

View File

@ -0,0 +1,479 @@
using System;
using System.Collections.Generic;
using System.Collections;
using System.Text;
using System.Drawing;
namespace Ease.UICreator
{
#region Enum
public enum BESFControlEnum
{
Lebel = 1,
Text = 2,
Combo = 3,
Check = 4,
DTPicker = 5,
NumText = 6,
IntNumText = 7
}
#endregion
#region Class
public class SingleFormControl
{
#region Variables
private string _propertyName;
private string _caption;
private string _name;
private int _maxLength;
private int _height;
private int _width;
private int _positionX;
private int _positionY;
private bool _isReadOnly;
private bool _isTabStop;
private bool _isMustEntry;
private bool _isFocused;
private BESFControlEnum _controlType;
private SingleFormComboBox _SingleFormComboBox;
private int _verticalSeparation;
#endregion
#region Constructor
public SingleFormControl()
{
_verticalSeparation = 27;
_propertyName = "";
_caption = "";
_name = "";
_height = 20;
_width = 100;
_positionX = 0;
_positionY = 0;
_maxLength = 50;
_isReadOnly = false;
_isMustEntry = false;
_SingleFormComboBox = new SingleFormComboBox();
_maxLength = 0;
_isCodeAutoGenerated = false;
}
#endregion
#region Properties
#region Source
public string PropertyName
{
get { return _propertyName; }
set { _propertyName = value; }
}
#endregion
#region Caption
public string Caption
{
get { return _caption; }
set { _caption = value; }
}
#endregion
#region Name
public string Name
{
get { return _name; }
set { _name = value; }
}
#endregion
#region Control Type
public BESFControlEnum ControlType
{
get { return _controlType; }
set { _controlType = value; }
}
#endregion
#region Height
public int Height
{
get { return _height; }
set { _height = value; }
}
#endregion
#region Width
public int Width
{
get { return _width; }
set { _width = value; }
}
#endregion
#region PositionX
public int PositionX
{
get { return _positionX; }
set { _positionX = value; }
}
#endregion
#region PositionY
public int PositionY
{
get { return _positionY; }
set { _positionY = value; }
}
#endregion
#region Max Length
public int MaxLength
{
get { return _maxLength; }
set { _maxLength = value; }
}
#endregion
#region IsReadOnly
public bool IsReadOnly
{
get { return _isReadOnly; }
set { _isReadOnly = value; }
}
#endregion
//#region BackColor
//public Color BackColor
//{
// get { return _backColor; }
// set { _backColor = value; }
//}
//#endregion
private bool _isCodeAutoGenerated;
public bool IsCodeAutoGenerated
{
get { return _isCodeAutoGenerated; }
set { _isCodeAutoGenerated = value; }
}
#region IsTabStop
public bool IsTabStop
{
get { return _isTabStop; }
set { _isTabStop = value; }
}
#endregion
#region IsMustEntry
public bool IsMustEntry
{
get { return _isMustEntry; }
set { _isMustEntry = value; }
}
#endregion
#region Is Focus
public bool IsFocused
{
get { return _isFocused; }
set { _isFocused = value; }
}
#endregion
#region SingleFormComboBox
public SingleFormComboBox CboBox
{
get { return _SingleFormComboBox; }
set { _SingleFormComboBox = value; }
}
#endregion
#region VerticalSeparation
public int VerticalSeparation
{
get { return _verticalSeparation; }
set { _verticalSeparation = value; }
}
#endregion
#endregion
}
#endregion
#region Collection
public class SingleFormControls : CollectionBase
{
#region Methods
#region Indexer
public SingleFormControl this[int index]
{
get
{
return ((SingleFormControl)List[index]);
}
set
{
List[index] = value;
}
}
public SingleFormControl this[string ControlName]
{
get
{
foreach (SingleFormControl item in this)
{
if (item.Name == ControlName)
{
return item;
}
}
return new SingleFormControl();
}
}
#endregion
#region Add
public int Add(SingleFormControl value)
{
return (List.Add(value));
}
#region PositionY
public SingleFormControl LastAddedControl
{
get { return this[this.Count - 1]; }
set { this[this.Count - 1] = value; }
}
#endregion
public int Add(BESFControlEnum controlType, string caption, string name, string propertyName, int height, int width, int posX, int posY)
{
SingleFormControl item = new SingleFormControl();
item.ControlType = controlType;
item.Caption = caption;
item.PropertyName = propertyName;
item.Name = name;
item.Height = height;
item.Width = width;
item.PositionX = posX;
item.PositionY = posY;
return (List.Add(item));
}
public int Add(BESFControlEnum controlType, string caption, string name, string propertyName, int height, int width, int posX, int posYofChosenControl, int nVerticalSeparation)
{
SingleFormControl item = new SingleFormControl();
item.ControlType = controlType;
item.Caption = caption;
item.PropertyName = propertyName;
item.Name = name;
item.Height = height;
item.Width = width;
item.PositionX = posX;
item.PositionY = posYofChosenControl + nVerticalSeparation;
return (List.Add(item));
}
public int Add(BESFControlEnum controlType, string caption, string name, string propertyName, int height, int width)
{
if (this.Count == 0)
{
SingleFormControl item = new SingleFormControl();
item.ControlType = controlType;
item.Caption = caption;
item.PropertyName = propertyName;
item.Name = name;
item.Height = height;
item.Width = width;
item.PositionX = 12;
item.PositionY = 9;
return (List.Add(item));
}
else if (this.Count == 1)
{
SingleFormControl item = new SingleFormControl();
item.ControlType = controlType;
item.Caption = caption;
item.PropertyName = propertyName;
item.Name = name;
item.Height = height;
item.Width = width;
item.PositionX = 118;
item.PositionY = 9;
return (List.Add(item));
}
else
{
if ((this.Count) % 2 == 0)
{
SingleFormControl item = new SingleFormControl();
item.ControlType = controlType;
item.Caption = caption;
item.PropertyName = propertyName;
item.Name = name;
item.Height = height;
item.Width = width;
item.PositionX = this[this.Count - 2].PositionX;
//item.PositionY = this[this.Count - 1].PositionY + item.VerticalSeparation + this[this.Count - 1].Height-20;
item.PositionY = this[this.Count - 1].PositionY + item.VerticalSeparation;
return (List.Add(item));
}
else
{
SingleFormControl item = new SingleFormControl();
item.ControlType = controlType;
item.Caption = caption;
item.PropertyName = propertyName;
item.Name = name;
item.Height = height;
item.Width = width;
item.PositionX = this[this.Count - 2].PositionX;
//item.PositionY = this[this.Count - 2].PositionY + item.VerticalSeparation+this[this.Count - 2].Height - 20;
item.PositionY = this[this.Count - 2].PositionY + item.VerticalSeparation;
return (List.Add(item));
}
}
}
public int Add(BESFControlEnum controlType, string caption, string name, string propertyName)
{
if (this.Count == 0)
{
SingleFormControl item = new SingleFormControl();
item.ControlType = controlType;
item.Caption = caption;
item.PropertyName = propertyName;
item.Name = name;
item.PositionX = 12;
item.PositionY = 9;
return (List.Add(item));
}
else if (this.Count == 1)
{
SingleFormControl item = new SingleFormControl();
item.ControlType = controlType;
item.Caption = caption;
item.PropertyName = propertyName;
item.Name = name;
item.PositionX = 118;
item.PositionY = 9;
return (List.Add(item));
}
else
{
if ((this.Count) % 2 == 0)
{
SingleFormControl item = new SingleFormControl();
item.ControlType = controlType;
item.Caption = caption;
item.PropertyName = propertyName;
item.Name = name;
item.PositionX = this[this.Count - 2].PositionX;
item.PositionY = this[this.Count - 2].PositionY + item.VerticalSeparation;
return (List.Add(item));
}
else
{
SingleFormControl item = new SingleFormControl();
item.ControlType = controlType;
item.Caption = caption;
item.PropertyName = propertyName;
item.Name = name;
item.PositionX = this[this.Count - 2].PositionX;
item.PositionY = this[this.Count - 2].PositionY + item.VerticalSeparation;
return (List.Add(item));
}
}
}
#endregion
#region IndexOf
public int IndexOf(SingleFormControl value)
{
return (List.IndexOf(value));
}
#endregion
#region Insert
public void Insert(int index, SingleFormControl value)
{
List.Insert(index, value);
}
#endregion
#region Remove
public void Remove(SingleFormControl value)
{
List.Remove(value);
}
#endregion
#region Contains
public bool Contains(SingleFormControl value)
{
// If value is not of type SingleFormControl, this will return false.
return (List.Contains(value));
}
#endregion
public void IsDuplicateCtlName()
{
int nIndex = -1;
foreach (SingleFormControl item in this)
{
nIndex = nIndex + 1;
for (int i = 0; i < this.Count; i++)
{
if (nIndex != i)
{
if ((this[nIndex].PropertyName == this[i].PropertyName) && (this[nIndex].PropertyName != ""))
{
throw new Exception("Duplicate Control Name Exist:" + this[nIndex].PropertyName);
}
}
}
}
}
public SingleFormControl GetControl(string propertyName)
{
foreach (SingleFormControl item in this)
{
if (item.PropertyName == propertyName)
{
return item;
}
}
return null;
}
#region Migth be needed
//protected override void OnInsert(int index, Object value)
//{
// // Insert additional code to be run only when inserting values.
//}
//protected override void OnRemove(int index, Object value)
//{
// // Insert additional code to be run only when removing values.
//}
//protected override void OnSet(int index, Object oldValue, Object newValue)
//{
// // Insert additional code to be run only when setting values.
//}
//protected override void OnValidate(Object value)
//{
// if (value.GetType() != typeof(MasterFormlvw))
// throw new ArgumentException("value must be of type List view column.", "value");
//}
#endregion
#endregion
}
#endregion
}

Binary file not shown.

BIN
Library/ClosedXML.dll Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
Library/Ease.Controls.dll Normal file

Binary file not shown.

BIN
Library/Ease.Core.dll Normal file

Binary file not shown.

BIN
Library/Ease.CoreV35.dll Normal file

Binary file not shown.

BIN
Library/Ease.Excel.dll Normal file

Binary file not shown.

BIN
Library/Ease.Printing.dll Normal file

Binary file not shown.

BIN
Library/Ease.Report.dll Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
Library/Ease.UICreator.dll Normal file

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More