First create solution
This commit is contained in:
@@ -0,0 +1,97 @@
|
||||
Partial Class ProjectVC
|
||||
|
||||
<System.Diagnostics.DebuggerNonUserCode()> _
|
||||
Public Sub New(ByVal Container As System.ComponentModel.IContainer)
|
||||
MyClass.New()
|
||||
|
||||
'Required for Windows.Forms Class Composition Designer support
|
||||
Container.Add(Me)
|
||||
|
||||
End Sub
|
||||
|
||||
'Component overrides dispose to clean up the component list.
|
||||
<System.Diagnostics.DebuggerNonUserCode()> _
|
||||
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
|
||||
If disposing AndAlso components IsNot Nothing Then
|
||||
components.Dispose()
|
||||
End If
|
||||
MyBase.Dispose(disposing)
|
||||
End Sub
|
||||
|
||||
'Required by the Component Designer
|
||||
Private components As System.ComponentModel.IContainer
|
||||
|
||||
'NOTE: The following procedure is required by the Component Designer
|
||||
'It can be modified using the Component Designer.
|
||||
'Do not modify it using the code editor.
|
||||
<System.Diagnostics.DebuggerStepThrough()> _
|
||||
Private Sub InitializeComponent()
|
||||
Me.components = New System.ComponentModel.Container()
|
||||
Me.aProjectG2anttPrint = New DevExpress.ExpressApp.Actions.SimpleAction(Me.components)
|
||||
Me.aProject_GenerateProjectQuestions = New DevExpress.ExpressApp.Actions.SimpleAction(Me.components)
|
||||
Me.aProject_GenerateNewEvents = New DevExpress.ExpressApp.Actions.PopupWindowShowAction(Me.components)
|
||||
'
|
||||
'aProjectAddRow
|
||||
'
|
||||
'
|
||||
'aProjectEditRow
|
||||
'
|
||||
'
|
||||
'aProjectDeleteRow
|
||||
'
|
||||
'
|
||||
'aProjectRefreshG2antt
|
||||
'
|
||||
'
|
||||
'aProjectG2anttPrint
|
||||
'
|
||||
Me.aProjectG2anttPrint.Caption = "aProject G2antt Print"
|
||||
Me.aProjectG2anttPrint.ConfirmationMessage = Nothing
|
||||
Me.aProjectG2anttPrint.Id = "aProjectG2anttPrint"
|
||||
Me.aProjectG2anttPrint.ImageName = Nothing
|
||||
Me.aProjectG2anttPrint.SelectionDependencyType = DevExpress.ExpressApp.Actions.SelectionDependencyType.RequireSingleObject
|
||||
Me.aProjectG2anttPrint.Shortcut = Nothing
|
||||
Me.aProjectG2anttPrint.Tag = Nothing
|
||||
Me.aProjectG2anttPrint.TargetObjectsCriteria = Nothing
|
||||
Me.aProjectG2anttPrint.TargetObjectType = GetType(Nuvolar.[Module].ProjectHeader)
|
||||
Me.aProjectG2anttPrint.TargetViewId = Nothing
|
||||
Me.aProjectG2anttPrint.TargetViewType = DevExpress.ExpressApp.ViewType.DetailView
|
||||
Me.aProjectG2anttPrint.ToolTip = Nothing
|
||||
Me.aProjectG2anttPrint.TypeOfView = GetType(DevExpress.ExpressApp.DetailView)
|
||||
'
|
||||
'aProject_GenerateProjectQuestions
|
||||
'
|
||||
Me.aProject_GenerateProjectQuestions.Caption = "aProject_GenerateProjectQuestions"
|
||||
Me.aProject_GenerateProjectQuestions.ConfirmationMessage = Nothing
|
||||
Me.aProject_GenerateProjectQuestions.Id = "aProject_GenerateProjectQuestions"
|
||||
Me.aProject_GenerateProjectQuestions.ImageName = Nothing
|
||||
Me.aProject_GenerateProjectQuestions.Shortcut = Nothing
|
||||
Me.aProject_GenerateProjectQuestions.Tag = Nothing
|
||||
Me.aProject_GenerateProjectQuestions.TargetObjectsCriteria = Nothing
|
||||
Me.aProject_GenerateProjectQuestions.TargetObjectType = GetType(Nuvolar.[Module].ProjectHeader)
|
||||
Me.aProject_GenerateProjectQuestions.TargetViewId = Nothing
|
||||
Me.aProject_GenerateProjectQuestions.ToolTip = Nothing
|
||||
Me.aProject_GenerateProjectQuestions.TypeOfView = Nothing
|
||||
'
|
||||
'aProject_GenerateNewEvents
|
||||
'
|
||||
Me.aProject_GenerateNewEvents.AcceptButtonCaption = Nothing
|
||||
Me.aProject_GenerateNewEvents.CancelButtonCaption = Nothing
|
||||
Me.aProject_GenerateNewEvents.Caption = "aProject_GenerateNewEvents"
|
||||
Me.aProject_GenerateNewEvents.ConfirmationMessage = Nothing
|
||||
Me.aProject_GenerateNewEvents.Id = "aProject_GenerateNewEvents"
|
||||
Me.aProject_GenerateNewEvents.ImageName = Nothing
|
||||
Me.aProject_GenerateNewEvents.Shortcut = Nothing
|
||||
Me.aProject_GenerateNewEvents.Tag = Nothing
|
||||
Me.aProject_GenerateNewEvents.TargetObjectsCriteria = Nothing
|
||||
Me.aProject_GenerateNewEvents.TargetObjectType = GetType(Nuvolar.[Module].ProjectHeader)
|
||||
Me.aProject_GenerateNewEvents.TargetViewId = Nothing
|
||||
Me.aProject_GenerateNewEvents.ToolTip = Nothing
|
||||
Me.aProject_GenerateNewEvents.TypeOfView = Nothing
|
||||
|
||||
End Sub
|
||||
Friend WithEvents aProjectG2anttPrint As DevExpress.ExpressApp.Actions.SimpleAction
|
||||
Friend WithEvents aProject_GenerateProjectQuestions As DevExpress.ExpressApp.Actions.SimpleAction
|
||||
Friend WithEvents aProject_GenerateNewEvents As DevExpress.ExpressApp.Actions.PopupWindowShowAction
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,144 @@
|
||||
<?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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="aProjectAddRow.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>642, 95</value>
|
||||
</metadata>
|
||||
<metadata name="aProjectEditRow.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>502, 95</value>
|
||||
</metadata>
|
||||
<metadata name="aProjectDeleteRow.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>348, 95</value>
|
||||
</metadata>
|
||||
<metadata name="aProjectRefreshG2antt.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>175, 95</value>
|
||||
</metadata>
|
||||
<metadata name="aProjectG2anttPrint.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 95</value>
|
||||
</metadata>
|
||||
<metadata name="aProject_GenerateProjectQuestions.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 56</value>
|
||||
</metadata>
|
||||
<metadata name="aProject_GenerateNewEvents.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>175, 17</value>
|
||||
</metadata>
|
||||
<metadata name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
</root>
|
||||
@@ -0,0 +1,558 @@
|
||||
Imports System
|
||||
Imports System.ComponentModel
|
||||
Imports System.Collections.Generic
|
||||
Imports System.Diagnostics
|
||||
Imports System.Text
|
||||
|
||||
Imports DevExpress.ExpressApp
|
||||
Imports DevExpress.ExpressApp.Actions
|
||||
Imports DevExpress.Persistent.Base
|
||||
Imports DevExpress.ExpressApp.Editors
|
||||
Imports exontrol.EXG2ANTTLib
|
||||
Imports DevExpress.Xpo
|
||||
Imports DevExpress.Data.Filtering
|
||||
Imports DevExpress.ExpressApp.SystemModule
|
||||
Imports DevExpress.Persistent.BaseImpl
|
||||
Imports System.Net.Mail
|
||||
Imports System.Reflection
|
||||
Imports DevExpress.ExpressApp.Utils
|
||||
|
||||
Public Class ProjectVC
|
||||
Inherits Nuvolar.Module.ProjectVC
|
||||
Dim _GanttControl As exontrol.EXG2ANTTLib.exg2antt
|
||||
Dim _CtrlDownYes As Boolean = False
|
||||
|
||||
Public Sub New()
|
||||
MyBase.New()
|
||||
|
||||
'This call is required by the Component Designer.
|
||||
InitializeComponent()
|
||||
RegisterActions(components)
|
||||
|
||||
End Sub
|
||||
Protected Overrides Sub OnActivated()
|
||||
MyBase.OnActivated()
|
||||
|
||||
If View.Id = "ProjectHeader_DetailView" Then
|
||||
Dim _DetailView As DetailView = TryCast(View, DetailView)
|
||||
Dim _GanttContolViewItem As ViewItem = _DetailView.FindItem("G2antt")
|
||||
If _GanttContolViewItem IsNot Nothing Then
|
||||
AddHandler _GanttContolViewItem.ControlCreated, AddressOf GanttContolViewItem_ControlCreated
|
||||
AddHandler Frame.GetController(Of RefreshController).RefreshAction.Executing, AddressOf RefreshAction_Executing
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
Private Sub aProjectAddRow_Execute_1(sender As System.Object, e As DevExpress.ExpressApp.Actions.SimpleActionExecuteEventArgs) Handles aProjectAddRow.Execute
|
||||
Dim _ProjectHeader As ProjectHeader = TryCast(View.SelectedObjects(0), ProjectHeader)
|
||||
Dim _ProjectRows As ProjectRows
|
||||
|
||||
Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace
|
||||
|
||||
_ProjectRows = _onew.CreateObject(Of ProjectRows)()
|
||||
_ProjectRows.ProjectHeader = _onew.GetObject(_ProjectHeader)
|
||||
|
||||
e.ShowViewParameters.CreatedView = Application.CreateDetailView(_onew, "ProjectRows_DetailView", True, _ProjectRows)
|
||||
End Sub
|
||||
Private Sub aProjectEditRow_Execute_1(sender As System.Object, e As DevExpress.ExpressApp.Actions.SimpleActionExecuteEventArgs) Handles aProjectEditRow.Execute
|
||||
Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace
|
||||
Dim _ProjectRows As ProjectRows
|
||||
Dim _selecteditem As Long = 0
|
||||
Dim _Oid As String
|
||||
If _GanttControl IsNot Nothing Then
|
||||
_selecteditem = _GanttControl.Items.get_SelectedItem(0)
|
||||
_Oid = _GanttControl.Items.get_CellValue(_selecteditem, 0)
|
||||
_ProjectRows = _onew.FindObject(Of ProjectRows)(CriteriaOperator.Parse("Oid=?", _Oid))
|
||||
If _ProjectRows IsNot Nothing Then
|
||||
e.ShowViewParameters.CreatedView = Application.CreateDetailView(_onew, "ProjectRows_DetailView", True, _ProjectRows)
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub aProjectRefreshG2antt_Execute(sender As System.Object, e As DevExpress.ExpressApp.Actions.SimpleActionExecuteEventArgs) Handles aProjectRefreshG2antt.Execute
|
||||
'// Gantt diagram frissítése
|
||||
Dim _ocur As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace)
|
||||
Dim _ProjectHeader As ProjectHeader = TryCast(View.SelectedObjects(0), ProjectHeader)
|
||||
|
||||
|
||||
If _ProjectHeader IsNot Nothing Then
|
||||
Dim _ProjectRows_Collection As New XPCollection(Of ProjectRows)(_ocur.Session, CriteriaOperator.Parse("ProjectHeader=?", _ProjectHeader))
|
||||
If _ProjectRows_Collection.Count > 0 Then
|
||||
_ProjectRows_Collection.Sorting.Add(New SortProperty("RowPos", DB.SortingDirection.Ascending))
|
||||
Dim _ProjectRows As ProjectRows
|
||||
|
||||
If _GanttControl IsNot Nothing Then
|
||||
_GanttControl.BeginUpdate()
|
||||
_GanttControl.Items.RemoveAllItems()
|
||||
For Each _ProjectRows In _ProjectRows_Collection
|
||||
RecursiveLoadItems(_ProjectRows)
|
||||
Next
|
||||
_ProjectRows_Collection.Sorting.Add(New SortProperty("DateStart", DB.SortingDirection.Ascending))
|
||||
_GanttControl.Chart.FirstVisibleDate = _ProjectRows_Collection(0).DateStart
|
||||
_GanttControl.Chart.StartPrintDate = _ProjectRows_Collection(0).DateStart
|
||||
_ProjectRows_Collection.Sorting.Add(New SortProperty("DateEnd", DB.SortingDirection.Descending))
|
||||
_GanttControl.Chart.EndPrintDate = _ProjectRows_Collection(0).DateEnd
|
||||
_GanttControl.Chart.set_SelectDate(GetSQLTime(TryCast(View.ObjectSpace, Xpo.XPObjectSpace).Session), True)
|
||||
_GanttControl.EndUpdate()
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
Private Sub RecursiveLoadItems(_ProjectRows As ProjectRows)
|
||||
Dim _item As Long
|
||||
|
||||
_item = _GanttControl.Items.get_FindItem(_ProjectRows.Oid.ToString, 0)
|
||||
If _item > 0 Then Exit Sub
|
||||
|
||||
If _ProjectRows.ProjectRows Is Nothing Then
|
||||
'//AddItem
|
||||
_item = _GanttControl.Items.AddItem()
|
||||
SetItemData(_item, _ProjectRows)
|
||||
Else
|
||||
'//InsertItem
|
||||
_item = _GanttControl.Items.get_FindItem(_ProjectRows.ProjectRows.Oid.ToString, 0)
|
||||
If _item > 0 Then
|
||||
_item = _GanttControl.Items.InsertItem(_item, "")
|
||||
SetItemData(_item, _ProjectRows)
|
||||
Else
|
||||
RecursiveLoadItems(_ProjectRows.ProjectRows)
|
||||
_item = _GanttControl.Items.get_FindItem(_ProjectRows.ProjectRows.Oid.ToString, 0)
|
||||
If _item > 0 Then
|
||||
_item = _GanttControl.Items.InsertItem(_item, "")
|
||||
SetItemData(_item, _ProjectRows)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
End Sub
|
||||
Private Sub SetItemData(_item As Long, _ProjectRows As ProjectRows)
|
||||
If _ProjectRows.ProjectRows Is Nothing Then
|
||||
_GanttControl.Items.set_CellValue(_item, 0, _ProjectRows.Oid.ToString)
|
||||
_GanttControl.Items.set_CellValue(_item, 1, _ProjectRows.RowPos)
|
||||
_GanttControl.Items.set_CellValue(_item, 2, "<b>" & _ProjectRows.TaskName & "</b>")
|
||||
_GanttControl.Items.set_CellValueFormat(_item, 2, ValueFormatEnum.exHTML)
|
||||
_GanttControl.Items.set_CellValue(_item, 3, _ProjectRows.DateStart)
|
||||
_GanttControl.Items.set_CellValue(_item, 4, _ProjectRows.DateEnd)
|
||||
_GanttControl.Items.set_CellValue(_item, 5, _ProjectRows.SumDay)
|
||||
Else
|
||||
_GanttControl.Items.set_CellValue(_item, 0, _ProjectRows.Oid.ToString)
|
||||
_GanttControl.Items.set_CellValue(_item, 1, _ProjectRows.RowPos)
|
||||
_GanttControl.Items.set_CellValue(_item, 2, _ProjectRows.TaskName)
|
||||
_GanttControl.Items.set_CellValue(_item, 3, _ProjectRows.DateStart)
|
||||
_GanttControl.Items.set_CellValue(_item, 4, _ProjectRows.DateEnd)
|
||||
_GanttControl.Items.set_CellValue(_item, 5, _ProjectRows.SumDay)
|
||||
End If
|
||||
|
||||
Select Case _ProjectRows.ProjectBarType
|
||||
Case eProjectBarType.eDeadline
|
||||
_GanttControl.Items.AddBar(CInt(_item), "Deadline", _ProjectRows.DateStart, _ProjectRows.DateEnd)
|
||||
Case eProjectBarType.eMilestone
|
||||
_GanttControl.Items.AddBar(CInt(_item), "Milestone", _ProjectRows.DateStart, _ProjectRows.DateEnd)
|
||||
Case eProjectBarType.eProgress
|
||||
_GanttControl.Items.AddBar(CInt(_item), "Progress", _ProjectRows.DateStart, _ProjectRows.DateEnd)
|
||||
Case eProjectBarType.eProjectSummary
|
||||
_GanttControl.Items.AddBar(CInt(_item), "ProjectSummary", _ProjectRows.DateStart, _ProjectRows.DateEnd)
|
||||
Case eProjectBarType.eSplit
|
||||
_GanttControl.Items.AddBar(CInt(_item), "Split", _ProjectRows.DateStart, _ProjectRows.DateEnd)
|
||||
Case eProjectBarType.eSummary
|
||||
_GanttControl.Items.AddBar(CInt(_item), "Summary", _ProjectRows.DateStart, _ProjectRows.DateEnd)
|
||||
Case eProjectBarType.eTask
|
||||
_GanttControl.Items.AddBar(CInt(_item), "Task%Progress", _ProjectRows.DateStart, _ProjectRows.DateEnd, "P1")
|
||||
Select Case _ProjectRows.TaskDuty
|
||||
Case eTaskDuty.eMyTask
|
||||
_GanttControl.Items.set_ItemBar(CInt(_item), "P1", exontrol.EXG2ANTTLib.ItemBarPropertyEnum.exBarColor, _ProjectRows.ProjectHeader.ProjectType.DutyColorMyTask_NP)
|
||||
Case eTaskDuty.eNotSet
|
||||
_GanttControl.Items.set_ItemBar(CInt(_item), "P1", exontrol.EXG2ANTTLib.ItemBarPropertyEnum.exBarColor, _ProjectRows.ProjectHeader.ProjectType.DutyColorNotSet_NP)
|
||||
Case eTaskDuty.ePartnerTask
|
||||
_GanttControl.Items.set_ItemBar(CInt(_item), "P1", exontrol.EXG2ANTTLib.ItemBarPropertyEnum.exBarColor, _ProjectRows.ProjectHeader.ProjectType.DutyColorPartnerTask_NP)
|
||||
Case eTaskDuty.eSubcontractorTask
|
||||
_GanttControl.Items.set_ItemBar(CInt(_item), "P1", exontrol.EXG2ANTTLib.ItemBarPropertyEnum.exBarColor, _ProjectRows.ProjectHeader.ProjectType.DutyColorSubcontractorTask_NP)
|
||||
End Select
|
||||
|
||||
If _ProjectRows.PercentCompleted > 0 Then
|
||||
_GanttControl.Items.set_ItemBar(CInt(_item), "P1", exontrol.EXG2ANTTLib.ItemBarPropertyEnum.exBarPercent, _ProjectRows.PercentCompleted / 100)
|
||||
_GanttControl.Items.set_ItemBar(CInt(_item), "P1", exontrol.EXG2ANTTLib.ItemBarPropertyEnum.exBarShowPercentCaption, True)
|
||||
End If
|
||||
End Select
|
||||
End Sub
|
||||
Private Sub GanttContolViewItem_ControlCreated(sender As Object, e As EventArgs)
|
||||
Dim _ItemControl As Object = TryCast(sender, ViewItem).Control
|
||||
Dim _columnindex As Long = 0
|
||||
_GanttControl = TryCast(_ItemControl, G2anttUserControl).Exg2antt
|
||||
|
||||
AddHandler _GanttControl.MouseDownEvent, AddressOf GanttControl_MouseDownEvent
|
||||
AddHandler _GanttControl.KeyDown, AddressOf GanttControl_KeyDown
|
||||
AddHandler _GanttControl.KeyUp, AddressOf GanttControl_KeyUp
|
||||
|
||||
If _GanttControl IsNot Nothing Then
|
||||
'//Gantt inicializálása
|
||||
_GanttControl.BeginUpdate()
|
||||
_GanttControl.Columns.Clear()
|
||||
_GanttControl.Columns.Add("Oid")
|
||||
_GanttControl.Columns(0).Visible = False
|
||||
_GanttControl.Columns.Add("Pos")
|
||||
_GanttControl.Columns(1).Width = 10
|
||||
_GanttControl.Columns.Add("TaskName")
|
||||
_GanttControl.Columns.Add("DateStart")
|
||||
_GanttControl.Columns(3).Width = 20
|
||||
_GanttControl.Columns.Add("DateEnd")
|
||||
_GanttControl.Columns(4).Width = 20
|
||||
_GanttControl.Columns.Add("Day")
|
||||
_GanttControl.Columns(5).Width = 5
|
||||
|
||||
_GanttControl.LinesAtRoot = exontrol.EXG2ANTTLib.LinesAtRootEnum.exLinesAtRoot
|
||||
_GanttControl.TreeColumnIndex = 2
|
||||
_GanttControl.HeaderHeight = 36
|
||||
|
||||
_GanttControl.Columns(2).Editor.ExpandAll()
|
||||
|
||||
_GanttControl.Chart.Bars.Add("Task%Progress")
|
||||
|
||||
'_GanttControl.Chart.FirstVisibleDate = #5/30/2010#
|
||||
_GanttControl.Chart.PaneWidthRight = 500
|
||||
_GanttControl.Chart.FirstWeekDay = 1
|
||||
_GanttControl.Chart.UnitWidth = 36
|
||||
|
||||
_GanttControl.Chart.LevelCount = 2
|
||||
'_GanttControl.Chart.get_Level(0).Label = "<b><%loc_mmmm%></b> <%yyyy%><br><%loc_sdate%><r> <%ww%> "
|
||||
_GanttControl.Chart.get_Level(0).ToolTip = _GanttControl.Chart.get_Level(0).Label
|
||||
_GanttControl.Chart.get_Level(0).Unit = 256
|
||||
|
||||
'_GanttControl.Chart.get_Level(1).Label = "<%loc_ddd%><br><%d%>"
|
||||
_GanttControl.Chart.get_Level(1).ToolTip = _GanttControl.Chart.get_Level(1).Label
|
||||
|
||||
'_GanttControl.Chart.ToolTip = "<%loc_ldate%>"
|
||||
|
||||
|
||||
_GanttControl.Chart.OverviewVisible = exontrol.EXG2ANTTLib.OverviewVisibleEnum.exOverviewShowAll
|
||||
_GanttControl.Chart.AllowOverviewZoom = exontrol.EXG2ANTTLib.OverviewZoomEnum.exAlwaysZoom
|
||||
'_GanttControl.Chart.OverviewZoomCaption = "½Year|¼Year|Month|Third|Week|Day|Hour"
|
||||
_GanttControl.SingleSel = False
|
||||
|
||||
_GanttControl.EndUpdate()
|
||||
|
||||
Frame.GetController(Of ProjectVC).aProjectRefreshG2antt.DoExecute()
|
||||
End If
|
||||
End Sub
|
||||
Private Sub RefreshAction_Executing(sender As Object, e As CancelEventArgs)
|
||||
Frame.GetController(Of ProjectVC).aProjectRefreshG2antt.DoExecute()
|
||||
End Sub
|
||||
Private Sub aProjectG2anttPrint_Execute(sender As Object, e As SimpleActionExecuteEventArgs) Handles aProjectG2anttPrint.Execute
|
||||
With New exontrol.EXPRINTLib.exprint()
|
||||
.Options = "ColumnsOnEveryPage=1"
|
||||
.PrintExt = _GanttControl
|
||||
.Preview()
|
||||
End With
|
||||
End Sub
|
||||
Private Sub GanttControl_KeyDown(sender As Object, ByRef KeyCode As Short, Shift As Short)
|
||||
Try
|
||||
Select Case KeyCode
|
||||
Case 17
|
||||
If Not _CtrlDownYes Then
|
||||
_CtrlDownYes = True
|
||||
End If
|
||||
End Select
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message, MsgBoxStyle.OkOnly + MsgBoxStyle.Critical, String.Format(CaptionHelper.GetLocalizedText("Exceptions\NuvolarExceptions", "MsgBoxCheckItAgain")))
|
||||
End Try
|
||||
End Sub
|
||||
Private Sub GanttControl_KeyUp(sender As Object, ByRef KeyCode As Short, Shift As Short)
|
||||
Try
|
||||
Select Case KeyCode
|
||||
Case 17
|
||||
If _CtrlDownYes Then
|
||||
_CtrlDownYes = False
|
||||
End If
|
||||
End Select
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message, MsgBoxStyle.OkOnly + MsgBoxStyle.Critical, String.Format(CaptionHelper.GetLocalizedText("Exceptions\NuvolarExceptions", "MsgBoxCheckItAgain")))
|
||||
End Try
|
||||
End Sub
|
||||
Private Sub GanttControl_MouseDownEvent(sender As Object, Button As Short, Shift As Short, X As Integer, Y As Integer)
|
||||
Try
|
||||
If _CtrlDownYes Then
|
||||
Dim _Item As Long = _GanttControl.get_ItemFromPoint(X, Y)
|
||||
_GanttControl.Items.set_SelectableItem(_Item, True)
|
||||
End If
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message, MsgBoxStyle.OkOnly + MsgBoxStyle.Critical, String.Format(CaptionHelper.GetLocalizedText("Exceptions\NuvolarExceptions", "MsgBoxCheckItAgain")))
|
||||
End Try
|
||||
End Sub
|
||||
Private Sub aProject_GenerateProjectQuestions_Execute(sender As Object, e As SimpleActionExecuteEventArgs) Handles aProject_GenerateProjectQuestions.Execute
|
||||
Try
|
||||
Dim _ocur As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace)
|
||||
Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace
|
||||
|
||||
Dim _ProjectHeader As ProjectHeader = TryCast(View.SelectedObjects(0), ProjectHeader)
|
||||
If _ProjectHeader Is Nothing Then Throw New Exception("*Váratlan hiba történt, a folyamat megszakadt!")
|
||||
|
||||
Dim _ProjectQuestion_Collection As New XPCollection(Of ProjectQuestion)(_onew.Session, CriteriaOperator.Parse("ProjectHeader=?", _onew.GetObjectByKey(Of ProjectHeader)(_ProjectHeader.Oid)))
|
||||
If _ProjectQuestion_Collection.Count > 0 Then
|
||||
_onew.Delete(_ProjectQuestion_Collection)
|
||||
_onew.CommitChanges()
|
||||
End If
|
||||
_ProjectQuestion_Collection.Dispose()
|
||||
|
||||
Dim _User_Collection As New ArrayList
|
||||
Dim _HRPerson_Collection As New ArrayList
|
||||
|
||||
UsersUppload(_User_Collection, _HRPerson_Collection, _ProjectHeader)
|
||||
|
||||
'---=== ProjectQuestions ===---
|
||||
For Each _User As User In _User_Collection
|
||||
Dim _Question As Question = _onew.FindObject(Of Question)(CriteriaOperator.Parse("AliasUser=? AND DocumentNumber=?", _onew.GetObjectByKey(Of User)(_User.Oid), _ProjectHeader.DocumentNumber))
|
||||
If _Question Is Nothing Then
|
||||
_Question = New Question(_onew.Session)
|
||||
With _Question
|
||||
.QuestionStatus = eQuestionStatus.eActive
|
||||
.QuestionClosed = eQuestionClosed.eOpen
|
||||
.IssueType = eIssueType.eQuestion
|
||||
.DocumentNumber = _ProjectHeader.DocumentNumber
|
||||
.Subject = String.Format("{0} számú project.", _ProjectHeader.DocumentNumber)
|
||||
.Description = String.Format("{0} számú project.", _ProjectHeader.DocumentNumber)
|
||||
.User = _onew.GetObjectByKey(Of User)(_User.Oid)
|
||||
.UserCreated = _onew.GetObjectByKey(Of User)(_User.Oid)
|
||||
.AliasUser = _onew.GetObjectByKey(Of User)(_User.Oid)
|
||||
Dim _Contacts As Contacts = _ocur.FindObject(Of Contacts)(CriteriaOperator.Parse("User=?", _User))
|
||||
If _Contacts IsNot Nothing Then .Customers = _onew.GetObjectByKey(Of Customers)(_Contacts.Customers.Oid)
|
||||
End With
|
||||
End If
|
||||
Dim _Events As New Events(_onew.Session)
|
||||
With _Events
|
||||
.Question = _Question
|
||||
.QuestionStatus = eQuestionStatus.eActive
|
||||
.EventDirection = eEventDirection.eOut
|
||||
.Description = String.Format("{0} szmú projekt megnyitása.", _ProjectHeader.DocumentNumber)
|
||||
End With
|
||||
Dim _ProjectQuestion As New ProjectQuestion(_onew.Session)
|
||||
With _ProjectQuestion
|
||||
.ProjectHeader = _onew.GetObjectByKey(Of ProjectHeader)(_ProjectHeader.Oid)
|
||||
.Question = _Question
|
||||
End With
|
||||
|
||||
SendEmail(_Events, _User, _ProjectHeader)
|
||||
Next
|
||||
|
||||
_onew.CommitChanges()
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message, MsgBoxStyle.OkOnly + MsgBoxStyle.Critical, String.Format(CaptionHelper.GetLocalizedText("Exceptions\NuvolarExceptions", "MsgBoxCheckItAgain")))
|
||||
End Try
|
||||
End Sub
|
||||
Private Sub aProject_GenerateNewEvents_CustomizePopupWindowParams(sender As Object, e As CustomizePopupWindowParamsEventArgs) Handles aProject_GenerateNewEvents.CustomizePopupWindowParams
|
||||
Try
|
||||
Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace
|
||||
Dim _ProjectNewEvents As New ProjectNewEvents(_onew.Session)
|
||||
|
||||
e.View = Application.CreateDetailView(_onew, "ProjectNewEvents_DetailView", True, _ProjectNewEvents)
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message, MsgBoxStyle.OkOnly + MsgBoxStyle.Critical, String.Format(CaptionHelper.GetLocalizedText("Exceptions\NuvolarExceptions", "MsgBoxCheckItAgain")))
|
||||
End Try
|
||||
End Sub
|
||||
Private Sub aProject_GenerateNewEvents_Execute(sender As Object, e As PopupWindowShowActionExecuteEventArgs) Handles aProject_GenerateNewEvents.Execute
|
||||
Try
|
||||
Dim _ocur As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace)
|
||||
Dim _ProjectHeader As ProjectHeader = TryCast(View.SelectedObjects(0), ProjectHeader)
|
||||
|
||||
Dim _User_Collection As New ArrayList
|
||||
Dim _HRPerson_Collection As New ArrayList
|
||||
Dim _ProjectRows_Collection As New ArrayList
|
||||
|
||||
For _ik = 0 To _GanttControl.Items.SelectCount - 1
|
||||
Dim _index As Long = _GanttControl.Items.get_SelectedItem(_ik)
|
||||
Dim _Oid As String = _GanttControl.Items.get_CellValue(_index, 0)
|
||||
Dim _ProjectRows As ProjectRows = _ocur.FindObject(Of ProjectRows)(CriteriaOperator.Parse("Oid=?", _Oid))
|
||||
If _ProjectRows IsNot Nothing Then
|
||||
If _ProjectRows_Collection.Count = 0 Then
|
||||
_ProjectRows_Collection.Add(_ProjectRows)
|
||||
Else
|
||||
If Not _ProjectRows_Collection.Contains(_ProjectRows) Then _ProjectRows_Collection.Add(_ProjectRows)
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
|
||||
UsersUppload_Selected(_User_Collection, _HRPerson_Collection, _ProjectRows_Collection, _ProjectHeader)
|
||||
|
||||
For Each _User As User In _User_Collection
|
||||
Dim _Question As Question = _ocur.FindObject(Of Question)(CriteriaOperator.Parse("DocumentNumber=? And AliasUser=?", _ProjectHeader.DocumentNumber, _User))
|
||||
If _Question IsNot Nothing Then
|
||||
Dim _Events As New Events(_ocur.Session)
|
||||
With _Events
|
||||
.Question = _Question
|
||||
.Description = TryCast(e.PopupWindow.View.SelectedObjects(0), ProjectNewEvents).Description
|
||||
.EventDirection = eEventDirection.eOut
|
||||
.QuestionStatus = eQuestionStatus.eActive
|
||||
End With
|
||||
|
||||
SendEmail(_Events, _User, _ProjectHeader)
|
||||
End If
|
||||
Next
|
||||
|
||||
Try
|
||||
Dim _WebParameters As WebParameters = _ocur.FindObject(Of WebParameters)(CriteriaOperator.Parse("1=1"))
|
||||
If _WebParameters Is Nothing Then Throw New Exception("*Nincsnek e-mail paraméterek beállítva!")
|
||||
If _WebParameters.SMTPHost Is Nothing Then Throw New Exception("*Nincs SMTP server beállítva!")
|
||||
If _WebParameters.SMTPUserName = "" Then Throw New Exception("*Nincs felhasználói név beállítva!")
|
||||
If _WebParameters.SMTPPort = 0 Then Throw New Exception("*Nincs SMTP port beállítva!")
|
||||
|
||||
For Each _User As User In _HRPerson_Collection
|
||||
If Not String.IsNullOrEmpty(_User.Email) Then
|
||||
Try
|
||||
Dim _MailMessage As New MailMessage
|
||||
Dim _SmtpClient As SmtpClient = New SmtpClient(_WebParameters.SMTPHost)
|
||||
_MailMessage.From = New MailAddress(_WebParameters.Email_SupportAdmin)
|
||||
_MailMessage.To.Add(_User.Email)
|
||||
_MailMessage.Subject = String.Format("{0} számú projekt", _ProjectHeader.DocumentNumber)
|
||||
_MailMessage.IsBodyHtml = True
|
||||
|
||||
_MailMessage.Body = TryCast(e.PopupWindow.View.SelectedObjects(0), ProjectNewEvents).Description
|
||||
|
||||
_SmtpClient.Port = _WebParameters.SMTPPort
|
||||
_SmtpClient.Credentials = New System.Net.NetworkCredential(_WebParameters.SMTPUserName, _WebParameters.SMTPPassword)
|
||||
_SmtpClient.EnableSsl = _WebParameters.EnableSsl
|
||||
|
||||
_SmtpClient.Send(_MailMessage)
|
||||
Catch ex As Exception
|
||||
Dim _onewEr As Xpo.XPObjectSpace = Application.CreateObjectSpace
|
||||
Dim sf As StackFrame = New StackFrame()
|
||||
Dim _ErrorLog As ErrorLog = _onewEr.CreateObject(Of ErrorLog)()
|
||||
_ErrorLog.Description = ex.Message
|
||||
_ErrorLog.SubName = TryCast(sf.GetMethod(), MethodBase).Name
|
||||
_onewEr.CommitChanges()
|
||||
End Try
|
||||
End If
|
||||
Next
|
||||
Catch ex As Exception
|
||||
Dim _onewEr As Xpo.XPObjectSpace = Application.CreateObjectSpace
|
||||
Dim sf As StackFrame = New StackFrame()
|
||||
Dim _ErrorLog As ErrorLog = _onewEr.CreateObject(Of ErrorLog)()
|
||||
_ErrorLog.Description = ex.Message
|
||||
_ErrorLog.SubName = TryCast(sf.GetMethod(), MethodBase).Name
|
||||
_onewEr.CommitChanges()
|
||||
End Try
|
||||
_ocur.CommitChanges()
|
||||
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message, MsgBoxStyle.OkOnly + MsgBoxStyle.Critical, String.Format(CaptionHelper.GetLocalizedText("Exceptions\NuvolarExceptions", "MsgBoxCheckItAgain")))
|
||||
End Try
|
||||
End Sub
|
||||
Private Sub UsersUppload(_User_Collection As ArrayList, _HRPerson_Collection As ArrayList, _ProjectHeader As ProjectHeader)
|
||||
For Each _ProjectContacts As ProjectContacts In _ProjectHeader.ProjectContacts
|
||||
If _User_Collection.Count = 0 Then
|
||||
_User_Collection.Add(_ProjectContacts.Contacts.User)
|
||||
Else
|
||||
If Not _User_Collection.Contains(_ProjectContacts.Contacts.User) Then _User_Collection.Add(_ProjectContacts.Contacts.User)
|
||||
End If
|
||||
Next
|
||||
|
||||
For Each _ProjectHRPerson As ProjectHRPerson In _ProjectHeader.ProjectHRPerson
|
||||
If _HRPerson_Collection.Count = 0 Then
|
||||
_HRPerson_Collection.Add(_ProjectHRPerson.HRPerson.User)
|
||||
Else
|
||||
If Not _HRPerson_Collection.Contains(_ProjectHRPerson.HRPerson.User) Then _HRPerson_Collection.Add(_ProjectHRPerson.HRPerson.User)
|
||||
End If
|
||||
Next
|
||||
|
||||
'---=== ProjectHeader.ProjectRows collections ===---
|
||||
For Each _ProjectRows As ProjectRows In _ProjectHeader.ProjectRows
|
||||
For Each _ProjectRowsContacts As ProjectRowsContacts In _ProjectRows.ProjectRowsContacts
|
||||
If _User_Collection.Count = 0 Then
|
||||
_User_Collection.Add(_ProjectRowsContacts.Contacts.User)
|
||||
Else
|
||||
If Not _User_Collection.Contains(_ProjectRowsContacts.Contacts.User) Then _User_Collection.Add(_ProjectRowsContacts.Contacts.User)
|
||||
End If
|
||||
Next
|
||||
|
||||
For Each _ProjectRowsHRPerson As ProjectRowsHRPerson In _ProjectRows.ProjectRowsHRPerson
|
||||
If _HRPerson_Collection.Count = 0 Then
|
||||
_HRPerson_Collection.Add(_ProjectRowsHRPerson.HRPerson.User)
|
||||
Else
|
||||
If Not _HRPerson_Collection.Contains(_ProjectRowsHRPerson.HRPerson.User) Then _HRPerson_Collection.Add(_ProjectRowsHRPerson.HRPerson.User)
|
||||
End If
|
||||
Next
|
||||
Next
|
||||
End Sub
|
||||
Private Sub UsersUppload_Selected(_User_Collection As ArrayList, _HRPerson_Collection As ArrayList, _ProjectRows_Collection As ArrayList, _ProjectHeader As ProjectHeader)
|
||||
For Each _ProjectContacts As ProjectContacts In _ProjectHeader.ProjectContacts
|
||||
If _User_Collection.Count = 0 Then
|
||||
_User_Collection.Add(_ProjectContacts.Contacts.User)
|
||||
Else
|
||||
If Not _User_Collection.Contains(_ProjectContacts.Contacts.User) Then _User_Collection.Add(_ProjectContacts.Contacts.User)
|
||||
End If
|
||||
Next
|
||||
|
||||
For Each _ProjectHRPerson As ProjectHRPerson In _ProjectHeader.ProjectHRPerson
|
||||
If _HRPerson_Collection.Count = 0 Then
|
||||
_HRPerson_Collection.Add(_ProjectHRPerson.HRPerson.User)
|
||||
Else
|
||||
If Not _HRPerson_Collection.Contains(_ProjectHRPerson.HRPerson.User) Then _HRPerson_Collection.Add(_ProjectHRPerson.HRPerson.User)
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
For Each _ProjectRows As ProjectRows In _ProjectRows_Collection
|
||||
For Each _ProjectRowsContacts As ProjectRowsContacts In _ProjectRows.ProjectRowsContacts
|
||||
If _User_Collection.Count = 0 Then
|
||||
_User_Collection.Add(_ProjectRowsContacts.Contacts.User)
|
||||
Else
|
||||
If Not _User_Collection.Contains(_ProjectRowsContacts.Contacts.User) Then _User_Collection.Add(_ProjectRowsContacts.Contacts.User)
|
||||
End If
|
||||
Next
|
||||
|
||||
For Each _ProjectRowsHRPerson As ProjectRowsHRPerson In _ProjectRows.ProjectRowsHRPerson
|
||||
If _HRPerson_Collection.Count = 0 Then
|
||||
_HRPerson_Collection.Add(_ProjectRowsHRPerson.HRPerson.User)
|
||||
Else
|
||||
If Not _HRPerson_Collection.Contains(_ProjectRowsHRPerson.HRPerson.User) Then _HRPerson_Collection.Add(_ProjectRowsHRPerson.HRPerson.User)
|
||||
End If
|
||||
Next
|
||||
Next
|
||||
End Sub
|
||||
Private Sub SendEmail(_Events As [Module].Events, _User As User, _ProjectHeader As ProjectHeader)
|
||||
Try
|
||||
Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace
|
||||
Dim _WebParameters As WebParameters = _onew.FindObject(Of WebParameters)(CriteriaOperator.Parse("1=1"))
|
||||
If _WebParameters Is Nothing Then Throw New Exception("*Nincsnek e-mail paraméterek beállítva!")
|
||||
If _WebParameters.SMTPHost Is Nothing Then Throw New Exception("*Nincs SMTP server beállítva!")
|
||||
If _WebParameters.SMTPUserName = "" Then Throw New Exception("*Nincs felhasználói név beállítva!")
|
||||
If _WebParameters.SMTPPort = 0 Then Throw New Exception("*Nincs SMTP port beállítva!")
|
||||
|
||||
If Not String.IsNullOrEmpty(_User.Email) Then
|
||||
Dim _MailMessage As New MailMessage
|
||||
Dim _SmtpClient As SmtpClient = New SmtpClient(_WebParameters.SMTPHost)
|
||||
_MailMessage.From = New MailAddress(_WebParameters.Email_SupportAdmin)
|
||||
_MailMessage.To.Add(_User.Email)
|
||||
_MailMessage.Subject = String.Format("{0} számú projekt", _ProjectHeader.DocumentNumber)
|
||||
_MailMessage.IsBodyHtml = True
|
||||
|
||||
_MailMessage.Body = _Events.Description
|
||||
|
||||
_SmtpClient.Port = _WebParameters.SMTPPort
|
||||
_SmtpClient.Credentials = New System.Net.NetworkCredential(_WebParameters.SMTPUserName, _WebParameters.SMTPPassword)
|
||||
_SmtpClient.EnableSsl = _WebParameters.EnableSsl
|
||||
|
||||
_SmtpClient.Send(_MailMessage)
|
||||
End If
|
||||
Catch ex As Exception
|
||||
Dim _onewEr As Xpo.XPObjectSpace = Application.CreateObjectSpace
|
||||
Dim sf As StackFrame = New StackFrame()
|
||||
Dim _ErrorLog As ErrorLog = _onewEr.CreateObject(Of ErrorLog)()
|
||||
_ErrorLog.Description = ex.Message
|
||||
_ErrorLog.SubName = TryCast(sf.GetMethod(), MethodBase).Name
|
||||
_onewEr.CommitChanges()
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Sub aProjectDeleteRow_Execute_1(sender As Object, e As SimpleActionExecuteEventArgs) Handles aProjectDeleteRow.Execute
|
||||
Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace
|
||||
Dim _ProjectRows As ProjectRows
|
||||
Dim _selecteditem As Long = 0
|
||||
Dim _Oid As String
|
||||
If _GanttControl IsNot Nothing Then
|
||||
_selecteditem = _GanttControl.Items.get_SelectedItem(0)
|
||||
_Oid = _GanttControl.Items.get_CellValue(_selecteditem, 0)
|
||||
_ProjectRows = _onew.FindObject(Of ProjectRows)(CriteriaOperator.Parse("Oid=?", _Oid))
|
||||
If _ProjectRows IsNot Nothing Then
|
||||
_onew.Delete(_ProjectRows)
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user