Tasks 184281, 184799, 184800, 184801 and 184802
Align .editorconfig files Move Controller logic to DMO classes GlobalVars.AppSettings = Models.AppSettings.GetFromConfigurationManager(); Question EditorConfig Project level editorconfig Format White Spaces AppSetting when EnvironmentVariable not set Corrective Actions Tests Schedule Actions Tests DMO Tests Controller Tests Get ready to use VSCode IDE
This commit is contained in:
parent
538b1f817e
commit
b1c6903c1c
380
Fab2ApprovalMKLink/.editorconfig
Normal file
380
Fab2ApprovalMKLink/.editorconfig
Normal file
@ -0,0 +1,380 @@
|
|||||||
|
[*.md]
|
||||||
|
end_of_line = crlf
|
||||||
|
file_header_template = unset
|
||||||
|
indent_size = 2
|
||||||
|
indent_style = space
|
||||||
|
insert_final_newline = false
|
||||||
|
root = true
|
||||||
|
tab_width = 2
|
||||||
|
[*.csproj]
|
||||||
|
end_of_line = crlf
|
||||||
|
file_header_template = unset
|
||||||
|
indent_size = 2
|
||||||
|
indent_style = space
|
||||||
|
insert_final_newline = false
|
||||||
|
root = true
|
||||||
|
tab_width = 2
|
||||||
|
[*.cs]
|
||||||
|
csharp_indent_block_contents = true
|
||||||
|
csharp_indent_braces = false
|
||||||
|
csharp_indent_case_contents = true
|
||||||
|
csharp_indent_case_contents_when_block = true
|
||||||
|
csharp_indent_labels = one_less_than_current
|
||||||
|
csharp_indent_switch_labels = true
|
||||||
|
csharp_new_line_before_catch = false
|
||||||
|
csharp_new_line_before_else = false
|
||||||
|
csharp_new_line_before_finally = false
|
||||||
|
csharp_new_line_before_members_in_anonymous_types = true
|
||||||
|
csharp_new_line_before_members_in_object_initializers = true
|
||||||
|
csharp_new_line_before_open_brace = none
|
||||||
|
csharp_new_line_between_query_expression_clauses = true
|
||||||
|
csharp_prefer_braces = false
|
||||||
|
csharp_prefer_qualified_reference = true:error
|
||||||
|
csharp_prefer_simple_default_expression = true:warning
|
||||||
|
csharp_prefer_simple_using_statement = true:warning
|
||||||
|
csharp_prefer_static_local_function = true:warning
|
||||||
|
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async
|
||||||
|
csharp_preserve_single_line_blocks = true
|
||||||
|
csharp_preserve_single_line_statements = false
|
||||||
|
csharp_space_after_cast = false
|
||||||
|
csharp_space_after_colon_in_inheritance_clause = true
|
||||||
|
csharp_space_after_comma = true
|
||||||
|
csharp_space_after_dot = false
|
||||||
|
csharp_space_after_keywords_in_control_flow_statements = true
|
||||||
|
csharp_space_after_semicolon_in_for_statement = true
|
||||||
|
csharp_space_around_binary_operators = before_and_after
|
||||||
|
csharp_space_around_declaration_statements = false
|
||||||
|
csharp_space_before_colon_in_inheritance_clause = true
|
||||||
|
csharp_space_before_comma = false
|
||||||
|
csharp_space_before_dot = false
|
||||||
|
csharp_space_before_open_square_brackets = false
|
||||||
|
csharp_space_before_semicolon_in_for_statement = false
|
||||||
|
csharp_space_between_empty_square_brackets = false
|
||||||
|
csharp_space_between_method_call_empty_parameter_list_parentheses = false
|
||||||
|
csharp_space_between_method_call_name_and_opening_parenthesis = false
|
||||||
|
csharp_space_between_method_call_parameter_list_parentheses = false
|
||||||
|
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
|
||||||
|
csharp_space_between_method_declaration_name_and_open_parenthesis = false
|
||||||
|
csharp_space_between_method_declaration_parameter_list_parentheses = false
|
||||||
|
csharp_space_between_parentheses = false
|
||||||
|
csharp_space_between_square_brackets = false
|
||||||
|
csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true
|
||||||
|
csharp_style_allow_blank_line_after_token_in_arrow_expression_clause_experimental = true
|
||||||
|
csharp_style_allow_blank_line_after_token_in_conditional_expression_experimental = true
|
||||||
|
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = false
|
||||||
|
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true
|
||||||
|
csharp_style_allow_embedded_statements_on_same_line_experimental = true
|
||||||
|
csharp_style_conditional_delegate_call = true
|
||||||
|
csharp_style_deconstructed_variable_declaration = false
|
||||||
|
csharp_style_expression_bodied_accessors = when_on_single_line:warning
|
||||||
|
csharp_style_expression_bodied_constructors = when_on_single_line:warning
|
||||||
|
csharp_style_expression_bodied_indexers = when_on_single_line:warning
|
||||||
|
csharp_style_expression_bodied_lambdas = when_on_single_line:warning
|
||||||
|
csharp_style_expression_bodied_local_functions = when_on_single_line:warning
|
||||||
|
csharp_style_expression_bodied_methods = when_on_single_line:warning
|
||||||
|
csharp_style_expression_bodied_operators = when_on_single_line:warning
|
||||||
|
csharp_style_expression_bodied_properties = when_on_single_line:warning
|
||||||
|
csharp_style_implicit_object_creation_when_type_is_apparent = true:warning
|
||||||
|
csharp_style_inlined_variable_declaration = false
|
||||||
|
csharp_style_namespace_declarations = file_scoped:warning
|
||||||
|
csharp_style_pattern_local_over_anonymous_function = true:warning
|
||||||
|
csharp_style_pattern_matching_over_as_with_null_check = true:warning
|
||||||
|
csharp_style_pattern_matching_over_is_with_cast_check = true:warning
|
||||||
|
csharp_style_prefer_index_operator = true:warning
|
||||||
|
csharp_style_prefer_not_pattern = true:warning
|
||||||
|
csharp_style_prefer_null_check_over_type_check = true
|
||||||
|
csharp_style_prefer_pattern_matching = true:warning
|
||||||
|
csharp_style_prefer_range_operator = true:warning
|
||||||
|
csharp_style_prefer_switch_expression = true:warning
|
||||||
|
csharp_style_throw_expression = true
|
||||||
|
csharp_style_unused_value_assignment_preference = discard_variable:warning
|
||||||
|
csharp_style_unused_value_expression_statement_preference = discard_variable:warning
|
||||||
|
csharp_style_var_elsewhere = false:warning
|
||||||
|
csharp_style_var_for_built_in_types = false:warning
|
||||||
|
csharp_style_var_when_type_is_apparent = false:warning
|
||||||
|
csharp_using_directive_placement = outside_namespace
|
||||||
|
dotnet_analyzer_diagnostic.category-Design.severity = error
|
||||||
|
dotnet_analyzer_diagnostic.category-Documentation.severity = error
|
||||||
|
dotnet_analyzer_diagnostic.category-Globalization.severity = none
|
||||||
|
dotnet_analyzer_diagnostic.category-Interoperability.severity = error
|
||||||
|
dotnet_analyzer_diagnostic.category-Maintainability.severity = error
|
||||||
|
dotnet_analyzer_diagnostic.category-Naming.severity = none
|
||||||
|
dotnet_analyzer_diagnostic.category-Performance.severity = none
|
||||||
|
dotnet_analyzer_diagnostic.category-Reliability.severity = error
|
||||||
|
dotnet_analyzer_diagnostic.category-Security.severity = error
|
||||||
|
dotnet_analyzer_diagnostic.category-SingleFile.severity = error
|
||||||
|
dotnet_analyzer_diagnostic.category-Style.severity = error
|
||||||
|
dotnet_analyzer_diagnostic.category-Usage.severity = error
|
||||||
|
dotnet_code_quality_unused_parameters = all
|
||||||
|
dotnet_code_quality_unused_parameters = non_public
|
||||||
|
dotnet_code_quality.CAXXXX.api_surface = private, internal
|
||||||
|
dotnet_diagnostic.CA1001.severity = error # CA1001: Types that own disposable fields should be disposable
|
||||||
|
dotnet_diagnostic.CA1051.severity = error # CA1051: Do not declare visible instance fields
|
||||||
|
dotnet_diagnostic.CA1511.severity = warning # CA1511: Use 'ArgumentException.ThrowIfNullOrEmpty' instead of explicitly throwing a new exception instance
|
||||||
|
dotnet_diagnostic.CA1513.severity = warning # Use 'ObjectDisposedException.ThrowIf' instead of explicitly throwing a new exception instance
|
||||||
|
dotnet_diagnostic.CA1825.severity = warning # CA1825: Avoid zero-length array allocations
|
||||||
|
dotnet_diagnostic.CA1829.severity = error # CA1829: Use Length/Count property instead of Count() when available
|
||||||
|
dotnet_diagnostic.CA1834.severity = warning # CA1834: Consider using 'StringBuilder.Append(char)' when applicable
|
||||||
|
dotnet_diagnostic.CA1860.severity = error # CA1860: Prefer comparing 'Count' to 0 rather than using 'Any()', both for clarity and for performance
|
||||||
|
dotnet_diagnostic.CA1862.severity = warning # CA1862: Prefer using 'string.Equals(string, StringComparison)' to perform a case-insensitive comparison, but keep in mind that this might cause subtle changes in behavior, so make sure to conduct thorough testing after applying the suggestion, or if culturally sensitive comparison is not required, consider using 'StringComparison.OrdinalIgnoreCase'
|
||||||
|
dotnet_diagnostic.CA1869.severity = none # CA1869: Avoid creating a new 'JsonSerializerOptions' instance for every serialization operation. Cache and reuse instances instead.
|
||||||
|
dotnet_diagnostic.CA2201.severity = none # CA2201: Exception type System.NullReferenceException is reserved by the runtime
|
||||||
|
dotnet_diagnostic.CA2254.severity = none # CA2254: The logging message template should not vary between calls to 'LoggerExtensions.LogInformation(ILogger, string?, params object?[])'
|
||||||
|
dotnet_diagnostic.IDE0001.severity = warning # IDE0001: Simplify name
|
||||||
|
dotnet_diagnostic.IDE0002.severity = warning # Simplify (member access) - System.Version.Equals("1", "2"); Version.Equals("1", "2");
|
||||||
|
dotnet_diagnostic.IDE0004.severity = warning # IDE0004: Cast is redundant.
|
||||||
|
dotnet_diagnostic.IDE0005.severity = error # Using directive is unnecessary
|
||||||
|
dotnet_diagnostic.IDE0010.severity = none # Add missing cases to switch statement (IDE0010)
|
||||||
|
dotnet_diagnostic.IDE0028.severity = error # IDE0028: Collection initialization can be simplified
|
||||||
|
dotnet_diagnostic.IDE0031.severity = warning # Use null propagation (IDE0031)
|
||||||
|
dotnet_diagnostic.IDE0047.severity = warning # IDE0047: Parentheses can be removed
|
||||||
|
dotnet_diagnostic.IDE0048.severity = none # Parentheses preferences (IDE0047 and IDE0048)
|
||||||
|
dotnet_diagnostic.IDE0049.severity = warning # Use language keywords instead of framework type names for type references (IDE0049)
|
||||||
|
dotnet_diagnostic.IDE0051.severity = error # Private member '' is unused [, ]
|
||||||
|
dotnet_diagnostic.IDE0058.severity = error # IDE0058: Expression value is never used
|
||||||
|
dotnet_diagnostic.IDE0060.severity = error # IDE0060: Remove unused parameter
|
||||||
|
dotnet_diagnostic.IDE0074.severity = warning # IDE0074: Use compound assignment
|
||||||
|
dotnet_diagnostic.IDE0130.severity = none # Namespace does not match folder structure (IDE0130)
|
||||||
|
dotnet_diagnostic.IDE0270.severity = warning # IDE0270: Null check can be simplified
|
||||||
|
dotnet_diagnostic.IDE0290.severity = none # Use primary constructor [Distance]csharp(IDE0290)
|
||||||
|
dotnet_diagnostic.IDE0300.severity = error # IDE0300: Collection initialization can be simplified
|
||||||
|
dotnet_diagnostic.IDE0301.severity = error #IDE0301: Collection initialization can be simplified
|
||||||
|
dotnet_diagnostic.IDE0305.severity = none # IDE0305: Collection initialization can be simplified
|
||||||
|
dotnet_diagnostic.IDE2000.severity = error # IDE2000: Allow multiple blank lines
|
||||||
|
dotnet_naming_rule.abstract_method_should_be_pascal_case.severity = warning
|
||||||
|
dotnet_naming_rule.abstract_method_should_be_pascal_case.style = pascal_case
|
||||||
|
dotnet_naming_rule.abstract_method_should_be_pascal_case.symbols = abstract_method
|
||||||
|
dotnet_naming_rule.class_should_be_pascal_case.severity = warning
|
||||||
|
dotnet_naming_rule.class_should_be_pascal_case.style = pascal_case
|
||||||
|
dotnet_naming_rule.class_should_be_pascal_case.symbols = class
|
||||||
|
dotnet_naming_rule.delegate_should_be_pascal_case.severity = warning
|
||||||
|
dotnet_naming_rule.delegate_should_be_pascal_case.style = pascal_case
|
||||||
|
dotnet_naming_rule.delegate_should_be_pascal_case.symbols = delegate
|
||||||
|
dotnet_naming_rule.enum_should_be_pascal_case.severity = warning
|
||||||
|
dotnet_naming_rule.enum_should_be_pascal_case.style = pascal_case
|
||||||
|
dotnet_naming_rule.enum_should_be_pascal_case.symbols = enum
|
||||||
|
dotnet_naming_rule.event_should_be_pascal_case.severity = warning
|
||||||
|
dotnet_naming_rule.event_should_be_pascal_case.style = pascal_case
|
||||||
|
dotnet_naming_rule.event_should_be_pascal_case.symbols = event
|
||||||
|
dotnet_naming_rule.interface_should_be_begins_with_i.severity = warning
|
||||||
|
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i
|
||||||
|
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
|
||||||
|
dotnet_naming_rule.method_should_be_pascal_case.severity = warning
|
||||||
|
dotnet_naming_rule.method_should_be_pascal_case.style = pascal_case
|
||||||
|
dotnet_naming_rule.method_should_be_pascal_case.symbols = method
|
||||||
|
dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = warning
|
||||||
|
dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
|
||||||
|
dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
|
||||||
|
dotnet_naming_rule.private_method_should_be_pascal_case.severity = warning
|
||||||
|
dotnet_naming_rule.private_method_should_be_pascal_case.style = pascal_case
|
||||||
|
dotnet_naming_rule.private_method_should_be_pascal_case.symbols = private_method
|
||||||
|
dotnet_naming_rule.private_or_internal_field_should_be_private_of_internal_field.severity = warning
|
||||||
|
dotnet_naming_rule.private_or_internal_field_should_be_private_of_internal_field.style = private_of_internal_field
|
||||||
|
dotnet_naming_rule.private_or_internal_field_should_be_private_of_internal_field.symbols = private_or_internal_field
|
||||||
|
dotnet_naming_rule.private_or_internal_static_field_should_be_private_of_internal_field.severity = warning
|
||||||
|
dotnet_naming_rule.private_or_internal_static_field_should_be_private_of_internal_field.style = private_of_internal_field
|
||||||
|
dotnet_naming_rule.private_or_internal_static_field_should_be_private_of_internal_field.symbols = private_or_internal_static_field
|
||||||
|
dotnet_naming_rule.property_should_be_pascal_case.severity = warning
|
||||||
|
dotnet_naming_rule.property_should_be_pascal_case.style = pascal_case
|
||||||
|
dotnet_naming_rule.property_should_be_pascal_case.symbols = property
|
||||||
|
dotnet_naming_rule.public_or_protected_field_should_be_private_of_internal_field.severity = warning
|
||||||
|
dotnet_naming_rule.public_or_protected_field_should_be_private_of_internal_field.style = private_of_internal_field
|
||||||
|
dotnet_naming_rule.public_or_protected_field_should_be_private_of_internal_field.symbols = public_or_protected_field
|
||||||
|
dotnet_naming_rule.static_field_should_be_pascal_case.severity = warning
|
||||||
|
dotnet_naming_rule.static_field_should_be_pascal_case.style = pascal_case
|
||||||
|
dotnet_naming_rule.static_field_should_be_pascal_case.symbols = static_field
|
||||||
|
dotnet_naming_rule.static_method_should_be_pascal_case.severity = warning
|
||||||
|
dotnet_naming_rule.static_method_should_be_pascal_case.style = pascal_case
|
||||||
|
dotnet_naming_rule.static_method_should_be_pascal_case.symbols = static_method
|
||||||
|
dotnet_naming_rule.struct_should_be_pascal_case.severity = warning
|
||||||
|
dotnet_naming_rule.struct_should_be_pascal_case.style = pascal_case
|
||||||
|
dotnet_naming_rule.struct_should_be_pascal_case.symbols = struct
|
||||||
|
dotnet_naming_rule.types_should_be_pascal_case.severity = warning
|
||||||
|
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
|
||||||
|
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
|
||||||
|
dotnet_naming_style.begins_with_i.capitalization = pascal_case
|
||||||
|
dotnet_naming_style.begins_with_i.required_prefix = I
|
||||||
|
dotnet_naming_style.begins_with_i.required_suffix =
|
||||||
|
dotnet_naming_style.begins_with_i.word_separator =
|
||||||
|
dotnet_naming_style.pascal_case.capitalization = pascal_case
|
||||||
|
dotnet_naming_style.pascal_case.required_prefix =
|
||||||
|
dotnet_naming_style.pascal_case.required_suffix =
|
||||||
|
dotnet_naming_style.pascal_case.word_separator =
|
||||||
|
dotnet_naming_style.private_of_internal_field.capitalization = pascal_case
|
||||||
|
dotnet_naming_style.private_of_internal_field.required_prefix = _
|
||||||
|
dotnet_naming_style.private_of_internal_field.required_suffix =
|
||||||
|
dotnet_naming_style.private_of_internal_field.word_separator =
|
||||||
|
dotnet_naming_symbols.abstract_method.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||||
|
dotnet_naming_symbols.abstract_method.applicable_kinds = method
|
||||||
|
dotnet_naming_symbols.abstract_method.required_modifiers = abstract
|
||||||
|
dotnet_naming_symbols.class.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||||
|
dotnet_naming_symbols.class.applicable_kinds = class
|
||||||
|
dotnet_naming_symbols.class.required_modifiers =
|
||||||
|
dotnet_naming_symbols.delegate.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||||
|
dotnet_naming_symbols.delegate.applicable_kinds = delegate
|
||||||
|
dotnet_naming_symbols.delegate.required_modifiers =
|
||||||
|
dotnet_naming_symbols.enum.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||||
|
dotnet_naming_symbols.enum.applicable_kinds = enum
|
||||||
|
dotnet_naming_symbols.enum.required_modifiers =
|
||||||
|
dotnet_naming_symbols.event.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||||
|
dotnet_naming_symbols.event.applicable_kinds = event
|
||||||
|
dotnet_naming_symbols.event.required_modifiers =
|
||||||
|
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||||
|
dotnet_naming_symbols.interface.applicable_kinds = interface
|
||||||
|
dotnet_naming_symbols.interface.required_modifiers =
|
||||||
|
dotnet_naming_symbols.method.applicable_accessibilities = public
|
||||||
|
dotnet_naming_symbols.method.applicable_kinds = method
|
||||||
|
dotnet_naming_symbols.method.required_modifiers =
|
||||||
|
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||||
|
dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
|
||||||
|
dotnet_naming_symbols.non_field_members.required_modifiers =
|
||||||
|
dotnet_naming_symbols.private_method.applicable_accessibilities = private
|
||||||
|
dotnet_naming_symbols.private_method.applicable_kinds = method
|
||||||
|
dotnet_naming_symbols.private_method.required_modifiers =
|
||||||
|
dotnet_naming_symbols.private_or_internal_field.applicable_accessibilities = internal, private, private_protected
|
||||||
|
dotnet_naming_symbols.private_or_internal_field.applicable_kinds = field
|
||||||
|
dotnet_naming_symbols.private_or_internal_field.required_modifiers =
|
||||||
|
dotnet_naming_symbols.private_or_internal_static_field.applicable_accessibilities = internal, private, private_protected
|
||||||
|
dotnet_naming_symbols.private_or_internal_static_field.applicable_kinds = field
|
||||||
|
dotnet_naming_symbols.private_or_internal_static_field.required_modifiers = static
|
||||||
|
dotnet_naming_symbols.property.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||||
|
dotnet_naming_symbols.property.applicable_kinds = property
|
||||||
|
dotnet_naming_symbols.property.required_modifiers =
|
||||||
|
dotnet_naming_symbols.public_or_protected_field.applicable_accessibilities = public, protected
|
||||||
|
dotnet_naming_symbols.public_or_protected_field.applicable_kinds = field
|
||||||
|
dotnet_naming_symbols.public_or_protected_field.required_modifiers =
|
||||||
|
dotnet_naming_symbols.static_field.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||||
|
dotnet_naming_symbols.static_field.applicable_kinds = field
|
||||||
|
dotnet_naming_symbols.static_field.required_modifiers = static
|
||||||
|
dotnet_naming_symbols.static_method.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||||
|
dotnet_naming_symbols.static_method.applicable_kinds = method
|
||||||
|
dotnet_naming_symbols.static_method.required_modifiers = static
|
||||||
|
dotnet_naming_symbols.struct.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||||
|
dotnet_naming_symbols.struct.applicable_kinds = struct
|
||||||
|
dotnet_naming_symbols.struct.required_modifiers =
|
||||||
|
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||||
|
dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
|
||||||
|
dotnet_naming_symbols.types.required_modifiers =
|
||||||
|
dotnet_remove_unnecessary_suppression_exclusions = 0
|
||||||
|
dotnet_separate_import_directive_groups = true
|
||||||
|
dotnet_sort_system_directives_first = true
|
||||||
|
dotnet_style_allow_multiple_blank_lines_experimental = false:warning
|
||||||
|
dotnet_style_allow_statement_immediately_after_block_experimental = true
|
||||||
|
dotnet_style_coalesce_expression = true
|
||||||
|
dotnet_style_collection_initializer = true:warning
|
||||||
|
dotnet_style_explicit_tuple_names = true:warning
|
||||||
|
dotnet_style_namespace_match_folder = true
|
||||||
|
dotnet_style_null_propagation = true:warning
|
||||||
|
dotnet_style_object_initializer = true:warning
|
||||||
|
dotnet_style_operator_placement_when_wrapping = beginning_of_line
|
||||||
|
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity
|
||||||
|
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity
|
||||||
|
dotnet_style_parentheses_in_other_operators = never_if_unnecessary
|
||||||
|
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity
|
||||||
|
dotnet_style_predefined_type_for_locals_parameters_members = true
|
||||||
|
dotnet_style_predefined_type_for_member_access = true:warning
|
||||||
|
dotnet_style_prefer_auto_properties = true:warning
|
||||||
|
dotnet_style_prefer_compound_assignment = true:warning
|
||||||
|
dotnet_style_prefer_conditional_expression_over_assignment = false
|
||||||
|
dotnet_style_prefer_conditional_expression_over_return = false
|
||||||
|
dotnet_style_prefer_inferred_anonymous_type_member_names = true:warning
|
||||||
|
dotnet_style_prefer_inferred_tuple_names = true:warning
|
||||||
|
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:warning
|
||||||
|
dotnet_style_prefer_simplified_boolean_expressions = true:warning
|
||||||
|
dotnet_style_prefer_simplified_interpolation = true
|
||||||
|
dotnet_style_qualification_for_event = false:error
|
||||||
|
dotnet_style_qualification_for_field = false
|
||||||
|
dotnet_style_qualification_for_method = false:error
|
||||||
|
dotnet_style_qualification_for_property = false:error
|
||||||
|
dotnet_style_readonly_field = true:warning
|
||||||
|
dotnet_style_require_accessibility_modifiers = for_non_interface_members
|
||||||
|
end_of_line = crlf
|
||||||
|
file_header_template = unset
|
||||||
|
indent_size = 4
|
||||||
|
indent_style = space
|
||||||
|
insert_final_newline = false
|
||||||
|
root = true
|
||||||
|
tab_width = 4
|
||||||
|
# https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1822
|
||||||
|
# https://github.com/dotnet/aspnetcore/blob/main/.editorconfig
|
||||||
|
# https://github.com/dotnet/project-system/blob/main/.editorconfig
|
||||||
|
|
||||||
|
# Question
|
||||||
|
csharp_prefer_simple_using_statement = false # Question
|
||||||
|
csharp_style_expression_bodied_constructors = when_on_single_line:none # Question
|
||||||
|
csharp_style_expression_bodied_properties = true # Question
|
||||||
|
csharp_style_implicit_object_creation_when_type_is_apparent = true:warning # Question
|
||||||
|
csharp_style_pattern_matching_over_as_with_null_check = false # Question
|
||||||
|
csharp_style_prefer_pattern_matching = false # Question
|
||||||
|
csharp_style_prefer_range_operator = false # Question
|
||||||
|
csharp_style_prefer_switch_expression = false # Question
|
||||||
|
csharp_style_unused_value_assignment_preference = unused_local_variable # Question
|
||||||
|
csharp_style_unused_value_expression_statement_preference = false # Question
|
||||||
|
csharp_style_var_elsewhere = false:none # Question
|
||||||
|
csharp_style_var_for_built_in_types = false:none # Question
|
||||||
|
csharp_style_var_when_type_is_apparent = false:warning # Question
|
||||||
|
dotnet_diagnostic.CA1001.severity = none # Question - Types that own disposable fields should be disposable
|
||||||
|
dotnet_diagnostic.CA1051.severity = none # Question - Do not declare visible instance fields
|
||||||
|
dotnet_diagnostic.CA1416.severity = none # Question - This call site is reachable on all platforms.
|
||||||
|
dotnet_diagnostic.CA1510.severity = none # Question - Use
|
||||||
|
dotnet_diagnostic.CA1834.severity = none # CA1834: Consider using 'StringBuilder.Append(char)' when applicable
|
||||||
|
dotnet_diagnostic.CA1860.severity = none # Question - Avoid using
|
||||||
|
dotnet_diagnostic.CA1862.severity = none # Question - Prefer using
|
||||||
|
dotnet_diagnostic.CA2208.severity = none # Question - Instantiate argument exceptions correctly
|
||||||
|
dotnet_diagnostic.CA2211.severity = none # Question - Non-constant fields should not be visible
|
||||||
|
dotnet_diagnostic.CA2249.severity = none # Question - Use
|
||||||
|
dotnet_diagnostic.CA2253.severity = none # Question - Named placeholders should not be numeric values
|
||||||
|
dotnet_diagnostic.CS0103.severity = none # Question - The name
|
||||||
|
dotnet_diagnostic.CS0168.severity = none # Question - The variable
|
||||||
|
dotnet_diagnostic.CS0219.severity = none # Question - The variable
|
||||||
|
dotnet_diagnostic.CS0612.severity = none # Question - is obsolete
|
||||||
|
dotnet_diagnostic.CS0618.severity = none # Question - Compiler Warning (level 2)
|
||||||
|
dotnet_diagnostic.CS0659.severity = none # Question - Compiler Warning (level 3)
|
||||||
|
dotnet_diagnostic.CS8019.severity = warning # Question - Unnecessary using directive.
|
||||||
|
dotnet_diagnostic.CS8600.severity = none # Question - Converting null literal or possible null value to non-nullable type
|
||||||
|
dotnet_diagnostic.CS8602.severity = none # Question - Dereference of a possibly null reference.
|
||||||
|
dotnet_diagnostic.CS8603.severity = none # Question - Possible null reference return
|
||||||
|
dotnet_diagnostic.CS8604.severity = none # Question - Possible null reference argument for parameter.
|
||||||
|
dotnet_diagnostic.CS8618.severity = none # Question - Non-nullable variable must contain a non-null value when exiting constructor
|
||||||
|
dotnet_diagnostic.CS8625.severity = none # Question - Cannot convert null literal to non-nullable reference type.
|
||||||
|
dotnet_diagnostic.CS8629.severity = none # Question - Nullable value type may be null
|
||||||
|
dotnet_diagnostic.CS8765.severity = none # Question - Nullability of type of parameter
|
||||||
|
dotnet_diagnostic.IDE0005.severity = none # Question - Remove unnecessary using directives
|
||||||
|
dotnet_diagnostic.IDE0008.severity = warning # Question - Use explicit type instead of
|
||||||
|
dotnet_diagnostic.IDE0017.severity = none # Question - Object initialization can be simplified
|
||||||
|
dotnet_diagnostic.IDE0019.severity = none # Question - Use pattern matching
|
||||||
|
dotnet_diagnostic.IDE0021.severity = none # Question - Use expression body for constructor
|
||||||
|
dotnet_diagnostic.IDE0022.severity = none # Question - Use expression body for method
|
||||||
|
dotnet_diagnostic.IDE0025.severity = none # Question - Use expression body for property
|
||||||
|
dotnet_diagnostic.IDE0027.severity = none # Question - Use expression body for accessor
|
||||||
|
dotnet_diagnostic.IDE0028.severity = none # Question - Use collection initializers or expressions
|
||||||
|
dotnet_diagnostic.IDE0031.severity = none # Question - Null check can be simplified
|
||||||
|
dotnet_diagnostic.IDE0032.severity = none # Question - Use auto property
|
||||||
|
dotnet_diagnostic.IDE0037.severity = none # Question - Member name can be simplified
|
||||||
|
dotnet_diagnostic.IDE0041.severity = none # Question - Null check can be simplified
|
||||||
|
dotnet_diagnostic.IDE0047.severity = none # Question - Parentheses preferences
|
||||||
|
dotnet_diagnostic.IDE0049.severity = warning # Question - Name can be simplified
|
||||||
|
dotnet_diagnostic.IDE0051.severity = none # Question - Remove unused private member
|
||||||
|
dotnet_diagnostic.IDE0053.severity = none # Question - Use expression body for lambdas
|
||||||
|
dotnet_diagnostic.IDE0054.severity = none # Question - Use compound assignment
|
||||||
|
dotnet_diagnostic.IDE0055.severity = none # Question - Formatting rule
|
||||||
|
dotnet_diagnostic.IDE0057.severity = none # Question - Substring can be simplified
|
||||||
|
dotnet_diagnostic.IDE0058.severity = none # Question - Remove unnecessary expression value
|
||||||
|
dotnet_diagnostic.IDE0059.severity = none # Question - Unnecessary assignment of a value to
|
||||||
|
dotnet_diagnostic.IDE0060.severity = none # Question - Remove unused parameter
|
||||||
|
dotnet_diagnostic.IDE0063.severity = none # Question - Use simple
|
||||||
|
dotnet_diagnostic.IDE0065.severity = none # Question -
|
||||||
|
dotnet_diagnostic.IDE0066.severity = none # Question - Use
|
||||||
|
dotnet_diagnostic.IDE0078.severity = none # Question - Use pattern matching (may change code meaning)
|
||||||
|
dotnet_diagnostic.IDE0090.severity = warning # Question - Simplify new expression
|
||||||
|
dotnet_diagnostic.IDE0160.severity = warning # Question - Use block-scoped namespace
|
||||||
|
dotnet_diagnostic.IDE0161.severity = warning # Question - Namespace declaration preferences
|
||||||
|
dotnet_diagnostic.IDE0270.severity = none # Question - Null check can be simplified
|
||||||
|
dotnet_diagnostic.IDE0300.severity = none # Question - Collection initialization can be simplified
|
||||||
|
dotnet_diagnostic.IDE1006.severity = none # Question - Use collection expression for builder dotnet_style_prefer_collection_expression
|
||||||
|
dotnet_style_null_propagation = false # Question
|
||||||
|
dotnet_style_object_initializer = false # Question
|
||||||
|
dotnet_style_prefer_auto_properties = false # Question
|
||||||
|
dotnet_style_allow_statement_immediately_after_block_experimental = true # Question
|
||||||
|
dotnet_style_prefer_inferred_anonymous_type_member_names = false:warning # Question
|
||||||
|
dotnet_style_prefer_is_null_check_over_reference_equality_method = false # Question
|
1
Fab2ApprovalMKLink/.vscode/format-report.json
vendored
Normal file
1
Fab2ApprovalMKLink/.vscode/format-report.json
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
[]
|
33
Fab2ApprovalMKLink/.vscode/launch.json
vendored
Normal file
33
Fab2ApprovalMKLink/.vscode/launch.json
vendored
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
{
|
||||||
|
// Use IntelliSense to learn about possible attributes.
|
||||||
|
// Hover to view descriptions of existing attributes.
|
||||||
|
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||||
|
"version": "0.2.0",
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"name": ".NET Core Launch (console)",
|
||||||
|
"type": "coreclr",
|
||||||
|
"request": "launch",
|
||||||
|
"preLaunchTask": "build",
|
||||||
|
"program": "${workspaceFolder}/bin/Debug/net8.0/Fab2ApprovalMKLink.dll",
|
||||||
|
"args": [
|
||||||
|
"s",
|
||||||
|
"test"
|
||||||
|
],
|
||||||
|
"cwd": "${workspaceFolder}",
|
||||||
|
"console": "integratedTerminal",
|
||||||
|
"stopAtEntry": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": ".NET Core Attach",
|
||||||
|
"type": "coreclr",
|
||||||
|
"request": "attach"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "node",
|
||||||
|
"request": "launch",
|
||||||
|
"name": "node Launch Current Opened File",
|
||||||
|
"program": "${file}"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
37
Fab2ApprovalMKLink/.vscode/mklink.md
vendored
Normal file
37
Fab2ApprovalMKLink/.vscode/mklink.md
vendored
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
# mklink
|
||||||
|
|
||||||
|
```bash 1731546128283 = 638671429282830000 = Wed Nov 13 2024 18:02:07 GMT-0700 (Mountain Standard Time)
|
||||||
|
mklink /J "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalMKLink\App_Start" "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalSystem\App_Start"
|
||||||
|
mklink /J "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalMKLink\bin" "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalSystem\bin"
|
||||||
|
mklink /J "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalMKLink\Content" "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalSystem\Content"
|
||||||
|
mklink /J "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalMKLink\Controllers" "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalSystem\Controllers"
|
||||||
|
mklink /J "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalMKLink\DMO" "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalSystem\DMO"
|
||||||
|
mklink /J "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalMKLink\EmailTemplates" "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalSystem\EmailTemplates"
|
||||||
|
mklink /J "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalMKLink\fonts" "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalSystem\fonts"
|
||||||
|
mklink /J "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalMKLink\FTPBatch" "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalSystem\FTPBatch"
|
||||||
|
mklink /J "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalMKLink\Jobs" "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalSystem\Jobs"
|
||||||
|
mklink /J "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalMKLink\JobSchedules" "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalSystem\JobSchedules"
|
||||||
|
mklink /J "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalMKLink\Lib" "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalSystem\Lib"
|
||||||
|
mklink /J "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalMKLink\Misc" "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalSystem\Misc"
|
||||||
|
mklink /J "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalMKLink\Models" "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalSystem\Models"
|
||||||
|
mklink /J "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalMKLink\obj" "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalSystem\obj"
|
||||||
|
mklink /J "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalMKLink\PdfGenerator" "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalSystem\PdfGenerator"
|
||||||
|
mklink /J "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalMKLink\Properties" "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalSystem\Properties"
|
||||||
|
mklink /J "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalMKLink\SafeModels" "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalSystem\SafeModels"
|
||||||
|
mklink /J "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalMKLink\Scripts" "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalSystem\Scripts"
|
||||||
|
mklink /J "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalMKLink\Utilities" "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalSystem\Utilities"
|
||||||
|
mklink /J "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalMKLink\View" "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalSystem\View"
|
||||||
|
mklink /J "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalMKLink\ViewModels" "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalSystem\ViewModels"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash 1731615429577 = 638672122295770000 = Thu Nov 14 2024 13:17:09 GMT-0700 (Mountain Standard Time)
|
||||||
|
mklink /J "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalMKLink\.vscode\.UserSecrets" "C:\Users\phares\AppData\Roaming\Microsoft\UserSecrets\f2da5035-aba9-4676-9f8d-d6689f84663d"
|
||||||
|
mklink /J "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalMKLink\ViewModels" "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalSystem\ViewModels"
|
||||||
|
mklink /J "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalMKLink\Models" "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalSystem\Models"
|
||||||
|
mklink /J "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalMKLink\Misc" "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalSystem\Misc"
|
||||||
|
mklink /J "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalMKLink\DMO" "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalSystem\DMO"
|
||||||
|
mklink /J "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalMKLink\Utilities" "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalSystem\Utilities"
|
||||||
|
mklink /J "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalMKLink\PdfGenerator" "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalSystem\PdfGenerator"
|
||||||
|
mklink /J "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalMKLink\Jobs" "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalSystem\Jobs"
|
||||||
|
mklink /J "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalMKLink\JobSchedules" "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalSystem\JobSchedules"
|
||||||
|
```
|
424
Fab2ApprovalMKLink/.vscode/settings.json
vendored
Normal file
424
Fab2ApprovalMKLink/.vscode/settings.json
vendored
Normal file
@ -0,0 +1,424 @@
|
|||||||
|
{
|
||||||
|
"[markdown]": {
|
||||||
|
"editor.wordWrap": "off"
|
||||||
|
},
|
||||||
|
"files.exclude": {
|
||||||
|
"**/.git": false,
|
||||||
|
"**/node_modules": true
|
||||||
|
},
|
||||||
|
"files.watcherExclude": {
|
||||||
|
"**/node_modules": true
|
||||||
|
},
|
||||||
|
"cSpell.words": [
|
||||||
|
"abutton",
|
||||||
|
"accessibilities",
|
||||||
|
"accodingly",
|
||||||
|
"acknowledgmentby",
|
||||||
|
"Acks",
|
||||||
|
"actionsheet",
|
||||||
|
"Additonal",
|
||||||
|
"Addtional",
|
||||||
|
"againm",
|
||||||
|
"agendaview",
|
||||||
|
"Antlr",
|
||||||
|
"Appover",
|
||||||
|
"Appprrovers",
|
||||||
|
"Approvalog",
|
||||||
|
"Aprovers",
|
||||||
|
"Aproverslist",
|
||||||
|
"asax",
|
||||||
|
"aspnetmvc",
|
||||||
|
"Assignedto",
|
||||||
|
"Atachments",
|
||||||
|
"Attachemnt",
|
||||||
|
"Attachemnts",
|
||||||
|
"Attchment",
|
||||||
|
"auditee",
|
||||||
|
"Auditee",
|
||||||
|
"Auditees",
|
||||||
|
"automaically",
|
||||||
|
"Autthorized",
|
||||||
|
"beacuase",
|
||||||
|
"beforeunload",
|
||||||
|
"Belguim",
|
||||||
|
"bfound",
|
||||||
|
"bgcolor",
|
||||||
|
"Bies",
|
||||||
|
"binded",
|
||||||
|
"blackbackground",
|
||||||
|
"blackhover",
|
||||||
|
"blackpressed",
|
||||||
|
"blueenergy",
|
||||||
|
"blueopal",
|
||||||
|
"buttongroup",
|
||||||
|
"BYMRB",
|
||||||
|
"bytesgot",
|
||||||
|
"CAID",
|
||||||
|
"casection",
|
||||||
|
"CAXXXX",
|
||||||
|
"CCPCR",
|
||||||
|
"CCPCRB",
|
||||||
|
"cellspacing",
|
||||||
|
"Cheeso's",
|
||||||
|
"chkbx",
|
||||||
|
"Clib",
|
||||||
|
"colorpicker",
|
||||||
|
"columnmenu",
|
||||||
|
"columnsreorder",
|
||||||
|
"columnsresize",
|
||||||
|
"comming",
|
||||||
|
"Containmen",
|
||||||
|
"Copmments",
|
||||||
|
"correctiv",
|
||||||
|
"Correctivet",
|
||||||
|
"Creat",
|
||||||
|
"currentd",
|
||||||
|
"Cyle",
|
||||||
|
"dadada",
|
||||||
|
"darkbluehover",
|
||||||
|
"darkbluepressed",
|
||||||
|
"darkred",
|
||||||
|
"datafields",
|
||||||
|
"datasource",
|
||||||
|
"dataviz",
|
||||||
|
"datepicker",
|
||||||
|
"datetimepicker",
|
||||||
|
"dayview",
|
||||||
|
"Deletet",
|
||||||
|
"Delgation",
|
||||||
|
"DENITED",
|
||||||
|
"Deparmtent",
|
||||||
|
"departmentids",
|
||||||
|
"Descirption",
|
||||||
|
"devprog",
|
||||||
|
"dfeffc",
|
||||||
|
"Disp",
|
||||||
|
"Dispo",
|
||||||
|
"Dispoitio",
|
||||||
|
"Dispos",
|
||||||
|
"Dispositon",
|
||||||
|
"Dispostion",
|
||||||
|
"Dispostions",
|
||||||
|
"dispotypevalidation",
|
||||||
|
"Docbase",
|
||||||
|
"Documentum",
|
||||||
|
"Documetum",
|
||||||
|
"dont",
|
||||||
|
"downlaoded",
|
||||||
|
"draganddrop",
|
||||||
|
"dragcancel",
|
||||||
|
"dropdownlist",
|
||||||
|
"Eamils",
|
||||||
|
"ECNPCRB",
|
||||||
|
"Ecns",
|
||||||
|
"edmx",
|
||||||
|
"EECN",
|
||||||
|
"emai",
|
||||||
|
"emailparams",
|
||||||
|
"Emergrncy",
|
||||||
|
"energyblue",
|
||||||
|
"Eran",
|
||||||
|
"Esql",
|
||||||
|
"ETECN",
|
||||||
|
"EXCELOPENXML",
|
||||||
|
"existinglocation",
|
||||||
|
"Expando",
|
||||||
|
"extrafield",
|
||||||
|
"fadc",
|
||||||
|
"fbec",
|
||||||
|
"fcfdfd",
|
||||||
|
"fdff",
|
||||||
|
"fece",
|
||||||
|
"feeebd",
|
||||||
|
"ffdc",
|
||||||
|
"ffdd",
|
||||||
|
"fieldset",
|
||||||
|
"FILIPE",
|
||||||
|
"filtermenu",
|
||||||
|
"Fldr",
|
||||||
|
"flintstone",
|
||||||
|
"FLOWLOCS",
|
||||||
|
"FMEA",
|
||||||
|
"ftplib",
|
||||||
|
"FTPSPN",
|
||||||
|
"GETDATE",
|
||||||
|
"gitea",
|
||||||
|
"globaldocudms",
|
||||||
|
"glyphicons",
|
||||||
|
"groupable",
|
||||||
|
"Guids",
|
||||||
|
"halflings",
|
||||||
|
"Hexsize",
|
||||||
|
"highcontrast",
|
||||||
|
"Hmac",
|
||||||
|
"holdsteps",
|
||||||
|
"hostspecific",
|
||||||
|
"icenium",
|
||||||
|
"IECN",
|
||||||
|
"imagebrowser",
|
||||||
|
"IMRB",
|
||||||
|
"Infineon",
|
||||||
|
"Insertd",
|
||||||
|
"inverseicons",
|
||||||
|
"IPCRB",
|
||||||
|
"ISADMIN",
|
||||||
|
"islast",
|
||||||
|
"ISNULL",
|
||||||
|
"ITAR",
|
||||||
|
"jquery",
|
||||||
|
"jqueryval",
|
||||||
|
"jqwidgets",
|
||||||
|
"jqxbuttongroup",
|
||||||
|
"jqxbuttons",
|
||||||
|
"jqxcalendar",
|
||||||
|
"jqxchart",
|
||||||
|
"jqxcheckbox",
|
||||||
|
"jqxcolorpicker",
|
||||||
|
"jqxcombobox",
|
||||||
|
"jqxcore",
|
||||||
|
"jqxdata",
|
||||||
|
"jqxdatatable",
|
||||||
|
"jqxdatetimeinput",
|
||||||
|
"jqxdocking",
|
||||||
|
"jqxdockpanel",
|
||||||
|
"jqxdragdrop",
|
||||||
|
"jqxdropdownbutton",
|
||||||
|
"jqxdropdownlist",
|
||||||
|
"jqxexpander",
|
||||||
|
"jqxgauge",
|
||||||
|
"jqxgrid",
|
||||||
|
"jqxinput",
|
||||||
|
"jqxknockout",
|
||||||
|
"jqxlistbox",
|
||||||
|
"jqxlistmenu",
|
||||||
|
"jqxmaskedinput",
|
||||||
|
"jqxmenu",
|
||||||
|
"jqxnavigationbar",
|
||||||
|
"jqxnumberinput",
|
||||||
|
"jqxpanel",
|
||||||
|
"jqxpasswordinput",
|
||||||
|
"jqxprogressbar",
|
||||||
|
"jqxradiobutton",
|
||||||
|
"jqxrangeselector",
|
||||||
|
"jqxrating",
|
||||||
|
"jqxresponse",
|
||||||
|
"jqxscrollbar",
|
||||||
|
"jqxscrollview",
|
||||||
|
"jqxslider",
|
||||||
|
"jqxsplitter",
|
||||||
|
"jqxswitchbutton",
|
||||||
|
"jqxtabs",
|
||||||
|
"jqxtooltip",
|
||||||
|
"jqxtouch",
|
||||||
|
"jqxtree",
|
||||||
|
"jqxtreegrid",
|
||||||
|
"jqxtreemap",
|
||||||
|
"jqxvalidator",
|
||||||
|
"jqxwindow",
|
||||||
|
"kendogridcustom",
|
||||||
|
"kendoui",
|
||||||
|
"labelelement",
|
||||||
|
"labelledby",
|
||||||
|
"Leanred",
|
||||||
|
"lightgray",
|
||||||
|
"linkbutton",
|
||||||
|
"Linq",
|
||||||
|
"Listdiv",
|
||||||
|
"listview",
|
||||||
|
"Lnks",
|
||||||
|
"localfilename",
|
||||||
|
"loclist",
|
||||||
|
"logis",
|
||||||
|
"logtext",
|
||||||
|
"loopmis",
|
||||||
|
"lotdispo",
|
||||||
|
"LOTDISPSITION",
|
||||||
|
"Lotfile",
|
||||||
|
"lotlist",
|
||||||
|
"lotstatusoption",
|
||||||
|
"LTRIM",
|
||||||
|
"MADUREIRA",
|
||||||
|
"mailrelay",
|
||||||
|
"MDTM",
|
||||||
|
"meego",
|
||||||
|
"meetingid",
|
||||||
|
"menubutton",
|
||||||
|
"mesafi",
|
||||||
|
"metroblack",
|
||||||
|
"metrodark",
|
||||||
|
"miliseconds",
|
||||||
|
"modalview",
|
||||||
|
"modernizr",
|
||||||
|
"Modernizr",
|
||||||
|
"monthview",
|
||||||
|
"MRBIs",
|
||||||
|
"Mrbs",
|
||||||
|
"msecs",
|
||||||
|
"multipleextended",
|
||||||
|
"Navigatable",
|
||||||
|
"nbsp",
|
||||||
|
"newbase",
|
||||||
|
"newchange",
|
||||||
|
"newdi",
|
||||||
|
"newfilename",
|
||||||
|
"newsource",
|
||||||
|
"Newtonsoft",
|
||||||
|
"notications",
|
||||||
|
"Notifcation",
|
||||||
|
"Notifyf",
|
||||||
|
"NTLM",
|
||||||
|
"Nullcc",
|
||||||
|
"numerictextbox",
|
||||||
|
"objdata",
|
||||||
|
"OCAP",
|
||||||
|
"occured",
|
||||||
|
"odata",
|
||||||
|
"oldfilename",
|
||||||
|
"OLHOLD",
|
||||||
|
"onclick",
|
||||||
|
"onmousemove",
|
||||||
|
"OPDESC",
|
||||||
|
"OPENQUERY",
|
||||||
|
"Oper",
|
||||||
|
"operationslist",
|
||||||
|
"Orginator",
|
||||||
|
"Originatorname",
|
||||||
|
"Ouellette",
|
||||||
|
"Owin",
|
||||||
|
"pageable",
|
||||||
|
"Pageable",
|
||||||
|
"panelbar",
|
||||||
|
"parentid",
|
||||||
|
"parminput",
|
||||||
|
"parms",
|
||||||
|
"Parms",
|
||||||
|
"particula",
|
||||||
|
"pasv",
|
||||||
|
"PASV",
|
||||||
|
"PATINDEX",
|
||||||
|
"PCRB",
|
||||||
|
"PCRBID",
|
||||||
|
"pcrvalues",
|
||||||
|
"pdbonly",
|
||||||
|
"Preventitive",
|
||||||
|
"preventivet",
|
||||||
|
"Prevetative",
|
||||||
|
"proces",
|
||||||
|
"Processedl",
|
||||||
|
"procs",
|
||||||
|
"productfamilies",
|
||||||
|
"progess",
|
||||||
|
"progressbar",
|
||||||
|
"qrcode",
|
||||||
|
"Quanityt",
|
||||||
|
"rangebar",
|
||||||
|
"Recep",
|
||||||
|
"Recepient",
|
||||||
|
"recieved",
|
||||||
|
"recordlock",
|
||||||
|
"remotefilename",
|
||||||
|
"reorderable",
|
||||||
|
"reportform",
|
||||||
|
"reportslist",
|
||||||
|
"reportslistdiv",
|
||||||
|
"Reqquired",
|
||||||
|
"Reqs",
|
||||||
|
"Requiest",
|
||||||
|
"Responsibles",
|
||||||
|
"RETR",
|
||||||
|
"Revisioing",
|
||||||
|
"Revisioned",
|
||||||
|
"Revison",
|
||||||
|
"rgba",
|
||||||
|
"rkotian",
|
||||||
|
"RNFR",
|
||||||
|
"RNTO",
|
||||||
|
"Roless",
|
||||||
|
"roundbg",
|
||||||
|
"RTRIM",
|
||||||
|
"SAMDB",
|
||||||
|
"scroller",
|
||||||
|
"scrollview",
|
||||||
|
"seleced",
|
||||||
|
"selectionlog",
|
||||||
|
"Selectpart",
|
||||||
|
"sess",
|
||||||
|
"Sfisharepoint",
|
||||||
|
"shinyblack",
|
||||||
|
"showpassword",
|
||||||
|
"SIGNON",
|
||||||
|
"simpleparser",
|
||||||
|
"slddrw",
|
||||||
|
"sldprt",
|
||||||
|
"sortasc",
|
||||||
|
"sortascbutton",
|
||||||
|
"sortdesc",
|
||||||
|
"sortdescbutton",
|
||||||
|
"sortremove",
|
||||||
|
"sparkline",
|
||||||
|
"splitview",
|
||||||
|
"SPNMRB",
|
||||||
|
"SPNPDB",
|
||||||
|
"SSRS",
|
||||||
|
"Sssign",
|
||||||
|
"Staus",
|
||||||
|
"stylesheet",
|
||||||
|
"Submited",
|
||||||
|
"subrole",
|
||||||
|
"subroles",
|
||||||
|
"Succefully",
|
||||||
|
"Succesfully",
|
||||||
|
"sucessfully",
|
||||||
|
"SURP",
|
||||||
|
"Swashbuckle",
|
||||||
|
"SWRN",
|
||||||
|
"tabindex",
|
||||||
|
"tabstrip",
|
||||||
|
"Tahoma",
|
||||||
|
"taskcompleted",
|
||||||
|
"Tasklist",
|
||||||
|
"Taveler",
|
||||||
|
"TECN",
|
||||||
|
"TECNs",
|
||||||
|
"TEMIRWAP",
|
||||||
|
"tempecd",
|
||||||
|
"tempimplement",
|
||||||
|
"templabel",
|
||||||
|
"tempvalue",
|
||||||
|
"TEMSA",
|
||||||
|
"timepicker",
|
||||||
|
"Tobe",
|
||||||
|
"Toplevel",
|
||||||
|
"Totrav",
|
||||||
|
"trainingby",
|
||||||
|
"Traininglist",
|
||||||
|
"traininglistdiv",
|
||||||
|
"transanction",
|
||||||
|
"Trav",
|
||||||
|
"Traveller",
|
||||||
|
"Traverler",
|
||||||
|
"TRAVLELER",
|
||||||
|
"Travler",
|
||||||
|
"TREEVIEW",
|
||||||
|
"trigerred",
|
||||||
|
"ttinclude",
|
||||||
|
"Uhandled",
|
||||||
|
"Updat",
|
||||||
|
"Uplaod",
|
||||||
|
"Upto",
|
||||||
|
"userevents",
|
||||||
|
"userids",
|
||||||
|
"userlist",
|
||||||
|
"Validatable",
|
||||||
|
"valueelement",
|
||||||
|
"Variabls",
|
||||||
|
"Verdana",
|
||||||
|
"vgrid",
|
||||||
|
"viewmodel",
|
||||||
|
"vsdoc",
|
||||||
|
"whethere",
|
||||||
|
"windowsphone",
|
||||||
|
"Winsock",
|
||||||
|
"worlflow"
|
||||||
|
]
|
||||||
|
}
|
109
Fab2ApprovalMKLink/.vscode/tasks.json
vendored
Normal file
109
Fab2ApprovalMKLink/.vscode/tasks.json
vendored
Normal file
@ -0,0 +1,109 @@
|
|||||||
|
{
|
||||||
|
"version": "2.0.0",
|
||||||
|
"tasks": [
|
||||||
|
{
|
||||||
|
"label": "User Secrets Init",
|
||||||
|
"command": "dotnet",
|
||||||
|
"type": "process",
|
||||||
|
"args": [
|
||||||
|
"user-secrets",
|
||||||
|
"-p",
|
||||||
|
"${workspaceFolder}/Fab2ApprovalMKLink.csproj",
|
||||||
|
"init"
|
||||||
|
],
|
||||||
|
"problemMatcher": "$msCompile"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "User Secrets Set",
|
||||||
|
"command": "dotnet",
|
||||||
|
"type": "process",
|
||||||
|
"args": [
|
||||||
|
"user-secrets",
|
||||||
|
"-p",
|
||||||
|
"${workspaceFolder}/Fab2ApprovalMKLink.csproj",
|
||||||
|
"set",
|
||||||
|
"_UserSecretsId",
|
||||||
|
"f2da5035-aba9-4676-9f8d-d6689f84663d"
|
||||||
|
],
|
||||||
|
"problemMatcher": "$msCompile"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Format",
|
||||||
|
"command": "dotnet",
|
||||||
|
"type": "process",
|
||||||
|
"args": [
|
||||||
|
"format",
|
||||||
|
"--report",
|
||||||
|
".vscode",
|
||||||
|
"--verbosity",
|
||||||
|
"detailed",
|
||||||
|
"--severity",
|
||||||
|
"warn"
|
||||||
|
],
|
||||||
|
"problemMatcher": "$msCompile"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Format-Whitespaces",
|
||||||
|
"command": "dotnet",
|
||||||
|
"type": "process",
|
||||||
|
"args": [
|
||||||
|
"format",
|
||||||
|
"whitespace"
|
||||||
|
],
|
||||||
|
"problemMatcher": "$msCompile"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "build",
|
||||||
|
"command": "dotnet",
|
||||||
|
"type": "process",
|
||||||
|
"args": [
|
||||||
|
"build",
|
||||||
|
"${workspaceFolder}/Fab2ApprovalMKLink.csproj",
|
||||||
|
"/property:GenerateFullPaths=true",
|
||||||
|
"/consoleloggerparameters:NoSummary"
|
||||||
|
],
|
||||||
|
"problemMatcher": "$msCompile"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "publish",
|
||||||
|
"command": "dotnet",
|
||||||
|
"type": "process",
|
||||||
|
"args": [
|
||||||
|
"publish",
|
||||||
|
"${workspaceFolder}/Fab2ApprovalMKLink.csproj",
|
||||||
|
"/property:GenerateFullPaths=true",
|
||||||
|
"/consoleloggerparameters:NoSummary"
|
||||||
|
],
|
||||||
|
"problemMatcher": "$msCompile"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "watch",
|
||||||
|
"command": "dotnet",
|
||||||
|
"type": "process",
|
||||||
|
"args": [
|
||||||
|
"watch",
|
||||||
|
"run",
|
||||||
|
"--project",
|
||||||
|
"${workspaceFolder}/Fab2ApprovalMKLink.csproj"
|
||||||
|
],
|
||||||
|
"problemMatcher": "$msCompile"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Publish AOT",
|
||||||
|
"command": "dotnet",
|
||||||
|
"type": "process",
|
||||||
|
"args": [
|
||||||
|
"publish",
|
||||||
|
"-r",
|
||||||
|
"win-x64",
|
||||||
|
"-c",
|
||||||
|
"Release",
|
||||||
|
"-p:PublishAot=true",
|
||||||
|
"${workspaceFolder}/Fab2ApprovalMKLink.csproj",
|
||||||
|
"/property:GenerateFullPaths=true",
|
||||||
|
"/consoleloggerparameters:NoSummary"
|
||||||
|
],
|
||||||
|
"problemMatcher": "$msCompile"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
51
Fab2ApprovalMKLink/Fab2ApprovalMKLink.csproj
Normal file
51
Fab2ApprovalMKLink/Fab2ApprovalMKLink.csproj
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||||
|
<PropertyGroup Label="Globals">
|
||||||
|
<SccProjectName>SAK</SccProjectName>
|
||||||
|
<SccProvider>SAK</SccProvider>
|
||||||
|
<SccAuxPath>SAK</SccAuxPath>
|
||||||
|
<SccLocalPath>SAK</SccLocalPath>
|
||||||
|
<UserSecretsId>f2da5035-aba9-4676-9f8d-d6689f84663d</UserSecretsId>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
|
||||||
|
<ImplicitUsings>disable</ImplicitUsings>
|
||||||
|
<IsPackable>false</IsPackable>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
<OutputType>Exe</OutputType>
|
||||||
|
<RuntimeIdentifiers>win-x64;linux-x64</RuntimeIdentifiers>
|
||||||
|
<TargetFramework>net8.0</TargetFramework>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(TargetFramework)' == 'net8.0'">
|
||||||
|
<DefineConstants>NET8</DefineConstants>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Dapper.Contrib" Version="2.0.78" />
|
||||||
|
<PackageReference Include="Dapper" Version="2.1.44" />
|
||||||
|
<PackageReference Include="EntityFramework" Version="6.5.1" />
|
||||||
|
<PackageReference Include="ExcelDataReader" Version="3.7.0" />
|
||||||
|
<PackageReference Include="jQuery" Version="3.7.1" />
|
||||||
|
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="8.0.10" />
|
||||||
|
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.2.0" />
|
||||||
|
<PackageReference Include="Microsoft.Data.Sqlite" Version="8.0.2" />
|
||||||
|
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="8.0.1" />
|
||||||
|
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.1" />
|
||||||
|
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="8.0.1" />
|
||||||
|
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.1" />
|
||||||
|
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="8.0.1" />
|
||||||
|
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.1" />
|
||||||
|
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.0" />
|
||||||
|
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="8.0.1" />
|
||||||
|
<PackageReference Include="Microsoft.Extensions.Logging.EventLog" Version="8.0.1" />
|
||||||
|
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||||
|
<PackageReference Include="NLog.Extensions.Logging" Version="5.3.8" />
|
||||||
|
<PackageReference Include="NLog" Version="5.2.8" />
|
||||||
|
<PackageReference Include="Quartz.Extensions.Hosting" Version="3.8.1" />
|
||||||
|
<PackageReference Include="Quartz" Version="3.8.1" />
|
||||||
|
<PackageReference Include="SharpZipLib" Version="1.4.2" />
|
||||||
|
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.8.1" />
|
||||||
|
<PackageReference Include="System.Data.SqlClient" Version="4.8.6" />
|
||||||
|
<PackageReference Include="System.DirectoryServices.AccountManagement" Version="9.0.0" />
|
||||||
|
<PackageReference Include="System.DirectoryServices" Version="9.0.0" />
|
||||||
|
<PackageReference Include="System.Drawing.Common" Version="8.0.7" />
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
77
Fab2ApprovalMKLink/Program.cs
Normal file
77
Fab2ApprovalMKLink/Program.cs
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
|
||||||
|
using Fab2ApprovalSystem.Models;
|
||||||
|
|
||||||
|
using Microsoft.AspNetCore.Builder;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Microsoft.Extensions.Configuration;
|
||||||
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
using Microsoft.Extensions.Hosting;
|
||||||
|
using Microsoft.Extensions.Hosting.WindowsServices;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
|
namespace Fab2ApprovalMKLink;
|
||||||
|
|
||||||
|
public class Program {
|
||||||
|
|
||||||
|
public static int Main(string[] args) {
|
||||||
|
ILogger<Program>? logger = null;
|
||||||
|
WebApplicationBuilder webApplicationBuilder = WebApplication.CreateBuilder(args);
|
||||||
|
_ = webApplicationBuilder.Configuration.AddUserSecrets<Program>();
|
||||||
|
AppSettings appSettings = AppSettings.Get(webApplicationBuilder.Configuration);
|
||||||
|
if (string.IsNullOrEmpty(appSettings.Company))
|
||||||
|
throw new Exception("Company name must have a value!");
|
||||||
|
if (string.IsNullOrEmpty(appSettings.WorkingDirectoryName))
|
||||||
|
throw new Exception("Working directory name must have a value!");
|
||||||
|
try {
|
||||||
|
_ = webApplicationBuilder.Services.Configure<ApiBehaviorOptions>(options => options.SuppressModelStateInvalidFilter = true);
|
||||||
|
_ = webApplicationBuilder.Services.AddControllers();
|
||||||
|
_ = webApplicationBuilder.Services.AddDistributedMemoryCache();
|
||||||
|
_ = webApplicationBuilder.Services.AddHttpClient();
|
||||||
|
_ = webApplicationBuilder.Services.AddSingleton(_ => appSettings);
|
||||||
|
_ = webApplicationBuilder.Services.AddSwaggerGen();
|
||||||
|
_ = webApplicationBuilder.Services.AddSession(sessionOptions => {
|
||||||
|
sessionOptions.IdleTimeout = TimeSpan.FromSeconds(2000);
|
||||||
|
sessionOptions.Cookie.HttpOnly = true;
|
||||||
|
sessionOptions.Cookie.IsEssential = true;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (WindowsServiceHelpers.IsWindowsService()) {
|
||||||
|
_ = webApplicationBuilder.Services.AddSingleton<IHostLifetime, WindowsServiceLifetime>();
|
||||||
|
_ = webApplicationBuilder.Logging.AddEventLog(settings => {
|
||||||
|
#pragma warning disable CA1416
|
||||||
|
if (string.IsNullOrEmpty(settings.SourceName))
|
||||||
|
settings.SourceName = webApplicationBuilder.Environment.ApplicationName;
|
||||||
|
#pragma warning restore
|
||||||
|
});
|
||||||
|
}
|
||||||
|
WebApplication webApplication = webApplicationBuilder.Build();
|
||||||
|
if (Debugger.IsAttached)
|
||||||
|
webApplication.Services.GetRequiredService<AppSettings>();
|
||||||
|
logger = webApplication.Services.GetRequiredService<ILogger<Program>>();
|
||||||
|
_ = webApplication.UseCors(corsPolicyBuilder => corsPolicyBuilder.AllowAnyOrigin().AllowAnyHeader().AllowAnyMethod());
|
||||||
|
if (!webApplicationBuilder.Environment.IsDevelopment()) {
|
||||||
|
_ = webApplication.UseExceptionHandler("/Error");
|
||||||
|
_ = webApplication.UseHttpsRedirection();
|
||||||
|
_ = webApplication.UseHsts();
|
||||||
|
} else {
|
||||||
|
if (string.IsNullOrEmpty(appSettings.URLs)) {
|
||||||
|
Environment.ExitCode = -1;
|
||||||
|
webApplication.Lifetime.StopApplication();
|
||||||
|
}
|
||||||
|
_ = webApplication.UseSwagger();
|
||||||
|
_ = webApplication.UseSwaggerUI(c => c.SwaggerEndpoint("/swagger/v1/swagger.json", "Server V1"));
|
||||||
|
}
|
||||||
|
_ = webApplication.UseSession();
|
||||||
|
_ = webApplication.MapControllers();
|
||||||
|
logger.LogInformation("Starting Web Application");
|
||||||
|
webApplication.Run();
|
||||||
|
return 0;
|
||||||
|
} catch (Exception ex) {
|
||||||
|
try { logger?.LogCritical(ex, "Host terminated unexpectedly"); } catch (Exception) { }
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
380
Fab2ApprovalSystem/.editorconfig
Normal file
380
Fab2ApprovalSystem/.editorconfig
Normal file
@ -0,0 +1,380 @@
|
|||||||
|
[*.md]
|
||||||
|
end_of_line = crlf
|
||||||
|
file_header_template = unset
|
||||||
|
indent_size = 2
|
||||||
|
indent_style = space
|
||||||
|
insert_final_newline = false
|
||||||
|
root = true
|
||||||
|
tab_width = 2
|
||||||
|
[*.csproj]
|
||||||
|
end_of_line = crlf
|
||||||
|
file_header_template = unset
|
||||||
|
indent_size = 2
|
||||||
|
indent_style = space
|
||||||
|
insert_final_newline = false
|
||||||
|
root = true
|
||||||
|
tab_width = 2
|
||||||
|
[*.cs]
|
||||||
|
csharp_indent_block_contents = true
|
||||||
|
csharp_indent_braces = false
|
||||||
|
csharp_indent_case_contents = true
|
||||||
|
csharp_indent_case_contents_when_block = true
|
||||||
|
csharp_indent_labels = one_less_than_current
|
||||||
|
csharp_indent_switch_labels = true
|
||||||
|
csharp_new_line_before_catch = false
|
||||||
|
csharp_new_line_before_else = false
|
||||||
|
csharp_new_line_before_finally = false
|
||||||
|
csharp_new_line_before_members_in_anonymous_types = true
|
||||||
|
csharp_new_line_before_members_in_object_initializers = true
|
||||||
|
csharp_new_line_before_open_brace = none
|
||||||
|
csharp_new_line_between_query_expression_clauses = true
|
||||||
|
csharp_prefer_braces = false
|
||||||
|
csharp_prefer_qualified_reference = true:error
|
||||||
|
csharp_prefer_simple_default_expression = true:warning
|
||||||
|
csharp_prefer_simple_using_statement = true:warning
|
||||||
|
csharp_prefer_static_local_function = true:warning
|
||||||
|
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async
|
||||||
|
csharp_preserve_single_line_blocks = true
|
||||||
|
csharp_preserve_single_line_statements = false
|
||||||
|
csharp_space_after_cast = false
|
||||||
|
csharp_space_after_colon_in_inheritance_clause = true
|
||||||
|
csharp_space_after_comma = true
|
||||||
|
csharp_space_after_dot = false
|
||||||
|
csharp_space_after_keywords_in_control_flow_statements = true
|
||||||
|
csharp_space_after_semicolon_in_for_statement = true
|
||||||
|
csharp_space_around_binary_operators = before_and_after
|
||||||
|
csharp_space_around_declaration_statements = false
|
||||||
|
csharp_space_before_colon_in_inheritance_clause = true
|
||||||
|
csharp_space_before_comma = false
|
||||||
|
csharp_space_before_dot = false
|
||||||
|
csharp_space_before_open_square_brackets = false
|
||||||
|
csharp_space_before_semicolon_in_for_statement = false
|
||||||
|
csharp_space_between_empty_square_brackets = false
|
||||||
|
csharp_space_between_method_call_empty_parameter_list_parentheses = false
|
||||||
|
csharp_space_between_method_call_name_and_opening_parenthesis = false
|
||||||
|
csharp_space_between_method_call_parameter_list_parentheses = false
|
||||||
|
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
|
||||||
|
csharp_space_between_method_declaration_name_and_open_parenthesis = false
|
||||||
|
csharp_space_between_method_declaration_parameter_list_parentheses = false
|
||||||
|
csharp_space_between_parentheses = false
|
||||||
|
csharp_space_between_square_brackets = false
|
||||||
|
csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true
|
||||||
|
csharp_style_allow_blank_line_after_token_in_arrow_expression_clause_experimental = true
|
||||||
|
csharp_style_allow_blank_line_after_token_in_conditional_expression_experimental = true
|
||||||
|
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = false
|
||||||
|
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true
|
||||||
|
csharp_style_allow_embedded_statements_on_same_line_experimental = true
|
||||||
|
csharp_style_conditional_delegate_call = true
|
||||||
|
csharp_style_deconstructed_variable_declaration = false
|
||||||
|
csharp_style_expression_bodied_accessors = when_on_single_line:warning
|
||||||
|
csharp_style_expression_bodied_constructors = when_on_single_line:warning
|
||||||
|
csharp_style_expression_bodied_indexers = when_on_single_line:warning
|
||||||
|
csharp_style_expression_bodied_lambdas = when_on_single_line:warning
|
||||||
|
csharp_style_expression_bodied_local_functions = when_on_single_line:warning
|
||||||
|
csharp_style_expression_bodied_methods = when_on_single_line:warning
|
||||||
|
csharp_style_expression_bodied_operators = when_on_single_line:warning
|
||||||
|
csharp_style_expression_bodied_properties = when_on_single_line:warning
|
||||||
|
csharp_style_implicit_object_creation_when_type_is_apparent = true:warning
|
||||||
|
csharp_style_inlined_variable_declaration = false
|
||||||
|
csharp_style_namespace_declarations = file_scoped:warning
|
||||||
|
csharp_style_pattern_local_over_anonymous_function = true:warning
|
||||||
|
csharp_style_pattern_matching_over_as_with_null_check = true:warning
|
||||||
|
csharp_style_pattern_matching_over_is_with_cast_check = true:warning
|
||||||
|
csharp_style_prefer_index_operator = true:warning
|
||||||
|
csharp_style_prefer_not_pattern = true:warning
|
||||||
|
csharp_style_prefer_null_check_over_type_check = true
|
||||||
|
csharp_style_prefer_pattern_matching = true:warning
|
||||||
|
csharp_style_prefer_range_operator = true:warning
|
||||||
|
csharp_style_prefer_switch_expression = true:warning
|
||||||
|
csharp_style_throw_expression = true
|
||||||
|
csharp_style_unused_value_assignment_preference = discard_variable:warning
|
||||||
|
csharp_style_unused_value_expression_statement_preference = discard_variable:warning
|
||||||
|
csharp_style_var_elsewhere = false:warning
|
||||||
|
csharp_style_var_for_built_in_types = false:warning
|
||||||
|
csharp_style_var_when_type_is_apparent = false:warning
|
||||||
|
csharp_using_directive_placement = outside_namespace
|
||||||
|
dotnet_analyzer_diagnostic.category-Design.severity = error
|
||||||
|
dotnet_analyzer_diagnostic.category-Documentation.severity = error
|
||||||
|
dotnet_analyzer_diagnostic.category-Globalization.severity = none
|
||||||
|
dotnet_analyzer_diagnostic.category-Interoperability.severity = error
|
||||||
|
dotnet_analyzer_diagnostic.category-Maintainability.severity = error
|
||||||
|
dotnet_analyzer_diagnostic.category-Naming.severity = none
|
||||||
|
dotnet_analyzer_diagnostic.category-Performance.severity = none
|
||||||
|
dotnet_analyzer_diagnostic.category-Reliability.severity = error
|
||||||
|
dotnet_analyzer_diagnostic.category-Security.severity = error
|
||||||
|
dotnet_analyzer_diagnostic.category-SingleFile.severity = error
|
||||||
|
dotnet_analyzer_diagnostic.category-Style.severity = error
|
||||||
|
dotnet_analyzer_diagnostic.category-Usage.severity = error
|
||||||
|
dotnet_code_quality_unused_parameters = all
|
||||||
|
dotnet_code_quality_unused_parameters = non_public
|
||||||
|
dotnet_code_quality.CAXXXX.api_surface = private, internal
|
||||||
|
dotnet_diagnostic.CA1001.severity = error # CA1001: Types that own disposable fields should be disposable
|
||||||
|
dotnet_diagnostic.CA1051.severity = error # CA1051: Do not declare visible instance fields
|
||||||
|
dotnet_diagnostic.CA1511.severity = warning # CA1511: Use 'ArgumentException.ThrowIfNullOrEmpty' instead of explicitly throwing a new exception instance
|
||||||
|
dotnet_diagnostic.CA1513.severity = warning # Use 'ObjectDisposedException.ThrowIf' instead of explicitly throwing a new exception instance
|
||||||
|
dotnet_diagnostic.CA1825.severity = warning # CA1825: Avoid zero-length array allocations
|
||||||
|
dotnet_diagnostic.CA1829.severity = error # CA1829: Use Length/Count property instead of Count() when available
|
||||||
|
dotnet_diagnostic.CA1834.severity = warning # CA1834: Consider using 'StringBuilder.Append(char)' when applicable
|
||||||
|
dotnet_diagnostic.CA1860.severity = error # CA1860: Prefer comparing 'Count' to 0 rather than using 'Any()', both for clarity and for performance
|
||||||
|
dotnet_diagnostic.CA1862.severity = warning # CA1862: Prefer using 'string.Equals(string, StringComparison)' to perform a case-insensitive comparison, but keep in mind that this might cause subtle changes in behavior, so make sure to conduct thorough testing after applying the suggestion, or if culturally sensitive comparison is not required, consider using 'StringComparison.OrdinalIgnoreCase'
|
||||||
|
dotnet_diagnostic.CA1869.severity = none # CA1869: Avoid creating a new 'JsonSerializerOptions' instance for every serialization operation. Cache and reuse instances instead.
|
||||||
|
dotnet_diagnostic.CA2201.severity = none # CA2201: Exception type System.NullReferenceException is reserved by the runtime
|
||||||
|
dotnet_diagnostic.CA2254.severity = none # CA2254: The logging message template should not vary between calls to 'LoggerExtensions.LogInformation(ILogger, string?, params object?[])'
|
||||||
|
dotnet_diagnostic.IDE0001.severity = warning # IDE0001: Simplify name
|
||||||
|
dotnet_diagnostic.IDE0002.severity = warning # Simplify (member access) - System.Version.Equals("1", "2"); Version.Equals("1", "2");
|
||||||
|
dotnet_diagnostic.IDE0004.severity = warning # IDE0004: Cast is redundant.
|
||||||
|
dotnet_diagnostic.IDE0005.severity = error # Using directive is unnecessary
|
||||||
|
dotnet_diagnostic.IDE0010.severity = none # Add missing cases to switch statement (IDE0010)
|
||||||
|
dotnet_diagnostic.IDE0028.severity = error # IDE0028: Collection initialization can be simplified
|
||||||
|
dotnet_diagnostic.IDE0031.severity = warning # Use null propagation (IDE0031)
|
||||||
|
dotnet_diagnostic.IDE0047.severity = warning # IDE0047: Parentheses can be removed
|
||||||
|
dotnet_diagnostic.IDE0048.severity = none # Parentheses preferences (IDE0047 and IDE0048)
|
||||||
|
dotnet_diagnostic.IDE0049.severity = warning # Use language keywords instead of framework type names for type references (IDE0049)
|
||||||
|
dotnet_diagnostic.IDE0051.severity = error # Private member '' is unused [, ]
|
||||||
|
dotnet_diagnostic.IDE0058.severity = error # IDE0058: Expression value is never used
|
||||||
|
dotnet_diagnostic.IDE0060.severity = error # IDE0060: Remove unused parameter
|
||||||
|
dotnet_diagnostic.IDE0074.severity = warning # IDE0074: Use compound assignment
|
||||||
|
dotnet_diagnostic.IDE0130.severity = none # Namespace does not match folder structure (IDE0130)
|
||||||
|
dotnet_diagnostic.IDE0270.severity = warning # IDE0270: Null check can be simplified
|
||||||
|
dotnet_diagnostic.IDE0290.severity = none # Use primary constructor [Distance]csharp(IDE0290)
|
||||||
|
dotnet_diagnostic.IDE0300.severity = error # IDE0300: Collection initialization can be simplified
|
||||||
|
dotnet_diagnostic.IDE0301.severity = error #IDE0301: Collection initialization can be simplified
|
||||||
|
dotnet_diagnostic.IDE0305.severity = none # IDE0305: Collection initialization can be simplified
|
||||||
|
dotnet_diagnostic.IDE2000.severity = error # IDE2000: Allow multiple blank lines
|
||||||
|
dotnet_naming_rule.abstract_method_should_be_pascal_case.severity = warning
|
||||||
|
dotnet_naming_rule.abstract_method_should_be_pascal_case.style = pascal_case
|
||||||
|
dotnet_naming_rule.abstract_method_should_be_pascal_case.symbols = abstract_method
|
||||||
|
dotnet_naming_rule.class_should_be_pascal_case.severity = warning
|
||||||
|
dotnet_naming_rule.class_should_be_pascal_case.style = pascal_case
|
||||||
|
dotnet_naming_rule.class_should_be_pascal_case.symbols = class
|
||||||
|
dotnet_naming_rule.delegate_should_be_pascal_case.severity = warning
|
||||||
|
dotnet_naming_rule.delegate_should_be_pascal_case.style = pascal_case
|
||||||
|
dotnet_naming_rule.delegate_should_be_pascal_case.symbols = delegate
|
||||||
|
dotnet_naming_rule.enum_should_be_pascal_case.severity = warning
|
||||||
|
dotnet_naming_rule.enum_should_be_pascal_case.style = pascal_case
|
||||||
|
dotnet_naming_rule.enum_should_be_pascal_case.symbols = enum
|
||||||
|
dotnet_naming_rule.event_should_be_pascal_case.severity = warning
|
||||||
|
dotnet_naming_rule.event_should_be_pascal_case.style = pascal_case
|
||||||
|
dotnet_naming_rule.event_should_be_pascal_case.symbols = event
|
||||||
|
dotnet_naming_rule.interface_should_be_begins_with_i.severity = warning
|
||||||
|
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i
|
||||||
|
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
|
||||||
|
dotnet_naming_rule.method_should_be_pascal_case.severity = warning
|
||||||
|
dotnet_naming_rule.method_should_be_pascal_case.style = pascal_case
|
||||||
|
dotnet_naming_rule.method_should_be_pascal_case.symbols = method
|
||||||
|
dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = warning
|
||||||
|
dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
|
||||||
|
dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
|
||||||
|
dotnet_naming_rule.private_method_should_be_pascal_case.severity = warning
|
||||||
|
dotnet_naming_rule.private_method_should_be_pascal_case.style = pascal_case
|
||||||
|
dotnet_naming_rule.private_method_should_be_pascal_case.symbols = private_method
|
||||||
|
dotnet_naming_rule.private_or_internal_field_should_be_private_of_internal_field.severity = warning
|
||||||
|
dotnet_naming_rule.private_or_internal_field_should_be_private_of_internal_field.style = private_of_internal_field
|
||||||
|
dotnet_naming_rule.private_or_internal_field_should_be_private_of_internal_field.symbols = private_or_internal_field
|
||||||
|
dotnet_naming_rule.private_or_internal_static_field_should_be_private_of_internal_field.severity = warning
|
||||||
|
dotnet_naming_rule.private_or_internal_static_field_should_be_private_of_internal_field.style = private_of_internal_field
|
||||||
|
dotnet_naming_rule.private_or_internal_static_field_should_be_private_of_internal_field.symbols = private_or_internal_static_field
|
||||||
|
dotnet_naming_rule.property_should_be_pascal_case.severity = warning
|
||||||
|
dotnet_naming_rule.property_should_be_pascal_case.style = pascal_case
|
||||||
|
dotnet_naming_rule.property_should_be_pascal_case.symbols = property
|
||||||
|
dotnet_naming_rule.public_or_protected_field_should_be_private_of_internal_field.severity = warning
|
||||||
|
dotnet_naming_rule.public_or_protected_field_should_be_private_of_internal_field.style = private_of_internal_field
|
||||||
|
dotnet_naming_rule.public_or_protected_field_should_be_private_of_internal_field.symbols = public_or_protected_field
|
||||||
|
dotnet_naming_rule.static_field_should_be_pascal_case.severity = warning
|
||||||
|
dotnet_naming_rule.static_field_should_be_pascal_case.style = pascal_case
|
||||||
|
dotnet_naming_rule.static_field_should_be_pascal_case.symbols = static_field
|
||||||
|
dotnet_naming_rule.static_method_should_be_pascal_case.severity = warning
|
||||||
|
dotnet_naming_rule.static_method_should_be_pascal_case.style = pascal_case
|
||||||
|
dotnet_naming_rule.static_method_should_be_pascal_case.symbols = static_method
|
||||||
|
dotnet_naming_rule.struct_should_be_pascal_case.severity = warning
|
||||||
|
dotnet_naming_rule.struct_should_be_pascal_case.style = pascal_case
|
||||||
|
dotnet_naming_rule.struct_should_be_pascal_case.symbols = struct
|
||||||
|
dotnet_naming_rule.types_should_be_pascal_case.severity = warning
|
||||||
|
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
|
||||||
|
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
|
||||||
|
dotnet_naming_style.begins_with_i.capitalization = pascal_case
|
||||||
|
dotnet_naming_style.begins_with_i.required_prefix = I
|
||||||
|
dotnet_naming_style.begins_with_i.required_suffix =
|
||||||
|
dotnet_naming_style.begins_with_i.word_separator =
|
||||||
|
dotnet_naming_style.pascal_case.capitalization = pascal_case
|
||||||
|
dotnet_naming_style.pascal_case.required_prefix =
|
||||||
|
dotnet_naming_style.pascal_case.required_suffix =
|
||||||
|
dotnet_naming_style.pascal_case.word_separator =
|
||||||
|
dotnet_naming_style.private_of_internal_field.capitalization = pascal_case
|
||||||
|
dotnet_naming_style.private_of_internal_field.required_prefix = _
|
||||||
|
dotnet_naming_style.private_of_internal_field.required_suffix =
|
||||||
|
dotnet_naming_style.private_of_internal_field.word_separator =
|
||||||
|
dotnet_naming_symbols.abstract_method.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||||
|
dotnet_naming_symbols.abstract_method.applicable_kinds = method
|
||||||
|
dotnet_naming_symbols.abstract_method.required_modifiers = abstract
|
||||||
|
dotnet_naming_symbols.class.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||||
|
dotnet_naming_symbols.class.applicable_kinds = class
|
||||||
|
dotnet_naming_symbols.class.required_modifiers =
|
||||||
|
dotnet_naming_symbols.delegate.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||||
|
dotnet_naming_symbols.delegate.applicable_kinds = delegate
|
||||||
|
dotnet_naming_symbols.delegate.required_modifiers =
|
||||||
|
dotnet_naming_symbols.enum.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||||
|
dotnet_naming_symbols.enum.applicable_kinds = enum
|
||||||
|
dotnet_naming_symbols.enum.required_modifiers =
|
||||||
|
dotnet_naming_symbols.event.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||||
|
dotnet_naming_symbols.event.applicable_kinds = event
|
||||||
|
dotnet_naming_symbols.event.required_modifiers =
|
||||||
|
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||||
|
dotnet_naming_symbols.interface.applicable_kinds = interface
|
||||||
|
dotnet_naming_symbols.interface.required_modifiers =
|
||||||
|
dotnet_naming_symbols.method.applicable_accessibilities = public
|
||||||
|
dotnet_naming_symbols.method.applicable_kinds = method
|
||||||
|
dotnet_naming_symbols.method.required_modifiers =
|
||||||
|
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||||
|
dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
|
||||||
|
dotnet_naming_symbols.non_field_members.required_modifiers =
|
||||||
|
dotnet_naming_symbols.private_method.applicable_accessibilities = private
|
||||||
|
dotnet_naming_symbols.private_method.applicable_kinds = method
|
||||||
|
dotnet_naming_symbols.private_method.required_modifiers =
|
||||||
|
dotnet_naming_symbols.private_or_internal_field.applicable_accessibilities = internal, private, private_protected
|
||||||
|
dotnet_naming_symbols.private_or_internal_field.applicable_kinds = field
|
||||||
|
dotnet_naming_symbols.private_or_internal_field.required_modifiers =
|
||||||
|
dotnet_naming_symbols.private_or_internal_static_field.applicable_accessibilities = internal, private, private_protected
|
||||||
|
dotnet_naming_symbols.private_or_internal_static_field.applicable_kinds = field
|
||||||
|
dotnet_naming_symbols.private_or_internal_static_field.required_modifiers = static
|
||||||
|
dotnet_naming_symbols.property.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||||
|
dotnet_naming_symbols.property.applicable_kinds = property
|
||||||
|
dotnet_naming_symbols.property.required_modifiers =
|
||||||
|
dotnet_naming_symbols.public_or_protected_field.applicable_accessibilities = public, protected
|
||||||
|
dotnet_naming_symbols.public_or_protected_field.applicable_kinds = field
|
||||||
|
dotnet_naming_symbols.public_or_protected_field.required_modifiers =
|
||||||
|
dotnet_naming_symbols.static_field.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||||
|
dotnet_naming_symbols.static_field.applicable_kinds = field
|
||||||
|
dotnet_naming_symbols.static_field.required_modifiers = static
|
||||||
|
dotnet_naming_symbols.static_method.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||||
|
dotnet_naming_symbols.static_method.applicable_kinds = method
|
||||||
|
dotnet_naming_symbols.static_method.required_modifiers = static
|
||||||
|
dotnet_naming_symbols.struct.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||||
|
dotnet_naming_symbols.struct.applicable_kinds = struct
|
||||||
|
dotnet_naming_symbols.struct.required_modifiers =
|
||||||
|
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||||
|
dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
|
||||||
|
dotnet_naming_symbols.types.required_modifiers =
|
||||||
|
dotnet_remove_unnecessary_suppression_exclusions = 0
|
||||||
|
dotnet_separate_import_directive_groups = true
|
||||||
|
dotnet_sort_system_directives_first = true
|
||||||
|
dotnet_style_allow_multiple_blank_lines_experimental = false:warning
|
||||||
|
dotnet_style_allow_statement_immediately_after_block_experimental = true
|
||||||
|
dotnet_style_coalesce_expression = true
|
||||||
|
dotnet_style_collection_initializer = true:warning
|
||||||
|
dotnet_style_explicit_tuple_names = true:warning
|
||||||
|
dotnet_style_namespace_match_folder = true
|
||||||
|
dotnet_style_null_propagation = true:warning
|
||||||
|
dotnet_style_object_initializer = true:warning
|
||||||
|
dotnet_style_operator_placement_when_wrapping = beginning_of_line
|
||||||
|
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity
|
||||||
|
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity
|
||||||
|
dotnet_style_parentheses_in_other_operators = never_if_unnecessary
|
||||||
|
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity
|
||||||
|
dotnet_style_predefined_type_for_locals_parameters_members = true
|
||||||
|
dotnet_style_predefined_type_for_member_access = true:warning
|
||||||
|
dotnet_style_prefer_auto_properties = true:warning
|
||||||
|
dotnet_style_prefer_compound_assignment = true:warning
|
||||||
|
dotnet_style_prefer_conditional_expression_over_assignment = false
|
||||||
|
dotnet_style_prefer_conditional_expression_over_return = false
|
||||||
|
dotnet_style_prefer_inferred_anonymous_type_member_names = true:warning
|
||||||
|
dotnet_style_prefer_inferred_tuple_names = true:warning
|
||||||
|
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:warning
|
||||||
|
dotnet_style_prefer_simplified_boolean_expressions = true:warning
|
||||||
|
dotnet_style_prefer_simplified_interpolation = true
|
||||||
|
dotnet_style_qualification_for_event = false:error
|
||||||
|
dotnet_style_qualification_for_field = false
|
||||||
|
dotnet_style_qualification_for_method = false:error
|
||||||
|
dotnet_style_qualification_for_property = false:error
|
||||||
|
dotnet_style_readonly_field = true:warning
|
||||||
|
dotnet_style_require_accessibility_modifiers = for_non_interface_members
|
||||||
|
end_of_line = crlf
|
||||||
|
file_header_template = unset
|
||||||
|
indent_size = 4
|
||||||
|
indent_style = space
|
||||||
|
insert_final_newline = false
|
||||||
|
root = true
|
||||||
|
tab_width = 4
|
||||||
|
# https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1822
|
||||||
|
# https://github.com/dotnet/aspnetcore/blob/main/.editorconfig
|
||||||
|
# https://github.com/dotnet/project-system/blob/main/.editorconfig
|
||||||
|
|
||||||
|
# Question
|
||||||
|
csharp_prefer_simple_using_statement = false # Question
|
||||||
|
csharp_style_expression_bodied_constructors = when_on_single_line:none # Question
|
||||||
|
csharp_style_expression_bodied_properties = true # Question
|
||||||
|
csharp_style_implicit_object_creation_when_type_is_apparent = true:warning # Question
|
||||||
|
csharp_style_pattern_matching_over_as_with_null_check = false # Question
|
||||||
|
csharp_style_prefer_pattern_matching = false # Question
|
||||||
|
csharp_style_prefer_range_operator = false # Question
|
||||||
|
csharp_style_prefer_switch_expression = false # Question
|
||||||
|
csharp_style_unused_value_assignment_preference = unused_local_variable # Question
|
||||||
|
csharp_style_unused_value_expression_statement_preference = false # Question
|
||||||
|
csharp_style_var_elsewhere = false:none # Question
|
||||||
|
csharp_style_var_for_built_in_types = false:none # Question
|
||||||
|
csharp_style_var_when_type_is_apparent = false:warning # Question
|
||||||
|
dotnet_diagnostic.CA1001.severity = none # Question - Types that own disposable fields should be disposable
|
||||||
|
dotnet_diagnostic.CA1051.severity = none # Question - Do not declare visible instance fields
|
||||||
|
dotnet_diagnostic.CA1416.severity = none # Question - This call site is reachable on all platforms.
|
||||||
|
dotnet_diagnostic.CA1510.severity = none # Question - Use
|
||||||
|
dotnet_diagnostic.CA1834.severity = none # CA1834: Consider using 'StringBuilder.Append(char)' when applicable
|
||||||
|
dotnet_diagnostic.CA1860.severity = none # Question - Avoid using
|
||||||
|
dotnet_diagnostic.CA1862.severity = none # Question - Prefer using
|
||||||
|
dotnet_diagnostic.CA2208.severity = none # Question - Instantiate argument exceptions correctly
|
||||||
|
dotnet_diagnostic.CA2211.severity = none # Question - Non-constant fields should not be visible
|
||||||
|
dotnet_diagnostic.CA2249.severity = none # Question - Use
|
||||||
|
dotnet_diagnostic.CA2253.severity = none # Question - Named placeholders should not be numeric values
|
||||||
|
dotnet_diagnostic.CS0103.severity = none # Question - The name
|
||||||
|
dotnet_diagnostic.CS0168.severity = none # Question - The variable
|
||||||
|
dotnet_diagnostic.CS0219.severity = none # Question - The variable
|
||||||
|
dotnet_diagnostic.CS0612.severity = none # Question - is obsolete
|
||||||
|
dotnet_diagnostic.CS0618.severity = none # Question - Compiler Warning (level 2)
|
||||||
|
dotnet_diagnostic.CS0659.severity = none # Question - Compiler Warning (level 3)
|
||||||
|
dotnet_diagnostic.CS8019.severity = warning # Question - Unnecessary using directive.
|
||||||
|
dotnet_diagnostic.CS8600.severity = none # Question - Converting null literal or possible null value to non-nullable type
|
||||||
|
dotnet_diagnostic.CS8602.severity = none # Question - Dereference of a possibly null reference.
|
||||||
|
dotnet_diagnostic.CS8603.severity = none # Question - Possible null reference return
|
||||||
|
dotnet_diagnostic.CS8604.severity = none # Question - Possible null reference argument for parameter.
|
||||||
|
dotnet_diagnostic.CS8618.severity = none # Question - Non-nullable variable must contain a non-null value when exiting constructor
|
||||||
|
dotnet_diagnostic.CS8625.severity = none # Question - Cannot convert null literal to non-nullable reference type.
|
||||||
|
dotnet_diagnostic.CS8629.severity = none # Question - Nullable value type may be null
|
||||||
|
dotnet_diagnostic.CS8765.severity = none # Question - Nullability of type of parameter
|
||||||
|
dotnet_diagnostic.IDE0005.severity = none # Question - Remove unnecessary using directives
|
||||||
|
dotnet_diagnostic.IDE0008.severity = warning # Question - Use explicit type instead of
|
||||||
|
dotnet_diagnostic.IDE0017.severity = none # Question - Object initialization can be simplified
|
||||||
|
dotnet_diagnostic.IDE0019.severity = none # Question - Use pattern matching
|
||||||
|
dotnet_diagnostic.IDE0021.severity = none # Question - Use expression body for constructor
|
||||||
|
dotnet_diagnostic.IDE0022.severity = none # Question - Use expression body for method
|
||||||
|
dotnet_diagnostic.IDE0025.severity = none # Question - Use expression body for property
|
||||||
|
dotnet_diagnostic.IDE0027.severity = none # Question - Use expression body for accessor
|
||||||
|
dotnet_diagnostic.IDE0028.severity = none # Question - Use collection initializers or expressions
|
||||||
|
dotnet_diagnostic.IDE0031.severity = none # Question - Null check can be simplified
|
||||||
|
dotnet_diagnostic.IDE0032.severity = none # Question - Use auto property
|
||||||
|
dotnet_diagnostic.IDE0037.severity = none # Question - Member name can be simplified
|
||||||
|
dotnet_diagnostic.IDE0041.severity = none # Question - Null check can be simplified
|
||||||
|
dotnet_diagnostic.IDE0047.severity = none # Question - Parentheses preferences
|
||||||
|
dotnet_diagnostic.IDE0049.severity = warning # Question - Name can be simplified
|
||||||
|
dotnet_diagnostic.IDE0051.severity = none # Question - Remove unused private member
|
||||||
|
dotnet_diagnostic.IDE0053.severity = none # Question - Use expression body for lambdas
|
||||||
|
dotnet_diagnostic.IDE0054.severity = none # Question - Use compound assignment
|
||||||
|
dotnet_diagnostic.IDE0055.severity = none # Question - Formatting rule
|
||||||
|
dotnet_diagnostic.IDE0057.severity = none # Question - Substring can be simplified
|
||||||
|
dotnet_diagnostic.IDE0058.severity = none # Question - Remove unnecessary expression value
|
||||||
|
dotnet_diagnostic.IDE0059.severity = none # Question - Unnecessary assignment of a value to
|
||||||
|
dotnet_diagnostic.IDE0060.severity = none # Question - Remove unused parameter
|
||||||
|
dotnet_diagnostic.IDE0063.severity = none # Question - Use simple
|
||||||
|
dotnet_diagnostic.IDE0065.severity = none # Question -
|
||||||
|
dotnet_diagnostic.IDE0066.severity = none # Question - Use
|
||||||
|
dotnet_diagnostic.IDE0078.severity = none # Question - Use pattern matching (may change code meaning)
|
||||||
|
dotnet_diagnostic.IDE0090.severity = warning # Question - Simplify new expression
|
||||||
|
dotnet_diagnostic.IDE0160.severity = warning # Question - Use block-scoped namespace
|
||||||
|
dotnet_diagnostic.IDE0161.severity = warning # Question - Namespace declaration preferences
|
||||||
|
dotnet_diagnostic.IDE0270.severity = none # Question - Null check can be simplified
|
||||||
|
dotnet_diagnostic.IDE0300.severity = none # Question - Collection initialization can be simplified
|
||||||
|
dotnet_diagnostic.IDE1006.severity = none # Question - Use collection expression for builder dotnet_style_prefer_collection_expression
|
||||||
|
dotnet_style_null_propagation = false # Question
|
||||||
|
dotnet_style_object_initializer = false # Question
|
||||||
|
dotnet_style_prefer_auto_properties = false # Question
|
||||||
|
dotnet_style_allow_statement_immediately_after_block_experimental = true # Question
|
||||||
|
dotnet_style_prefer_is_null_check_over_reference_equality_method = false # Question
|
||||||
|
dotnet_style_prefer_inferred_anonymous_type_member_names = false:warning # Question
|
1
Fab2ApprovalSystem/.vscode/format-report.json
vendored
Normal file
1
Fab2ApprovalSystem/.vscode/format-report.json
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
[]
|
30
Fab2ApprovalSystem/.vscode/launch.json
vendored
Normal file
30
Fab2ApprovalSystem/.vscode/launch.json
vendored
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
{
|
||||||
|
// Use IntelliSense to learn about possible attributes.
|
||||||
|
// Hover to view descriptions of existing attributes.
|
||||||
|
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||||
|
"version": "0.2.0",
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"name": ".NET Core Launch (console)",
|
||||||
|
"type": "coreclr",
|
||||||
|
"request": "launch",
|
||||||
|
"preLaunchTask": "build",
|
||||||
|
"program": "${workspaceFolder}/bin/Debug/net8.0/win-x64/Fab2ApprovalSystem.dll",
|
||||||
|
"args": [],
|
||||||
|
"cwd": "${workspaceFolder}",
|
||||||
|
"console": "integratedTerminal",
|
||||||
|
"stopAtEntry": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": ".NET Core Attach",
|
||||||
|
"type": "coreclr",
|
||||||
|
"request": "attach"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "node",
|
||||||
|
"request": "launch",
|
||||||
|
"name": "node Launch Current Opened File",
|
||||||
|
"program": "${file}"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
424
Fab2ApprovalSystem/.vscode/settings.json
vendored
Normal file
424
Fab2ApprovalSystem/.vscode/settings.json
vendored
Normal file
@ -0,0 +1,424 @@
|
|||||||
|
{
|
||||||
|
"[markdown]": {
|
||||||
|
"editor.wordWrap": "off"
|
||||||
|
},
|
||||||
|
"files.exclude": {
|
||||||
|
"**/.git": false,
|
||||||
|
"**/node_modules": true
|
||||||
|
},
|
||||||
|
"files.watcherExclude": {
|
||||||
|
"**/node_modules": true
|
||||||
|
},
|
||||||
|
"cSpell.words": [
|
||||||
|
"abutton",
|
||||||
|
"accessibilities",
|
||||||
|
"accodingly",
|
||||||
|
"acknowledgmentby",
|
||||||
|
"Acks",
|
||||||
|
"actionsheet",
|
||||||
|
"Additonal",
|
||||||
|
"Addtional",
|
||||||
|
"againm",
|
||||||
|
"agendaview",
|
||||||
|
"Antlr",
|
||||||
|
"Appover",
|
||||||
|
"Appprrovers",
|
||||||
|
"Approvalog",
|
||||||
|
"Aprovers",
|
||||||
|
"Aproverslist",
|
||||||
|
"asax",
|
||||||
|
"aspnetmvc",
|
||||||
|
"Assignedto",
|
||||||
|
"Atachments",
|
||||||
|
"Attachemnt",
|
||||||
|
"Attachemnts",
|
||||||
|
"Attchment",
|
||||||
|
"auditee",
|
||||||
|
"Auditee",
|
||||||
|
"Auditees",
|
||||||
|
"automaically",
|
||||||
|
"Autthorized",
|
||||||
|
"beacuase",
|
||||||
|
"beforeunload",
|
||||||
|
"Belguim",
|
||||||
|
"bfound",
|
||||||
|
"bgcolor",
|
||||||
|
"Bies",
|
||||||
|
"binded",
|
||||||
|
"blackbackground",
|
||||||
|
"blackhover",
|
||||||
|
"blackpressed",
|
||||||
|
"blueenergy",
|
||||||
|
"blueopal",
|
||||||
|
"buttongroup",
|
||||||
|
"BYMRB",
|
||||||
|
"bytesgot",
|
||||||
|
"CAID",
|
||||||
|
"casection",
|
||||||
|
"CAXXXX",
|
||||||
|
"CCPCR",
|
||||||
|
"CCPCRB",
|
||||||
|
"cellspacing",
|
||||||
|
"Cheeso's",
|
||||||
|
"chkbx",
|
||||||
|
"Clib",
|
||||||
|
"colorpicker",
|
||||||
|
"columnmenu",
|
||||||
|
"columnsreorder",
|
||||||
|
"columnsresize",
|
||||||
|
"comming",
|
||||||
|
"Containmen",
|
||||||
|
"Copmments",
|
||||||
|
"correctiv",
|
||||||
|
"Correctivet",
|
||||||
|
"Creat",
|
||||||
|
"currentd",
|
||||||
|
"Cyle",
|
||||||
|
"dadada",
|
||||||
|
"darkbluehover",
|
||||||
|
"darkbluepressed",
|
||||||
|
"darkred",
|
||||||
|
"datafields",
|
||||||
|
"datasource",
|
||||||
|
"dataviz",
|
||||||
|
"datepicker",
|
||||||
|
"datetimepicker",
|
||||||
|
"dayview",
|
||||||
|
"Deletet",
|
||||||
|
"Delgation",
|
||||||
|
"DENITED",
|
||||||
|
"Deparmtent",
|
||||||
|
"departmentids",
|
||||||
|
"Descirption",
|
||||||
|
"devprog",
|
||||||
|
"dfeffc",
|
||||||
|
"Disp",
|
||||||
|
"Dispo",
|
||||||
|
"Dispoitio",
|
||||||
|
"Dispos",
|
||||||
|
"Dispositon",
|
||||||
|
"Dispostion",
|
||||||
|
"Dispostions",
|
||||||
|
"dispotypevalidation",
|
||||||
|
"Docbase",
|
||||||
|
"Documentum",
|
||||||
|
"Documetum",
|
||||||
|
"dont",
|
||||||
|
"downlaoded",
|
||||||
|
"draganddrop",
|
||||||
|
"dragcancel",
|
||||||
|
"dropdownlist",
|
||||||
|
"Eamils",
|
||||||
|
"ECNPCRB",
|
||||||
|
"Ecns",
|
||||||
|
"edmx",
|
||||||
|
"EECN",
|
||||||
|
"emai",
|
||||||
|
"emailparams",
|
||||||
|
"Emergrncy",
|
||||||
|
"energyblue",
|
||||||
|
"Eran",
|
||||||
|
"Esql",
|
||||||
|
"ETECN",
|
||||||
|
"EXCELOPENXML",
|
||||||
|
"existinglocation",
|
||||||
|
"Expando",
|
||||||
|
"extrafield",
|
||||||
|
"fadc",
|
||||||
|
"fbec",
|
||||||
|
"fcfdfd",
|
||||||
|
"fdff",
|
||||||
|
"fece",
|
||||||
|
"feeebd",
|
||||||
|
"ffdc",
|
||||||
|
"ffdd",
|
||||||
|
"fieldset",
|
||||||
|
"FILIPE",
|
||||||
|
"filtermenu",
|
||||||
|
"Fldr",
|
||||||
|
"flintstone",
|
||||||
|
"FLOWLOCS",
|
||||||
|
"FMEA",
|
||||||
|
"ftplib",
|
||||||
|
"FTPSPN",
|
||||||
|
"GETDATE",
|
||||||
|
"gitea",
|
||||||
|
"globaldocudms",
|
||||||
|
"glyphicons",
|
||||||
|
"groupable",
|
||||||
|
"Guids",
|
||||||
|
"halflings",
|
||||||
|
"Hexsize",
|
||||||
|
"highcontrast",
|
||||||
|
"Hmac",
|
||||||
|
"holdsteps",
|
||||||
|
"hostspecific",
|
||||||
|
"icenium",
|
||||||
|
"IECN",
|
||||||
|
"imagebrowser",
|
||||||
|
"IMRB",
|
||||||
|
"Infineon",
|
||||||
|
"Insertd",
|
||||||
|
"inverseicons",
|
||||||
|
"IPCRB",
|
||||||
|
"ISADMIN",
|
||||||
|
"islast",
|
||||||
|
"ISNULL",
|
||||||
|
"ITAR",
|
||||||
|
"jquery",
|
||||||
|
"jqueryval",
|
||||||
|
"jqwidgets",
|
||||||
|
"jqxbuttongroup",
|
||||||
|
"jqxbuttons",
|
||||||
|
"jqxcalendar",
|
||||||
|
"jqxchart",
|
||||||
|
"jqxcheckbox",
|
||||||
|
"jqxcolorpicker",
|
||||||
|
"jqxcombobox",
|
||||||
|
"jqxcore",
|
||||||
|
"jqxdata",
|
||||||
|
"jqxdatatable",
|
||||||
|
"jqxdatetimeinput",
|
||||||
|
"jqxdocking",
|
||||||
|
"jqxdockpanel",
|
||||||
|
"jqxdragdrop",
|
||||||
|
"jqxdropdownbutton",
|
||||||
|
"jqxdropdownlist",
|
||||||
|
"jqxexpander",
|
||||||
|
"jqxgauge",
|
||||||
|
"jqxgrid",
|
||||||
|
"jqxinput",
|
||||||
|
"jqxknockout",
|
||||||
|
"jqxlistbox",
|
||||||
|
"jqxlistmenu",
|
||||||
|
"jqxmaskedinput",
|
||||||
|
"jqxmenu",
|
||||||
|
"jqxnavigationbar",
|
||||||
|
"jqxnumberinput",
|
||||||
|
"jqxpanel",
|
||||||
|
"jqxpasswordinput",
|
||||||
|
"jqxprogressbar",
|
||||||
|
"jqxradiobutton",
|
||||||
|
"jqxrangeselector",
|
||||||
|
"jqxrating",
|
||||||
|
"jqxresponse",
|
||||||
|
"jqxscrollbar",
|
||||||
|
"jqxscrollview",
|
||||||
|
"jqxslider",
|
||||||
|
"jqxsplitter",
|
||||||
|
"jqxswitchbutton",
|
||||||
|
"jqxtabs",
|
||||||
|
"jqxtooltip",
|
||||||
|
"jqxtouch",
|
||||||
|
"jqxtree",
|
||||||
|
"jqxtreegrid",
|
||||||
|
"jqxtreemap",
|
||||||
|
"jqxvalidator",
|
||||||
|
"jqxwindow",
|
||||||
|
"kendogridcustom",
|
||||||
|
"kendoui",
|
||||||
|
"labelelement",
|
||||||
|
"labelledby",
|
||||||
|
"Leanred",
|
||||||
|
"lightgray",
|
||||||
|
"linkbutton",
|
||||||
|
"Linq",
|
||||||
|
"Listdiv",
|
||||||
|
"listview",
|
||||||
|
"Lnks",
|
||||||
|
"localfilename",
|
||||||
|
"loclist",
|
||||||
|
"logis",
|
||||||
|
"logtext",
|
||||||
|
"loopmis",
|
||||||
|
"lotdispo",
|
||||||
|
"LOTDISPSITION",
|
||||||
|
"Lotfile",
|
||||||
|
"lotlist",
|
||||||
|
"lotstatusoption",
|
||||||
|
"LTRIM",
|
||||||
|
"MADUREIRA",
|
||||||
|
"mailrelay",
|
||||||
|
"MDTM",
|
||||||
|
"meego",
|
||||||
|
"meetingid",
|
||||||
|
"menubutton",
|
||||||
|
"mesafi",
|
||||||
|
"metroblack",
|
||||||
|
"metrodark",
|
||||||
|
"miliseconds",
|
||||||
|
"modalview",
|
||||||
|
"modernizr",
|
||||||
|
"Modernizr",
|
||||||
|
"monthview",
|
||||||
|
"MRBIs",
|
||||||
|
"Mrbs",
|
||||||
|
"msecs",
|
||||||
|
"multipleextended",
|
||||||
|
"Navigatable",
|
||||||
|
"nbsp",
|
||||||
|
"newbase",
|
||||||
|
"newchange",
|
||||||
|
"newdi",
|
||||||
|
"newfilename",
|
||||||
|
"newsource",
|
||||||
|
"Newtonsoft",
|
||||||
|
"notications",
|
||||||
|
"Notifcation",
|
||||||
|
"Notifyf",
|
||||||
|
"NTLM",
|
||||||
|
"Nullcc",
|
||||||
|
"numerictextbox",
|
||||||
|
"objdata",
|
||||||
|
"OCAP",
|
||||||
|
"occured",
|
||||||
|
"odata",
|
||||||
|
"oldfilename",
|
||||||
|
"OLHOLD",
|
||||||
|
"onclick",
|
||||||
|
"onmousemove",
|
||||||
|
"OPDESC",
|
||||||
|
"OPENQUERY",
|
||||||
|
"Oper",
|
||||||
|
"operationslist",
|
||||||
|
"Orginator",
|
||||||
|
"Originatorname",
|
||||||
|
"Ouellette",
|
||||||
|
"Owin",
|
||||||
|
"pageable",
|
||||||
|
"Pageable",
|
||||||
|
"panelbar",
|
||||||
|
"parentid",
|
||||||
|
"parminput",
|
||||||
|
"parms",
|
||||||
|
"Parms",
|
||||||
|
"particula",
|
||||||
|
"pasv",
|
||||||
|
"PASV",
|
||||||
|
"PATINDEX",
|
||||||
|
"PCRB",
|
||||||
|
"PCRBID",
|
||||||
|
"pcrvalues",
|
||||||
|
"pdbonly",
|
||||||
|
"Preventitive",
|
||||||
|
"preventivet",
|
||||||
|
"Prevetative",
|
||||||
|
"proces",
|
||||||
|
"Processedl",
|
||||||
|
"procs",
|
||||||
|
"productfamilies",
|
||||||
|
"progess",
|
||||||
|
"progressbar",
|
||||||
|
"qrcode",
|
||||||
|
"Quanityt",
|
||||||
|
"rangebar",
|
||||||
|
"Recep",
|
||||||
|
"Recepient",
|
||||||
|
"recieved",
|
||||||
|
"recordlock",
|
||||||
|
"remotefilename",
|
||||||
|
"reorderable",
|
||||||
|
"reportform",
|
||||||
|
"reportslist",
|
||||||
|
"reportslistdiv",
|
||||||
|
"Reqquired",
|
||||||
|
"Reqs",
|
||||||
|
"Requiest",
|
||||||
|
"Responsibles",
|
||||||
|
"RETR",
|
||||||
|
"Revisioing",
|
||||||
|
"Revisioned",
|
||||||
|
"Revison",
|
||||||
|
"rgba",
|
||||||
|
"rkotian",
|
||||||
|
"RNFR",
|
||||||
|
"RNTO",
|
||||||
|
"Roless",
|
||||||
|
"roundbg",
|
||||||
|
"RTRIM",
|
||||||
|
"SAMDB",
|
||||||
|
"scroller",
|
||||||
|
"scrollview",
|
||||||
|
"seleced",
|
||||||
|
"selectionlog",
|
||||||
|
"Selectpart",
|
||||||
|
"sess",
|
||||||
|
"Sfisharepoint",
|
||||||
|
"shinyblack",
|
||||||
|
"showpassword",
|
||||||
|
"SIGNON",
|
||||||
|
"simpleparser",
|
||||||
|
"slddrw",
|
||||||
|
"sldprt",
|
||||||
|
"sortasc",
|
||||||
|
"sortascbutton",
|
||||||
|
"sortdesc",
|
||||||
|
"sortdescbutton",
|
||||||
|
"sortremove",
|
||||||
|
"sparkline",
|
||||||
|
"splitview",
|
||||||
|
"SPNMRB",
|
||||||
|
"SPNPDB",
|
||||||
|
"SSRS",
|
||||||
|
"Sssign",
|
||||||
|
"Staus",
|
||||||
|
"stylesheet",
|
||||||
|
"Submited",
|
||||||
|
"subrole",
|
||||||
|
"subroles",
|
||||||
|
"Succefully",
|
||||||
|
"Succesfully",
|
||||||
|
"sucessfully",
|
||||||
|
"SURP",
|
||||||
|
"Swashbuckle",
|
||||||
|
"SWRN",
|
||||||
|
"tabindex",
|
||||||
|
"tabstrip",
|
||||||
|
"Tahoma",
|
||||||
|
"taskcompleted",
|
||||||
|
"Tasklist",
|
||||||
|
"Taveler",
|
||||||
|
"TECN",
|
||||||
|
"TECNs",
|
||||||
|
"TEMIRWAP",
|
||||||
|
"tempecd",
|
||||||
|
"tempimplement",
|
||||||
|
"templabel",
|
||||||
|
"tempvalue",
|
||||||
|
"TEMSA",
|
||||||
|
"timepicker",
|
||||||
|
"Tobe",
|
||||||
|
"Toplevel",
|
||||||
|
"Totrav",
|
||||||
|
"trainingby",
|
||||||
|
"Traininglist",
|
||||||
|
"traininglistdiv",
|
||||||
|
"transanction",
|
||||||
|
"Trav",
|
||||||
|
"Traveller",
|
||||||
|
"Traverler",
|
||||||
|
"TRAVLELER",
|
||||||
|
"Travler",
|
||||||
|
"TREEVIEW",
|
||||||
|
"trigerred",
|
||||||
|
"ttinclude",
|
||||||
|
"Uhandled",
|
||||||
|
"Updat",
|
||||||
|
"Uplaod",
|
||||||
|
"Upto",
|
||||||
|
"userevents",
|
||||||
|
"userids",
|
||||||
|
"userlist",
|
||||||
|
"Validatable",
|
||||||
|
"valueelement",
|
||||||
|
"Variabls",
|
||||||
|
"Verdana",
|
||||||
|
"vgrid",
|
||||||
|
"viewmodel",
|
||||||
|
"vsdoc",
|
||||||
|
"whethere",
|
||||||
|
"windowsphone",
|
||||||
|
"Winsock",
|
||||||
|
"worlflow"
|
||||||
|
]
|
||||||
|
}
|
20
Fab2ApprovalSystem/.vscode/tasks.json
vendored
Normal file
20
Fab2ApprovalSystem/.vscode/tasks.json
vendored
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
"version": "2.0.0",
|
||||||
|
"tasks": [
|
||||||
|
{
|
||||||
|
"label": "MSBuild",
|
||||||
|
"command": "C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/MSBuild/Current/Bin/MSBuild.exe",
|
||||||
|
"type": "process",
|
||||||
|
"args": [
|
||||||
|
"/target:Build",
|
||||||
|
"/restore:True",
|
||||||
|
"/p:RestoreSources=https://artifactory.intra.infineon.com/artifactory/api/nuget/ngt-fi-package-main-vir/%3Bhttps://packagemanagement.eu.infineon.com:4430/api/v2/%3Bhttps://api.nuget.org/v3/index.json",
|
||||||
|
"/detailedsummary",
|
||||||
|
"/consoleloggerparameters:PerformanceSummary;ErrorsOnly;",
|
||||||
|
"/property:Configuration=Debug;TargetFrameworkVersion=v4.8",
|
||||||
|
"Fab2ApprovalSystem.csproj"
|
||||||
|
],
|
||||||
|
"problemMatcher": "$msCompile"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
31
Fab2ApprovalSystem/App_Start/.editorconfig
Normal file
31
Fab2ApprovalSystem/App_Start/.editorconfig
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
|
||||||
|
#### .NET Coding Conventions ####
|
||||||
|
|
||||||
|
# Organize usings
|
||||||
|
dotnet_separate_import_directive_groups = true
|
||||||
|
dotnet_sort_system_directives_first = true
|
||||||
|
|
||||||
|
# New line preferences
|
||||||
|
csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true
|
||||||
|
csharp_style_allow_blank_line_after_token_in_arrow_expression_clause_experimental = true
|
||||||
|
csharp_style_allow_blank_line_after_token_in_conditional_expression_experimental = true
|
||||||
|
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = false
|
||||||
|
csharp_style_allow_embedded_statements_on_same_line_experimental = true
|
||||||
|
|
||||||
|
#### C# Formatting Rules ####
|
||||||
|
|
||||||
|
# New line preferences
|
||||||
|
csharp_new_line_before_catch = false
|
||||||
|
csharp_new_line_before_else = false
|
||||||
|
csharp_new_line_before_finally = false
|
||||||
|
csharp_new_line_before_members_in_anonymous_types = true
|
||||||
|
csharp_new_line_before_members_in_object_initializers = true
|
||||||
|
csharp_new_line_before_open_brace = none
|
||||||
|
csharp_new_line_between_query_expression_clauses = true
|
||||||
|
|
||||||
|
####
|
||||||
|
|
||||||
|
insert_final_newline = false
|
||||||
|
csharp_style_namespace_declarations = file_scoped:warning
|
||||||
|
dotnet_diagnostic.IDE0161.severity = warning # Question - Namespace declaration preferences
|
||||||
|
dotnet_diagnostic.IDE2000.severity = error # IDE2000: Allow multiple blank lines
|
@ -1,66 +1,58 @@
|
|||||||
using System.Web;
|
using System.Web;
|
||||||
using System.Web.Optimization;
|
using System.Web.Optimization;
|
||||||
|
|
||||||
namespace Fab2ApprovalSystem
|
namespace Fab2ApprovalSystem;
|
||||||
{
|
|
||||||
public class BundleConfig
|
|
||||||
{
|
|
||||||
// For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862
|
|
||||||
public static void RegisterBundles(BundleCollection bundles)
|
|
||||||
{
|
|
||||||
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
|
|
||||||
"~/Scripts/jquery-{version}.js",
|
|
||||||
"~/Scripts/jquery-ui-{version}.js")
|
|
||||||
);
|
|
||||||
|
|
||||||
//bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
|
public class BundleConfig {
|
||||||
// "~/Scripts/jquery.validate*"));
|
// For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862
|
||||||
|
public static void RegisterBundles(BundleCollection bundles) {
|
||||||
|
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
|
||||||
|
"~/Scripts/jquery-{version}.js",
|
||||||
|
"~/Scripts/jquery-ui-{version}.js")
|
||||||
|
);
|
||||||
|
|
||||||
bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
|
//bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
|
||||||
"~/Scripts/jquery.unobtrusive*",
|
// "~/Scripts/jquery.validate*"));
|
||||||
"~/Scripts/jquery.validate*"));
|
|
||||||
|
|
||||||
// Use the development version of Modernizr to develop with and learn from. Then, when you're
|
bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
|
||||||
// ready for production, use the build tool at http://modernizr.com to pick only the tests you need.
|
"~/Scripts/jquery.unobtrusive*",
|
||||||
bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
|
"~/Scripts/jquery.validate*"));
|
||||||
"~/Scripts/modernizr-*"));
|
|
||||||
|
|
||||||
bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
|
// Use the development version of Modernizr to develop with and learn from. Then, when you're
|
||||||
"~/Scripts/bootstrap.js",
|
// ready for production, use the build tool at http://modernizr.com to pick only the tests you need.
|
||||||
"~/Scripts/respond.min.js",
|
bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
|
||||||
"~/Scripts/common.js"));
|
"~/Scripts/modernizr-*"));
|
||||||
|
|
||||||
|
bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
|
||||||
|
"~/Scripts/bootstrap.js",
|
||||||
|
"~/Scripts/respond.min.js",
|
||||||
|
"~/Scripts/common.js"));
|
||||||
|
|
||||||
bundles.Add(new ScriptBundle("~/bundles/kendo").Include(
|
bundles.Add(new ScriptBundle("~/bundles/kendo").Include(
|
||||||
"~/Scripts/kendo/kendo.all.min.js",
|
"~/Scripts/kendo/kendo.all.min.js",
|
||||||
"~/Scripts/kendo/kendo.aspnetmvc.min.js"));
|
"~/Scripts/kendo/kendo.aspnetmvc.min.js"));
|
||||||
|
|
||||||
bundles.Add(new StyleBundle("~/Content/kendo/css").Include(
|
bundles.Add(new StyleBundle("~/Content/kendo/css").Include(
|
||||||
"~/Content/kendo/kendo.common-bootstrap.min.css",
|
"~/Content/kendo/kendo.common-bootstrap.min.css",
|
||||||
"~/Content/kendo/kendo.bootstrap.min.css"));
|
"~/Content/kendo/kendo.bootstrap.min.css"));
|
||||||
|
|
||||||
bundles.Add(new StyleBundle("~/Content/jqw/css").Include(
|
bundles.Add(new StyleBundle("~/Content/jqw/css").Include(
|
||||||
"~/Scripts/jqwidgets/styles/jqx.base.css",
|
"~/Scripts/jqwidgets/styles/jqx.base.css",
|
||||||
"~/Scripts/jqwidgets/styles/jqx.energyblue.css",
|
"~/Scripts/jqwidgets/styles/jqx.energyblue.css",
|
||||||
"~/Scripts/jqwidgets/styles/jqx.arctic.css",
|
"~/Scripts/jqwidgets/styles/jqx.arctic.css",
|
||||||
"~/Scripts/jqwidgets/styles/jqx.energyblue.css"));
|
"~/Scripts/jqwidgets/styles/jqx.energyblue.css"));
|
||||||
|
|
||||||
|
bundles.Add(new ScriptBundle("~/Content/jqw/jq").Include(
|
||||||
|
"~/Scripts/jqwidgets/jqxcore.js",
|
||||||
|
"~/Scripts/jqwidgets/jqxdata.js",
|
||||||
|
"~/Scripts/jqwidgets/jqxbuttons.js",
|
||||||
|
"~/Scripts/jqwidgets/jqxscrollbar.js",
|
||||||
|
"~/Scripts/jqwidgets/jqxlistbox.js",
|
||||||
|
"~/Scripts/jqwidgets/jqxpanel.js",
|
||||||
|
"~/Scripts/jqwidgets/jqxtree.js"));
|
||||||
|
|
||||||
bundles.Add(new ScriptBundle("~/Content/jqw/jq").Include(
|
bundles.Add(new StyleBundle("~/Content/css").Include("~/Content/bootstrap.min.css",
|
||||||
"~/Scripts/jqwidgets/jqxcore.js",
|
"~/Content/site.css",
|
||||||
"~/Scripts/jqwidgets/jqxdata.js",
|
"~/Content/jquery-ui.css"));
|
||||||
"~/Scripts/jqwidgets/jqxbuttons.js",
|
|
||||||
"~/Scripts/jqwidgets/jqxscrollbar.js",
|
|
||||||
"~/Scripts/jqwidgets/jqxlistbox.js",
|
|
||||||
"~/Scripts/jqwidgets/jqxpanel.js",
|
|
||||||
"~/Scripts/jqwidgets/jqxtree.js"));
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bundles.Add(new StyleBundle("~/Content/css").Include("~/Content/bootstrap.min.css",
|
|
||||||
"~/Content/site.css",
|
|
||||||
"~/Content/jquery-ui.css"));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,13 +1,10 @@
|
|||||||
using System.Web;
|
using System.Web;
|
||||||
using System.Web.Mvc;
|
using System.Web.Mvc;
|
||||||
|
|
||||||
namespace Fab2ApprovalSystem
|
namespace Fab2ApprovalSystem;
|
||||||
{
|
|
||||||
public class FilterConfig
|
public class FilterConfig {
|
||||||
{
|
public static void RegisterGlobalFilters(GlobalFilterCollection filters) {
|
||||||
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
|
filters.Add(new HandleErrorAttribute());
|
||||||
{
|
|
||||||
filters.Add(new HandleErrorAttribute());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -6,27 +6,24 @@ using System.Web.Http;
|
|||||||
using System.Web.Mvc;
|
using System.Web.Mvc;
|
||||||
using System.Web.Routing;
|
using System.Web.Routing;
|
||||||
|
|
||||||
namespace Fab2ApprovalSystem
|
namespace Fab2ApprovalSystem;
|
||||||
{
|
|
||||||
public class RouteConfig
|
|
||||||
{
|
|
||||||
public static void RegisterRoutes(RouteCollection routes)
|
|
||||||
{
|
|
||||||
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
|
|
||||||
|
|
||||||
routes.MapRoute(
|
public class RouteConfig {
|
||||||
name: "Default",
|
public static void RegisterRoutes(RouteCollection routes) {
|
||||||
url: "{controller}/{action}/{id}",
|
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
|
||||||
// fixing hyperlinks so that the login page will redirect to them
|
|
||||||
// set the default route to the desired landing page, instead of the login page
|
routes.MapRoute(
|
||||||
// otherwise MVC generates the wrong form action url
|
name: "Default",
|
||||||
defaults: new { controller = "Home", action = "MyTasks", id = UrlParameter.Optional }
|
url: "{controller}/{action}/{id}",
|
||||||
);
|
// fixing hyperlinks so that the login page will redirect to them
|
||||||
//routes.MapHttpRoute(
|
// set the default route to the desired landing page, instead of the login page
|
||||||
// name: "ApiRoute",
|
// otherwise MVC generates the wrong form action url
|
||||||
// routeTemplate: "api/{controller}/{id}",
|
defaults: new { controller = "Home", action = "MyTasks", id = UrlParameter.Optional }
|
||||||
// defaults: new { id = RouteParameter.Optional }
|
);
|
||||||
//);
|
//routes.MapHttpRoute(
|
||||||
}
|
// name: "ApiRoute",
|
||||||
|
// routeTemplate: "api/{controller}/{id}",
|
||||||
|
// defaults: new { id = RouteParameter.Optional }
|
||||||
|
//);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,38 +1,35 @@
|
|||||||
using Microsoft.AspNet.Identity;
|
using Microsoft.AspNet.Identity;
|
||||||
using Microsoft.Owin;
|
using Microsoft.Owin;
|
||||||
using Microsoft.Owin.Security.Cookies;
|
using Microsoft.Owin.Security.Cookies;
|
||||||
|
|
||||||
using Owin;
|
using Owin;
|
||||||
|
|
||||||
namespace Fab2ApprovalSystem
|
namespace Fab2ApprovalSystem;
|
||||||
{
|
|
||||||
public partial class Startup
|
|
||||||
{
|
|
||||||
// For more information on configuring authentication, please visit http://go.microsoft.com/fwlink/?LinkId=301864
|
|
||||||
public void ConfigureAuth(IAppBuilder app)
|
|
||||||
{
|
|
||||||
// Enable the application to use a cookie to store information for the signed in user
|
|
||||||
app.UseCookieAuthentication(new CookieAuthenticationOptions
|
|
||||||
{
|
|
||||||
AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
|
|
||||||
LoginPath = new PathString("/Account/Login")
|
|
||||||
});
|
|
||||||
// Use a cookie to temporarily store information about a user logging in with a third party login provider
|
|
||||||
// app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie);
|
|
||||||
|
|
||||||
// Uncomment the following lines to enable logging in with third party login providers
|
public partial class Startup {
|
||||||
//app.UseMicrosoftAccountAuthentication(
|
// For more information on configuring authentication, please visit http://go.microsoft.com/fwlink/?LinkId=301864
|
||||||
// clientId: "",
|
public void ConfigureAuth(IAppBuilder app) {
|
||||||
// clientSecret: "");
|
// Enable the application to use a cookie to store information for the signed in user
|
||||||
|
app.UseCookieAuthentication(new CookieAuthenticationOptions {
|
||||||
|
AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
|
||||||
|
LoginPath = new PathString("/Account/Login")
|
||||||
|
});
|
||||||
|
// Use a cookie to temporarily store information about a user logging in with a third party login provider
|
||||||
|
// app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie);
|
||||||
|
|
||||||
//app.UseTwitterAuthentication(
|
// Uncomment the following lines to enable logging in with third party login providers
|
||||||
// consumerKey: "",
|
//app.UseMicrosoftAccountAuthentication(
|
||||||
// consumerSecret: "");
|
// clientId: "",
|
||||||
|
// clientSecret: "");
|
||||||
|
|
||||||
//app.UseFacebookAuthentication(
|
//app.UseTwitterAuthentication(
|
||||||
// appId: "",
|
// consumerKey: "",
|
||||||
// appSecret: "");
|
// consumerSecret: "");
|
||||||
|
|
||||||
//app.UseGoogleAuthentication();
|
//app.UseFacebookAuthentication(
|
||||||
}
|
// appId: "",
|
||||||
|
// appSecret: "");
|
||||||
|
|
||||||
|
//app.UseGoogleAuthentication();
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,17 +1,15 @@
|
|||||||
using System.Web.Http;
|
using System.Web.Http;
|
||||||
|
|
||||||
namespace Fab2ApprovalSystem {
|
namespace Fab2ApprovalSystem;
|
||||||
public static class WebApiConfig
|
|
||||||
{
|
|
||||||
public static void Register(HttpConfiguration config)
|
|
||||||
{
|
|
||||||
config.MapHttpAttributeRoutes();
|
|
||||||
|
|
||||||
config.Routes.MapHttpRoute(
|
public static class WebApiConfig {
|
||||||
name: "DefaultApi",
|
public static void Register(HttpConfiguration config) {
|
||||||
routeTemplate: "api/{controller}/{id}",
|
config.MapHttpAttributeRoutes();
|
||||||
defaults: new { id = RouteParameter.Optional }
|
|
||||||
);
|
config.Routes.MapHttpRoute(
|
||||||
}
|
name: "DefaultApi",
|
||||||
|
routeTemplate: "api/{controller}/{id}",
|
||||||
|
defaults: new { id = RouteParameter.Optional }
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
31
Fab2ApprovalSystem/Controllers/.editorconfig
Normal file
31
Fab2ApprovalSystem/Controllers/.editorconfig
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
|
||||||
|
#### .NET Coding Conventions ####
|
||||||
|
|
||||||
|
# Organize usings
|
||||||
|
dotnet_separate_import_directive_groups = true
|
||||||
|
dotnet_sort_system_directives_first = true
|
||||||
|
|
||||||
|
# New line preferences
|
||||||
|
csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true
|
||||||
|
csharp_style_allow_blank_line_after_token_in_arrow_expression_clause_experimental = true
|
||||||
|
csharp_style_allow_blank_line_after_token_in_conditional_expression_experimental = true
|
||||||
|
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = false
|
||||||
|
csharp_style_allow_embedded_statements_on_same_line_experimental = true
|
||||||
|
|
||||||
|
#### C# Formatting Rules ####
|
||||||
|
|
||||||
|
# New line preferences
|
||||||
|
csharp_new_line_before_catch = false
|
||||||
|
csharp_new_line_before_else = false
|
||||||
|
csharp_new_line_before_finally = false
|
||||||
|
csharp_new_line_before_members_in_anonymous_types = true
|
||||||
|
csharp_new_line_before_members_in_object_initializers = true
|
||||||
|
csharp_new_line_before_open_brace = none
|
||||||
|
csharp_new_line_between_query_expression_clauses = true
|
||||||
|
|
||||||
|
####
|
||||||
|
|
||||||
|
insert_final_newline = false
|
||||||
|
csharp_style_namespace_declarations = file_scoped:warning
|
||||||
|
dotnet_diagnostic.IDE0161.severity = warning # Question - Namespace declaration preferences
|
||||||
|
dotnet_diagnostic.IDE2000.severity = error # IDE2000: Allow multiple blank lines
|
@ -1,367 +1,334 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Net;
|
||||||
|
using System.Net.Http;
|
||||||
using System.Security.Claims;
|
using System.Security.Claims;
|
||||||
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Web;
|
using System.Web;
|
||||||
using System.Web.Mvc;
|
using System.Web.Mvc;
|
||||||
|
using System.Web.Security;
|
||||||
|
|
||||||
|
using Fab2ApprovalSystem.DMO;
|
||||||
|
using Fab2ApprovalSystem.Misc;
|
||||||
|
using Fab2ApprovalSystem.Models;
|
||||||
|
|
||||||
using Microsoft.AspNet.Identity;
|
using Microsoft.AspNet.Identity;
|
||||||
using Microsoft.AspNet.Identity.EntityFramework;
|
using Microsoft.AspNet.Identity.EntityFramework;
|
||||||
using Microsoft.Owin.Security;
|
|
||||||
using Fab2ApprovalSystem.Models;
|
|
||||||
using System.Web.Security;
|
|
||||||
using Fab2ApprovalSystem.Misc;
|
|
||||||
using Fab2ApprovalSystem.DMO;
|
|
||||||
using Microsoft.AspNet.Identity.Owin;
|
using Microsoft.AspNet.Identity.Owin;
|
||||||
using System.Net.Http;
|
using Microsoft.Owin.Security;
|
||||||
|
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System.Text;
|
|
||||||
using System.Net;
|
|
||||||
|
|
||||||
namespace Fab2ApprovalSystem.Controllers {
|
namespace Fab2ApprovalSystem.Controllers;
|
||||||
[Authorize]
|
|
||||||
public class AccountController : Controller {
|
|
||||||
private string _apiBaseUrl;
|
|
||||||
|
|
||||||
public AccountController()
|
[Authorize]
|
||||||
: this(new UserManager<ApplicationUser>(new UserStore<ApplicationUser>(new ApplicationDbContext()))) {
|
public class AccountController : Controller {
|
||||||
_apiBaseUrl = Environment.GetEnvironmentVariable("FabApprovalApiBaseUrl") ??
|
private string _apiBaseUrl;
|
||||||
throw new ArgumentNullException("FabApprovalApiBaseUrl environment variable not found");
|
|
||||||
}
|
|
||||||
|
|
||||||
public AccountController(UserManager<ApplicationUser> userManager) {
|
public AccountController()
|
||||||
UserManager = userManager;
|
: this(new UserManager<ApplicationUser>(new UserStore<ApplicationUser>(new ApplicationDbContext()))) {
|
||||||
}
|
_apiBaseUrl = Environment.GetEnvironmentVariable("FabApprovalApiBaseUrl") ??
|
||||||
|
throw new ArgumentNullException("FabApprovalApiBaseUrl environment variable not found");
|
||||||
|
}
|
||||||
|
|
||||||
public UserManager<ApplicationUser> UserManager { get; private set; }
|
public AccountController(UserManager<ApplicationUser> userManager) {
|
||||||
|
UserManager = userManager;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
public UserManager<ApplicationUser> UserManager { get; private set; }
|
||||||
// GET: /Account/Login
|
|
||||||
[AllowAnonymous]
|
|
||||||
// try to make the browser refresh the login page every time, to prevent issues with changing usernames and the anti-forgery token validation
|
|
||||||
[OutputCache(NoStore = true, Duration = 0, VaryByParam = "*")]
|
|
||||||
public ActionResult Login(string returnUrl) {
|
|
||||||
ViewBag.ReturnUrl = returnUrl;
|
|
||||||
return View();
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpPost]
|
//
|
||||||
[AllowAnonymous]
|
// GET: /Account/Login
|
||||||
[ValidateAntiForgeryToken]
|
[AllowAnonymous]
|
||||||
public async Task<ActionResult> Login(LoginModel model, string returnUrl) {
|
// try to make the browser refresh the login page every time, to prevent issues with changing usernames and the anti-forgery token validation
|
||||||
try {
|
[OutputCache(NoStore = true, Duration = 0, VaryByParam = "*")]
|
||||||
bool isLoginValid;
|
public ActionResult Login(string returnUrl) {
|
||||||
|
ViewBag.ReturnUrl = returnUrl;
|
||||||
|
return View();
|
||||||
|
}
|
||||||
|
|
||||||
HttpClient httpClient = HttpClientFactory.Create();
|
private void SetSessionParameters(LoginResult loginResult, LoginModel user) {
|
||||||
httpClient.BaseAddress = new Uri(_apiBaseUrl);
|
Session["JWT"] = loginResult.AuthTokens.JwtToken;
|
||||||
|
Session["RefreshToken"] = loginResult.AuthTokens.RefreshToken;
|
||||||
|
|
||||||
AuthAttempt authAttempt = new AuthAttempt() {
|
Session[GlobalVars.SESSION_USERID] = user.UserID;
|
||||||
LoginID = model.LoginID,
|
Session[GlobalVars.SESSION_USERNAME] = user.FullName;
|
||||||
Password = model.Password
|
Session[GlobalVars.IS_ADMIN] = user.IsAdmin;
|
||||||
};
|
Session[GlobalVars.IS_MANAGER] = user.IsManager;
|
||||||
|
Session[GlobalVars.OOO] = user.OOO;
|
||||||
|
Session[GlobalVars.CAN_CREATE_PARTS_REQUEST] = user.IsAdmin || PartsRequestController.CanCreatePartsRequest(user.UserID);
|
||||||
|
|
||||||
HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Post, "auth/login");
|
FormsAuthentication.SetAuthCookie(user.LoginID, true);
|
||||||
|
}
|
||||||
|
|
||||||
request.Content = new StringContent(JsonConvert.SerializeObject(authAttempt),
|
[HttpPost]
|
||||||
Encoding.UTF8,
|
[AllowAnonymous]
|
||||||
"application/json");
|
[ValidateAntiForgeryToken]
|
||||||
|
public async Task<ActionResult> Login(LoginModel model, string returnUrl) {
|
||||||
|
try {
|
||||||
|
bool isLoginValid;
|
||||||
|
|
||||||
HttpResponseMessage httpResponseMessage = await httpClient.SendAsync(request);
|
HttpClient httpClient = HttpClientFactory.Create();
|
||||||
|
httpClient.BaseAddress = new Uri(_apiBaseUrl);
|
||||||
|
|
||||||
if (!httpResponseMessage.IsSuccessStatusCode)
|
LoginResult loginResult = await AccountDMO.LoginAsync(httpClient, model);
|
||||||
throw new Exception($"The authentication API failed, because {httpResponseMessage.ReasonPhrase}");
|
|
||||||
|
|
||||||
string responseContent = await httpResponseMessage.Content.ReadAsStringAsync();
|
#if (DEBUG)
|
||||||
|
isLoginValid = true;
|
||||||
LoginResult loginResult = JsonConvert.DeserializeObject<LoginResult>(responseContent);
|
|
||||||
|
|
||||||
#if(DEBUG)
|
|
||||||
isLoginValid = true;
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#if (!DEBUG)
|
#if (!DEBUG)
|
||||||
|
|
||||||
bool isIFX = false;
|
bool isIFX = false;
|
||||||
//domainProvider = Membership.Providers["NA_ADMembershipProvider"];
|
//domainProvider = Membership.Providers["NA_ADMembershipProvider"];
|
||||||
//isLoginValid = domainProvider.ValidateUser(model.LoginID, model.Password);
|
//isLoginValid = domainProvider.ValidateUser(model.LoginID, model.Password);
|
||||||
|
|
||||||
if (GlobalVars.DBConnection.ToUpper() == "TEST" || GlobalVars.DBConnection.ToUpper() == "QUALITY") {
|
if (GlobalVars.DBConnection.ToUpper() == "TEST" || GlobalVars.DBConnection.ToUpper() == "QUALITY") {
|
||||||
isLoginValid = true;
|
|
||||||
} else {
|
|
||||||
isLoginValid = loginResult.IsAuthenticated;
|
|
||||||
if (isLoginValid) isIFX = true;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (isLoginValid) {
|
|
||||||
UserAccountDMO userDMO = new UserAccountDMO();
|
|
||||||
LoginModel user = userDMO.GetUser(model.LoginID);
|
|
||||||
if (user != null) {
|
|
||||||
Session["JWT"] = loginResult.AuthTokens.JwtToken;
|
|
||||||
Session["RefreshToken"] = loginResult.AuthTokens.RefreshToken;
|
|
||||||
|
|
||||||
Session[GlobalVars.SESSION_USERID] = user.UserID;
|
|
||||||
Session[GlobalVars.SESSION_USERNAME] = user.FullName;
|
|
||||||
Session[GlobalVars.IS_ADMIN] = user.IsAdmin;
|
|
||||||
Session[GlobalVars.IS_MANAGER] = user.IsManager;
|
|
||||||
Session[GlobalVars.OOO] = user.OOO;
|
|
||||||
Session[GlobalVars.CAN_CREATE_PARTS_REQUEST] = user.IsAdmin || PartsRequestController.CanCreatePartsRequest(user.UserID);
|
|
||||||
|
|
||||||
FormsAuthentication.SetAuthCookie(user.LoginID, true);
|
|
||||||
|
|
||||||
return RedirectToLocal(returnUrl);
|
|
||||||
} else {
|
|
||||||
ModelState.AddModelError("", "The user name does not exist in the DB. Please contact the System Admin");
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
ModelState.AddModelError("", "The user name or password provided is incorrect.");
|
|
||||||
}
|
|
||||||
} catch (Exception ex) {
|
|
||||||
Functions.WriteEvent(@User.Identity.Name + " " + ex.InnerException, System.Diagnostics.EventLogEntryType.Error);
|
|
||||||
EventLogDMO.Add(new WinEventLog() { IssueID = 99999, UserID = @User.Identity.Name, DocumentType = "Login", OperationType = "Error", Comments = "Reject - " + ex.Message });
|
|
||||||
ModelState.AddModelError("", ex.Message);
|
|
||||||
}
|
|
||||||
|
|
||||||
return View(model);
|
|
||||||
// If we got this far, something failed, redisplay form
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpPost]
|
|
||||||
[AllowAnonymous]
|
|
||||||
public async Task<HttpResponseMessage> ExternalAuthSetup(AuthAttempt authAttempt) {
|
|
||||||
try {
|
|
||||||
bool isLoginValid;
|
|
||||||
|
|
||||||
HttpClient httpClient = HttpClientFactory.Create();
|
|
||||||
httpClient.BaseAddress = new Uri(_apiBaseUrl);
|
|
||||||
|
|
||||||
HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Post, "auth/refresh");
|
|
||||||
|
|
||||||
request.Content = new StringContent(JsonConvert.SerializeObject(authAttempt),
|
|
||||||
Encoding.UTF8,
|
|
||||||
"application/json");
|
|
||||||
|
|
||||||
HttpResponseMessage httpResponseMessage = await httpClient.SendAsync(request);
|
|
||||||
|
|
||||||
if (!httpResponseMessage.IsSuccessStatusCode)
|
|
||||||
throw new Exception($"The authentication API failed, because {httpResponseMessage.ReasonPhrase}");
|
|
||||||
|
|
||||||
string responseContent = await httpResponseMessage.Content.ReadAsStringAsync();
|
|
||||||
|
|
||||||
LoginResult loginResult = JsonConvert.DeserializeObject<LoginResult>(responseContent);
|
|
||||||
|
|
||||||
#if(DEBUG)
|
|
||||||
isLoginValid = true;
|
isLoginValid = true;
|
||||||
|
|
||||||
#endif
|
|
||||||
#if (!DEBUG)
|
|
||||||
|
|
||||||
bool isIFX = false;
|
|
||||||
//domainProvider = Membership.Providers["NA_ADMembershipProvider"];
|
|
||||||
//isLoginValid = domainProvider.ValidateUser(model.LoginID, model.Password);
|
|
||||||
|
|
||||||
if (GlobalVars.DBConnection.ToUpper() == "TEST" || GlobalVars.DBConnection.ToUpper() == "QUALITY") {
|
|
||||||
isLoginValid = true;
|
|
||||||
} else {
|
|
||||||
isLoginValid = loginResult.IsAuthenticated;
|
|
||||||
if (isLoginValid) isIFX = true;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (isLoginValid) {
|
|
||||||
UserAccountDMO userDMO = new UserAccountDMO();
|
|
||||||
LoginModel user = userDMO.GetUser(authAttempt.LoginID);
|
|
||||||
if (user != null) {
|
|
||||||
Session["JWT"] = loginResult.AuthTokens.JwtToken;
|
|
||||||
Session["RefreshToken"] = loginResult.AuthTokens.RefreshToken;
|
|
||||||
|
|
||||||
Session[GlobalVars.SESSION_USERID] = user.UserID;
|
|
||||||
Session[GlobalVars.SESSION_USERNAME] = user.FullName;
|
|
||||||
Session[GlobalVars.IS_ADMIN] = user.IsAdmin;
|
|
||||||
Session[GlobalVars.IS_MANAGER] = user.IsManager;
|
|
||||||
Session[GlobalVars.OOO] = user.OOO;
|
|
||||||
Session[GlobalVars.CAN_CREATE_PARTS_REQUEST] = user.IsAdmin || PartsRequestController.CanCreatePartsRequest(user.UserID);
|
|
||||||
|
|
||||||
FormsAuthentication.SetAuthCookie(user.LoginID, true);
|
|
||||||
|
|
||||||
return new HttpResponseMessage(HttpStatusCode.OK);
|
|
||||||
} else {
|
|
||||||
ModelState.AddModelError("", "The user name does not exist in the DB. Please contact the System Admin");
|
|
||||||
|
|
||||||
return new HttpResponseMessage(HttpStatusCode.NotFound);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
ModelState.AddModelError("", "The user name or password provided is incorrect.");
|
|
||||||
|
|
||||||
return new HttpResponseMessage(HttpStatusCode.Unauthorized);
|
|
||||||
}
|
|
||||||
} catch (Exception ex) {
|
|
||||||
Functions.WriteEvent(@User.Identity.Name + " " + ex.InnerException, System.Diagnostics.EventLogEntryType.Error);
|
|
||||||
EventLogDMO.Add(new WinEventLog() { IssueID = 99999, UserID = @User.Identity.Name, DocumentType = "Login", OperationType = "Error", Comments = "Reject - " + ex.Message });
|
|
||||||
ModelState.AddModelError("", ex.Message);
|
|
||||||
|
|
||||||
return new HttpResponseMessage(HttpStatusCode.InternalServerError);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// GET: /Account/Register
|
|
||||||
[AllowAnonymous]
|
|
||||||
public ActionResult Register() {
|
|
||||||
return View();
|
|
||||||
}
|
|
||||||
|
|
||||||
// POST: /Account/Disassociate
|
|
||||||
[HttpPost]
|
|
||||||
[ValidateAntiForgeryToken]
|
|
||||||
public async Task<ActionResult> Disassociate(string loginProvider, string providerKey) {
|
|
||||||
ManageMessageId? message = null;
|
|
||||||
IdentityResult result = await UserManager.RemoveLoginAsync(User.Identity.GetUserId(), new UserLoginInfo(loginProvider, providerKey));
|
|
||||||
if (result.Succeeded) {
|
|
||||||
message = ManageMessageId.RemoveLoginSuccess;
|
|
||||||
} else {
|
} else {
|
||||||
message = ManageMessageId.Error;
|
isLoginValid = loginResult.IsAuthenticated;
|
||||||
|
if (isLoginValid)
|
||||||
|
isIFX = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
return RedirectToAction("Manage", new { Message = message });
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (isLoginValid) {
|
||||||
|
UserAccountDMO userDMO = new UserAccountDMO();
|
||||||
|
LoginModel user = userDMO.GetUser(model.LoginID);
|
||||||
|
if (user != null) {
|
||||||
|
SetSessionParameters(loginResult, user);
|
||||||
|
|
||||||
|
return RedirectToLocal(returnUrl);
|
||||||
|
} else {
|
||||||
|
ModelState.AddModelError("", "The user name does not exist in the DB. Please contact the System Admin");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ModelState.AddModelError("", "The user name or password provided is incorrect.");
|
||||||
|
}
|
||||||
|
} catch (Exception ex) {
|
||||||
|
Functions.WriteEvent(GlobalVars.AppSettings, @User.Identity.Name + " " + ex.InnerException, System.Diagnostics.EventLogEntryType.Error);
|
||||||
|
EventLogDMO.Add(new WinEventLog() { IssueID = 99999, UserID = @User.Identity.Name, DocumentType = "Login", OperationType = "Error", Comments = "Reject - " + ex.Message });
|
||||||
|
ModelState.AddModelError("", ex.Message);
|
||||||
}
|
}
|
||||||
|
|
||||||
// GET: /Account/Manage
|
return View(model);
|
||||||
#pragma warning disable IDE0060 // Remove unused parameter
|
// If we got this far, something failed, redisplay form
|
||||||
public ActionResult Manage(ManageMessageId? message) {
|
}
|
||||||
return View();
|
|
||||||
|
[HttpPost]
|
||||||
|
[AllowAnonymous]
|
||||||
|
public async Task<HttpResponseMessage> ExternalAuthSetup(AuthAttempt authAttempt) {
|
||||||
|
try {
|
||||||
|
bool isLoginValid;
|
||||||
|
|
||||||
|
HttpClient httpClient = HttpClientFactory.Create();
|
||||||
|
httpClient.BaseAddress = new Uri(_apiBaseUrl);
|
||||||
|
|
||||||
|
LoginResult loginResult = await AccountDMO.ExternalAuthSetupAsync(httpClient, authAttempt);
|
||||||
|
|
||||||
|
#if (DEBUG)
|
||||||
|
isLoginValid = true;
|
||||||
|
|
||||||
|
#endif
|
||||||
|
#if (!DEBUG)
|
||||||
|
|
||||||
|
bool isIFX = false;
|
||||||
|
//domainProvider = Membership.Providers["NA_ADMembershipProvider"];
|
||||||
|
//isLoginValid = domainProvider.ValidateUser(model.LoginID, model.Password);
|
||||||
|
|
||||||
|
if (GlobalVars.DBConnection.ToUpper() == "TEST" || GlobalVars.DBConnection.ToUpper() == "QUALITY") {
|
||||||
|
isLoginValid = true;
|
||||||
|
} else {
|
||||||
|
isLoginValid = loginResult.IsAuthenticated;
|
||||||
|
if (isLoginValid)
|
||||||
|
isIFX = true;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (isLoginValid) {
|
||||||
|
UserAccountDMO userDMO = new UserAccountDMO();
|
||||||
|
LoginModel user = userDMO.GetUser(authAttempt.LoginID);
|
||||||
|
if (user != null) {
|
||||||
|
SetSessionParameters(loginResult, user);
|
||||||
|
|
||||||
|
return new HttpResponseMessage(HttpStatusCode.OK);
|
||||||
|
} else {
|
||||||
|
ModelState.AddModelError("", "The user name does not exist in the DB. Please contact the System Admin");
|
||||||
|
|
||||||
|
return new HttpResponseMessage(HttpStatusCode.NotFound);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ModelState.AddModelError("", "The user name or password provided is incorrect.");
|
||||||
|
|
||||||
|
return new HttpResponseMessage(HttpStatusCode.Unauthorized);
|
||||||
|
}
|
||||||
|
} catch (Exception ex) {
|
||||||
|
Functions.WriteEvent(GlobalVars.AppSettings, @User.Identity.Name + " " + ex.InnerException, System.Diagnostics.EventLogEntryType.Error);
|
||||||
|
EventLogDMO.Add(new WinEventLog() { IssueID = 99999, UserID = @User.Identity.Name, DocumentType = "Login", OperationType = "Error", Comments = "Reject - " + ex.Message });
|
||||||
|
ModelState.AddModelError("", ex.Message);
|
||||||
|
|
||||||
|
return new HttpResponseMessage(HttpStatusCode.InternalServerError);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// GET: /Account/Register
|
||||||
|
[AllowAnonymous]
|
||||||
|
public ActionResult Register() {
|
||||||
|
return View();
|
||||||
|
}
|
||||||
|
|
||||||
|
// POST: /Account/Disassociate
|
||||||
|
[HttpPost]
|
||||||
|
[ValidateAntiForgeryToken]
|
||||||
|
public async Task<ActionResult> Disassociate(string loginProvider, string providerKey) {
|
||||||
|
ManageMessageId? message = null;
|
||||||
|
IdentityResult result = await UserManager.RemoveLoginAsync(User.Identity.GetUserId(), new UserLoginInfo(loginProvider, providerKey));
|
||||||
|
if (result.Succeeded) {
|
||||||
|
message = ManageMessageId.RemoveLoginSuccess;
|
||||||
|
} else {
|
||||||
|
message = ManageMessageId.Error;
|
||||||
|
}
|
||||||
|
return RedirectToAction("Manage", new { Message = message });
|
||||||
|
}
|
||||||
|
|
||||||
|
// GET: /Account/Manage
|
||||||
|
#pragma warning disable IDE0060 // Remove unused parameter
|
||||||
|
public ActionResult Manage(ManageMessageId? message) {
|
||||||
|
return View();
|
||||||
|
}
|
||||||
#pragma warning restore IDE0060 // Remove unused parameter
|
#pragma warning restore IDE0060 // Remove unused parameter
|
||||||
|
|
||||||
// POST: /Account/ExternalLogin
|
// POST: /Account/ExternalLogin
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
[AllowAnonymous]
|
[AllowAnonymous]
|
||||||
[ValidateAntiForgeryToken]
|
[ValidateAntiForgeryToken]
|
||||||
public ActionResult ExternalLogin(string provider, string returnUrl) {
|
public ActionResult ExternalLogin(string provider, string returnUrl) {
|
||||||
// Request a redirect to the external login provider
|
// Request a redirect to the external login provider
|
||||||
return new ChallengeResult(provider, Url.Action("ExternalLoginCallback", "Account", new { ReturnUrl = returnUrl }));
|
return new ChallengeResult(provider, Url.Action("ExternalLoginCallback", "Account", new { ReturnUrl = returnUrl }));
|
||||||
}
|
}
|
||||||
|
|
||||||
// POST: /Account/LinkLogin
|
// POST: /Account/LinkLogin
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
[ValidateAntiForgeryToken]
|
[ValidateAntiForgeryToken]
|
||||||
public ActionResult LinkLogin(string provider) {
|
public ActionResult LinkLogin(string provider) {
|
||||||
// Request a redirect to the external login provider to link a login for the current user
|
// Request a redirect to the external login provider to link a login for the current user
|
||||||
return new ChallengeResult(provider, Url.Action("LinkLoginCallback", "Account"), User.Identity.GetUserId());
|
return new ChallengeResult(provider, Url.Action("LinkLoginCallback", "Account"), User.Identity.GetUserId());
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// GET: /Account/LinkLoginCallback
|
// GET: /Account/LinkLoginCallback
|
||||||
public async Task<ActionResult> LinkLoginCallback() {
|
public async Task<ActionResult> LinkLoginCallback() {
|
||||||
ExternalLoginInfo loginInfo = await AuthenticationManager.GetExternalLoginInfoAsync(XsrfKey, User.Identity.GetUserId());
|
ExternalLoginInfo loginInfo = await AuthenticationManager.GetExternalLoginInfoAsync(XsrfKey, User.Identity.GetUserId());
|
||||||
if (loginInfo == null) {
|
if (loginInfo == null) {
|
||||||
return RedirectToAction("Manage", new { Message = ManageMessageId.Error });
|
|
||||||
}
|
|
||||||
IdentityResult result = await UserManager.AddLoginAsync(User.Identity.GetUserId(), loginInfo.Login);
|
|
||||||
if (result.Succeeded) {
|
|
||||||
return RedirectToAction("Manage");
|
|
||||||
}
|
|
||||||
return RedirectToAction("Manage", new { Message = ManageMessageId.Error });
|
return RedirectToAction("Manage", new { Message = ManageMessageId.Error });
|
||||||
}
|
}
|
||||||
|
IdentityResult result = await UserManager.AddLoginAsync(User.Identity.GetUserId(), loginInfo.Login);
|
||||||
// POST: /Account/LogOff
|
if (result.Succeeded) {
|
||||||
[HttpPost]
|
return RedirectToAction("Manage");
|
||||||
[ValidateAntiForgeryToken]
|
|
||||||
public ActionResult LogOff() {
|
|
||||||
FormsAuthentication.SignOut();
|
|
||||||
return RedirectToAction("Login", "Account");
|
|
||||||
}
|
}
|
||||||
|
return RedirectToAction("Manage", new { Message = ManageMessageId.Error });
|
||||||
// GET: /Account/ExternalLoginFailure
|
|
||||||
[AllowAnonymous]
|
|
||||||
public ActionResult ExternalLoginFailure() {
|
|
||||||
return View();
|
|
||||||
}
|
|
||||||
|
|
||||||
[ChildActionOnly]
|
|
||||||
public ActionResult RemoveAccountList() {
|
|
||||||
IList<UserLoginInfo> linkedAccounts = UserManager.GetLogins(User.Identity.GetUserId());
|
|
||||||
ViewBag.ShowRemoveButton = HasPassword() || linkedAccounts.Count > 1;
|
|
||||||
return (ActionResult)PartialView("_RemoveAccountPartial", linkedAccounts);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void Dispose(bool disposing) {
|
|
||||||
if (disposing && UserManager != null) {
|
|
||||||
UserManager.Dispose();
|
|
||||||
UserManager = null;
|
|
||||||
}
|
|
||||||
base.Dispose(disposing);
|
|
||||||
}
|
|
||||||
|
|
||||||
#region Helpers
|
|
||||||
// Used for XSRF protection when adding external logins
|
|
||||||
private const string XsrfKey = "XsrfId";
|
|
||||||
|
|
||||||
private IAuthenticationManager AuthenticationManager {
|
|
||||||
get {
|
|
||||||
return HttpContext.GetOwinContext().Authentication;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private async Task SignInAsync(ApplicationUser user, bool isPersistent) {
|
|
||||||
AuthenticationManager.SignOut(DefaultAuthenticationTypes.ExternalCookie);
|
|
||||||
ClaimsIdentity identity = await UserManager.CreateIdentityAsync(user, DefaultAuthenticationTypes.ApplicationCookie);
|
|
||||||
AuthenticationManager.SignIn(new AuthenticationProperties() { IsPersistent = isPersistent }, identity);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void AddErrors(IdentityResult result) {
|
|
||||||
foreach (string error in result.Errors) {
|
|
||||||
ModelState.AddModelError("", error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private bool HasPassword() {
|
|
||||||
ApplicationUser user = UserManager.FindById(User.Identity.GetUserId());
|
|
||||||
if (user != null) {
|
|
||||||
return user.PasswordHash != null;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum ManageMessageId {
|
|
||||||
ChangePasswordSuccess,
|
|
||||||
SetPasswordSuccess,
|
|
||||||
RemoveLoginSuccess,
|
|
||||||
Error
|
|
||||||
}
|
|
||||||
|
|
||||||
private ActionResult RedirectToLocal(string returnUrl) {
|
|
||||||
if (Url.IsLocalUrl(returnUrl)) {
|
|
||||||
return Redirect(returnUrl);
|
|
||||||
} else {
|
|
||||||
return RedirectToAction("MyTasks", "Home");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private class ChallengeResult : HttpUnauthorizedResult {
|
|
||||||
public ChallengeResult(string provider, string redirectUri) : this(provider, redirectUri, null) {
|
|
||||||
}
|
|
||||||
|
|
||||||
public ChallengeResult(string provider, string redirectUri, string userId) {
|
|
||||||
LoginProvider = provider;
|
|
||||||
RedirectUri = redirectUri;
|
|
||||||
UserId = userId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public string LoginProvider { get; set; }
|
|
||||||
public string RedirectUri { get; set; }
|
|
||||||
public string UserId { get; set; }
|
|
||||||
|
|
||||||
public override void ExecuteResult(ControllerContext context) {
|
|
||||||
AuthenticationProperties properties = new AuthenticationProperties() { RedirectUri = RedirectUri };
|
|
||||||
if (UserId != null) {
|
|
||||||
properties.Dictionary[XsrfKey] = UserId;
|
|
||||||
}
|
|
||||||
context.HttpContext.GetOwinContext().Authentication.Challenge(properties, LoginProvider);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// POST: /Account/LogOff
|
||||||
|
[HttpPost]
|
||||||
|
[ValidateAntiForgeryToken]
|
||||||
|
public ActionResult LogOff() {
|
||||||
|
FormsAuthentication.SignOut();
|
||||||
|
return RedirectToAction("Login", "Account");
|
||||||
|
}
|
||||||
|
|
||||||
|
// GET: /Account/ExternalLoginFailure
|
||||||
|
[AllowAnonymous]
|
||||||
|
public ActionResult ExternalLoginFailure() {
|
||||||
|
return View();
|
||||||
|
}
|
||||||
|
|
||||||
|
[ChildActionOnly]
|
||||||
|
public ActionResult RemoveAccountList() {
|
||||||
|
IList<UserLoginInfo> linkedAccounts = UserManager.GetLogins(User.Identity.GetUserId());
|
||||||
|
ViewBag.ShowRemoveButton = HasPassword() || linkedAccounts.Count > 1;
|
||||||
|
return (ActionResult)PartialView("_RemoveAccountPartial", linkedAccounts);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Dispose(bool disposing) {
|
||||||
|
if (disposing && UserManager != null) {
|
||||||
|
UserManager.Dispose();
|
||||||
|
UserManager = null;
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Helpers
|
||||||
|
// Used for XSRF protection when adding external logins
|
||||||
|
private const string XsrfKey = "XsrfId";
|
||||||
|
|
||||||
|
private IAuthenticationManager AuthenticationManager {
|
||||||
|
get {
|
||||||
|
return HttpContext.GetOwinContext().Authentication;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task SignInAsync(ApplicationUser user, bool isPersistent) {
|
||||||
|
AuthenticationManager.SignOut(DefaultAuthenticationTypes.ExternalCookie);
|
||||||
|
ClaimsIdentity identity = await UserManager.CreateIdentityAsync(user, DefaultAuthenticationTypes.ApplicationCookie);
|
||||||
|
AuthenticationManager.SignIn(new AuthenticationProperties() { IsPersistent = isPersistent }, identity);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void AddErrors(IdentityResult result) {
|
||||||
|
foreach (string error in result.Errors) {
|
||||||
|
ModelState.AddModelError("", error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool HasPassword() {
|
||||||
|
ApplicationUser user = UserManager.FindById(User.Identity.GetUserId());
|
||||||
|
if (user != null) {
|
||||||
|
return user.PasswordHash != null;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum ManageMessageId {
|
||||||
|
ChangePasswordSuccess,
|
||||||
|
SetPasswordSuccess,
|
||||||
|
RemoveLoginSuccess,
|
||||||
|
Error
|
||||||
|
}
|
||||||
|
|
||||||
|
private ActionResult RedirectToLocal(string returnUrl) {
|
||||||
|
if (Url.IsLocalUrl(returnUrl)) {
|
||||||
|
return Redirect(returnUrl);
|
||||||
|
} else {
|
||||||
|
return RedirectToAction("MyTasks", "Home");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private class ChallengeResult : HttpUnauthorizedResult {
|
||||||
|
public ChallengeResult(string provider, string redirectUri) : this(provider, redirectUri, null) {
|
||||||
|
}
|
||||||
|
|
||||||
|
public ChallengeResult(string provider, string redirectUri, string userId) {
|
||||||
|
LoginProvider = provider;
|
||||||
|
RedirectUri = redirectUri;
|
||||||
|
UserId = userId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public string LoginProvider { get; set; }
|
||||||
|
public string RedirectUri { get; set; }
|
||||||
|
public string UserId { get; set; }
|
||||||
|
|
||||||
|
public override void ExecuteResult(ControllerContext context) {
|
||||||
|
AuthenticationProperties properties = new AuthenticationProperties() { RedirectUri = RedirectUri };
|
||||||
|
if (UserId != null) {
|
||||||
|
properties.Dictionary[XsrfKey] = UserId;
|
||||||
|
}
|
||||||
|
context.HttpContext.GetOwinContext().Authentication.Challenge(properties, LoginProvider);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
}
|
}
|
File diff suppressed because it is too large
Load Diff
@ -1,669 +1,310 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Configuration;
|
||||||
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Web;
|
using System.Web;
|
||||||
using System.Web.Mvc;
|
using System.Web.Mvc;
|
||||||
using Kendo.Mvc.Extensions;
|
|
||||||
using Kendo.Mvc.UI;
|
|
||||||
using Fab2ApprovalSystem.Models;
|
|
||||||
using Fab2ApprovalSystem.DMO;
|
using Fab2ApprovalSystem.DMO;
|
||||||
using Fab2ApprovalSystem.Misc;
|
using Fab2ApprovalSystem.Misc;
|
||||||
using System.IO;
|
using Fab2ApprovalSystem.Models;
|
||||||
using System.Configuration;
|
|
||||||
using Fab2ApprovalSystem.Utilities;
|
using Fab2ApprovalSystem.Utilities;
|
||||||
|
|
||||||
namespace Fab2ApprovalSystem.Controllers
|
using Kendo.Mvc.Extensions;
|
||||||
{
|
using Kendo.Mvc.UI;
|
||||||
[Authorize]
|
|
||||||
[OutputCache(NoStore = true, Duration = 0, VaryByParam = "*")]
|
namespace Fab2ApprovalSystem.Controllers;
|
||||||
[SessionExpireFilter]
|
|
||||||
public class AuditController : Controller
|
[Authorize]
|
||||||
{
|
[OutputCache(NoStore = true, Duration = 0, VaryByParam = "*")]
|
||||||
AuditDMO auditDMO = new AuditDMO();
|
[SessionExpireFilter]
|
||||||
CorrectiveActionDMO caDMO = new CorrectiveActionDMO();
|
public class AuditController : Controller {
|
||||||
UserUtilities adUsers = new UserUtilities();
|
|
||||||
// GET: Audit
|
AuditDMO auditDMO;
|
||||||
public ActionResult Index()
|
CorrectiveActionDMO caDMO;
|
||||||
{
|
private readonly AppSettings _AppSettings;
|
||||||
return View();
|
|
||||||
|
public AuditController(AppSettings appSettings) {
|
||||||
|
_AppSettings = appSettings;
|
||||||
|
auditDMO = new AuditDMO(appSettings);
|
||||||
|
caDMO = new CorrectiveActionDMO(appSettings);
|
||||||
|
}
|
||||||
|
|
||||||
|
// GET: Audit
|
||||||
|
public ActionResult Index() {
|
||||||
|
return View();
|
||||||
|
}
|
||||||
|
|
||||||
|
public ActionResult Create() {
|
||||||
|
Audit audit = new Audit();
|
||||||
|
try {
|
||||||
|
// TODO: Add insert logic here
|
||||||
|
|
||||||
|
audit.OriginatorID = (int)Session[GlobalVars.SESSION_USERID];
|
||||||
|
auditDMO.InsertAudit(audit);
|
||||||
|
return RedirectToAction("Edit", new { issueID = audit.AuditNo });
|
||||||
|
} catch (Exception e) {
|
||||||
|
string detailedException = "";
|
||||||
|
try {
|
||||||
|
detailedException = e.InnerException.ToString();
|
||||||
|
} catch {
|
||||||
|
detailedException = e.Message;
|
||||||
|
}
|
||||||
|
string exceptionString = e.Message.ToString().Trim().Length > 500 ? "Issue=" + audit.AuditNo.ToString() + e.Message.ToString().Substring(0, 250) : e.Message.ToString();
|
||||||
|
Functions.WriteEvent(_AppSettings, @User.Identity.Name + "\r\n SubmitDocument - Audit\r\n" + audit.AuditNo.ToString() + "\r\n" + detailedException, System.Diagnostics.EventLogEntryType.Error);
|
||||||
|
EventLogDMO.Add(new WinEventLog() { IssueID = audit.AuditNo, UserID = @User.Identity.Name, DocumentType = "Audit", OperationType = "Error", Comments = "SubmitDocument - " + exceptionString });
|
||||||
|
throw new Exception(e.Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public ActionResult Edit(int issueID) {
|
||||||
|
int isITARCompliant = 1;
|
||||||
|
Audit audit = new Audit();
|
||||||
|
|
||||||
|
try {
|
||||||
|
bool isAdmin = (bool)Session[GlobalVars.IS_ADMIN];
|
||||||
|
int userId = (int)Session[GlobalVars.SESSION_USERID];
|
||||||
|
AuditEdit auditEdit = auditDMO.GetAuditEdit(issueID, audit, isAdmin, userId);
|
||||||
|
if (auditEdit.RedirectToAction)
|
||||||
|
return RedirectToAction("ReadOnlyAudit", new { auditNo = audit.AuditNo });
|
||||||
|
ViewBag.AuditAreaList = auditEdit.AuditAreaList;
|
||||||
|
ViewBag.AuditeeNames = auditEdit.AuditeeNames;
|
||||||
|
ViewBag.AuditFindingCategoryList = auditEdit.AuditFindingCategoryList;
|
||||||
|
ViewBag.AuditorList = auditEdit.AuditorList;
|
||||||
|
ViewBag.AuditTypeList = auditEdit.AuditTypeList;
|
||||||
|
ViewBag.CANoList = auditEdit.CANoList;
|
||||||
|
ViewBag.Is8DQA = auditEdit.Is8DQA;
|
||||||
|
ViewBag.IsAdmin = auditEdit.IsAdmin;
|
||||||
|
ViewBag.IsSubmitter = auditEdit.IsSubmitter;
|
||||||
|
ViewBag.MesaUsers = auditEdit.MesaUsers;
|
||||||
|
ViewBag.UserList = auditEdit.UserList;
|
||||||
|
} catch (Exception e) {
|
||||||
|
string detailedException = "";
|
||||||
|
try {
|
||||||
|
detailedException = e.InnerException.ToString();
|
||||||
|
} catch {
|
||||||
|
detailedException = e.Message;
|
||||||
|
}
|
||||||
|
string exceptionString = e.Message.ToString().Trim().Length > 500 ? "Issue=" + audit.AuditNo.ToString() + e.Message.ToString().Substring(0, 250) : e.Message.ToString();
|
||||||
|
Functions.WriteEvent(_AppSettings, @User.Identity.Name + "\r\n Edit - Audit\r\n" + audit.AuditNo.ToString() + "\r\n" + detailedException, System.Diagnostics.EventLogEntryType.Error);
|
||||||
|
EventLogDMO.Add(new WinEventLog() { IssueID = audit.AuditNo, UserID = @User.Identity.Name, DocumentType = "Audit", OperationType = "Error", Comments = "Edit - " + exceptionString });
|
||||||
|
throw new Exception(e.Message);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
return View(audit);
|
||||||
///
|
}
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
public ActionResult Create()
|
|
||||||
{
|
|
||||||
|
|
||||||
|
[HttpPost]
|
||||||
Audit audit = new Audit();
|
public ActionResult Edit(Audit model) {
|
||||||
try
|
try {
|
||||||
{
|
var data = model;
|
||||||
// TODO: Add insert logic here
|
auditDMO.UpdateAudit(model, (int)Session[GlobalVars.SESSION_USERID]);
|
||||||
|
} catch (Exception ex) {
|
||||||
|
return Content(ex.Message);
|
||||||
audit.OriginatorID = (int)Session[GlobalVars.SESSION_USERID];
|
|
||||||
auditDMO.InsertAudit(audit);
|
|
||||||
return RedirectToAction("Edit", new { issueID = audit.AuditNo });
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
string detailedException = "";
|
|
||||||
try
|
|
||||||
{
|
|
||||||
detailedException = e.InnerException.ToString();
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
detailedException = e.Message;
|
|
||||||
}
|
|
||||||
string exceptionString = e.Message.ToString().Trim().Length > 500 ? "Issue=" + audit.AuditNo.ToString() + e.Message.ToString().Substring(0, 250) : e.Message.ToString();
|
|
||||||
Functions.WriteEvent(@User.Identity.Name + "\r\n SubmitDocument - Audit\r\n" + audit.AuditNo.ToString() + "\r\n" + detailedException, System.Diagnostics.EventLogEntryType.Error);
|
|
||||||
EventLogDMO.Add(new WinEventLog() { IssueID = audit.AuditNo, UserID = @User.Identity.Name, DocumentType = "Audit", OperationType = "Error", Comments = "SubmitDocument - " + exceptionString });
|
|
||||||
throw new Exception(e.Message);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return Content("Successfully Saved");
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
public ActionResult CheckCAStatus(int auditNo) {
|
||||||
///
|
int dataCount = -1;
|
||||||
/// </summary>
|
try {
|
||||||
/// <param name="issueID"></param>
|
dataCount = auditDMO.GetOpenCACountByAuditNo(auditNo);
|
||||||
/// <returns></returns>
|
} catch (Exception ex) {
|
||||||
public ActionResult Edit(int issueID)
|
throw;
|
||||||
{
|
|
||||||
int isITARCompliant = 1;
|
|
||||||
Audit audit = new Audit();
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
List<int> userList = auditDMO.Get8DQA();
|
|
||||||
ViewBag.MesaUsers = adUsers.GetMesaUsers();
|
|
||||||
int QAs = userList.Find(delegate(int al) { return al == (int)Session[GlobalVars.SESSION_USERID]; });
|
|
||||||
ViewBag.Is8DQA = "false";
|
|
||||||
if (QAs != 0)
|
|
||||||
{
|
|
||||||
ViewBag.Is8DQA = "true";
|
|
||||||
}
|
|
||||||
|
|
||||||
audit = auditDMO.GetAuditItem(issueID, (int)Session[GlobalVars.SESSION_USERID]);
|
|
||||||
//transform audit users from string to list, delimited by a comma.
|
|
||||||
if(audit.Auditees == null || !audit.Auditees.Contains(","))
|
|
||||||
{
|
|
||||||
ViewBag.AuditeeNames = audit.Auditees;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
string[] auditeeNames = audit.Auditees.Split(',');
|
|
||||||
ViewBag.AuditeeNames = auditeeNames.ToList();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ViewBag.IsSubmitter = false;
|
|
||||||
if(audit.OriginatorID == (int)Session[GlobalVars.SESSION_USERID])
|
|
||||||
{
|
|
||||||
ViewBag.IsSubmitter = true;
|
|
||||||
}
|
|
||||||
if((bool)Session[GlobalVars.IS_ADMIN] != true)
|
|
||||||
{
|
|
||||||
ViewBag.IsAdmin = false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ViewBag.IsAdmin = true;
|
|
||||||
}
|
|
||||||
if ((audit.RecordLockIndicator && audit.RecordLockedBy != (int)Session[GlobalVars.SESSION_USERID])
|
|
||||||
|| audit.AuditStatus != 0 ) //open
|
|
||||||
{
|
|
||||||
return RedirectToAction("ReadOnlyAudit", new { auditNo = audit.AuditNo });
|
|
||||||
}
|
|
||||||
if (ViewBag.IsAdmin == false && ViewBag.IsSubmitter == false)
|
|
||||||
{
|
|
||||||
return RedirectToAction("ReadOnlyAudit", new { auditNo = audit.AuditNo });
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ViewBag.UserList = auditDMO.GetUserList();
|
|
||||||
ViewBag.AuditTypeList = auditDMO.GetAuditTypeList();
|
|
||||||
//ViewBag.AuditStandardList = auditDMO.GetAuditStandardList();
|
|
||||||
ViewBag.AuditorList = auditDMO.GetAuditorList();
|
|
||||||
ViewBag.AuditAreaList = auditDMO.GetAuditAreaList();
|
|
||||||
ViewBag.AuditFindingCategoryList = auditDMO.GetAuditFindingCategories();
|
|
||||||
ViewBag.CANoList = auditDMO.GetCorrectiveActionNoList();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
string detailedException = "";
|
|
||||||
try
|
|
||||||
{
|
|
||||||
detailedException = e.InnerException.ToString();
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
detailedException = e.Message;
|
|
||||||
}
|
|
||||||
string exceptionString = e.Message.ToString().Trim().Length > 500 ? "Issue=" + audit.AuditNo.ToString() + e.Message.ToString().Substring(0, 250) : e.Message.ToString();
|
|
||||||
Functions.WriteEvent(@User.Identity.Name + "\r\n Edit - Audit\r\n" + audit.AuditNo.ToString() + "\r\n" + detailedException, System.Diagnostics.EventLogEntryType.Error);
|
|
||||||
EventLogDMO.Add(new WinEventLog() { IssueID = audit.AuditNo, UserID = @User.Identity.Name, DocumentType = "Audit", OperationType = "Error", Comments = "Edit - " + exceptionString });
|
|
||||||
throw new Exception(e.Message);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
return View(audit);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
return Content(dataCount.ToString());
|
||||||
///
|
}
|
||||||
/// </summary>
|
|
||||||
/// <param name="model"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpPost]
|
|
||||||
public ActionResult Edit(Audit model)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
|
|
||||||
var data = model;
|
public ActionResult ReadOnlyAudit(int auditNo) {
|
||||||
auditDMO.UpdateAudit(model, (int)Session[GlobalVars.SESSION_USERID]);
|
Audit audit = new Audit();
|
||||||
}
|
audit = auditDMO.GetAuditItemReadOnly(auditNo, (int)Session[GlobalVars.SESSION_USERID]);
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
return Content(ex.Message);
|
|
||||||
}
|
|
||||||
|
|
||||||
return Content("Successfully Saved");
|
ViewBag.AuditTypeList = auditDMO.GetAuditTypeList();
|
||||||
}
|
ViewBag.AuditorList = auditDMO.GetAuditorList();
|
||||||
|
ViewBag.AuditAreaList = auditDMO.GetAuditAreaList();
|
||||||
|
ViewBag.AuditFindingCategoryList = auditDMO.GetAuditFindingCategories();
|
||||||
|
|
||||||
/// <summary>
|
return View(audit);
|
||||||
///
|
}
|
||||||
/// </summary>
|
|
||||||
/// <param name="auditNo"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public ActionResult CheckCAStatus(int auditNo)
|
|
||||||
{
|
|
||||||
int dataCount = -1;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
dataCount = auditDMO.GetOpenCACountByAuditNo(auditNo);
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
|
|
||||||
return Content(dataCount.ToString());
|
public ActionResult AuditReportAttachSave(IEnumerable<HttpPostedFileBase> AuditReportFiles, int auditNo) {
|
||||||
|
try {
|
||||||
}
|
// The Name of the Upload component is "files"
|
||||||
|
if (AuditReportFiles != null) {
|
||||||
/// <summary>
|
int userId = (int)Session[GlobalVars.SESSION_USERID];
|
||||||
///
|
foreach (var file in AuditReportFiles) {
|
||||||
/// </summary>
|
auditDMO.AuditReportAttachSave(auditNo, userId, file.FileName, file.InputStream);
|
||||||
/// <param name="auditNo"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public ActionResult ReadOnlyAudit(int auditNo)
|
|
||||||
{
|
|
||||||
Audit audit = new Audit();
|
|
||||||
audit = auditDMO.GetAuditItemReadOnly(auditNo, (int)Session[GlobalVars.SESSION_USERID]);
|
|
||||||
|
|
||||||
ViewBag.AuditTypeList = auditDMO.GetAuditTypeList();
|
|
||||||
ViewBag.AuditorList = auditDMO.GetAuditorList();
|
|
||||||
ViewBag.AuditAreaList = auditDMO.GetAuditAreaList();
|
|
||||||
ViewBag.AuditFindingCategoryList = auditDMO.GetAuditFindingCategories();
|
|
||||||
|
|
||||||
|
|
||||||
return View(audit);
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="AuditReportFiles"></param>
|
|
||||||
/// <param name="auditNo"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public ActionResult AuditReportAttachSave(IEnumerable<HttpPostedFileBase> AuditReportFiles, int auditNo)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
// The Name of the Upload component is "files"
|
|
||||||
if (AuditReportFiles != null)
|
|
||||||
{
|
|
||||||
foreach (var file in AuditReportFiles)
|
|
||||||
{
|
|
||||||
// Some browsers send file names with full path.
|
|
||||||
// We are only interested in the file name.
|
|
||||||
|
|
||||||
|
|
||||||
var fileName = Path.GetFileName(file.FileName);
|
|
||||||
var fileExtension = Path.GetExtension(file.FileName);
|
|
||||||
//var physicalPath = Path.Combine(Server.MapPath("~/UserUploads"), fileName);
|
|
||||||
DirectoryInfo di;
|
|
||||||
var ccPhysicalPath = Functions.GetAttachmentFolder() + @"Audit\" + auditNo;
|
|
||||||
di = new DirectoryInfo(ccPhysicalPath);
|
|
||||||
if (!di.Exists)
|
|
||||||
di.Create();
|
|
||||||
|
|
||||||
|
|
||||||
var guid = Guid.NewGuid().ToString();
|
|
||||||
var physicalPath = Path.Combine(Functions.GetAttachmentFolder() + @"Audit\" + auditNo + @"\", guid + fileExtension);
|
|
||||||
|
|
||||||
|
|
||||||
file.SaveAs(physicalPath);
|
|
||||||
AuditReportAttachment attach = new AuditReportAttachment()
|
|
||||||
{
|
|
||||||
AuditNo = auditNo,
|
|
||||||
FileGUID = guid,
|
|
||||||
FileName = fileName,
|
|
||||||
UploadedByID = (int)Session[GlobalVars.SESSION_USERID]
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
//ccDMO.InsertCCAttachment(attach);
|
|
||||||
auditDMO.InsertAuditReportAttachment(attach);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch
|
} catch {
|
||||||
{
|
throw;
|
||||||
throw;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
return Content("");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
return Content("");
|
||||||
///
|
}
|
||||||
/// </summary>
|
|
||||||
/// <param name="request"></param>
|
|
||||||
/// <param name="auditNo"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public ActionResult AuditReportAttachment_Read([DataSourceRequest] DataSourceRequest request, int auditNo)
|
|
||||||
{
|
|
||||||
|
|
||||||
return Json(auditDMO.GetAuditReportAttachments(auditNo).ToDataSourceResult(request));
|
public ActionResult AuditReportAttachment_Read([DataSourceRequest] DataSourceRequest request, int auditNo) {
|
||||||
}
|
|
||||||
|
|
||||||
|
return Json(auditDMO.GetAuditReportAttachments(auditNo).ToDataSourceResult(request));
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpPost]
|
||||||
|
public void DeleteAuditReportAttachment(int attachID) {
|
||||||
|
auditDMO.DeleteAuditReportAttachment(attachID);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
public FileResult DownloadAuditReportAttachment(string fileGuid, int auditNo) {
|
||||||
///
|
try {
|
||||||
/// </summary>
|
string fileName, sDocument;
|
||||||
/// <param name="attachID"></param>
|
List<string> results = auditDMO.GetFileNameAndDocument(fileGuid, auditNo);
|
||||||
[HttpPost]
|
fileName = results[0];
|
||||||
public void DeleteAuditReportAttachment(int attachID)
|
sDocument = results[1];
|
||||||
{
|
if (string.IsNullOrEmpty(sDocument)) {
|
||||||
auditDMO.DeleteAuditReportAttachment(attachID);
|
// Ensure that we are serving file only inside the Fab2ApprovalAttachments folder
|
||||||
|
// and block requests outside like "../web.config"
|
||||||
|
throw new HttpException(403, "Forbidden");
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="fileGuid"></param>
|
|
||||||
/// <param name="auditNo"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public FileResult DownloadAuditReportAttachment(string fileGuid, int auditNo)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
string fileName = auditDMO.GetAuditReportAttachmentFileName(fileGuid);
|
|
||||||
|
|
||||||
string fileExtension = fileName.Substring(fileName.LastIndexOf("."), fileName.Length - fileName.LastIndexOf("."));
|
|
||||||
|
|
||||||
string ecnFolderPath = Functions.GetAttachmentFolder() + "Audit\\" + auditNo.ToString();
|
|
||||||
var sDocument = Path.Combine(ecnFolderPath, fileGuid + fileExtension);
|
|
||||||
|
|
||||||
var FDir_AppData = Functions.GetAttachmentFolder();
|
|
||||||
if (!sDocument.StartsWith(FDir_AppData))
|
|
||||||
{
|
|
||||||
// Ensure that we are serving file only inside the Fab2ApprovalAttachments folder
|
|
||||||
// and block requests outside like "../web.config"
|
|
||||||
throw new HttpException(403, "Forbidden");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!System.IO.File.Exists(sDocument))
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
//throw new Exception("File not found");
|
|
||||||
}
|
|
||||||
|
|
||||||
return File(sDocument, System.Net.Mime.MediaTypeNames.Application.Octet, fileName);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
catch
|
if (!System.IO.File.Exists(sDocument)) {
|
||||||
{
|
return null;
|
||||||
// TODO - proces the error
|
//throw new Exception("File not found");
|
||||||
throw;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return File(sDocument, System.Net.Mime.MediaTypeNames.Application.Octet, fileName);
|
||||||
|
} catch {
|
||||||
|
// TODO - proces the error
|
||||||
|
throw;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public ActionResult GetAuditFindingsList([DataSourceRequest] DataSourceRequest request, int auditNo) {
|
||||||
|
return Json(auditDMO.GetAuditFindingsList(auditNo).ToDataSourceResult(request));
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
public ActionResult InsertAuditFindingsItem(AuditFindings data) {
|
||||||
///
|
if ((data.FindingType == "Major" || data.FindingType == "Minor") && data.CANo == 0) {
|
||||||
/// </summary>
|
throw new ArgumentException("You must select add a CA for a Major or Minor finding.");
|
||||||
/// <param name="request"></param>
|
} else {
|
||||||
/// <param name="auditNo"></param>
|
int userId = (int)Session[GlobalVars.SESSION_USERID];
|
||||||
/// <returns></returns>
|
Audit audit = auditDMO.InsertAndGetAudit(caDMO, data, userId);
|
||||||
public ActionResult GetAuditFindingsList([DataSourceRequest] DataSourceRequest request, int auditNo)
|
|
||||||
{
|
|
||||||
|
|
||||||
return Json(auditDMO.GetAuditFindingsList(auditNo).ToDataSourceResult(request));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="data"></param>
|
|
||||||
public ActionResult InsertAuditFindingsItem(AuditFindings data)
|
|
||||||
{
|
|
||||||
if ((data.FindingType == "Major" || data.FindingType == "Minor") && data.CANo == 0)
|
|
||||||
{
|
|
||||||
throw new ArgumentException("You must select add a CA for a Major or Minor finding.");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
|
|
||||||
Audit audit = new Audit();
|
|
||||||
auditDMO.InsertAuditFindingsItem(data);
|
|
||||||
audit = auditDMO.GetAuditItem(data.AuditNo, (int)Session[GlobalVars.SESSION_USERID]);
|
|
||||||
|
|
||||||
//Transfer Finding Details to CA
|
|
||||||
if(data.CANo != 0)
|
|
||||||
{
|
|
||||||
CorrectiveAction ca = caDMO.GetCAItem(data.CANo, (int)Session[GlobalVars.SESSION_USERID]);
|
|
||||||
ca.CATitle = data.Title;
|
|
||||||
ca.CASourceID = 1;//Audit
|
|
||||||
caDMO.UpdateCorrectiveAction(ca);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
return Json(audit, JsonRequestBehavior.AllowGet);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="data"></param>
|
|
||||||
public ActionResult UpdateAuditFindingsItem(AuditFindings data)
|
|
||||||
{
|
|
||||||
if ((data.FindingType == "Major" || data.FindingType == "Minor") && data.CANo == 0)
|
|
||||||
{
|
|
||||||
throw new ArgumentException("You must select add a CA for a Major or Minor finding.");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Audit audit = new Audit();
|
|
||||||
auditDMO.UpdateAuditFindingsItem(data);
|
|
||||||
audit = auditDMO.GetAuditItem(data.AuditNo, (int)Session[GlobalVars.SESSION_USERID]);
|
|
||||||
|
|
||||||
//Transfer Finding Details to CA
|
|
||||||
if (data.CANo != 0)
|
|
||||||
{
|
|
||||||
CorrectiveAction ca = caDMO.GetCAItem(data.CANo, (int)Session[GlobalVars.SESSION_USERID]);
|
|
||||||
ca.CATitle = data.Title;
|
|
||||||
ca.CASourceID = 1;//Audit
|
|
||||||
caDMO.UpdateCorrectiveAction(ca);
|
|
||||||
}
|
|
||||||
|
|
||||||
return Json(audit, JsonRequestBehavior.AllowGet);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public ActionResult DeleteAuditFindingsItem(int auditFindingsID)
|
|
||||||
{
|
|
||||||
var af = auditDMO.GetAuditFindingsByID(auditFindingsID);
|
|
||||||
auditDMO.DeleteAuditFindingsItem(auditFindingsID);
|
|
||||||
var audit = auditDMO.GetAuditItem(af.AuditNo, (int)Session[GlobalVars.SESSION_USERID]);
|
|
||||||
return Json(audit, JsonRequestBehavior.AllowGet);
|
return Json(audit, JsonRequestBehavior.AllowGet);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="issueID"></param>
|
|
||||||
public void ReleaseLockOnDocument(int issueID)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
auditDMO.ReleaseLockOnDocument((int)Session[GlobalVars.SESSION_USERID], issueID);
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
Functions.WriteEvent(@User.Identity.Name + "\r\n ReleaseLockOnDocument CA\r\n" + issueID.ToString() + "\r\n" + e.Message, System.Diagnostics.EventLogEntryType.Error);
|
|
||||||
}
|
|
||||||
catch { }
|
|
||||||
auditDMO.ReleaseLockOnDocument(-1, issueID);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// CA Findings ======================================================================================================================
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="data"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public ActionResult InsertCAFindingsItem(CAFindings data)
|
|
||||||
{
|
|
||||||
auditDMO.InsertCAFindings(data);
|
|
||||||
if (data.ResponsibilityOwnerID != null)
|
|
||||||
{
|
|
||||||
// send an email notification
|
|
||||||
NotifyActionItemOwner(data.AuditNo, data.ECD, data.ResponsibilityOwnerID);
|
|
||||||
}
|
|
||||||
|
|
||||||
return Content("");
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="data"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public ActionResult UpdateCAFindingsItem(CAFindings data)
|
|
||||||
{
|
|
||||||
auditDMO.UpdateCAFindings(data);
|
|
||||||
if (data.ResponsibilityOwnerID != data.CurrentResponsibilityOwnerID)
|
|
||||||
{
|
|
||||||
NotifyActionItemOwner(data.AuditNo, data.ECD, data.ResponsibilityOwnerID);
|
|
||||||
}
|
|
||||||
|
|
||||||
return Content("");
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="request"></param>
|
|
||||||
/// <param name="caNo"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public ActionResult GetCAFindingsList([DataSourceRequest] DataSourceRequest request, int auditNo)
|
|
||||||
{
|
|
||||||
|
|
||||||
return Json(auditDMO.GetCAFindingsList(auditNo).ToDataSourceResult(request));
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="request"></param>
|
|
||||||
/// <param name="d7PAID"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public ActionResult GetCAFindingsItemAttachments([DataSourceRequest] DataSourceRequest request, int caFindingsID)
|
|
||||||
{
|
|
||||||
|
|
||||||
return Json(auditDMO.GetCAFindingsItemAttachments(caFindingsID).ToDataSourceResult(request));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="d7paID"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public ActionResult GetCAFindingsItem(int caFindingsID)
|
|
||||||
{
|
|
||||||
var model = new CAFindings();
|
|
||||||
model = auditDMO.GetCAFindingsItem(caFindingsID);
|
|
||||||
|
|
||||||
return PartialView("_CAFindingsAttachment", model);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="caFindingsID"></param>
|
|
||||||
[HttpPost]
|
|
||||||
public void DeleteCAFindingsItem(int caFindingsID)
|
|
||||||
{
|
|
||||||
auditDMO.DeleteCAFindingsItem(caFindingsID);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="D7PA_Attachemnt"></param>
|
|
||||||
/// <param name="d7PAID"></param>
|
|
||||||
/// <param name="caNo"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public ActionResult SaveCAFindings_Attachemnt(IEnumerable<HttpPostedFileBase> CAFindings_Attachemnt, int caFindingsID, int auditNo)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
// The Name of the Upload component is "files"
|
|
||||||
if (CAFindings_Attachemnt != null)
|
|
||||||
{
|
|
||||||
foreach (var file in CAFindings_Attachemnt)
|
|
||||||
{
|
|
||||||
// Some browsers send file names with full path.
|
|
||||||
// We are only interested in the file name.
|
|
||||||
|
|
||||||
|
|
||||||
var fileName = Path.GetFileName(file.FileName);
|
|
||||||
var fileExtension = Path.GetExtension(file.FileName);
|
|
||||||
//var physicalPath = Path.Combine(Server.MapPath("~/UserUploads"), fileName);
|
|
||||||
DirectoryInfo di;
|
|
||||||
var ccPhysicalPath = Functions.GetAttachmentFolder() + @"Audit\" + auditNo;
|
|
||||||
di = new DirectoryInfo(ccPhysicalPath);
|
|
||||||
if (!di.Exists)
|
|
||||||
di.Create();
|
|
||||||
|
|
||||||
|
|
||||||
var guid = Guid.NewGuid().ToString();
|
|
||||||
var physicalPath = Path.Combine(Functions.GetAttachmentFolder() + @"Audit\" + auditNo + @"\", guid + fileExtension);
|
|
||||||
|
|
||||||
|
|
||||||
file.SaveAs(physicalPath);
|
|
||||||
AuditReportAttachment attach = new AuditReportAttachment()
|
|
||||||
{
|
|
||||||
CAFindingsID = caFindingsID,
|
|
||||||
AuditNo = auditNo,
|
|
||||||
FileGUID = guid,
|
|
||||||
FileName = fileName,
|
|
||||||
UploadedByID = (int)Session[GlobalVars.SESSION_USERID]
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
auditDMO.InsertAuditReportAttachment(attach);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
return Content("");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="issueID"></param>
|
|
||||||
/// <param name="currentStep"></param>
|
|
||||||
public void NotifyActionItemOwner(int issueID, DateTime? dueDate, int? responsibleOwnerID)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
string emailSentList = "";
|
|
||||||
|
|
||||||
//List<string> emailIst = ldDMO.GetApproverEmailList(@issueID, currentStep).Distinct().ToList();
|
|
||||||
string email = MiscDMO.GetEmail(responsibleOwnerID);
|
|
||||||
|
|
||||||
string emailTemplate = "CorrectiveActionFindingAssigned.txt";
|
|
||||||
string userEmail = string.Empty;
|
|
||||||
string subject = "5s/CA Findings";
|
|
||||||
string senderName = "CorrectiveAction";
|
|
||||||
|
|
||||||
EmailNotification en = new EmailNotification(subject, ConfigurationManager.AppSettings["EmailTemplatesPath"]);
|
|
||||||
string[] emailparams = new string[5];
|
|
||||||
emailparams[0] = Functions.ReturnAuditNoStringFormat(issueID);
|
|
||||||
emailparams[1] = dueDate.ToString();
|
|
||||||
emailparams[2] = Functions.DocumentTypeMapper(GlobalVars.DocumentType.Audit);
|
|
||||||
emailparams[3] = GlobalVars.hostURL;
|
|
||||||
emailparams[4] = issueID.ToString();
|
|
||||||
userEmail = email;
|
|
||||||
|
|
||||||
en.SendNotificationEmail(emailTemplate, GlobalVars.SENDER_EMAIL, senderName, userEmail, null, subject, emailparams);
|
|
||||||
emailSentList += email + ",";
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
|
|
||||||
EventLogDMO.Add(new WinEventLog() { IssueID = issueID, UserID = @User.Identity.Name, DocumentType = "Corrective Action", OperationType = "Email", Comments = "Task Assigned for 5S/CA Findings" + ":" + email });
|
|
||||||
}
|
|
||||||
catch { }
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
string detailedException = "";
|
|
||||||
try
|
|
||||||
{
|
|
||||||
detailedException = e.InnerException.ToString();
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
detailedException = e.Message;
|
|
||||||
}
|
|
||||||
|
|
||||||
string exceptionString = e.Message.ToString().Trim().Length > 500 ? "Issue=" + issueID.ToString() + " 5s/CAFindings:" + e.Message.ToString().Substring(0, 250) : e.Message.ToString();
|
|
||||||
Functions.WriteEvent(@User.Identity.Name + "\r\n 5s/CAFindings - NotifyActionItemOwner\r\n" + detailedException, System.Diagnostics.EventLogEntryType.Error);
|
|
||||||
EventLogDMO.Add(new WinEventLog() { IssueID = issueID, UserID = @User.Identity.Name, DocumentType = "Corrective Action", OperationType = "Error", Comments = "5s/CAFindings Notification - " + exceptionString });
|
|
||||||
//throw e;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
public ActionResult IsCAAssignedToAudit(int caNo, int auditNo)
|
|
||||||
{
|
|
||||||
return Content(auditDMO.IsCAAssignedToAudit(caNo, auditNo).ToString());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ActionResult UpdateAuditFindingsItem(AuditFindings data) {
|
||||||
|
if ((data.FindingType == "Major" || data.FindingType == "Minor") && data.CANo == 0) {
|
||||||
|
throw new ArgumentException("You must select add a CA for a Major or Minor finding.");
|
||||||
|
} else {
|
||||||
|
int userId = (int)Session[GlobalVars.SESSION_USERID];
|
||||||
|
Audit audit = auditDMO.UpdateAndGetAudit(caDMO, data, userId);
|
||||||
|
|
||||||
|
return Json(audit, JsonRequestBehavior.AllowGet);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public ActionResult DeleteAuditFindingsItem(int auditFindingsID) {
|
||||||
|
int userId = (int)Session[GlobalVars.SESSION_USERID];
|
||||||
|
Audit audit = auditDMO.DeleteAndGetAudit(auditFindingsID, userId);
|
||||||
|
return Json(audit, JsonRequestBehavior.AllowGet);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ReleaseLockOnDocument(int issueID) {
|
||||||
|
try {
|
||||||
|
auditDMO.ReleaseLockOnDocument((int)Session[GlobalVars.SESSION_USERID], issueID);
|
||||||
|
} catch (Exception e) {
|
||||||
|
try {
|
||||||
|
Functions.WriteEvent(_AppSettings, @User.Identity.Name + "\r\n ReleaseLockOnDocument CA\r\n" + issueID.ToString() + "\r\n" + e.Message, System.Diagnostics.EventLogEntryType.Error);
|
||||||
|
} catch { }
|
||||||
|
auditDMO.ReleaseLockOnDocument(-1, issueID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// CA Findings ======================================================================================================================
|
||||||
|
|
||||||
|
public ActionResult InsertCAFindingsItem(CAFindings data) {
|
||||||
|
auditDMO.InsertCAFindings(data);
|
||||||
|
if (data.ResponsibilityOwnerID != null) {
|
||||||
|
// send an email notification
|
||||||
|
NotifyActionItemOwner(data.AuditNo, data.ECD, data.ResponsibilityOwnerID);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Content("");
|
||||||
|
}
|
||||||
|
|
||||||
|
public ActionResult UpdateCAFindingsItem(CAFindings data) {
|
||||||
|
auditDMO.UpdateCAFindings(data);
|
||||||
|
if (data.ResponsibilityOwnerID != data.CurrentResponsibilityOwnerID) {
|
||||||
|
NotifyActionItemOwner(data.AuditNo, data.ECD, data.ResponsibilityOwnerID);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Content("");
|
||||||
|
}
|
||||||
|
|
||||||
|
public ActionResult GetCAFindingsList([DataSourceRequest] DataSourceRequest request, int auditNo) {
|
||||||
|
return Json(auditDMO.GetCAFindingsList(auditNo).ToDataSourceResult(request));
|
||||||
|
}
|
||||||
|
|
||||||
|
public ActionResult GetCAFindingsItemAttachments([DataSourceRequest] DataSourceRequest request, int caFindingsID) {
|
||||||
|
return Json(auditDMO.GetCAFindingsItemAttachments(caFindingsID).ToDataSourceResult(request));
|
||||||
|
}
|
||||||
|
|
||||||
|
public ActionResult GetCAFindingsItem(int caFindingsID) {
|
||||||
|
var model = new CAFindings();
|
||||||
|
model = auditDMO.GetCAFindingsItem(caFindingsID);
|
||||||
|
|
||||||
|
return PartialView("_CAFindingsAttachment", model);
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpPost]
|
||||||
|
public void DeleteCAFindingsItem(int caFindingsID) {
|
||||||
|
auditDMO.DeleteCAFindingsItem(caFindingsID);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ActionResult SaveCAFindings_Attachemnt(IEnumerable<HttpPostedFileBase> CAFindings_Attachemnt, int caFindingsID, int auditNo) {
|
||||||
|
try {
|
||||||
|
// The Name of the Upload component is "files"
|
||||||
|
if (CAFindings_Attachemnt != null) {
|
||||||
|
int userId = (int)Session[GlobalVars.SESSION_USERID];
|
||||||
|
foreach (var file in CAFindings_Attachemnt) {
|
||||||
|
auditDMO.SaveAndInsert(caFindingsID, auditNo, userId, file.FileName, file.InputStream);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
|
||||||
|
return Content("");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void NotifyActionItemOwner(int issueID, DateTime? dueDate, int? responsibleOwnerID) {
|
||||||
|
try {
|
||||||
|
string emailTemplatesPath = ConfigurationManager.AppSettings["EmailTemplatesPath"];
|
||||||
|
string email = auditDMO.NotifyActionItemOwner(issueID, dueDate, responsibleOwnerID, emailTemplatesPath);
|
||||||
|
|
||||||
|
try {
|
||||||
|
EventLogDMO.Add(new WinEventLog() { IssueID = issueID, UserID = @User.Identity.Name, DocumentType = "Corrective Action", OperationType = "Email", Comments = "Task Assigned for 5S/CA Findings" + ":" + email });
|
||||||
|
} catch { }
|
||||||
|
} catch (Exception e) {
|
||||||
|
string detailedException = "";
|
||||||
|
try {
|
||||||
|
detailedException = e.InnerException.ToString();
|
||||||
|
} catch {
|
||||||
|
detailedException = e.Message;
|
||||||
|
}
|
||||||
|
|
||||||
|
string exceptionString = e.Message.ToString().Trim().Length > 500 ? "Issue=" + issueID.ToString() + " 5s/CAFindings:" + e.Message.ToString().Substring(0, 250) : e.Message.ToString();
|
||||||
|
Functions.WriteEvent(_AppSettings, @User.Identity.Name + "\r\n 5s/CAFindings - NotifyActionItemOwner\r\n" + detailedException, System.Diagnostics.EventLogEntryType.Error);
|
||||||
|
EventLogDMO.Add(new WinEventLog() { IssueID = issueID, UserID = @User.Identity.Name, DocumentType = "Corrective Action", OperationType = "Error", Comments = "5s/CAFindings Notification - " + exceptionString });
|
||||||
|
//throw e;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public ActionResult IsCAAssignedToAudit(int caNo, int auditNo) {
|
||||||
|
return Content(auditDMO.IsCAAssignedToAudit(caNo, auditNo).ToString());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,37 +1,36 @@
|
|||||||
|
using Fab2ApprovalSystem.DMO;
|
||||||
|
using Fab2ApprovalSystem.Misc;
|
||||||
|
using Fab2ApprovalSystem.Models;
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Web;
|
using System.Web;
|
||||||
using System.Web.Mvc;
|
using System.Web.Mvc;
|
||||||
using Fab2ApprovalSystem.DMO;
|
|
||||||
using Fab2ApprovalSystem.Misc;
|
|
||||||
|
|
||||||
namespace Fab2ApprovalSystem.Controllers
|
namespace Fab2ApprovalSystem.Controllers;
|
||||||
{
|
|
||||||
[Authorize]
|
|
||||||
[SessionExpireFilter]
|
|
||||||
public class ManagerController : Controller
|
|
||||||
{
|
|
||||||
UserAccountDMO userDMO = new UserAccountDMO();
|
|
||||||
AdminDMO adminDMO = new AdminDMO();
|
|
||||||
TrainingDMO trainingDMO = new TrainingDMO();
|
|
||||||
LotDispositionDMO ldDMO = new LotDispositionDMO();
|
|
||||||
|
|
||||||
/// <summary>
|
[Authorize]
|
||||||
///
|
[SessionExpireFilter]
|
||||||
/// </summary>
|
public class ManagerController : Controller {
|
||||||
/// <returns></returns>
|
|
||||||
public ActionResult Index()
|
|
||||||
{
|
|
||||||
|
|
||||||
if ((bool)Session[GlobalVars.IS_MANAGER])
|
UserAccountDMO userDMO = new UserAccountDMO();
|
||||||
{
|
AdminDMO adminDMO = new AdminDMO();
|
||||||
var model = userDMO.GetAllUsers();
|
TrainingDMO trainingDMO = new TrainingDMO();
|
||||||
ViewBag.AllActiveUsers = userDMO.GetAllActiveUsers();
|
LotDispositionDMO ldDMO;
|
||||||
return View(model);
|
private readonly AppSettings _AppSettings;
|
||||||
}
|
|
||||||
else
|
public ManagerController(AppSettings appSettings) {
|
||||||
return Content("Not Autthorized");
|
_AppSettings = appSettings;
|
||||||
}
|
ldDMO = new LotDispositionDMO(appSettings);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ActionResult Index() {
|
||||||
|
if ((bool)Session[GlobalVars.IS_MANAGER]) {
|
||||||
|
var model = userDMO.GetAllUsers();
|
||||||
|
ViewBag.AllActiveUsers = userDMO.GetAllActiveUsers();
|
||||||
|
return View(model);
|
||||||
|
} else
|
||||||
|
return Content("Not Autthorized");
|
||||||
}
|
}
|
||||||
}
|
}
|
File diff suppressed because it is too large
Load Diff
@ -1,221 +1,194 @@
|
|||||||
using System;
|
using Fab2ApprovalSystem.DMO;
|
||||||
|
using Fab2ApprovalSystem.Misc;
|
||||||
|
using Fab2ApprovalSystem.ViewModels;
|
||||||
|
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Web;
|
using System.Web;
|
||||||
using System.Web.Mvc;
|
using System.Web.Mvc;
|
||||||
|
|
||||||
using Fab2ApprovalSystem.DMO;
|
namespace Fab2ApprovalSystem.Controllers;
|
||||||
using Fab2ApprovalSystem.Misc;
|
|
||||||
using Fab2ApprovalSystem.ViewModels;
|
|
||||||
|
|
||||||
namespace Fab2ApprovalSystem.Controllers
|
[Authorize]
|
||||||
{
|
[SessionExpireFilter]
|
||||||
[Authorize]
|
public class ReportsController : Controller {
|
||||||
[SessionExpireFilter]
|
public const String specialNullString = "~NULL~";
|
||||||
public class ReportsController : Controller
|
|
||||||
{
|
|
||||||
public const String specialNullString = "~NULL~";
|
|
||||||
|
|
||||||
// GET: Export
|
// GET: Export
|
||||||
public ActionResult Index()
|
public ActionResult Index() {
|
||||||
{
|
UserAccountDMO userDMO = new UserAccountDMO();
|
||||||
UserAccountDMO userDMO = new UserAccountDMO();
|
ViewBag.HasITARAccess = userDMO.GetITARAccess((int)Session[GlobalVars.SESSION_USERID]);
|
||||||
ViewBag.HasITARAccess = userDMO.GetITARAccess((int)Session[GlobalVars.SESSION_USERID]);
|
|
||||||
|
|
||||||
return View();
|
|
||||||
}
|
|
||||||
|
|
||||||
public ActionResult Report(String id, String docType = "")
|
|
||||||
{
|
|
||||||
if (String.IsNullOrEmpty(id))
|
|
||||||
return RedirectToAction("Index");
|
|
||||||
|
|
||||||
UserAccountDMO userDMO = new UserAccountDMO();
|
|
||||||
if (!userDMO.GetITARAccess((int)Session[GlobalVars.SESSION_USERID]))
|
|
||||||
return View("UnAuthorizedAccess");
|
|
||||||
|
|
||||||
var m = new ReportViewModel();
|
|
||||||
var reports = GetReportList(docType);
|
|
||||||
foreach (var report in reports)
|
|
||||||
{
|
|
||||||
if (String.Equals(report.ReportID, id, StringComparison.OrdinalIgnoreCase))
|
|
||||||
{
|
|
||||||
m.ReportID = report.ReportID;
|
|
||||||
m.ReportName = report.Name;
|
|
||||||
m.Description = report.Description;
|
|
||||||
m.DocType = docType;
|
|
||||||
|
|
||||||
var c = SetupSSRSHelperClient();
|
|
||||||
|
|
||||||
m.Parameters = c.GetReportParameters(report.FullPath).Select(parm =>
|
|
||||||
{
|
|
||||||
var r = new ReportParameterViewModel();
|
|
||||||
r.Visible = (parm.PromptUser.HasValue == false || parm.PromptUser == true) && !String.IsNullOrEmpty(parm.Prompt);
|
|
||||||
r.Prompt = parm.Prompt;
|
|
||||||
r.Name = parm.Name;
|
|
||||||
r.HtmlID = "parm_" + parm.Name;
|
|
||||||
|
|
||||||
if (parm.MultiValue.HasValue && parm.MultiValue.Value)
|
|
||||||
r.ControlType = ParameterControlTypes.Multiselect;
|
|
||||||
else if ((parm.ValidValues != null) && (parm.ValidValues.Length > 0))
|
|
||||||
r.ControlType = ParameterControlTypes.Dropdown;
|
|
||||||
else if (parm.DataType.Equals("DateTime", StringComparison.OrdinalIgnoreCase))
|
|
||||||
r.ControlType = ParameterControlTypes.DatePicker;
|
|
||||||
else
|
|
||||||
r.ControlType = ParameterControlTypes.Textbox;
|
|
||||||
|
|
||||||
r.SelectList = null;
|
|
||||||
if (parm.ValidValues != null)
|
|
||||||
{
|
|
||||||
r.SelectList = parm.ValidValues.Select(vv => {
|
|
||||||
return new SelectListItem()
|
|
||||||
{
|
|
||||||
Text = vv.Value,
|
|
||||||
Value = (vv.Key == null ? specialNullString : vv.Key),
|
|
||||||
Selected = (parm.DefaultValues != null && parm.DefaultValues.Contains(vv.Key))
|
|
||||||
};
|
|
||||||
}).ToList();
|
|
||||||
}
|
|
||||||
|
|
||||||
r.DefaultValue = "";
|
|
||||||
if (parm.DefaultValues != null && parm.DefaultValues.Length > 0)
|
|
||||||
r.DefaultValue = parm.DefaultValues[0];
|
|
||||||
|
|
||||||
return r;
|
|
||||||
|
|
||||||
}).ToArray();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return View(m);
|
|
||||||
}
|
|
||||||
|
|
||||||
public SSRSHelper.SSRSClient SetupSSRSHelperClient()
|
|
||||||
{
|
|
||||||
var useCfgForBindings = false;
|
|
||||||
if (String.Equals(System.Configuration.ConfigurationManager.AppSettings["SSRSBindingsByConfiguration"], "true", StringComparison.OrdinalIgnoreCase))
|
|
||||||
useCfgForBindings = true;
|
|
||||||
|
|
||||||
var c = new SSRSHelper.SSRSClient(
|
|
||||||
Convert.ToString(System.Configuration.ConfigurationManager.AppSettings["SSRSBaseURL"]),
|
|
||||||
Convert.ToString(System.Configuration.ConfigurationManager.AppSettings["SSRSDomain"]),
|
|
||||||
Convert.ToString(System.Configuration.ConfigurationManager.AppSettings["SSRSUsername"]),
|
|
||||||
Convert.ToString(System.Configuration.ConfigurationManager.AppSettings["SSRSPassword"]),
|
|
||||||
useCfgForBindings);
|
|
||||||
c.Initialize();
|
|
||||||
|
|
||||||
return c;
|
|
||||||
}
|
|
||||||
|
|
||||||
private IEnumerable<SSRSHelper.ReportInfo> GetReportList(String docType)
|
|
||||||
{
|
|
||||||
String folderName = Convert.ToString(System.Configuration.ConfigurationManager.AppSettings["SSRSFolder"]);
|
|
||||||
if (folderName.EndsWith("/"))
|
|
||||||
folderName = folderName.TrimEnd('/');
|
|
||||||
if (!String.IsNullOrWhiteSpace(docType))
|
|
||||||
folderName = folderName + "/" + docType;
|
|
||||||
|
|
||||||
var c = SetupSSRSHelperClient();
|
|
||||||
return c.ListReports(folderName);
|
|
||||||
}
|
|
||||||
|
|
||||||
public ActionResult GetReports(String docType)
|
|
||||||
{
|
|
||||||
var reports = GetReportList(docType);
|
|
||||||
|
|
||||||
return Json(new { Data =
|
|
||||||
reports.Select(r => new ReportViewModel()
|
|
||||||
{
|
|
||||||
ReportName = r.Name ?? "",
|
|
||||||
Description = r.Description ?? "",
|
|
||||||
ReportID = r.ReportID ?? "",
|
|
||||||
DocType = docType
|
|
||||||
})
|
|
||||||
},
|
|
||||||
JsonRequestBehavior.AllowGet);
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpPost]
|
|
||||||
public ActionResult ExportReport(String DocType, String ReportID)
|
|
||||||
{
|
|
||||||
var c = SetupSSRSHelperClient();
|
|
||||||
var reports = GetReportList(DocType);
|
|
||||||
|
|
||||||
var report = reports.Where(r => String.Equals(r.ReportID, ReportID, StringComparison.OrdinalIgnoreCase)).FirstOrDefault();
|
|
||||||
if (report == null)
|
|
||||||
return Content("Invalid report ID");
|
|
||||||
|
|
||||||
var reportParms = c.GetReportParameters(report.FullPath);
|
|
||||||
|
|
||||||
var parms = new SSRSHelper.ReportParameterCollection();
|
|
||||||
parms.Add("DocType", DocType);
|
|
||||||
parms.Add("UserID", Convert.ToString(Session[GlobalVars.SESSION_USERID]));
|
|
||||||
parms.Add("BaseURL", GlobalVars.hostURL);
|
|
||||||
|
|
||||||
foreach (var rp in reportParms)
|
|
||||||
{
|
|
||||||
if (rp.MultiValue.HasValue && rp.MultiValue.Value)
|
|
||||||
{
|
|
||||||
foreach (String v in Request.Params.GetValues("parm_" + rp.Name))
|
|
||||||
{
|
|
||||||
parms.Add(rp.Name, v);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
String value = null;
|
|
||||||
|
|
||||||
if (Request.Params.AllKeys.Contains("parm_" + rp.Name))
|
|
||||||
value = Request.Params.GetValues("parm_" + rp.Name).FirstOrDefault();
|
|
||||||
|
|
||||||
if (value == specialNullString)
|
|
||||||
value = null;
|
|
||||||
|
|
||||||
if ((rp.AllowBlank.HasValue == false || rp.AllowBlank.Value == false) && value == "")
|
|
||||||
value = null;
|
|
||||||
|
|
||||||
if (value == null)
|
|
||||||
{
|
|
||||||
if (rp.Nullable.HasValue == false || rp.Nullable.Value == false)
|
|
||||||
{
|
|
||||||
if (rp.DefaultValues != null && rp.DefaultValues.Length > 0)
|
|
||||||
value = rp.DefaultValues[0];
|
|
||||||
if (value == null)
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
parms.Add(rp.Name, value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var b = c.ExportReport(report.FullPath, @User.Identity.Name, parms, "EXCELOPENXML");
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var b2 = c.FreezeExcelHeaders(b);
|
|
||||||
return File(b2, "application/octet-stream", MakeFilename(report.Name) + ".xlsx");
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
return File(b, "application/octet-stream", MakeFilename(report.Name) + ".xlsx");
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
protected String MakeFilename(String reportName)
|
|
||||||
{
|
|
||||||
String r = "";
|
|
||||||
var invalidChars = System.IO.Path.GetInvalidFileNameChars();
|
|
||||||
foreach (char c in reportName)
|
|
||||||
{
|
|
||||||
if (invalidChars.Contains(c))
|
|
||||||
r += '_';
|
|
||||||
else
|
|
||||||
r += c;
|
|
||||||
}
|
|
||||||
return r;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
return View();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ActionResult Report(String id, String docType = "") {
|
||||||
|
if (String.IsNullOrEmpty(id))
|
||||||
|
return RedirectToAction("Index");
|
||||||
|
|
||||||
|
UserAccountDMO userDMO = new UserAccountDMO();
|
||||||
|
if (!userDMO.GetITARAccess((int)Session[GlobalVars.SESSION_USERID]))
|
||||||
|
return View("UnAuthorizedAccess");
|
||||||
|
|
||||||
|
var m = new ReportViewModel<System.Web.Mvc.SelectListItem>();
|
||||||
|
var reports = GetReportList(docType);
|
||||||
|
foreach (var report in reports) {
|
||||||
|
if (String.Equals(report.ReportID, id, StringComparison.OrdinalIgnoreCase)) {
|
||||||
|
m.ReportID = report.ReportID;
|
||||||
|
m.ReportName = report.Name;
|
||||||
|
m.Description = report.Description;
|
||||||
|
m.DocType = docType;
|
||||||
|
|
||||||
|
var c = SetupSSRSHelperClient();
|
||||||
|
|
||||||
|
m.Parameters = c.GetReportParameters(report.FullPath).Select(parm => {
|
||||||
|
var r = new ReportParameterViewModel<System.Web.Mvc.SelectListItem>();
|
||||||
|
r.Visible = (parm.PromptUser.HasValue == false || parm.PromptUser == true) && !String.IsNullOrEmpty(parm.Prompt);
|
||||||
|
r.Prompt = parm.Prompt;
|
||||||
|
r.Name = parm.Name;
|
||||||
|
r.HtmlID = "parm_" + parm.Name;
|
||||||
|
|
||||||
|
if (parm.MultiValue.HasValue && parm.MultiValue.Value)
|
||||||
|
r.ControlType = ParameterControlTypes.Multiselect;
|
||||||
|
else if ((parm.ValidValues != null) && (parm.ValidValues.Length > 0))
|
||||||
|
r.ControlType = ParameterControlTypes.Dropdown;
|
||||||
|
else if (parm.DataType.Equals("DateTime", StringComparison.OrdinalIgnoreCase))
|
||||||
|
r.ControlType = ParameterControlTypes.DatePicker;
|
||||||
|
else
|
||||||
|
r.ControlType = ParameterControlTypes.Textbox;
|
||||||
|
|
||||||
|
r.SelectList = null;
|
||||||
|
if (parm.ValidValues != null) {
|
||||||
|
r.SelectList = parm.ValidValues.Select(vv => {
|
||||||
|
return new SelectListItem() {
|
||||||
|
Text = vv.Value,
|
||||||
|
Value = (vv.Key == null ? specialNullString : vv.Key),
|
||||||
|
Selected = (parm.DefaultValues != null && parm.DefaultValues.Contains(vv.Key))
|
||||||
|
};
|
||||||
|
}).ToList();
|
||||||
|
}
|
||||||
|
|
||||||
|
r.DefaultValue = "";
|
||||||
|
if (parm.DefaultValues != null && parm.DefaultValues.Length > 0)
|
||||||
|
r.DefaultValue = parm.DefaultValues[0];
|
||||||
|
|
||||||
|
return r;
|
||||||
|
|
||||||
|
}).ToArray();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return View(m);
|
||||||
|
}
|
||||||
|
|
||||||
|
public SSRSHelper.SSRSClient SetupSSRSHelperClient() {
|
||||||
|
var useCfgForBindings = false;
|
||||||
|
if (String.Equals(System.Configuration.ConfigurationManager.AppSettings["SSRSBindingsByConfiguration"], "true", StringComparison.OrdinalIgnoreCase))
|
||||||
|
useCfgForBindings = true;
|
||||||
|
|
||||||
|
var c = new SSRSHelper.SSRSClient(
|
||||||
|
Convert.ToString(System.Configuration.ConfigurationManager.AppSettings["SSRSBaseURL"]),
|
||||||
|
Convert.ToString(System.Configuration.ConfigurationManager.AppSettings["SSRSDomain"]),
|
||||||
|
Convert.ToString(System.Configuration.ConfigurationManager.AppSettings["SSRSUsername"]),
|
||||||
|
Convert.ToString(System.Configuration.ConfigurationManager.AppSettings["SSRSPassword"]),
|
||||||
|
useCfgForBindings);
|
||||||
|
c.Initialize();
|
||||||
|
|
||||||
|
return c;
|
||||||
|
}
|
||||||
|
|
||||||
|
private IEnumerable<SSRSHelper.ReportInfo> GetReportList(String docType) {
|
||||||
|
String folderName = Convert.ToString(System.Configuration.ConfigurationManager.AppSettings["SSRSFolder"]);
|
||||||
|
if (folderName.EndsWith("/"))
|
||||||
|
folderName = folderName.TrimEnd('/');
|
||||||
|
if (!String.IsNullOrWhiteSpace(docType))
|
||||||
|
folderName = folderName + "/" + docType;
|
||||||
|
|
||||||
|
var c = SetupSSRSHelperClient();
|
||||||
|
return c.ListReports(folderName);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ActionResult GetReports(String docType) {
|
||||||
|
var reports = GetReportList(docType);
|
||||||
|
|
||||||
|
return Json(new {
|
||||||
|
Data =
|
||||||
|
reports.Select(r => new ReportViewModel<System.Web.Mvc.SelectListItem>() {
|
||||||
|
ReportName = r.Name ?? "",
|
||||||
|
Description = r.Description ?? "",
|
||||||
|
ReportID = r.ReportID ?? "",
|
||||||
|
DocType = docType
|
||||||
|
})
|
||||||
|
},
|
||||||
|
JsonRequestBehavior.AllowGet);
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpPost]
|
||||||
|
public ActionResult ExportReport(String DocType, String ReportID) {
|
||||||
|
var c = SetupSSRSHelperClient();
|
||||||
|
var reports = GetReportList(DocType);
|
||||||
|
|
||||||
|
var report = reports.Where(r => String.Equals(r.ReportID, ReportID, StringComparison.OrdinalIgnoreCase)).FirstOrDefault();
|
||||||
|
if (report == null)
|
||||||
|
return Content("Invalid report ID");
|
||||||
|
|
||||||
|
var reportParms = c.GetReportParameters(report.FullPath);
|
||||||
|
|
||||||
|
var parms = new SSRSHelper.ReportParameterCollection();
|
||||||
|
parms.Add("DocType", DocType);
|
||||||
|
parms.Add("UserID", Convert.ToString(Session[GlobalVars.SESSION_USERID]));
|
||||||
|
parms.Add("BaseURL", GlobalVars.hostURL);
|
||||||
|
|
||||||
|
foreach (var rp in reportParms) {
|
||||||
|
if (rp.MultiValue.HasValue && rp.MultiValue.Value) {
|
||||||
|
foreach (String v in Request.Params.GetValues("parm_" + rp.Name)) {
|
||||||
|
parms.Add(rp.Name, v);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
String value = null;
|
||||||
|
|
||||||
|
if (Request.Params.AllKeys.Contains("parm_" + rp.Name))
|
||||||
|
value = Request.Params.GetValues("parm_" + rp.Name).FirstOrDefault();
|
||||||
|
|
||||||
|
if (value == specialNullString)
|
||||||
|
value = null;
|
||||||
|
|
||||||
|
if ((rp.AllowBlank.HasValue == false || rp.AllowBlank.Value == false) && value == "")
|
||||||
|
value = null;
|
||||||
|
|
||||||
|
if (value == null) {
|
||||||
|
if (rp.Nullable.HasValue == false || rp.Nullable.Value == false) {
|
||||||
|
if (rp.DefaultValues != null && rp.DefaultValues.Length > 0)
|
||||||
|
value = rp.DefaultValues[0];
|
||||||
|
if (value == null)
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
parms.Add(rp.Name, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var b = c.ExportReport(report.FullPath, @User.Identity.Name, parms, "EXCELOPENXML");
|
||||||
|
try {
|
||||||
|
var b2 = c.FreezeExcelHeaders(b);
|
||||||
|
return File(b2, "application/octet-stream", MakeFilename(report.Name) + ".xlsx");
|
||||||
|
} catch {
|
||||||
|
}
|
||||||
|
return File(b, "application/octet-stream", MakeFilename(report.Name) + ".xlsx");
|
||||||
|
}
|
||||||
|
|
||||||
|
protected String MakeFilename(String reportName) {
|
||||||
|
String r = "";
|
||||||
|
var invalidChars = System.IO.Path.GetInvalidFileNameChars();
|
||||||
|
foreach (char c in reportName) {
|
||||||
|
if (invalidChars.Contains(c))
|
||||||
|
r += '_';
|
||||||
|
else
|
||||||
|
r += c;
|
||||||
|
}
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
File diff suppressed because it is too large
Load Diff
@ -5,87 +5,69 @@ using System.Net;
|
|||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Web.Http;
|
using System.Web.Http;
|
||||||
|
|
||||||
|
using Fab2ApprovalSystem.Models;
|
||||||
|
|
||||||
namespace Fab2ApprovalSystem.Controllers
|
namespace Fab2ApprovalSystem.Controllers;
|
||||||
{
|
|
||||||
|
|
||||||
public class WebAPIController : ApiController
|
public class WebAPIController : ApiController {
|
||||||
{
|
public TrainingController trainingFunctions = new TrainingController();
|
||||||
public TrainingController trainingFunctions = new TrainingController();
|
public CorrectiveActionController carFunctions;
|
||||||
public CorrectiveActionController carFunctions = new CorrectiveActionController();
|
public AccountController accountFunctions = new AccountController();
|
||||||
public AccountController accountFunctions = new AccountController();
|
public HomeController homeFunctions;
|
||||||
public HomeController homeFunctions = new HomeController();
|
private readonly AppSettings _AppSettings;
|
||||||
public string Get()
|
|
||||||
{
|
public WebAPIController(AppSettings appSettings) {
|
||||||
return "Welcome To Web API";
|
_AppSettings = appSettings;
|
||||||
}
|
carFunctions = new CorrectiveActionController(appSettings);
|
||||||
public List<string> Get(int Id)
|
homeFunctions = new HomeController(appSettings);
|
||||||
{
|
}
|
||||||
return new List<string> {
|
|
||||||
|
public string Get() {
|
||||||
|
return "Welcome To Web API";
|
||||||
|
}
|
||||||
|
public List<string> Get(int Id) {
|
||||||
|
return new List<string> {
|
||||||
"Data1",
|
"Data1",
|
||||||
"Data2"
|
"Data2"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
public void Post()
|
public void Post() {
|
||||||
{
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public HttpResponseMessage Post(HttpRequestMessage request, string action)
|
|
||||||
{
|
|
||||||
|
|
||||||
switch (action)
|
|
||||||
{
|
|
||||||
case "TrainingReport":
|
|
||||||
if (trainingFunctions.RunTrainingReport())
|
|
||||||
{
|
|
||||||
return request.CreateResponse(HttpStatusCode.OK);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return request.CreateResponse(HttpStatusCode.InternalServerError);
|
|
||||||
}
|
|
||||||
case "CARDueDates":
|
|
||||||
if (carFunctions.ProcessCARDueDates())
|
|
||||||
{
|
|
||||||
return request.CreateResponse(HttpStatusCode.OK);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return request.CreateResponse(HttpStatusCode.InternalServerError);
|
|
||||||
}
|
|
||||||
case "ProcessOoO":
|
|
||||||
if (homeFunctions.ProcessOoO())
|
|
||||||
{
|
|
||||||
return request.CreateResponse(HttpStatusCode.OK);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return request.CreateResponse(HttpStatusCode.InternalServerError);
|
|
||||||
}
|
|
||||||
case "ExpireOoO":
|
|
||||||
if (homeFunctions.ExpireOoO())
|
|
||||||
{
|
|
||||||
return request.CreateResponse(HttpStatusCode.OK);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return request.CreateResponse(HttpStatusCode.InternalServerError);
|
|
||||||
}
|
|
||||||
case "ApprovalReminders":
|
|
||||||
if (homeFunctions.ApprovalsReminderNotifications())
|
|
||||||
{
|
|
||||||
return request.CreateResponse(HttpStatusCode.OK);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return request.CreateResponse(HttpStatusCode.InternalServerError);
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
return request.CreateResponse(HttpStatusCode.InternalServerError, "Action Not Found");
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
public HttpResponseMessage Post(HttpRequestMessage request, string action) {
|
||||||
|
switch (action) {
|
||||||
|
case "TrainingReport":
|
||||||
|
if (trainingFunctions.RunTrainingReport()) {
|
||||||
|
return request.CreateResponse(HttpStatusCode.OK);
|
||||||
|
} else {
|
||||||
|
return request.CreateResponse(HttpStatusCode.InternalServerError);
|
||||||
|
}
|
||||||
|
case "CARDueDates":
|
||||||
|
if (carFunctions.ProcessCARDueDates()) {
|
||||||
|
return request.CreateResponse(HttpStatusCode.OK);
|
||||||
|
} else {
|
||||||
|
return request.CreateResponse(HttpStatusCode.InternalServerError);
|
||||||
|
}
|
||||||
|
case "ProcessOoO":
|
||||||
|
if (homeFunctions.ProcessOoO()) {
|
||||||
|
return request.CreateResponse(HttpStatusCode.OK);
|
||||||
|
} else {
|
||||||
|
return request.CreateResponse(HttpStatusCode.InternalServerError);
|
||||||
|
}
|
||||||
|
case "ExpireOoO":
|
||||||
|
if (homeFunctions.ExpireOoO()) {
|
||||||
|
return request.CreateResponse(HttpStatusCode.OK);
|
||||||
|
} else {
|
||||||
|
return request.CreateResponse(HttpStatusCode.InternalServerError);
|
||||||
|
}
|
||||||
|
case "ApprovalReminders":
|
||||||
|
if (homeFunctions.ApprovalsReminderNotifications()) {
|
||||||
|
return request.CreateResponse(HttpStatusCode.OK);
|
||||||
|
} else {
|
||||||
|
return request.CreateResponse(HttpStatusCode.InternalServerError);
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
return request.CreateResponse(HttpStatusCode.InternalServerError, "Action Not Found");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,99 +1,81 @@
|
|||||||
using Fab2ApprovalSystem.DMO;
|
using Fab2ApprovalSystem.DMO;
|
||||||
using Fab2ApprovalSystem.Models;
|
using Fab2ApprovalSystem.Models;
|
||||||
|
|
||||||
|
using Kendo.Mvc.Extensions;
|
||||||
using Kendo.Mvc.UI;
|
using Kendo.Mvc.UI;
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Web;
|
using System.Web;
|
||||||
using System.Web.Mvc;
|
using System.Web.Mvc;
|
||||||
using Kendo.Mvc.Extensions;
|
|
||||||
|
|
||||||
|
namespace Fab2ApprovalSystem.Controllers;
|
||||||
|
|
||||||
|
public class WorkflowController : Controller {
|
||||||
|
//
|
||||||
|
|
||||||
namespace Fab2ApprovalSystem.Controllers
|
//
|
||||||
{
|
// GET: /Workflow/Details/5
|
||||||
public class WorkflowController : Controller
|
public ActionResult Details(int id) {
|
||||||
{
|
return View();
|
||||||
//
|
|
||||||
|
|
||||||
//
|
|
||||||
// GET: /Workflow/Details/5
|
|
||||||
public ActionResult Details(int id)
|
|
||||||
{
|
|
||||||
return View();
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// GET: /Workflow/Create
|
|
||||||
public ActionResult Create()
|
|
||||||
{
|
|
||||||
return View();
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// POST: /Workflow/Create
|
|
||||||
[HttpPost]
|
|
||||||
public ActionResult Create(FormCollection collection)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
// TODO: Add insert logic here
|
|
||||||
|
|
||||||
return RedirectToAction("Index");
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
return View();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// GET: /Workflow/Edit/5
|
|
||||||
public ActionResult Edit(int id)
|
|
||||||
{
|
|
||||||
return View();
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// POST: /Workflow/Edit/5
|
|
||||||
[HttpPost]
|
|
||||||
public ActionResult Edit(int id, FormCollection collection)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
// TODO: Add update logic here
|
|
||||||
|
|
||||||
return RedirectToAction("Index");
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
return View();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// GET: /Workflow/Delete/5
|
|
||||||
public ActionResult Delete(int id)
|
|
||||||
{
|
|
||||||
return View();
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// POST: /Workflow/Delete/5
|
|
||||||
[HttpPost]
|
|
||||||
public ActionResult Delete(int id, FormCollection collection)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
// TODO: Add delete logic here
|
|
||||||
|
|
||||||
return RedirectToAction("Index");
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
return View();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// GET: /Workflow/Create
|
||||||
|
public ActionResult Create() {
|
||||||
|
return View();
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// POST: /Workflow/Create
|
||||||
|
[HttpPost]
|
||||||
|
public ActionResult Create(FormCollection collection) {
|
||||||
|
try {
|
||||||
|
// TODO: Add insert logic here
|
||||||
|
|
||||||
|
return RedirectToAction("Index");
|
||||||
|
} catch {
|
||||||
|
return View();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// GET: /Workflow/Edit/5
|
||||||
|
public ActionResult Edit(int id) {
|
||||||
|
return View();
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// POST: /Workflow/Edit/5
|
||||||
|
[HttpPost]
|
||||||
|
public ActionResult Edit(int id, FormCollection collection) {
|
||||||
|
try {
|
||||||
|
// TODO: Add update logic here
|
||||||
|
|
||||||
|
return RedirectToAction("Index");
|
||||||
|
} catch {
|
||||||
|
return View();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// GET: /Workflow/Delete/5
|
||||||
|
public ActionResult Delete(int id) {
|
||||||
|
return View();
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// POST: /Workflow/Delete/5
|
||||||
|
[HttpPost]
|
||||||
|
public ActionResult Delete(int id, FormCollection collection) {
|
||||||
|
try {
|
||||||
|
// TODO: Add delete logic here
|
||||||
|
|
||||||
|
return RedirectToAction("Index");
|
||||||
|
} catch {
|
||||||
|
return View();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
59
Fab2ApprovalSystem/DMO/AccountDMO.cs
Normal file
59
Fab2ApprovalSystem/DMO/AccountDMO.cs
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
using System;
|
||||||
|
using System.Net.Http;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
using Fab2ApprovalSystem.Models;
|
||||||
|
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
namespace Fab2ApprovalSystem.DMO;
|
||||||
|
|
||||||
|
public class AccountDMO {
|
||||||
|
|
||||||
|
public static async Task<LoginResult> LoginAsync(HttpClient httpClient, LoginModel loginModel) {
|
||||||
|
LoginResult result;
|
||||||
|
|
||||||
|
HttpRequestMessage request = new(HttpMethod.Post, "auth/login");
|
||||||
|
|
||||||
|
AuthAttempt authAttempt = loginModel is null ? null : new AuthAttempt() {
|
||||||
|
LoginID = loginModel.LoginID,
|
||||||
|
Password = loginModel.Password
|
||||||
|
};
|
||||||
|
|
||||||
|
string json = authAttempt is null ? "{}" : JsonConvert.SerializeObject(authAttempt);
|
||||||
|
|
||||||
|
request.Content = new StringContent(json, Encoding.UTF8, "application/json");
|
||||||
|
|
||||||
|
HttpResponseMessage httpResponseMessage = await httpClient.SendAsync(request);
|
||||||
|
|
||||||
|
if (!httpResponseMessage.IsSuccessStatusCode)
|
||||||
|
throw new Exception($"The authentication API failed, because {httpResponseMessage.ReasonPhrase}");
|
||||||
|
|
||||||
|
string responseContent = await httpResponseMessage.Content.ReadAsStringAsync();
|
||||||
|
|
||||||
|
result = JsonConvert.DeserializeObject<LoginResult>(responseContent);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static async Task<LoginResult> ExternalAuthSetupAsync(HttpClient httpClient, AuthAttempt authAttempt) {
|
||||||
|
LoginResult result;
|
||||||
|
|
||||||
|
HttpRequestMessage request = new(HttpMethod.Post, "auth/refresh");
|
||||||
|
|
||||||
|
string json = authAttempt is null ? "{}" : JsonConvert.SerializeObject(authAttempt);
|
||||||
|
|
||||||
|
request.Content = new StringContent(json, Encoding.UTF8, "application/json");
|
||||||
|
|
||||||
|
HttpResponseMessage httpResponseMessage = await httpClient.SendAsync(request);
|
||||||
|
|
||||||
|
if (!httpResponseMessage.IsSuccessStatusCode)
|
||||||
|
throw new Exception($"The authentication API failed, because {httpResponseMessage.ReasonPhrase}");
|
||||||
|
|
||||||
|
string responseContent = await httpResponseMessage.Content.ReadAsStringAsync();
|
||||||
|
|
||||||
|
result = JsonConvert.DeserializeObject<LoginResult>(responseContent);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,311 +1,336 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Configuration;
|
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using System.Data.SqlClient;
|
using System.Data.SqlClient;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Web;
|
|
||||||
using Dapper;
|
|
||||||
using Fab2ApprovalSystem.Models;
|
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
|
using Dapper;
|
||||||
|
|
||||||
using Fab2ApprovalSystem.Misc;
|
using Fab2ApprovalSystem.Misc;
|
||||||
|
using Fab2ApprovalSystem.Models;
|
||||||
|
|
||||||
namespace Fab2ApprovalSystem.DMO
|
namespace Fab2ApprovalSystem.DMO;
|
||||||
{
|
|
||||||
public class AdminDMO
|
|
||||||
{
|
|
||||||
private IDbConnection db = new SqlConnection(GlobalVars.DB_CONNECTION_STRING);
|
|
||||||
private static FabApprovalTrainingEntities FabApprovalDB = new FabApprovalTrainingEntities();
|
|
||||||
|
|
||||||
/// <summary>
|
public class AdminDMO {
|
||||||
///
|
private readonly IDbConnection db = new SqlConnection(GlobalVars.DB_CONNECTION_STRING);
|
||||||
/// </summary>
|
#if !NET8
|
||||||
/// <returns></returns>
|
private static FabApprovalTrainingEntities FabApprovalDB = new FabApprovalTrainingEntities();
|
||||||
public List<Role> GetSubRoles()
|
#endif
|
||||||
{
|
|
||||||
StringBuilder sql = new StringBuilder();
|
|
||||||
sql.Append(
|
|
||||||
"SELECT R.RoleID, R.RoleName, SubRoleID, SubRoleCategoryItem, SR.RoleID, SR.Inactive " +
|
|
||||||
"FROM vSubRoles SR " +
|
|
||||||
"INNER JOIN Role R ON R.RoleID = SR.RoleID " +
|
|
||||||
"ORDER BY R.RoleID, SubRoleCategoryItem ");
|
|
||||||
|
|
||||||
|
public List<ParentChildModel> GetAllSubRoles(string showInactiveRoles = "") {
|
||||||
|
List<ParentChildModel> results = new();
|
||||||
|
|
||||||
|
List<Role> roles = GetSubRoles();
|
||||||
|
|
||||||
|
ParentChildModel child;
|
||||||
|
ParentChildModel parent;
|
||||||
|
|
||||||
|
foreach (Role r in roles) {
|
||||||
|
parent = new ParentChildModel {
|
||||||
|
id = r.RoleID,
|
||||||
|
parentid = -1,
|
||||||
|
text = r.RoleName,
|
||||||
|
value = r.RoleID.ToString()
|
||||||
|
};
|
||||||
|
|
||||||
|
foreach (SubRole sr in r.SubRoles) {
|
||||||
|
if (sr.Inactive) {
|
||||||
|
// hide inactive roles unless parameter says otherwise
|
||||||
|
if (showInactiveRoles.Equals("true") == false)
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
child = new ParentChildModel {
|
||||||
|
id = sr.SubRoleID,
|
||||||
|
parentid = r.RoleID,
|
||||||
|
text = sr.SubRoleCategoryItem + (sr.Inactive ? " (Inactive)" : ""),
|
||||||
|
value = sr.SubRoleID.ToString()
|
||||||
|
};
|
||||||
|
results.Add(child);
|
||||||
|
}
|
||||||
|
|
||||||
|
results.Add(parent);
|
||||||
|
};
|
||||||
|
return results;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Role> GetSubRoles() {
|
||||||
|
StringBuilder sql = new();
|
||||||
|
sql.Append(
|
||||||
|
"SELECT R.RoleID, R.RoleName, SubRoleID, SubRoleCategoryItem, SR.RoleID, SR.Inactive " +
|
||||||
|
"FROM vSubRoles SR " +
|
||||||
|
"INNER JOIN Role R ON R.RoleID = SR.RoleID " +
|
||||||
|
"ORDER BY R.RoleID, SubRoleCategoryItem ");
|
||||||
|
|
||||||
|
db.Open();
|
||||||
|
Dictionary<int, Role> lookup = new();
|
||||||
|
List<Role> data = db.Query<Role, SubRole, Role>(sql.ToString(),
|
||||||
|
(parent, child) => {
|
||||||
|
Role role;
|
||||||
|
if (!lookup.TryGetValue(parent.RoleID, out role)) {
|
||||||
|
lookup.Add(parent.RoleID, role = parent);
|
||||||
|
}
|
||||||
|
//if (role.RoleID == null)
|
||||||
|
// role.SubRoles = new List<SubRole>();
|
||||||
|
role.SubRoles.Add(child);
|
||||||
|
return role;
|
||||||
|
},
|
||||||
|
splitOn: "SubRoleID").Distinct().ToList();
|
||||||
|
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
///
|
||||||
|
public List<UserSubRoles> GetUserSubRoles(int userId) {
|
||||||
|
DynamicParameters parameters = new();
|
||||||
|
parameters.Add("@UserId", userId);
|
||||||
|
List<UserSubRoles> userSubRoleList = db.Query<UserSubRoles>("GetSubRolesByUserId", parameters, commandType: CommandType.StoredProcedure).ToList();
|
||||||
|
return userSubRoleList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public IEnumerable<LoginModel> GetAllUsersBySubRole(int subRole) {
|
||||||
|
StringBuilder sql = new();
|
||||||
|
sql.Append("SELECT FirstName + ' ' + LastName AS FullName , LoginID, FirstName, LastName, U.UserID, SubRoleID ");
|
||||||
|
sql.Append("FROM UserSubRole UR ");
|
||||||
|
sql.Append("INNER JOIN Users U ON UR.UserID = U.UserID ");
|
||||||
|
sql.Append("WHERE UR.SubRoleID = " + subRole.ToString() + " ");
|
||||||
|
sql.Append("ORDER BY FirstName");
|
||||||
|
|
||||||
|
return db.Query<LoginModel>(sql.ToString()).ToList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AddUserRoles(int subRole, string userids) {
|
||||||
|
string sql;
|
||||||
|
|
||||||
|
string[] arrayOfUsers = userids.Split(new char[] { '~' });
|
||||||
|
|
||||||
|
for (int i = 0; i < arrayOfUsers.Length; i++) {
|
||||||
|
sql = "INSERT INTO UserSubRole (UserID, SubRoleID) VALUES (" + arrayOfUsers[i] + ", " + subRole + " )";
|
||||||
|
db.Execute(sql);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void DeleteUserFromAllTrainingGroups(int userId) {
|
||||||
|
string sql = "DELETE FROM TrainingGroupMembers WHERE UserId = " + userId;
|
||||||
|
|
||||||
|
db.Open();
|
||||||
|
db.Execute(sql);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void DeleteUserRoles(int subRole, string userids) {
|
||||||
|
string sql;
|
||||||
|
|
||||||
|
string[] arrayOfUsers = userids.Split(new char[] { '~' });
|
||||||
|
|
||||||
|
for (int i = 0; i < arrayOfUsers.Length; i++) {
|
||||||
|
sql = "DELETE FROM UserSubRole WHERE UserID = " + arrayOfUsers[i] + " AND SubRoleID = " + subRole;
|
||||||
|
db.Execute(sql);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
#if !NET8
|
||||||
|
public List<TrainingReportUser> GetTrainingReportUsers() {
|
||||||
|
List<TrainingReportUser> CurrentReportUsers = (from a in FabApprovalDB.TrainingReportUsers select a).ToList();
|
||||||
|
return CurrentReportUsers;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
public List<TrainingReportUser> GetTrainingReportUsers() => throw new NotImplementedException();
|
||||||
|
#endif
|
||||||
|
#if !NET8
|
||||||
|
public List<TECNNotificationsUser> GetTECNNotificationUsers() {
|
||||||
|
List<TECNNotificationsUser> currentTECNNotificationUsers = (from a in FabApprovalDB.TECNNotificationsUsers select a).ToList();
|
||||||
|
return currentTECNNotificationUsers;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
public void TrainingReportAddUser(int userId) {
|
||||||
|
string sql = "INSERT INTO TrainingReportUsers (UserId) " + "VALUES ('" + userId + "') ";
|
||||||
|
|
||||||
|
db.Open();
|
||||||
|
db.Execute(sql);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void TECNExpirationAddUser(int userId) {
|
||||||
|
string sql = "INSERT INTO TECNNotificationsUsers (UserId) " + "VALUES ('" + userId + "') ";
|
||||||
|
|
||||||
|
db.Open();
|
||||||
|
db.Execute(sql);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void TrainingReportDeleteUser(int userId) {
|
||||||
|
DynamicParameters parameters = new();
|
||||||
|
|
||||||
|
parameters = new DynamicParameters();
|
||||||
|
parameters.Add("@UserID", userId);
|
||||||
|
|
||||||
|
db.Execute("DeleteUserFromTrainingReport", parameters, commandType: CommandType.StoredProcedure);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void TECNExpirationDeleteUser(int userId) {
|
||||||
|
DynamicParameters parameters = new();
|
||||||
|
|
||||||
|
parameters = new DynamicParameters();
|
||||||
|
parameters.Add("@UserID", userId);
|
||||||
|
|
||||||
|
db.Execute("DeleteUserFromTECNReport", parameters, commandType: CommandType.StoredProcedure);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#if !NET8
|
||||||
|
public List<TrainingGroup> GetTrainingGroups() {
|
||||||
|
//StringBuilder sql = new StringBuilder();
|
||||||
|
//sql.Append(
|
||||||
|
// "SELECT 'TrainingGroupID', TrainingGroupName " +
|
||||||
|
// "FROM TrainingGroups " +
|
||||||
|
// "ORDER BY TrainingGroupID ");
|
||||||
|
|
||||||
|
//db.Open();
|
||||||
|
//var lookup = new Dictionary<int, TrainingGroup>();
|
||||||
|
////List<TrainingGroup> data = this.db.Query<TrainingGroup>(sql.ToString()
|
||||||
|
//return this.db.Query<TrainingGroup>(sql.ToString()).ToList();
|
||||||
|
var TrainingGroups = from a in FabApprovalDB.TrainingGroups select a;
|
||||||
|
List<TrainingGroup> GroupsToReturn = TrainingGroups.ToList();
|
||||||
|
|
||||||
|
return GroupsToReturn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AddNewTrainingGroup(string groupName) {
|
||||||
|
TrainingGroup existing = null;
|
||||||
|
//Check to see that the group name doesn't exist.
|
||||||
|
try {
|
||||||
|
existing = (from a in FabApprovalDB.TrainingGroups where a.TrainingGroupName == groupName select a).FirstOrDefault();
|
||||||
|
} catch {
|
||||||
|
// string test = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (existing == null) {
|
||||||
|
//string sql = new StringBuilder();
|
||||||
|
string sql = "INSERT INTO TrainingGroups (TrainingGroupName) " + "VALUES ('" + groupName + "') ";
|
||||||
|
|
||||||
|
this.db.Open();
|
||||||
|
this.db.Execute(sql);
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
public void DeleteTrainingGroup(int groupID) {
|
||||||
|
try {
|
||||||
|
string sql = "DELETE FROM TrainingGroups WHERE TrainingGroupID = " + groupID;
|
||||||
db.Open();
|
db.Open();
|
||||||
var lookup = new Dictionary<int, Role>();
|
db.Execute(sql);
|
||||||
List<Role> data = this.db.Query<Role, SubRole, Role>(sql.ToString(),
|
|
||||||
(parent, child) =>
|
|
||||||
{
|
|
||||||
Role role;
|
|
||||||
if (!lookup.TryGetValue(parent.RoleID, out role))
|
|
||||||
{
|
|
||||||
lookup.Add(parent.RoleID, role = parent);
|
|
||||||
}
|
|
||||||
//if (role.RoleID == null)
|
|
||||||
// role.SubRoles = new List<SubRole>();
|
|
||||||
role.SubRoles.Add(child);
|
|
||||||
return role;
|
|
||||||
},
|
|
||||||
splitOn: "SubRoleID").Distinct().ToList();
|
|
||||||
|
|
||||||
|
sql = "DELETE FROM TrainingGroupMembers WHERE TrainingGroupID = " + groupID;
|
||||||
return data;
|
db.Execute(sql);
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
/// /// <param name="userId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public List<UserSubRoles> GetUserSubRoles(int userId)
|
|
||||||
{
|
|
||||||
var parameters = new DynamicParameters();
|
|
||||||
parameters.Add("@UserId", userId);
|
|
||||||
var userSubRoleList = this.db.Query<UserSubRoles>("GetSubRolesByUserId", parameters, commandType: CommandType.StoredProcedure).ToList();
|
|
||||||
return userSubRoleList;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="subRole"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public IEnumerable<LoginModel> GetAllUsersBySubRole(int subRole)
|
|
||||||
{
|
|
||||||
StringBuilder sql = new StringBuilder();
|
|
||||||
sql.Append("SELECT FirstName + ' ' + LastName AS FullName , LoginID, FirstName, LastName, U.UserID, SubRoleID ");
|
|
||||||
sql.Append("FROM UserSubRole UR ");
|
|
||||||
sql.Append("INNER JOIN Users U ON UR.UserID = U.UserID ");
|
|
||||||
sql.Append("WHERE UR.SubRoleID = " + subRole.ToString() + " ");
|
|
||||||
sql.Append("ORDER BY FirstName");
|
|
||||||
|
|
||||||
return this.db.Query<LoginModel>(sql.ToString()).ToList();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="subRole"></param>
|
|
||||||
/// <param name="userids"></param>
|
|
||||||
public void AddUserRoles(int subRole, string userids)
|
|
||||||
{
|
|
||||||
string sql;
|
|
||||||
|
|
||||||
string[] arrayOfUsers = userids.Split(new char[] { '~' });
|
|
||||||
|
|
||||||
for (int i = 0; i < arrayOfUsers.Length; i++)
|
|
||||||
{
|
|
||||||
sql = "INSERT INTO UserSubRole (UserID, SubRoleID) VALUES (" + arrayOfUsers[i] + ", " + subRole + " )";
|
|
||||||
this.db.Execute(sql);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void DeleteUserFromAllTrainingGroups(int userId)
|
|
||||||
{
|
|
||||||
string sql = "DELETE FROM TrainingGroupMembers WHERE UserId = " + userId;
|
|
||||||
|
|
||||||
|
|
||||||
this.db.Open();
|
|
||||||
this.db.Execute(sql);
|
|
||||||
return;
|
return;
|
||||||
|
} catch {
|
||||||
}
|
}
|
||||||
/// <summary>
|
}
|
||||||
///
|
#if !NET8
|
||||||
/// </summary>
|
public List<TrainingGroupMember> GetTrainingGroupMembers(int GroupID) {
|
||||||
/// <param name="subRole"></param>
|
return (from a in FabApprovalDB.TrainingGroupMembers where a.TrainingGroupID == GroupID select a).ToList();
|
||||||
/// <param name="userids"></param>
|
}
|
||||||
public void DeleteUserRoles(int subRole, string userids)
|
|
||||||
{
|
|
||||||
string sql;
|
|
||||||
|
|
||||||
string[] arrayOfUsers = userids.Split(new char[] { '~' });
|
public void AddUserToGroup(int userId, int groupId) {
|
||||||
|
UserAccountDMO userDB = new UserAccountDMO();
|
||||||
|
string userFullName = userDB.GetUserByID(userId).FullName;
|
||||||
|
|
||||||
for (int i = 0; i < arrayOfUsers.Length; i++)
|
TrainingGroupMember existing = null;
|
||||||
{
|
|
||||||
sql = "DELETE FROM UserSubRole WHERE UserID = " + arrayOfUsers[i] + " AND SubRoleID = " + subRole;
|
|
||||||
this.db.Execute(sql);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
existing = (from a in FabApprovalDB.TrainingGroupMembers where a.TrainingGroupID == groupId && a.UserID == userId select a).FirstOrDefault();
|
||||||
public List<TrainingReportUser> GetTrainingReportUsers()
|
if (existing == null) {
|
||||||
{
|
|
||||||
List<TrainingReportUser> CurrentReportUsers = (from a in FabApprovalDB.TrainingReportUsers select a).ToList();
|
|
||||||
return CurrentReportUsers;
|
|
||||||
}
|
|
||||||
public List<TECNNotificationsUser> GetTECNNotificationUsers()
|
|
||||||
{
|
|
||||||
List<TECNNotificationsUser> currentTECNNotificationUsers = (from a in FabApprovalDB.TECNNotificationsUsers select a).ToList();
|
|
||||||
return currentTECNNotificationUsers;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void TrainingReportAddUser(int userId)
|
|
||||||
{
|
|
||||||
string sql = "INSERT INTO TrainingReportUsers (UserId) " + "VALUES ('" + userId + "') ";
|
|
||||||
|
|
||||||
|
|
||||||
this.db.Open();
|
|
||||||
this.db.Execute(sql);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
public void TECNExpirationAddUser(int userId)
|
|
||||||
{
|
|
||||||
string sql = "INSERT INTO TECNNotificationsUsers (UserId) " + "VALUES ('" + userId + "') ";
|
|
||||||
|
|
||||||
this.db.Open();
|
|
||||||
this.db.Execute(sql);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
public void TrainingReportDeleteUser(int userId)
|
|
||||||
{
|
|
||||||
var parameters = new DynamicParameters();
|
|
||||||
|
|
||||||
parameters = new DynamicParameters();
|
|
||||||
parameters.Add("@UserID", userId);
|
|
||||||
|
|
||||||
this.db.Execute("DeleteUserFromTrainingReport", parameters, commandType: CommandType.StoredProcedure);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
public void TECNExpirationDeleteUser(int userId)
|
|
||||||
{
|
|
||||||
var parameters = new DynamicParameters();
|
|
||||||
|
|
||||||
parameters = new DynamicParameters();
|
|
||||||
parameters.Add("@UserID", userId);
|
|
||||||
|
|
||||||
this.db.Execute("DeleteUserFromTECNReport", parameters, commandType: CommandType.StoredProcedure);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
public List<TrainingGroup> GetTrainingGroups()
|
|
||||||
{
|
|
||||||
//StringBuilder sql = new StringBuilder();
|
|
||||||
//sql.Append(
|
|
||||||
// "SELECT 'TrainingGroupID', TrainingGroupName " +
|
|
||||||
// "FROM TrainingGroups " +
|
|
||||||
// "ORDER BY TrainingGroupID ");
|
|
||||||
|
|
||||||
//db.Open();
|
|
||||||
//var lookup = new Dictionary<int, TrainingGroup>();
|
|
||||||
////List<TrainingGroup> data = this.db.Query<TrainingGroup>(sql.ToString()
|
|
||||||
//return this.db.Query<TrainingGroup>(sql.ToString()).ToList();
|
|
||||||
var TrainingGroups = from a in FabApprovalDB.TrainingGroups select a;
|
|
||||||
List<TrainingGroup> GroupsToReturn = TrainingGroups.ToList();
|
|
||||||
|
|
||||||
return GroupsToReturn;
|
|
||||||
}
|
|
||||||
public void AddNewTrainingGroup(string groupName)
|
|
||||||
{
|
|
||||||
TrainingGroup existing = null;
|
|
||||||
//Check to see that the group name doesn't exist.
|
|
||||||
try
|
|
||||||
{
|
|
||||||
existing = (from a in FabApprovalDB.TrainingGroups where a.TrainingGroupName == groupName select a).FirstOrDefault();
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
// string test = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (existing == null)
|
|
||||||
{
|
|
||||||
//string sql = new StringBuilder();
|
|
||||||
string sql = "INSERT INTO TrainingGroups (TrainingGroupName) " + "VALUES ('" + groupName + "') ";
|
|
||||||
|
|
||||||
|
|
||||||
this.db.Open();
|
|
||||||
this.db.Execute(sql);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void DeleteTrainingGroup(int groupID)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
string sql = "DELETE FROM TrainingGroups WHERE TrainingGroupID = " + groupID;
|
|
||||||
this.db.Open();
|
|
||||||
this.db.Execute(sql);
|
|
||||||
|
|
||||||
sql = "DELETE FROM TrainingGroupMembers WHERE TrainingGroupID = " + groupID;
|
|
||||||
this.db.Execute(sql);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public List<TrainingGroupMember> GetTrainingGroupMembers(int GroupID)
|
|
||||||
{
|
|
||||||
return (from a in FabApprovalDB.TrainingGroupMembers where a.TrainingGroupID == GroupID select a).ToList();
|
|
||||||
}
|
|
||||||
public void AddUserToGroup(int userId, int groupId)
|
|
||||||
{
|
|
||||||
UserAccountDMO userDB = new UserAccountDMO();
|
|
||||||
string userFullName = userDB.GetUserByID(userId).FullName;
|
|
||||||
|
|
||||||
TrainingGroupMember existing = null;
|
|
||||||
|
|
||||||
existing = (from a in FabApprovalDB.TrainingGroupMembers where a.TrainingGroupID == groupId && a.UserID == userId select a).FirstOrDefault();
|
|
||||||
if (existing == null)
|
|
||||||
{
|
|
||||||
var parameters = new DynamicParameters();
|
|
||||||
|
|
||||||
parameters = new DynamicParameters();
|
|
||||||
parameters.Add("@GroupID", groupId);
|
|
||||||
parameters.Add("@UserID", userId);
|
|
||||||
parameters.Add("@UserFullName", userFullName);
|
|
||||||
|
|
||||||
this.db.Execute("AddUserToTrainingGroup", parameters, commandType: CommandType.StoredProcedure);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
throw new Exception("The user already exists in this training group.");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//if (existing == null)
|
|
||||||
//{
|
|
||||||
// //string sql = new StringBuilder();
|
|
||||||
|
|
||||||
// string sql = "INSERT INTO TrainingGroupMembers (TrainingGroupID, UserID, FullName) " + "VALUES ('" + groupId + "','" + userId + "','" + userFullName + "') ";
|
|
||||||
|
|
||||||
// try
|
|
||||||
// {
|
|
||||||
// this.db.Open();
|
|
||||||
// this.db.Execute(sql);
|
|
||||||
// }
|
|
||||||
// catch(Exception e)
|
|
||||||
// {
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// return;
|
|
||||||
//}
|
|
||||||
//else
|
|
||||||
//{
|
|
||||||
// return;
|
|
||||||
|
|
||||||
}
|
|
||||||
public void DeleteFromGroup(int userId, int groupId)
|
|
||||||
{
|
|
||||||
var parameters = new DynamicParameters();
|
var parameters = new DynamicParameters();
|
||||||
|
|
||||||
parameters = new DynamicParameters();
|
parameters = new DynamicParameters();
|
||||||
parameters.Add("@GroupID", groupId);
|
parameters.Add("@GroupID", groupId);
|
||||||
parameters.Add("@UserID", userId);
|
parameters.Add("@UserID", userId);
|
||||||
|
parameters.Add("@UserFullName", userFullName);
|
||||||
|
|
||||||
this.db.Execute("DeleteUserFromTrainingGroup", parameters, commandType: CommandType.StoredProcedure);
|
this.db.Execute("AddUserToTrainingGroup", parameters, commandType: CommandType.StoredProcedure);
|
||||||
|
} else {
|
||||||
|
throw new Exception("The user already exists in this training group.");
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
|
||||||
|
//if (existing == null)
|
||||||
|
//{
|
||||||
|
// //string sql = new StringBuilder();
|
||||||
|
|
||||||
|
// string sql = "INSERT INTO TrainingGroupMembers (TrainingGroupID, UserID, FullName) " + "VALUES ('" + groupId + "','" + userId + "','" + userFullName + "') ";
|
||||||
|
|
||||||
|
// try
|
||||||
|
// {
|
||||||
|
// this.db.Open();
|
||||||
|
// this.db.Execute(sql);
|
||||||
|
// }
|
||||||
|
// catch(Exception e)
|
||||||
|
// {
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
// return;
|
||||||
|
//}
|
||||||
|
//else
|
||||||
|
//{
|
||||||
|
// return;
|
||||||
|
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
public void DeleteFromGroup(int userId, int groupId) {
|
||||||
|
DynamicParameters parameters = new();
|
||||||
|
|
||||||
|
parameters = new DynamicParameters();
|
||||||
|
parameters.Add("@GroupID", groupId);
|
||||||
|
parameters.Add("@UserID", userId);
|
||||||
|
|
||||||
|
db.Execute("DeleteUserFromTrainingGroup", parameters, commandType: CommandType.StoredProcedure);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void DeleteUser(UserAccountDMO userDMO, TrainingDMO trainingDMO, LoginModel loginModel) {
|
||||||
|
if (loginModel != null) {
|
||||||
|
userDMO.DeleteUser(loginModel);
|
||||||
|
//Remove open trainings
|
||||||
|
//Get a list of all user assigned trainings.
|
||||||
|
List<TrainingAssignment> trainingAssignments = trainingDMO.GetTrainingAssignmentsByUserID(loginModel.UserID);
|
||||||
|
|
||||||
|
//Go Through that list.
|
||||||
|
foreach (var trainingAssignment in trainingAssignments) {
|
||||||
|
//Delete Any document acknowledgements.
|
||||||
|
trainingDMO.DeleteTrainingDocAck(trainingAssignment.ID);
|
||||||
|
//Delete the training assignment itself
|
||||||
|
trainingDMO.DeleteTrainingAssignment(trainingAssignment.ID);
|
||||||
|
//Check the parent Training task to set to to complete if applicable.
|
||||||
|
if (trainingDMO.CheckTrainingStatus(trainingAssignment.ID)) {
|
||||||
|
int TrainingID = trainingAssignment.TrainingID;
|
||||||
|
//Set Training status to complete
|
||||||
|
trainingDMO.UpdateTrainingStatus(TrainingID);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//Remove user from any Training Groups
|
||||||
|
DeleteUserFromAllTrainingGroups(loginModel.UserID);
|
||||||
|
|
||||||
|
//Remove User from training report notifications
|
||||||
|
TrainingReportDeleteUser(loginModel.UserID);
|
||||||
|
//Remove user from TECN Expiration Notifications
|
||||||
|
TECNExpirationDeleteUser(loginModel.UserID);
|
||||||
|
//Get user subroles
|
||||||
|
List<UserSubRoles> userSubRoles = GetUserSubRoles(loginModel.UserID);
|
||||||
|
//Delete user from any subroles
|
||||||
|
foreach (var userSubRole in userSubRoles) {
|
||||||
|
DeleteUserRoles(userSubRole.SubRoleID, loginModel.UserID.ToString());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -1,33 +1,26 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Web;
|
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using System.Data.SqlClient;
|
using System.Data.SqlClient;
|
||||||
using Fab2ApprovalSystem.Models;
|
|
||||||
using Dapper;
|
using Dapper;
|
||||||
using System.Configuration;
|
|
||||||
using Fab2ApprovalSystem.Misc;
|
using Fab2ApprovalSystem.Misc;
|
||||||
|
using Fab2ApprovalSystem.Models;
|
||||||
|
|
||||||
namespace Fab2ApprovalSystem.DMO
|
namespace Fab2ApprovalSystem.DMO;
|
||||||
{
|
|
||||||
public static class ApprovalLogDMO
|
|
||||||
{
|
|
||||||
|
|
||||||
private static IDbConnection db = new SqlConnection(GlobalVars.DB_CONNECTION_STRING);
|
public static class ApprovalLogDMO {
|
||||||
|
|
||||||
public static void Add(ApprovalLog appLog)
|
private static readonly IDbConnection db = new SqlConnection(GlobalVars.DB_CONNECTION_STRING);
|
||||||
{
|
|
||||||
var parameters = new DynamicParameters();
|
|
||||||
parameters.Add("@IssueID", appLog.IssueID);
|
|
||||||
parameters.Add("@UserID", appLog.UserID);
|
|
||||||
parameters.Add("@OperationType", appLog.OperationType);
|
|
||||||
parameters.Add("@SubRoleID", appLog.SubRoleID);
|
|
||||||
parameters.Add("@OperationLog", appLog.OperationLog);
|
|
||||||
parameters.Add("@DocumentTypeID", appLog.DocumentTypeID);
|
|
||||||
|
|
||||||
db.Execute("InsertApprovalLogByDocument", parameters, commandType: CommandType.StoredProcedure);
|
public static void Add(ApprovalLog appLog) {
|
||||||
|
DynamicParameters parameters = new();
|
||||||
|
parameters.Add("@IssueID", appLog.IssueID);
|
||||||
|
parameters.Add("@UserID", appLog.UserID);
|
||||||
|
parameters.Add("@OperationType", appLog.OperationType);
|
||||||
|
parameters.Add("@SubRoleID", appLog.SubRoleID);
|
||||||
|
parameters.Add("@OperationLog", appLog.OperationLog);
|
||||||
|
parameters.Add("@DocumentTypeID", appLog.DocumentTypeID);
|
||||||
|
|
||||||
}
|
db.Execute("InsertApprovalLogByDocument", parameters, commandType: CommandType.StoredProcedure);
|
||||||
}
|
}
|
||||||
}
|
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,41 +1,24 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Web;
|
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using System.Data.SqlClient;
|
using System.Data.SqlClient;
|
||||||
using Fab2ApprovalSystem.Models;
|
|
||||||
using Dapper;
|
using Dapper;
|
||||||
using System.Configuration;
|
|
||||||
using Fab2ApprovalSystem.Misc;
|
using Fab2ApprovalSystem.Misc;
|
||||||
|
using Fab2ApprovalSystem.Models;
|
||||||
|
|
||||||
namespace Fab2ApprovalSystem.DMO
|
namespace Fab2ApprovalSystem.DMO;
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public static class ECNTypeChangeLogDMO
|
|
||||||
{
|
|
||||||
private static IDbConnection db = new SqlConnection(GlobalVars.DB_CONNECTION_STRING);
|
|
||||||
|
|
||||||
/// <summary>
|
public static class ECNTypeChangeLogDMO {
|
||||||
///
|
private static readonly IDbConnection db = new SqlConnection(GlobalVars.DB_CONNECTION_STRING);
|
||||||
/// </summary>
|
|
||||||
/// <param name="changeLog"></param>
|
|
||||||
public static void Add(ECNTypeChangeLog changeLog)
|
|
||||||
{
|
|
||||||
|
|
||||||
var parameters = new DynamicParameters();
|
public static void Add(ECNTypeChangeLog changeLog) {
|
||||||
parameters.Add("@ECNNumber", changeLog.ECNNumber);
|
DynamicParameters parameters = new();
|
||||||
parameters.Add("@UserID", changeLog.UserID);
|
parameters.Add("@ECNNumber", changeLog.ECNNumber);
|
||||||
parameters.Add("@ECNTypeFrom", changeLog.ECNTypeFrom);
|
parameters.Add("@UserID", changeLog.UserID);
|
||||||
parameters.Add("@ECNTypeTo", changeLog.ECNTypeTo);
|
parameters.Add("@ECNTypeFrom", changeLog.ECNTypeFrom);
|
||||||
|
parameters.Add("@ECNTypeTo", changeLog.ECNTypeTo);
|
||||||
db.Execute("ECNInsertECNTypeChangeLog", parameters, commandType: CommandType.StoredProcedure);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
db.Execute("ECNInsertECNTypeChangeLog", parameters, commandType: CommandType.StoredProcedure);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
File diff suppressed because it is too large
Load Diff
@ -1,51 +1,25 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Configuration;
|
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using System.Data.SqlClient;
|
using System.Data.SqlClient;
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Web;
|
|
||||||
using Fab2ApprovalSystem.Models;
|
|
||||||
using Dapper;
|
using Dapper;
|
||||||
using System.Transactions;
|
|
||||||
using Fab2ApprovalSystem.ViewModels;
|
|
||||||
using System.Reflection;
|
|
||||||
using Fab2ApprovalSystem.Misc;
|
using Fab2ApprovalSystem.Misc;
|
||||||
|
using Fab2ApprovalSystem.Models;
|
||||||
|
|
||||||
namespace Fab2ApprovalSystem.DMO
|
namespace Fab2ApprovalSystem.DMO;
|
||||||
{
|
|
||||||
|
|
||||||
public static class EventLogDMO
|
public static class EventLogDMO {
|
||||||
{
|
private static readonly IDbConnection db = new SqlConnection(GlobalVars.DB_CONNECTION_STRING);
|
||||||
private static IDbConnection db = new SqlConnection(GlobalVars.DB_CONNECTION_STRING);
|
|
||||||
|
|
||||||
//public static void Add(WinEventLog eventLog)
|
|
||||||
//{
|
|
||||||
// var parameters = new DynamicParameters();
|
|
||||||
// parameters.Add("@IssueID", eventLog.IssueID);
|
|
||||||
// parameters.Add("@UserID", eventLog.UserID);
|
|
||||||
// parameters.Add("@OperationType", eventLog.OperationType);
|
|
||||||
// parameters.Add("@Comments", eventLog.Comments);
|
|
||||||
|
|
||||||
// db.Execute("InsertEventLog", parameters, commandType: CommandType.StoredProcedure);
|
|
||||||
|
|
||||||
//}
|
|
||||||
|
|
||||||
|
|
||||||
public static void Add(WinEventLog eventLog)
|
|
||||||
{
|
|
||||||
var parameters = new DynamicParameters();
|
|
||||||
parameters.Add("@IssueID", eventLog.IssueID);
|
|
||||||
parameters.Add("@UserID", eventLog.UserID);
|
|
||||||
parameters.Add("@DocumentType", eventLog.DocumentType);
|
|
||||||
parameters.Add("@OperationType", eventLog.OperationType);
|
|
||||||
parameters.Add("@Comments", eventLog.Comments);
|
|
||||||
|
|
||||||
db.Execute("InsertEventLogByDocument", parameters, commandType: CommandType.StoredProcedure);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
public static void Add(WinEventLog eventLog) {
|
||||||
|
DynamicParameters parameters = new();
|
||||||
|
parameters.Add("@IssueID", eventLog.IssueID);
|
||||||
|
parameters.Add("@UserID", eventLog.UserID);
|
||||||
|
parameters.Add("@DocumentType", eventLog.DocumentType);
|
||||||
|
parameters.Add("@OperationType", eventLog.OperationType);
|
||||||
|
parameters.Add("@Comments", eventLog.Comments);
|
||||||
|
|
||||||
|
db.Execute("InsertEventLogByDocument", parameters, commandType: CommandType.StoredProcedure);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,129 +1,141 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Configuration;
|
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using System.Data.SqlClient;
|
using System.Data.SqlClient;
|
||||||
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Web;
|
|
||||||
using Fab2ApprovalSystem.Models;
|
|
||||||
using Dapper;
|
using Dapper;
|
||||||
using System.Transactions;
|
|
||||||
using Fab2ApprovalSystem.Misc;
|
using Fab2ApprovalSystem.Misc;
|
||||||
|
using Fab2ApprovalSystem.Models;
|
||||||
|
|
||||||
namespace Fab2ApprovalSystem.DMO
|
namespace Fab2ApprovalSystem.DMO;
|
||||||
{
|
|
||||||
public class PartsRequestDMO
|
|
||||||
{
|
|
||||||
private IDbConnection db = new SqlConnection(GlobalVars.DB_CONNECTION_STRING);
|
|
||||||
|
|
||||||
WorkflowDMO wfDMO = new WorkflowDMO();
|
public class PartsRequestDMO {
|
||||||
|
|
||||||
public IEnumerable<PartsRequestList> GetPartsRequestList()
|
private readonly AppSettings _AppSettings;
|
||||||
{
|
private readonly IDbConnection db = new SqlConnection(GlobalVars.DB_CONNECTION_STRING);
|
||||||
var r = this.db.Query<PartsRequestList>("PartsRequestGetList", commandType: CommandType.StoredProcedure).ToList();
|
|
||||||
return r;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Insert(PartsRequest pr)
|
public PartsRequestDMO(AppSettings appSettings) =>
|
||||||
{
|
_AppSettings = appSettings;
|
||||||
var parameters = new DynamicParameters();
|
|
||||||
parameters.Add("@PRNumber", value: pr.PRNumber, dbType: DbType.Int32, direction: ParameterDirection.InputOutput);
|
|
||||||
parameters.Add("@OriginatorID", pr.OriginatorID);
|
|
||||||
|
|
||||||
this.db.Execute("PartsRequestInsert", parameters, commandType: CommandType.StoredProcedure);
|
|
||||||
|
|
||||||
pr.PRNumber = parameters.Get<int>("@PRNumber");
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Update(PartsRequest pr)
|
|
||||||
{
|
|
||||||
var parameters = new DynamicParameters();
|
|
||||||
parameters.Add("@PRNumber", pr.PRNumber);
|
|
||||||
parameters.Add("@Title", pr.Title);
|
|
||||||
parameters.Add("@RequestorID", pr.RequestorID);
|
|
||||||
parameters.Add("@TechLeadID", pr.TechLeadID);
|
|
||||||
parameters.Add("@Description", pr.Description);
|
|
||||||
|
|
||||||
this.db.Execute("PartsRequestUpdate", parameters, commandType: CommandType.StoredProcedure);
|
|
||||||
}
|
|
||||||
|
|
||||||
public PartsRequest Get(int PRNumber)
|
|
||||||
{
|
|
||||||
var parameters = new DynamicParameters();
|
|
||||||
parameters.Add("@PRNumber", value: PRNumber, dbType: DbType.Int32);
|
|
||||||
|
|
||||||
return this.db.Query<PartsRequest>("PartsRequestGet", parameters, commandType: CommandType.StoredProcedure).SingleOrDefault();
|
|
||||||
}
|
|
||||||
|
|
||||||
public IEnumerable<PartsRequestAttachmentList> GetAttachments(int prNumber)
|
|
||||||
{
|
|
||||||
var attachments = this.db.Query<PartsRequestAttachmentList>(
|
|
||||||
"SELECT AttachmentID, PRNumber, FileName, A.UserID, UploadDate, U.FirstName + ' ' + U.LastName AS FullName " +
|
|
||||||
"FROM PartsRequestAttachment A " +
|
|
||||||
"INNER JOIN Users U ON U.UserID = A.UserID " +
|
|
||||||
"WHERE PRNumber = @PRNumber",
|
|
||||||
new { PRNumber = prNumber }).ToList();
|
|
||||||
return attachments;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void InsertAttachment(PartsRequestAttachment attach)
|
|
||||||
{
|
|
||||||
var parameters = new DynamicParameters();
|
|
||||||
parameters.Add("@PRNumber", attach.PRNumber);
|
|
||||||
parameters.Add("@UserID", attach.UserID);
|
|
||||||
parameters.Add("@FileName", attach.FileName);
|
|
||||||
|
|
||||||
this.db.Execute("PartsRequestInsertAttachment", parameters, commandType: CommandType.StoredProcedure);
|
|
||||||
}
|
|
||||||
|
|
||||||
public string GetFileName(string attachmentID)
|
|
||||||
{
|
|
||||||
var parameters = new DynamicParameters();
|
|
||||||
parameters.Add("@AttachmentID", attachmentID);
|
|
||||||
var fileName = this.db.Query<string>("PartsRequestGetAttachmentFileName", parameters, commandType: CommandType.StoredProcedure).Single();
|
|
||||||
return fileName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void DeleteAttachment(int attachmentID)
|
|
||||||
{
|
|
||||||
var parameters = new DynamicParameters();
|
|
||||||
parameters.Add("@AttachmentID", attachmentID);
|
|
||||||
this.db.Execute("PartsRequestDeleteAttachment", parameters, commandType: CommandType.StoredProcedure);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Submit(int prNumber, int userID)
|
|
||||||
{
|
|
||||||
var parameters = new DynamicParameters();
|
|
||||||
parameters.Add("@PRNumber", prNumber);
|
|
||||||
parameters.Add("@UserID", userID);
|
|
||||||
this.db.Execute("PartsRequestSubmitForApproval", parameters, commandType: CommandType.StoredProcedure );
|
|
||||||
}
|
|
||||||
|
|
||||||
public IEnumerable<ApprovalLogHistory> GetApprovalLogHistory(int prNumber)
|
|
||||||
{
|
|
||||||
var parameters = new DynamicParameters();
|
|
||||||
parameters.Add("@PRNumber", prNumber);
|
|
||||||
var approverList = this.db.Query<ApprovalLogHistory>("PartsRequestGetApprovalLogHistory", parameters, commandType: CommandType.StoredProcedure).ToList();
|
|
||||||
return approverList;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IEnumerable<MyPartsRequestList> GetMyPartsRequests(int userID)
|
|
||||||
{
|
|
||||||
var parameters = new DynamicParameters();
|
|
||||||
parameters.Add("@UserID", userID);
|
|
||||||
|
|
||||||
var r = this.db.Query<MyPartsRequestList>("PartsRequestGetListByUser", parameters, commandType: CommandType.StoredProcedure);
|
|
||||||
return r.ToList();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void DeleteDocument(int prNumber, int userid)
|
|
||||||
{
|
|
||||||
var parameters = new DynamicParameters();
|
|
||||||
parameters.Add("@UserID", userid);
|
|
||||||
parameters.Add("@PRNumber", prNumber);
|
|
||||||
|
|
||||||
this.db.Execute("PartsRequestDelete", parameters, commandType: CommandType.StoredProcedure);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
public IEnumerable<PartsRequestList> GetPartsRequestList() {
|
||||||
|
List<PartsRequestList> r = db.Query<PartsRequestList>("PartsRequestGetList", commandType: CommandType.StoredProcedure).ToList();
|
||||||
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Insert(PartsRequest pr) {
|
||||||
|
DynamicParameters parameters = new();
|
||||||
|
parameters.Add("@PRNumber", value: pr.PRNumber, dbType: DbType.Int32, direction: ParameterDirection.InputOutput);
|
||||||
|
parameters.Add("@OriginatorID", pr.OriginatorID);
|
||||||
|
|
||||||
|
db.Execute("PartsRequestInsert", parameters, commandType: CommandType.StoredProcedure);
|
||||||
|
|
||||||
|
pr.PRNumber = parameters.Get<int>("@PRNumber");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Update(PartsRequest pr) {
|
||||||
|
DynamicParameters parameters = new();
|
||||||
|
parameters.Add("@PRNumber", pr.PRNumber);
|
||||||
|
parameters.Add("@Title", pr.Title);
|
||||||
|
parameters.Add("@RequestorID", pr.RequestorID);
|
||||||
|
parameters.Add("@TechLeadID", pr.TechLeadID);
|
||||||
|
parameters.Add("@Description", pr.Description);
|
||||||
|
|
||||||
|
db.Execute("PartsRequestUpdate", parameters, commandType: CommandType.StoredProcedure);
|
||||||
|
}
|
||||||
|
|
||||||
|
public PartsRequest Get(int PRNumber) {
|
||||||
|
DynamicParameters parameters = new();
|
||||||
|
parameters.Add("@PRNumber", value: PRNumber, dbType: DbType.Int32);
|
||||||
|
|
||||||
|
return db.Query<PartsRequest>("PartsRequestGet", parameters, commandType: CommandType.StoredProcedure).SingleOrDefault();
|
||||||
|
}
|
||||||
|
|
||||||
|
public IEnumerable<PartsRequestAttachmentList> GetAttachments(int prNumber) {
|
||||||
|
List<PartsRequestAttachmentList> attachments = db.Query<PartsRequestAttachmentList>(
|
||||||
|
"SELECT AttachmentID, PRNumber, FileName, A.UserID, UploadDate, U.FirstName + ' ' + U.LastName AS FullName " +
|
||||||
|
"FROM PartsRequestAttachment A " +
|
||||||
|
"INNER JOIN Users U ON U.UserID = A.UserID " +
|
||||||
|
"WHERE PRNumber = @PRNumber",
|
||||||
|
new { PRNumber = prNumber }).ToList();
|
||||||
|
return attachments;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void InsertAttachment(PartsRequestAttachment attach) {
|
||||||
|
DynamicParameters parameters = new();
|
||||||
|
parameters.Add("@PRNumber", attach.PRNumber);
|
||||||
|
parameters.Add("@UserID", attach.UserID);
|
||||||
|
parameters.Add("@FileName", attach.FileName);
|
||||||
|
|
||||||
|
db.Execute("PartsRequestInsertAttachment", parameters, commandType: CommandType.StoredProcedure);
|
||||||
|
}
|
||||||
|
|
||||||
|
public string GetFileName(string attachmentID) {
|
||||||
|
DynamicParameters parameters = new();
|
||||||
|
parameters.Add("@AttachmentID", attachmentID);
|
||||||
|
var fileName = db.Query<string>("PartsRequestGetAttachmentFileName", parameters, commandType: CommandType.StoredProcedure).Single();
|
||||||
|
return fileName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void DeleteAttachment(int attachmentID) {
|
||||||
|
DynamicParameters parameters = new();
|
||||||
|
parameters.Add("@AttachmentID", attachmentID);
|
||||||
|
db.Execute("PartsRequestDeleteAttachment", parameters, commandType: CommandType.StoredProcedure);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Submit(int prNumber, int userID) {
|
||||||
|
DynamicParameters parameters = new();
|
||||||
|
parameters.Add("@PRNumber", prNumber);
|
||||||
|
parameters.Add("@UserID", userID);
|
||||||
|
db.Execute("PartsRequestSubmitForApproval", parameters, commandType: CommandType.StoredProcedure);
|
||||||
|
}
|
||||||
|
|
||||||
|
public IEnumerable<ApprovalLogHistory> GetApprovalLogHistory(int prNumber) {
|
||||||
|
DynamicParameters parameters = new();
|
||||||
|
parameters.Add("@PRNumber", prNumber);
|
||||||
|
List<ApprovalLogHistory> approverList = db.Query<ApprovalLogHistory>("PartsRequestGetApprovalLogHistory", parameters, commandType: CommandType.StoredProcedure).ToList();
|
||||||
|
return approverList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public IEnumerable<MyPartsRequestList> GetMyPartsRequests(int userID) {
|
||||||
|
DynamicParameters parameters = new();
|
||||||
|
parameters.Add("@UserID", userID);
|
||||||
|
|
||||||
|
IEnumerable<MyPartsRequestList> r = db.Query<MyPartsRequestList>("PartsRequestGetListByUser", parameters, commandType: CommandType.StoredProcedure);
|
||||||
|
return r.ToList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void DeleteDocument(int prNumber, int userid) {
|
||||||
|
DynamicParameters parameters = new();
|
||||||
|
parameters.Add("@UserID", userid);
|
||||||
|
parameters.Add("@PRNumber", prNumber);
|
||||||
|
|
||||||
|
db.Execute("PartsRequestDelete", parameters, commandType: CommandType.StoredProcedure);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AttachSave(int prNumber, int userId, string fullFileName, Stream stream) {
|
||||||
|
// Some browsers send file names with full path.
|
||||||
|
// We are only interested in the file name.
|
||||||
|
var fileName = Path.GetFileName(fullFileName);
|
||||||
|
|
||||||
|
string prFolderPath = _AppSettings.AttachmentFolder + "PartsRequest\\" + prNumber.ToString();
|
||||||
|
|
||||||
|
DirectoryInfo di = new(prFolderPath);
|
||||||
|
if (!di.Exists)
|
||||||
|
di.Create();
|
||||||
|
|
||||||
|
var physicalPath = Path.Combine(prFolderPath, fileName);
|
||||||
|
|
||||||
|
using (FileStream fileStream = new(physicalPath, FileMode.Create, FileAccess.Write)) {
|
||||||
|
stream.CopyTo(fileStream);
|
||||||
|
}
|
||||||
|
PartsRequestAttachment attach = new() {
|
||||||
|
PRNumber = prNumber,
|
||||||
|
FileName = fileName,
|
||||||
|
UserID = userId,
|
||||||
|
};
|
||||||
|
InsertAttachment(attach);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -1,29 +1,20 @@
|
|||||||
using System;
|
using System.Configuration;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Configuration;
|
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using System.Data.SqlClient;
|
using System.Data.SqlClient;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Web;
|
|
||||||
using Dapper;
|
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace Fab2ApprovalSystem.DMO
|
using Dapper;
|
||||||
{
|
|
||||||
public class SAM_DMO
|
|
||||||
{
|
|
||||||
private IDbConnection db = new SqlConnection(ConfigurationManager.ConnectionStrings["SAMDBConnectionString"].ConnectionString);
|
|
||||||
|
|
||||||
|
namespace Fab2ApprovalSystem.DMO;
|
||||||
|
|
||||||
public int HasITARAccess(string userID)
|
public class SAM_DMO {
|
||||||
{
|
private readonly IDbConnection db = new SqlConnection(ConfigurationManager.ConnectionStrings["SAMDBConnectionString"].ConnectionString);
|
||||||
|
|
||||||
StringBuilder query = new StringBuilder("SELECT COUNT(*) FROM dbo.fnIsUserITARCompliant(@UserID) ");
|
|
||||||
//query.Append("WHERE UserID = @UserID AND AND EmployeeStatus = 'Active'");
|
|
||||||
return this.db.Query<int>(query.ToString(), new { UserID = userID }).SingleOrDefault();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
public int HasITARAccess(string userID) {
|
||||||
|
StringBuilder query = new("SELECT COUNT(*) FROM dbo.fnIsUserITARCompliant(@UserID) ");
|
||||||
|
//query.Append("WHERE UserID = @UserID AND AND EmployeeStatus = 'Active'");
|
||||||
|
return db.Query<int>(query.ToString(), new { UserID = userID }).SingleOrDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -1,479 +1,538 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Configuration;
|
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using System.Data.SqlClient;
|
using System.Data.SqlClient;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Web;
|
|
||||||
using Dapper;
|
using Dapper;
|
||||||
using Fab2ApprovalSystem.Models;
|
|
||||||
using System.Text;
|
|
||||||
using Fab2ApprovalSystem.Misc;
|
using Fab2ApprovalSystem.Misc;
|
||||||
|
using Fab2ApprovalSystem.Models;
|
||||||
|
|
||||||
namespace Fab2ApprovalSystem.DMO
|
namespace Fab2ApprovalSystem.DMO;
|
||||||
{
|
|
||||||
public class TrainingDMO
|
|
||||||
{
|
|
||||||
private IDbConnection db = new SqlConnection(GlobalVars.DB_CONNECTION_STRING);
|
|
||||||
private static FabApprovalTrainingEntities FabApprovalDB = new FabApprovalTrainingEntities();
|
|
||||||
|
|
||||||
public int Create(int issueId)
|
public class TrainingDMO {
|
||||||
{
|
private readonly IDbConnection db = new SqlConnection(GlobalVars.DB_CONNECTION_STRING);
|
||||||
var parameters = new DynamicParameters();
|
#if !NET8
|
||||||
|
private static FabApprovalTrainingEntities FabApprovalDB = new FabApprovalTrainingEntities();
|
||||||
|
#endif
|
||||||
|
|
||||||
parameters = new DynamicParameters();
|
public int Create(int issueId) {
|
||||||
parameters.Add("@TrainingId", dbType: DbType.Int32, direction: ParameterDirection.InputOutput);
|
DynamicParameters parameters = new();
|
||||||
parameters.Add("@ECNNumber", issueId);
|
|
||||||
|
|
||||||
this.db.Execute("InsertTrainingItem", parameters, commandType: CommandType.StoredProcedure);
|
parameters = new DynamicParameters();
|
||||||
int trainingId = parameters.Get<int>("@TrainingId");
|
parameters.Add("@TrainingId", dbType: DbType.Int32, direction: ParameterDirection.InputOutput);
|
||||||
|
parameters.Add("@ECNNumber", issueId);
|
||||||
|
|
||||||
return trainingId;
|
db.Execute("InsertTrainingItem", parameters, commandType: CommandType.StoredProcedure);
|
||||||
|
int trainingId = parameters.Get<int>("@TrainingId");
|
||||||
|
|
||||||
|
return trainingId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int CreateAssignment(int trainingId, int userId) {
|
||||||
|
DynamicParameters parameters = new();
|
||||||
|
|
||||||
|
parameters = new DynamicParameters();
|
||||||
|
//parameters.Add("@TrainingId", dbType: DbType.Int32, direction: ParameterDirection.InputOutput);
|
||||||
|
parameters.Add("@TrainingID", trainingId);
|
||||||
|
parameters.Add("@UserID", userId);
|
||||||
|
parameters.Add("@AssignmentID", dbType: DbType.Int32, direction: ParameterDirection.InputOutput);
|
||||||
|
|
||||||
|
db.Execute("InsertTrainingAssignment", parameters, commandType: CommandType.StoredProcedure);
|
||||||
|
int assignmentId = parameters.Get<int>("@AssignmentID");
|
||||||
|
|
||||||
|
return assignmentId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public IEnumerable<Training> GetAllTrainings() {
|
||||||
|
#if !NET8
|
||||||
|
FabApprovalTrainingEntities db = new FabApprovalTrainingEntities();
|
||||||
|
IEnumerable<Training> allTrainings = (from a in db.Trainings select a).ToList();
|
||||||
|
|
||||||
|
return allTrainings;
|
||||||
|
#else
|
||||||
|
throw new NotImplementedException();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
public Training GetTraining(int trainingId) {
|
||||||
|
#if !NET8
|
||||||
|
FabApprovalTrainingEntities db = new FabApprovalTrainingEntities();
|
||||||
|
Training trainingRecord = new Training();
|
||||||
|
trainingRecord = (from a in db.Trainings where a.TrainingID == trainingId select a).FirstOrDefault();
|
||||||
|
return trainingRecord;
|
||||||
|
#else
|
||||||
|
throw new NotImplementedException();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
public TrainingAssignment GetAssignment(int assignmentId) {
|
||||||
|
#if !NET8
|
||||||
|
FabApprovalTrainingEntities db = new FabApprovalTrainingEntities();
|
||||||
|
TrainingAssignment assignmentRecord = (from a in db.TrainingAssignments where a.ID == assignmentId select a).FirstOrDefault();
|
||||||
|
return assignmentRecord;
|
||||||
|
#else
|
||||||
|
throw new NotImplementedException();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
public int GetTrainingId(int issueId) {
|
||||||
|
#if !NET8
|
||||||
|
FabApprovalTrainingEntities db = new FabApprovalTrainingEntities();
|
||||||
|
int ECNId = issueId;
|
||||||
|
int trainingId = (from a in db.Trainings where a.ECN == ECNId select a.TrainingID).FirstOrDefault();
|
||||||
|
|
||||||
|
return trainingId;
|
||||||
|
#else
|
||||||
|
throw new NotImplementedException();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<int> GetTrainees(int groupId) {
|
||||||
|
#if !NET8
|
||||||
|
FabApprovalTrainingEntities db = new FabApprovalTrainingEntities();
|
||||||
|
var users = (from a in db.TrainingGroupMembers where a.TrainingGroupID == groupId select a.UserID).ToList();
|
||||||
|
|
||||||
|
return users;
|
||||||
|
#else
|
||||||
|
throw new NotImplementedException();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool isUserTrainingMember(int groupId, int userId) {
|
||||||
|
#if !NET8
|
||||||
|
FabApprovalTrainingEntities db = new FabApprovalTrainingEntities();
|
||||||
|
var users = (from a in db.TrainingGroupMembers where a.TrainingGroupID == groupId && a.UserID == userId select a).FirstOrDefault();
|
||||||
|
|
||||||
|
if (users == null) {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
public int CreateAssignment(int trainingId, int userId)
|
#else
|
||||||
{
|
throw new NotImplementedException();
|
||||||
var parameters = new DynamicParameters();
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
parameters = new DynamicParameters();
|
public List<TrainingGroup> GetTrainingGroups() {
|
||||||
//parameters.Add("@TrainingId", dbType: DbType.Int32, direction: ParameterDirection.InputOutput);
|
#if !NET8
|
||||||
parameters.Add("@TrainingID", trainingId);
|
FabApprovalTrainingEntities db = new FabApprovalTrainingEntities();
|
||||||
parameters.Add("@UserID", userId);
|
return (from a in db.TrainingGroups select a).ToList();
|
||||||
parameters.Add("@AssignmentID", dbType: DbType.Int32, direction: ParameterDirection.InputOutput);
|
#else
|
||||||
|
throw new NotImplementedException();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
this.db.Execute("InsertTrainingAssignment", parameters, commandType: CommandType.StoredProcedure);
|
public TrainingGroup GetTrainingGroupByID(int groupId) {
|
||||||
int assignmentId = parameters.Get<int>("@AssignmentID");
|
#if !NET8
|
||||||
|
FabApprovalTrainingEntities db = new FabApprovalTrainingEntities();
|
||||||
|
TrainingGroup groups = (from a in db.TrainingGroups where a.TrainingGroupID == groupId select a).FirstOrDefault();
|
||||||
|
return groups;
|
||||||
|
#else
|
||||||
|
throw new NotImplementedException();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
return assignmentId;
|
public List<int> GetECNAssignedTrainingGroups(int ECNNumber) {
|
||||||
|
#if !NET8
|
||||||
|
List<int> trainingGroups = (from a in FabApprovalDB.ECNTrainingBies where a.ECNNumber == ECNNumber select a.AcknowledgementTrainingByID).ToList();
|
||||||
|
|
||||||
|
return trainingGroups;
|
||||||
|
#else
|
||||||
|
throw new NotImplementedException();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AddTrainingGroupToECN(int ECNNumber, int groupId) {
|
||||||
|
#if !NET8
|
||||||
|
FabApprovalTrainingEntities db = new FabApprovalTrainingEntities();
|
||||||
|
//ECNTrainingBy ecnTraining = new ECNTrainingBy();
|
||||||
|
//ecnTraining.AcknowledgementTrainingByID = groupId;
|
||||||
|
//ecnTraining.ECNNumber = ECNNumber;
|
||||||
|
|
||||||
|
var parameters = new DynamicParameters();
|
||||||
|
parameters.Add("@ECNNumber", ECNNumber);
|
||||||
|
parameters.Add("@TrainingByID", groupId);
|
||||||
|
|
||||||
|
this.db.Execute("ECNInsertTrainingBy", parameters, commandType: CommandType.StoredProcedure);
|
||||||
|
|
||||||
|
//db.ECNTrainingBies.Add(ecnTraining);
|
||||||
|
#else
|
||||||
|
throw new NotImplementedException();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetTrainingFlag(int ECNNumber) {
|
||||||
|
#if !NET8
|
||||||
|
FabApprovalTrainingEntities db = new FabApprovalTrainingEntities();
|
||||||
|
//ECNTrainingBy ecnTraining = new ECNTrainingBy();
|
||||||
|
//ecnTraining.AcknowledgementTrainingByID = groupId;
|
||||||
|
//ecnTraining.ECNNumber = ECNNumber;
|
||||||
|
|
||||||
|
var parameters = new DynamicParameters();
|
||||||
|
parameters.Add("@ECNNumber", ECNNumber);
|
||||||
|
|
||||||
|
this.db.Execute("ECNSetTrainingFlag", parameters, commandType: CommandType.StoredProcedure);
|
||||||
|
|
||||||
|
//db.ECNTrainingBies.Add(ecnTraining);
|
||||||
|
#else
|
||||||
|
throw new NotImplementedException();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<TrainingAssignment> GetAllTrainingAssignments(int TrainingID) {
|
||||||
|
#if !NET8
|
||||||
|
FabApprovalTrainingEntities db = new FabApprovalTrainingEntities();
|
||||||
|
var TrainingData = from a in db.TrainingAssignments where a.TrainingID == TrainingID select a;
|
||||||
|
|
||||||
|
RefreshTrainingData(TrainingID, TrainingData);
|
||||||
|
|
||||||
|
TrainingData = from a in db.TrainingAssignments where a.TrainingID == TrainingID select a;
|
||||||
|
|
||||||
|
return TrainingData.ToList();
|
||||||
|
#else
|
||||||
|
throw new NotImplementedException();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<TrainingAssignment> GetTrainingAssignments(int TrainingID) {
|
||||||
|
#if !NET8
|
||||||
|
FabApprovalTrainingEntities db = new FabApprovalTrainingEntities();
|
||||||
|
var TrainingData = from a in db.TrainingAssignments where a.TrainingID == TrainingID && a.Deleted != true select a;
|
||||||
|
|
||||||
|
RefreshTrainingData(TrainingID, TrainingData);
|
||||||
|
|
||||||
|
TrainingData = from a in db.TrainingAssignments where a.TrainingID == TrainingID select a;
|
||||||
|
|
||||||
|
return TrainingData.ToList();
|
||||||
|
#else
|
||||||
|
throw new NotImplementedException();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<TrainingAssignment> GetTrainingAssignmentsByUser(int TrainingID, int userID) {
|
||||||
|
#if !NET8
|
||||||
|
FabApprovalTrainingEntities db = new FabApprovalTrainingEntities();
|
||||||
|
var TrainingData = from a in db.TrainingAssignments where a.TrainingID == TrainingID && a.UserID == userID select a;
|
||||||
|
|
||||||
|
return TrainingData.ToList();
|
||||||
|
#else
|
||||||
|
throw new NotImplementedException();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<TrainingDocAck> GetAssignedDocs(int trainingAssignmentId) {
|
||||||
|
#if !NET8
|
||||||
|
FabApprovalTrainingEntities db = new FabApprovalTrainingEntities();
|
||||||
|
var docs = (from a in db.TrainingDocAcks where a.TrainingAssignmentID == trainingAssignmentId && a.Deleted != true select a).ToList();
|
||||||
|
|
||||||
|
return docs;
|
||||||
|
#else
|
||||||
|
throw new NotImplementedException();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AcknowledgeDocument(int trainingDocAckID) {
|
||||||
|
DynamicParameters parameters = new();
|
||||||
|
|
||||||
|
parameters = new DynamicParameters();
|
||||||
|
parameters.Add("@TrainingDocAckID", trainingDocAckID);
|
||||||
|
//parameters.Add("@AttachmentID", attachmentID);
|
||||||
|
|
||||||
|
db.Execute("TrainingAcknowledgeDocument", parameters, commandType: CommandType.StoredProcedure);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UpdateAssignmentStatus(int trainingAssignmentID) {
|
||||||
|
#if !NET8
|
||||||
|
FabApprovalTrainingEntities db = new FabApprovalTrainingEntities();
|
||||||
|
var RecordToUpdate = (from a in db.TrainingAssignments where a.ID == trainingAssignmentID select a).SingleOrDefault();
|
||||||
|
if (RecordToUpdate.status != true) {
|
||||||
|
RecordToUpdate.DateCompleted = DateTime.Now;
|
||||||
|
RecordToUpdate.status = true;
|
||||||
|
try {
|
||||||
|
db.SaveChanges();
|
||||||
|
} catch (InvalidOperationException e) {
|
||||||
|
string exception = e.ToString();
|
||||||
|
Console.WriteLine(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
public IEnumerable<Training> GetAllTrainings()
|
#else
|
||||||
{
|
throw new NotImplementedException();
|
||||||
FabApprovalTrainingEntities db = new FabApprovalTrainingEntities();
|
#endif
|
||||||
IEnumerable<Training> allTrainings = (from a in db.Trainings select a).ToList();
|
}
|
||||||
|
|
||||||
return allTrainings;
|
public int GetTrainingIdByAssignment(int trainingAssignmentID) {
|
||||||
}
|
#if !NET8
|
||||||
public Training GetTraining(int trainingId)
|
FabApprovalTrainingEntities db = new FabApprovalTrainingEntities();
|
||||||
{
|
int trainingID = (from a in db.TrainingAssignments where a.ID == trainingAssignmentID select a.TrainingID).SingleOrDefault();
|
||||||
FabApprovalTrainingEntities db = new FabApprovalTrainingEntities();
|
|
||||||
Training trainingRecord = new Training();
|
|
||||||
trainingRecord = (from a in db.Trainings where a.TrainingID == trainingId select a).FirstOrDefault();
|
|
||||||
return trainingRecord;
|
|
||||||
}
|
|
||||||
public TrainingAssignment GetAssignment(int assignmentId)
|
|
||||||
{
|
|
||||||
FabApprovalTrainingEntities db = new FabApprovalTrainingEntities();
|
|
||||||
TrainingAssignment assignmentRecord = (from a in db.TrainingAssignments where a.ID == assignmentId select a).FirstOrDefault();
|
|
||||||
return assignmentRecord;
|
|
||||||
}
|
|
||||||
public int GetTrainingId(int issueId)
|
|
||||||
{
|
|
||||||
FabApprovalTrainingEntities db = new FabApprovalTrainingEntities();
|
|
||||||
int ECNId = issueId;
|
|
||||||
int trainingId = (from a in db.Trainings where a.ECN == ECNId select a.TrainingID).FirstOrDefault();
|
|
||||||
|
|
||||||
return trainingId;
|
return trainingID;
|
||||||
}
|
#else
|
||||||
public List<int> GetTrainees(int groupId)
|
throw new NotImplementedException();
|
||||||
{
|
#endif
|
||||||
FabApprovalTrainingEntities db = new FabApprovalTrainingEntities();
|
}
|
||||||
var users = (from a in db.TrainingGroupMembers where a.TrainingGroupID == groupId select a.UserID).ToList();
|
|
||||||
|
|
||||||
return users;
|
public void UpdateTrainingStatus(int trainingId) {
|
||||||
}
|
#if !NET8
|
||||||
public bool isUserTrainingMember(int groupId, int userId)
|
FabApprovalTrainingEntities db = new FabApprovalTrainingEntities();
|
||||||
{
|
Training training = (from a in db.Trainings where a.TrainingID == trainingId select a).SingleOrDefault();
|
||||||
FabApprovalTrainingEntities db = new FabApprovalTrainingEntities();
|
|
||||||
var users = (from a in db.TrainingGroupMembers where a.TrainingGroupID == groupId && a.UserID == userId select a).FirstOrDefault();
|
|
||||||
|
|
||||||
if (users == null)
|
if (training != null) {
|
||||||
{
|
training.CompletedDate = DateTime.Now;
|
||||||
|
training.Status = true;
|
||||||
|
|
||||||
|
try {
|
||||||
|
db.SaveChanges();
|
||||||
|
} catch (InvalidOperationException e) {
|
||||||
|
string exception = e.ToString();
|
||||||
|
Console.WriteLine(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
throw new NotImplementedException();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
public void reOpenTraining(int trainingId) {
|
||||||
|
#if !NET8
|
||||||
|
FabApprovalTrainingEntities db = new FabApprovalTrainingEntities();
|
||||||
|
Training training = (from a in db.Trainings where a.TrainingID == trainingId select a).SingleOrDefault();
|
||||||
|
|
||||||
|
if (training != null) {
|
||||||
|
training.CompletedDate = null;
|
||||||
|
training.Status = false;
|
||||||
|
|
||||||
|
try {
|
||||||
|
db.SaveChanges();
|
||||||
|
} catch (InvalidOperationException e) {
|
||||||
|
string exception = e.ToString();
|
||||||
|
Console.WriteLine(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
throw new NotImplementedException();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool CheckTrainingStatus(int trainingAssignmentID) {
|
||||||
|
#if !NET8
|
||||||
|
FabApprovalTrainingEntities db = new FabApprovalTrainingEntities();
|
||||||
|
bool isFinished = true;
|
||||||
|
int trainingID = (from a in db.TrainingAssignments where a.ID == trainingAssignmentID select a.TrainingID).SingleOrDefault();
|
||||||
|
var trainingAssignments = from a in db.TrainingAssignments where a.TrainingID == trainingID && a.Deleted != true select a;
|
||||||
|
|
||||||
|
foreach (var training in trainingAssignments) {
|
||||||
|
if (training.status == false) {
|
||||||
|
isFinished = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return isFinished;
|
||||||
|
#else
|
||||||
|
throw new NotImplementedException();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool CheckTrainingAssignmentStatus(int trainingAssignmentID) {
|
||||||
|
#if !NET8
|
||||||
|
FabApprovalTrainingEntities db = new FabApprovalTrainingEntities();
|
||||||
|
bool isFinished = true;
|
||||||
|
//TrainingDocAck docsAssigned = null;
|
||||||
|
|
||||||
|
var docsAssigned = from a in db.TrainingDocAcks where a.TrainingAssignmentID == trainingAssignmentID && a.Deleted != true select a;
|
||||||
|
|
||||||
|
foreach (var doc in docsAssigned) {
|
||||||
|
if (doc.Reviewed == false) {
|
||||||
|
isFinished = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return isFinished;
|
||||||
|
#else
|
||||||
|
throw new NotImplementedException();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool IsUserAssigned(int userId, int trainingId) {
|
||||||
|
#if !NET8
|
||||||
|
FabApprovalTrainingEntities db = new FabApprovalTrainingEntities();
|
||||||
|
bool userHasAssignment = false;
|
||||||
|
|
||||||
|
var assignments = (from a in db.TrainingAssignments where a.TrainingID == trainingId && a.UserID == userId && a.Deleted != true select a).ToList();
|
||||||
|
|
||||||
|
if (assignments.Count() > 0) {
|
||||||
|
userHasAssignment = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return userHasAssignment;
|
||||||
|
#else
|
||||||
|
throw new NotImplementedException();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Training> GetTrainings() {
|
||||||
|
#if !NET8
|
||||||
|
FabApprovalTrainingEntities db = new FabApprovalTrainingEntities();
|
||||||
|
var trainings = from a in db.Trainings select a;
|
||||||
|
|
||||||
|
return trainings.ToList();
|
||||||
|
#else
|
||||||
|
throw new NotImplementedException();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<TrainingAssignment> GetTrainingAssignmentsByUserID(int userID) {
|
||||||
|
#if !NET8
|
||||||
|
FabApprovalTrainingEntities db = new FabApprovalTrainingEntities();
|
||||||
|
var trainingAssignments = from a in db.TrainingAssignments where a.UserID == userID && a.Deleted != true select a;
|
||||||
|
|
||||||
|
return trainingAssignments.ToList();
|
||||||
|
#else
|
||||||
|
throw new NotImplementedException();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
public void DeleteTrainingAssignment(int trainingAssignmentId) {
|
||||||
|
#if !NET8
|
||||||
|
FabApprovalTrainingEntities db = new FabApprovalTrainingEntities();
|
||||||
|
var trainingAssignments = from a in db.TrainingAssignments where a.ID == trainingAssignmentId select a;
|
||||||
|
|
||||||
|
foreach (var item in trainingAssignments) {
|
||||||
|
item.Deleted = true;
|
||||||
|
item.DeletedDate = DateTime.Now;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
db.SaveChanges();
|
||||||
|
} catch (InvalidOperationException e) {
|
||||||
|
string exception = e.ToString();
|
||||||
|
Console.WriteLine(e);
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
throw new NotImplementedException();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
public void DeleteTrainingDocAck(int trainingAssignmentId) {
|
||||||
|
#if !NET8
|
||||||
|
FabApprovalTrainingEntities db = new FabApprovalTrainingEntities();
|
||||||
|
var trainingDocAcks = from a in db.TrainingDocAcks where a.TrainingAssignmentID == trainingAssignmentId select a;
|
||||||
|
|
||||||
|
foreach (var item in trainingDocAcks) {
|
||||||
|
item.Deleted = true;
|
||||||
|
item.DeletedDate = DateTime.Now;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
db.SaveChanges();
|
||||||
|
} catch (InvalidOperationException e) {
|
||||||
|
string exception = e.ToString();
|
||||||
|
Console.WriteLine(e);
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
throw new NotImplementedException();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
public void DeleteTraining(int trainingId) {
|
||||||
|
#if !NET8
|
||||||
|
FabApprovalTrainingEntities db = new FabApprovalTrainingEntities();
|
||||||
|
Training training = (from a in db.Trainings where a.TrainingID == trainingId select a).FirstOrDefault();
|
||||||
|
|
||||||
|
if (training != null) {
|
||||||
|
training.Deleted = true;
|
||||||
|
training.DeletedDate = DateTime.Now;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<TrainingAssignment> trainingAssignments = (from a in db.TrainingAssignments where a.TrainingID == trainingId select a).ToList();
|
||||||
|
db.SaveChanges();
|
||||||
|
foreach (TrainingAssignment trainingAssignment in trainingAssignments) {
|
||||||
|
DeleteTrainingAssignment(trainingAssignment.ID);
|
||||||
|
DeleteTrainingDocAck(trainingAssignment.ID);
|
||||||
|
//db.SaveChanges();
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
throw new NotImplementedException();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
public void DeleteAssignmentByUserId(int userId) {
|
||||||
|
#if !NET8
|
||||||
|
FabApprovalTrainingEntities db = new FabApprovalTrainingEntities();
|
||||||
|
|
||||||
|
var userAssignments = (from a in db.TrainingAssignments where a.UserID == userId select a).ToList();
|
||||||
|
|
||||||
|
foreach (var item in userAssignments) {
|
||||||
|
//get document assignments
|
||||||
|
var docAssignments = (from a in db.TrainingDocAcks where a.TrainingAssignmentID == item.TrainingID select a).ToList();
|
||||||
|
//delete each docAssignment
|
||||||
|
foreach (var docAssignment in docAssignments) {
|
||||||
|
DeleteTrainingDocAck(docAssignment.ID);
|
||||||
|
}
|
||||||
|
DeleteTrainingAssignment(item.ID);
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
throw new NotImplementedException();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool CheckValidDocAck(int docAckId) {
|
||||||
|
#if !NET8
|
||||||
|
FabApprovalTrainingEntities db = new FabApprovalTrainingEntities();
|
||||||
|
TrainingDocAck ack = (from a in db.TrainingDocAcks where a.ID == docAckId select a).FirstOrDefault();
|
||||||
|
|
||||||
|
//TODO Check the user is valid
|
||||||
|
|
||||||
|
//Check that the assignment exists
|
||||||
|
if (ack != null) {
|
||||||
|
//Check that the assignment isn't deleted
|
||||||
|
if (ack.Deleted == true) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
//Check that the assignment isn't completed
|
||||||
{
|
else if (ack.Reviewed == true) {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
public List<TrainingGroup> GetTrainingGroups()
|
#else
|
||||||
{
|
throw new NotImplementedException();
|
||||||
FabApprovalTrainingEntities db = new FabApprovalTrainingEntities();
|
#endif
|
||||||
return (from a in db.TrainingGroups select a).ToList();
|
}
|
||||||
}
|
|
||||||
public TrainingGroup GetTrainingGroupByID(int groupId)
|
|
||||||
{
|
|
||||||
FabApprovalTrainingEntities db = new FabApprovalTrainingEntities();
|
|
||||||
TrainingGroup groups = (from a in db.TrainingGroups where a.TrainingGroupID == groupId select a).FirstOrDefault();
|
|
||||||
return groups;
|
|
||||||
}
|
|
||||||
public List<int> GetECNAssignedTrainingGroups(int ECNNumber)
|
|
||||||
{
|
|
||||||
List<int> trainingGroups = (from a in FabApprovalDB.ECNTrainingBies where a.ECNNumber == ECNNumber select a.AcknowledgementTrainingByID).ToList();
|
|
||||||
|
|
||||||
return trainingGroups;
|
public List<Training> GetAllOpenTrainings() {
|
||||||
}
|
#if !NET8
|
||||||
public void AddTrainingGroupToECN(int ECNNumber, int groupId)
|
FabApprovalTrainingEntities db = new FabApprovalTrainingEntities();
|
||||||
{
|
List<Training> openTrainings = (from a in db.Trainings where a.Status != true && a.Deleted != true select a).ToList();
|
||||||
FabApprovalTrainingEntities db = new FabApprovalTrainingEntities();
|
return openTrainings;
|
||||||
//ECNTrainingBy ecnTraining = new ECNTrainingBy();
|
#else
|
||||||
//ecnTraining.AcknowledgementTrainingByID = groupId;
|
throw new NotImplementedException();
|
||||||
//ecnTraining.ECNNumber = ECNNumber;
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
var parameters = new DynamicParameters();
|
public List<TrainingAssignment> GetOpenAssignmentsByTrainingID(int trainingID) {
|
||||||
parameters.Add("@ECNNumber", ECNNumber);
|
#if !NET8
|
||||||
parameters.Add("@TrainingByID", groupId);
|
FabApprovalTrainingEntities db = new FabApprovalTrainingEntities();
|
||||||
|
List<TrainingAssignment> openAssignments = (from a in FabApprovalDB.TrainingAssignments where a.TrainingID == trainingID && a.status != true && a.Deleted != true select a).ToList();
|
||||||
|
return openAssignments;
|
||||||
|
#else
|
||||||
|
throw new NotImplementedException();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
this.db.Execute("ECNInsertTrainingBy", parameters, commandType: CommandType.StoredProcedure);
|
private void RefreshTrainingData(int TrainingID, IQueryable<TrainingAssignment> TrainingData) {
|
||||||
|
bool assignmentIsIncomplete = false;
|
||||||
|
UserAccountDMO userAccountDMO = new();
|
||||||
|
foreach (TrainingAssignment assignment in TrainingData) {
|
||||||
|
LoginModel userModel = userAccountDMO.GetUserByID(assignment.UserID);
|
||||||
//db.ECNTrainingBies.Add(ecnTraining);
|
if (!userModel.IsActive)
|
||||||
|
UpdateAssignmentStatus(assignment.ID);
|
||||||
}
|
if (assignment.Deleted != true && (assignment.DateCompleted is null || assignment.DateCompleted > DateTime.Now))
|
||||||
public void SetTrainingFlag(int ECNNumber)
|
assignmentIsIncomplete = true;
|
||||||
{
|
|
||||||
FabApprovalTrainingEntities db = new FabApprovalTrainingEntities();
|
|
||||||
//ECNTrainingBy ecnTraining = new ECNTrainingBy();
|
|
||||||
//ecnTraining.AcknowledgementTrainingByID = groupId;
|
|
||||||
//ecnTraining.ECNNumber = ECNNumber;
|
|
||||||
|
|
||||||
var parameters = new DynamicParameters();
|
|
||||||
parameters.Add("@ECNNumber", ECNNumber);
|
|
||||||
|
|
||||||
this.db.Execute("ECNSetTrainingFlag", parameters, commandType: CommandType.StoredProcedure);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//db.ECNTrainingBies.Add(ecnTraining);
|
|
||||||
|
|
||||||
}
|
|
||||||
public List<TrainingAssignment> GetAllTrainingAssignments(int TrainingID)
|
|
||||||
{
|
|
||||||
FabApprovalTrainingEntities db = new FabApprovalTrainingEntities();
|
|
||||||
var TrainingData = from a in db.TrainingAssignments where a.TrainingID == TrainingID select a;
|
|
||||||
|
|
||||||
RefreshTrainingData(TrainingID, TrainingData);
|
|
||||||
|
|
||||||
TrainingData = from a in db.TrainingAssignments where a.TrainingID == TrainingID select a;
|
|
||||||
|
|
||||||
return TrainingData.ToList();
|
|
||||||
}
|
|
||||||
public List<TrainingAssignment> GetTrainingAssignments(int TrainingID)
|
|
||||||
{
|
|
||||||
FabApprovalTrainingEntities db = new FabApprovalTrainingEntities();
|
|
||||||
var TrainingData = from a in db.TrainingAssignments where a.TrainingID == TrainingID && a.Deleted != true select a;
|
|
||||||
|
|
||||||
RefreshTrainingData(TrainingID, TrainingData);
|
|
||||||
|
|
||||||
TrainingData = from a in db.TrainingAssignments where a.TrainingID == TrainingID select a;
|
|
||||||
|
|
||||||
return TrainingData.ToList();
|
|
||||||
}
|
|
||||||
public List<TrainingAssignment> GetTrainingAssignmentsByUser(int TrainingID, int userID)
|
|
||||||
{
|
|
||||||
FabApprovalTrainingEntities db = new FabApprovalTrainingEntities();
|
|
||||||
var TrainingData = from a in db.TrainingAssignments where a.TrainingID == TrainingID && a.UserID == userID select a;
|
|
||||||
|
|
||||||
return TrainingData.ToList();
|
|
||||||
}
|
|
||||||
public List<TrainingDocAck> GetAssignedDocs(int trainingAssignmentId)
|
|
||||||
{
|
|
||||||
FabApprovalTrainingEntities db = new FabApprovalTrainingEntities();
|
|
||||||
var docs = (from a in db.TrainingDocAcks where a.TrainingAssignmentID == trainingAssignmentId && a.Deleted != true select a).ToList();
|
|
||||||
|
|
||||||
return docs;
|
|
||||||
}
|
|
||||||
public void AcknowledgeDocument(int trainingDocAckID)
|
|
||||||
{
|
|
||||||
var parameters = new DynamicParameters();
|
|
||||||
|
|
||||||
parameters = new DynamicParameters();
|
|
||||||
parameters.Add("@TrainingDocAckID", trainingDocAckID);
|
|
||||||
//parameters.Add("@AttachmentID", attachmentID);
|
|
||||||
|
|
||||||
this.db.Execute("TrainingAcknowledgeDocument", parameters, commandType: CommandType.StoredProcedure);
|
|
||||||
|
|
||||||
}
|
|
||||||
public void UpdateAssignmentStatus(int trainingAssignmentID)
|
|
||||||
{
|
|
||||||
FabApprovalTrainingEntities db = new FabApprovalTrainingEntities();
|
|
||||||
var RecordToUpdate = (from a in db.TrainingAssignments where a.ID == trainingAssignmentID select a).SingleOrDefault();
|
|
||||||
if(RecordToUpdate.status != true)
|
|
||||||
{
|
|
||||||
RecordToUpdate.DateCompleted = DateTime.Now;
|
|
||||||
RecordToUpdate.status = true;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
db.SaveChanges();
|
|
||||||
}
|
|
||||||
catch (InvalidOperationException e)
|
|
||||||
{
|
|
||||||
string exception = e.ToString();
|
|
||||||
Console.WriteLine(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
public int GetTrainingIdByAssignment(int trainingAssignmentID)
|
|
||||||
{
|
|
||||||
FabApprovalTrainingEntities db = new FabApprovalTrainingEntities();
|
|
||||||
int trainingID = (from a in db.TrainingAssignments where a.ID == trainingAssignmentID select a.TrainingID).SingleOrDefault();
|
|
||||||
|
|
||||||
return trainingID;
|
|
||||||
}
|
|
||||||
public void UpdateTrainingStatus(int trainingId)
|
|
||||||
{
|
|
||||||
FabApprovalTrainingEntities db = new FabApprovalTrainingEntities();
|
|
||||||
Training training = (from a in db.Trainings where a.TrainingID == trainingId select a).SingleOrDefault();
|
|
||||||
|
|
||||||
if (training != null)
|
|
||||||
{
|
|
||||||
training.CompletedDate = DateTime.Now;
|
|
||||||
training.Status = true;
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
db.SaveChanges();
|
|
||||||
}
|
|
||||||
catch (InvalidOperationException e)
|
|
||||||
{
|
|
||||||
string exception = e.ToString();
|
|
||||||
Console.WriteLine(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public void reOpenTraining(int trainingId)
|
|
||||||
{
|
|
||||||
FabApprovalTrainingEntities db = new FabApprovalTrainingEntities();
|
|
||||||
Training training = (from a in db.Trainings where a.TrainingID == trainingId select a).SingleOrDefault();
|
|
||||||
|
|
||||||
if (training != null)
|
|
||||||
{
|
|
||||||
training.CompletedDate = null;
|
|
||||||
training.Status = false;
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
db.SaveChanges();
|
|
||||||
}
|
|
||||||
catch (InvalidOperationException e)
|
|
||||||
{
|
|
||||||
string exception = e.ToString();
|
|
||||||
Console.WriteLine(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool CheckTrainingStatus(int trainingAssignmentID)
|
if (!assignmentIsIncomplete)
|
||||||
{
|
UpdateTrainingStatus(TrainingID);
|
||||||
FabApprovalTrainingEntities db = new FabApprovalTrainingEntities();
|
|
||||||
bool isFinished = true;
|
|
||||||
int trainingID = (from a in db.TrainingAssignments where a.ID == trainingAssignmentID select a.TrainingID).SingleOrDefault();
|
|
||||||
var trainingAssignments = from a in db.TrainingAssignments where a.TrainingID == trainingID && a.Deleted != true select a;
|
|
||||||
|
|
||||||
foreach (var training in trainingAssignments)
|
|
||||||
{
|
|
||||||
if (training.status == false)
|
|
||||||
{
|
|
||||||
isFinished = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
return isFinished;
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool CheckTrainingAssignmentStatus(int trainingAssignmentID)
|
|
||||||
{
|
|
||||||
FabApprovalTrainingEntities db = new FabApprovalTrainingEntities();
|
|
||||||
bool isFinished = true;
|
|
||||||
//TrainingDocAck docsAssigned = null;
|
|
||||||
|
|
||||||
var docsAssigned = from a in db.TrainingDocAcks where a.TrainingAssignmentID == trainingAssignmentID && a.Deleted != true select a;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
foreach (var doc in docsAssigned)
|
|
||||||
{
|
|
||||||
if (doc.Reviewed == false)
|
|
||||||
{
|
|
||||||
isFinished = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return isFinished;
|
|
||||||
}
|
|
||||||
public bool IsUserAssigned(int userId, int trainingId)
|
|
||||||
{
|
|
||||||
FabApprovalTrainingEntities db = new FabApprovalTrainingEntities();
|
|
||||||
bool userHasAssignment = false;
|
|
||||||
|
|
||||||
var assignments = (from a in db.TrainingAssignments where a.TrainingID == trainingId && a.UserID == userId && a.Deleted != true select a).ToList();
|
|
||||||
|
|
||||||
if(assignments.Count() > 0)
|
|
||||||
{
|
|
||||||
userHasAssignment = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return userHasAssignment;
|
|
||||||
}
|
|
||||||
public List<Training> GetTrainings()
|
|
||||||
{
|
|
||||||
FabApprovalTrainingEntities db = new FabApprovalTrainingEntities();
|
|
||||||
var trainings = from a in db.Trainings select a;
|
|
||||||
|
|
||||||
return trainings.ToList();
|
|
||||||
}
|
|
||||||
public List<TrainingAssignment> GetTrainingAssignmentsByUserID(int userID)
|
|
||||||
{
|
|
||||||
FabApprovalTrainingEntities db = new FabApprovalTrainingEntities();
|
|
||||||
var trainingAssignments = from a in db.TrainingAssignments where a.UserID == userID && a.Deleted != true select a;
|
|
||||||
|
|
||||||
return trainingAssignments.ToList();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void DeleteTrainingAssignment(int trainingAssignmentId)
|
|
||||||
{
|
|
||||||
FabApprovalTrainingEntities db = new FabApprovalTrainingEntities();
|
|
||||||
var trainingAssignments = from a in db.TrainingAssignments where a.ID == trainingAssignmentId select a;
|
|
||||||
|
|
||||||
foreach (var item in trainingAssignments)
|
|
||||||
{
|
|
||||||
item.Deleted = true;
|
|
||||||
item.DeletedDate = DateTime.Now;
|
|
||||||
}
|
|
||||||
try
|
|
||||||
{
|
|
||||||
db.SaveChanges();
|
|
||||||
}
|
|
||||||
catch (InvalidOperationException e)
|
|
||||||
{
|
|
||||||
string exception = e.ToString();
|
|
||||||
Console.WriteLine(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public void DeleteTrainingDocAck(int trainingAssignmentId)
|
|
||||||
{
|
|
||||||
FabApprovalTrainingEntities db = new FabApprovalTrainingEntities();
|
|
||||||
var trainingDocAcks = from a in db.TrainingDocAcks where a.TrainingAssignmentID == trainingAssignmentId select a;
|
|
||||||
|
|
||||||
foreach (var item in trainingDocAcks)
|
|
||||||
{
|
|
||||||
item.Deleted = true;
|
|
||||||
item.DeletedDate = DateTime.Now;
|
|
||||||
}
|
|
||||||
try
|
|
||||||
{
|
|
||||||
db.SaveChanges();
|
|
||||||
}
|
|
||||||
catch (InvalidOperationException e)
|
|
||||||
{
|
|
||||||
string exception = e.ToString();
|
|
||||||
Console.WriteLine(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public void DeleteTraining(int trainingId)
|
|
||||||
{
|
|
||||||
FabApprovalTrainingEntities db = new FabApprovalTrainingEntities();
|
|
||||||
Training training = (from a in db.Trainings where a.TrainingID == trainingId select a).FirstOrDefault();
|
|
||||||
|
|
||||||
if (training != null)
|
|
||||||
{
|
|
||||||
training.Deleted = true;
|
|
||||||
training.DeletedDate = DateTime.Now;
|
|
||||||
}
|
|
||||||
|
|
||||||
List<TrainingAssignment> trainingAssignments = (from a in db.TrainingAssignments where a.TrainingID == trainingId select a).ToList();
|
|
||||||
db.SaveChanges();
|
|
||||||
foreach (TrainingAssignment trainingAssignment in trainingAssignments)
|
|
||||||
{
|
|
||||||
DeleteTrainingAssignment(trainingAssignment.ID);
|
|
||||||
DeleteTrainingDocAck(trainingAssignment.ID);
|
|
||||||
//db.SaveChanges();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
public void DeleteAssignmentByUserId(int userId)
|
|
||||||
{
|
|
||||||
FabApprovalTrainingEntities db = new FabApprovalTrainingEntities();
|
|
||||||
|
|
||||||
var userAssignments = (from a in db.TrainingAssignments where a.UserID == userId select a).ToList();
|
|
||||||
|
|
||||||
foreach (var item in userAssignments)
|
|
||||||
{
|
|
||||||
//get document assignments
|
|
||||||
var docAssignments = (from a in db.TrainingDocAcks where a.TrainingAssignmentID == item.TrainingID select a).ToList();
|
|
||||||
//delete each docAssignment
|
|
||||||
foreach (var docAssignment in docAssignments)
|
|
||||||
{
|
|
||||||
DeleteTrainingDocAck(docAssignment.ID);
|
|
||||||
}
|
|
||||||
DeleteTrainingAssignment(item.ID);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public bool CheckValidDocAck(int docAckId)
|
|
||||||
{
|
|
||||||
FabApprovalTrainingEntities db = new FabApprovalTrainingEntities();
|
|
||||||
TrainingDocAck ack = (from a in db.TrainingDocAcks where a.ID == docAckId select a).FirstOrDefault();
|
|
||||||
|
|
||||||
//TODO Check the user is valid
|
|
||||||
|
|
||||||
//Check that the assignment exists
|
|
||||||
if (ack != null)
|
|
||||||
{
|
|
||||||
//Check that the assignment isn't deleted
|
|
||||||
if (ack.Deleted == true)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
//Check that the assignment isn't completed
|
|
||||||
else if (ack.Reviewed == true)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
public List<Training> GetAllOpenTrainings()
|
|
||||||
{
|
|
||||||
FabApprovalTrainingEntities db = new FabApprovalTrainingEntities();
|
|
||||||
List<Training> openTrainings = (from a in db.Trainings where a.Status != true && a.Deleted != true select a).ToList();
|
|
||||||
return openTrainings;
|
|
||||||
}
|
|
||||||
public List<TrainingAssignment> GetOpenAssignmentsByTrainingID(int trainingID)
|
|
||||||
{
|
|
||||||
FabApprovalTrainingEntities db = new FabApprovalTrainingEntities();
|
|
||||||
List<TrainingAssignment> openAssignments = (from a in FabApprovalDB.TrainingAssignments where a.TrainingID == trainingID && a.status != true && a.Deleted != true select a).ToList();
|
|
||||||
return openAssignments;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void RefreshTrainingData(int TrainingID, IQueryable<TrainingAssignment> TrainingData)
|
|
||||||
{
|
|
||||||
bool assignmentIsIncomplete = false;
|
|
||||||
UserAccountDMO userAccountDMO = new UserAccountDMO();
|
|
||||||
foreach (TrainingAssignment assignment in TrainingData)
|
|
||||||
{
|
|
||||||
LoginModel userModel = userAccountDMO.GetUserByID(assignment.UserID);
|
|
||||||
if (!userModel.IsActive) UpdateAssignmentStatus(assignment.ID);
|
|
||||||
if (assignment.Deleted != true && (assignment.DateCompleted is null || assignment.DateCompleted > DateTime.Now))
|
|
||||||
assignmentIsIncomplete = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!assignmentIsIncomplete)
|
|
||||||
UpdateTrainingStatus(TrainingID);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,212 +1,149 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Configuration;
|
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using System.Data.SqlClient;
|
using System.Data.SqlClient;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Web;
|
|
||||||
using Dapper;
|
|
||||||
using Fab2ApprovalSystem.Models;
|
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
|
using Dapper;
|
||||||
|
|
||||||
using Fab2ApprovalSystem.Misc;
|
using Fab2ApprovalSystem.Misc;
|
||||||
|
using Fab2ApprovalSystem.Models;
|
||||||
|
|
||||||
namespace Fab2ApprovalSystem.DMO
|
namespace Fab2ApprovalSystem.DMO;
|
||||||
{
|
|
||||||
public class UserAccountDMO
|
|
||||||
{
|
|
||||||
private IDbConnection db = new SqlConnection(GlobalVars.DB_CONNECTION_STRING);
|
|
||||||
|
|
||||||
|
public class UserAccountDMO {
|
||||||
|
private readonly IDbConnection db = new SqlConnection(GlobalVars.DB_CONNECTION_STRING);
|
||||||
|
|
||||||
//public List<LoginModel> GetUser(string loginID)
|
public IEnumerable<LoginModel> GetAllUsers() {
|
||||||
//{
|
StringBuilder sql = new();
|
||||||
// StringBuilder sql = new StringBuilder();
|
//sql.Append("SELECT U.FirstName + ' ' + U.LastName AS FullName, U1.FirstName + ' ' + U1.LastName AS DelegatedToFullName, U.* ");
|
||||||
// sql.Append("SELECT * FROM Users WHERE LoginID = '" + loginID + "'");
|
//sql.Append("FROM Users U LEFT JOIN Users U1 ");
|
||||||
|
//sql.Append("ON U.UserID = U1.DelegatedTo ORDER BY FirstName ");
|
||||||
|
|
||||||
// return this.db.Query<LoginModel>(sql.ToString()).ToList();
|
//sql.Append("SELECT FirstName + ' ' + LastName AS FullName, * FROM Users ORDER BY FirstName ");
|
||||||
//}
|
sql.Append(" SELECT U.FirstName + ' ' + U.LastName AS FullName, U.* , U1.FirstName + ' ' + U1.LastName AS DelegatedToFullName ");
|
||||||
|
sql.Append("FROM Users U LEFT JOIN Users U1 ON U.DelegatedTo = U1.UserID ");
|
||||||
|
sql.Append("ORDER BY FirstName ");
|
||||||
|
|
||||||
public IEnumerable<LoginModel> GetAllUsers()
|
return db.Query<LoginModel>(sql.ToString()).ToList();
|
||||||
{
|
}
|
||||||
StringBuilder sql = new StringBuilder();
|
|
||||||
//sql.Append("SELECT U.FirstName + ' ' + U.LastName AS FullName, U1.FirstName + ' ' + U1.LastName AS DelegatedToFullName, U.* ");
|
|
||||||
//sql.Append("FROM Users U LEFT JOIN Users U1 ");
|
|
||||||
//sql.Append("ON U.UserID = U1.DelegatedTo ORDER BY FirstName ");
|
|
||||||
|
|
||||||
//sql.Append("SELECT FirstName + ' ' + LastName AS FullName, * FROM Users ORDER BY FirstName ");
|
public IEnumerable<LoginModel> GetAllActiveUsers() {
|
||||||
sql.Append(" SELECT U.FirstName + ' ' + U.LastName AS FullName, U.* , U1.FirstName + ' ' + U1.LastName AS DelegatedToFullName ");
|
StringBuilder sql = new();
|
||||||
sql.Append("FROM Users U LEFT JOIN Users U1 ON U.DelegatedTo = U1.UserID ");
|
//sql.Append("SELECT U.FirstName + ' ' + U.LastName AS FullName, U1.FirstName + ' ' + U1.LastName AS DelegatedToFullName, U.* ");
|
||||||
sql.Append("ORDER BY FirstName ");
|
//sql.Append("FROM Users U LEFT JOIN Users U1 ");
|
||||||
|
//sql.Append("ON U.UserID = U1.DelegatedTo ORDER BY FirstName ");
|
||||||
|
|
||||||
return this.db.Query<LoginModel>(sql.ToString()).ToList();
|
//sql.Append("SELECT FirstName + ' ' + LastName AS FullName, * FROM Users ORDER BY FirstName ");
|
||||||
}
|
sql.Append(" SELECT U.FirstName + ' ' + U.LastName AS FullName, U.* , U1.FirstName + ' ' + U1.LastName AS DelegatedToFullName ");
|
||||||
public IEnumerable<LoginModel> GetAllActiveUsers()
|
sql.Append("FROM Users U LEFT JOIN Users U1 ON U.DelegatedTo = U1.UserID ");
|
||||||
{
|
sql.Append("WHERE U.IsActive = 1 ");
|
||||||
StringBuilder sql = new StringBuilder();
|
sql.Append("ORDER BY FirstName ");
|
||||||
//sql.Append("SELECT U.FirstName + ' ' + U.LastName AS FullName, U1.FirstName + ' ' + U1.LastName AS DelegatedToFullName, U.* ");
|
|
||||||
//sql.Append("FROM Users U LEFT JOIN Users U1 ");
|
|
||||||
//sql.Append("ON U.UserID = U1.DelegatedTo ORDER BY FirstName ");
|
|
||||||
|
|
||||||
//sql.Append("SELECT FirstName + ' ' + LastName AS FullName, * FROM Users ORDER BY FirstName ");
|
return db.Query<LoginModel>(sql.ToString()).ToList();
|
||||||
sql.Append(" SELECT U.FirstName + ' ' + U.LastName AS FullName, U.* , U1.FirstName + ' ' + U1.LastName AS DelegatedToFullName ");
|
}
|
||||||
sql.Append("FROM Users U LEFT JOIN Users U1 ON U.DelegatedTo = U1.UserID ");
|
|
||||||
sql.Append("WHERE U.IsActive = 1 ");
|
|
||||||
sql.Append("ORDER BY FirstName ");
|
|
||||||
|
|
||||||
return this.db.Query<LoginModel>(sql.ToString()).ToList();
|
public LoginModel GetUser(string loginID) =>
|
||||||
}
|
//StringBuilder sql = new StringBuilder();
|
||||||
|
//sql.Append("SELECT * FROM Users WHERE LoginID = '" + loginID + "'");
|
||||||
|
//return this.db.Query<LoginModel>(sql.ToString()).SingleOrDefault();
|
||||||
|
db.Query<LoginModel>("SELECT FirstName + ' ' + LastName AS FullName, * FROM Users WHERE LoginID = @loginID AND IsActive = 1 ", new { loginID = loginID }).Take(1).SingleOrDefault();
|
||||||
|
|
||||||
|
public LoginModel GetUserByID(int userID) {
|
||||||
|
return db.Query<LoginModel>(
|
||||||
|
"SELECT FirstName + ' ' + LastName AS FullName, * FROM Users WHERE UserID = @UserID ",
|
||||||
|
new { UserID = userID }).Take(1).SingleOrDefault();
|
||||||
|
}
|
||||||
|
|
||||||
|
public string GetUserEmailByID(int userID) {
|
||||||
|
return db.Query<string>(
|
||||||
|
"SELECT Email FROM Users WHERE UserID = @UserID ",
|
||||||
|
new { UserID = userID }).Take(1).SingleOrDefault();
|
||||||
|
}
|
||||||
|
|
||||||
|
internal void UpdateUser(LoginModel model) {
|
||||||
|
string sql;
|
||||||
|
sql = "UPDATE Users SET LoginID = @LoginID, FirstName = @FirstName, LastName = @LastName, Email = @Email, IsActive = @IsActive, IsAdmin = @IsAdmin WHERE UserID = @UserID";
|
||||||
|
DynamicParameters parameters = new();
|
||||||
|
parameters.Add("@UserID", model.UserID);
|
||||||
|
parameters.Add("@LoginID", model.LoginID);
|
||||||
|
parameters.Add("@FirstName", model.FirstName);
|
||||||
|
parameters.Add("@LastName", model.LastName);
|
||||||
|
parameters.Add("@Email", model.Email);
|
||||||
|
parameters.Add("@IsAdmin", model.IsAdmin);
|
||||||
|
parameters.Add("@IsActive", model.IsActive);
|
||||||
|
|
||||||
|
db.Execute(sql, parameters);
|
||||||
|
}
|
||||||
|
|
||||||
public LoginModel GetUser(string loginID)
|
internal void DeleteUser(LoginModel model) {
|
||||||
{
|
string sql;
|
||||||
//StringBuilder sql = new StringBuilder();
|
//sql = "DELETE Users WHERE UserID = @UserID";
|
||||||
//sql.Append("SELECT * FROM Users WHERE LoginID = '" + loginID + "'");
|
sql = "UPDATE Users SET IsActive = 0 WHERE UserID = @UserID";
|
||||||
|
DynamicParameters parameters = new();
|
||||||
|
parameters.Add("@UserID", model.UserID);
|
||||||
|
|
||||||
//return this.db.Query<LoginModel>(sql.ToString()).SingleOrDefault();
|
db.Execute(sql, parameters);
|
||||||
|
}
|
||||||
|
|
||||||
|
internal void InsertUser(LoginModel model) {
|
||||||
|
//string sql;
|
||||||
|
//sql = "INSERT Users (LoginID, FirstName, LastName, IsAdmin) VALUES (@LoginID, @FirstName, @LastName, @IsAdmin )";
|
||||||
|
DynamicParameters parameters = new();
|
||||||
|
parameters.Add("@UserID", model.UserID, DbType.Int32, direction: ParameterDirection.InputOutput);
|
||||||
|
parameters.Add("@LoginID", model.LoginID);
|
||||||
|
parameters.Add("@FirstName", model.FirstName);
|
||||||
|
parameters.Add("@LastName", model.LastName);
|
||||||
|
parameters.Add("@Email", model.Email);
|
||||||
|
parameters.Add("@IsAdmin", model.IsAdmin);
|
||||||
|
|
||||||
return this.db.Query<LoginModel>("SELECT FirstName + ' ' + LastName AS FullName, * FROM Users WHERE LoginID = @loginID AND IsActive = 1 ", new { loginID = loginID }).Take(1).SingleOrDefault();
|
db.Execute("InsertUsers", parameters, commandType: CommandType.StoredProcedure);
|
||||||
}
|
int userid = parameters.Get<int>("@UserID");
|
||||||
|
model.UserID = userid;
|
||||||
|
}
|
||||||
|
|
||||||
public LoginModel GetUserByID(int userID)
|
internal void UpdateInsertITARAccess(string userID, string hasITARAccess) {
|
||||||
{
|
DynamicParameters parameters = new();
|
||||||
return this.db.Query<LoginModel>(
|
parameters.Add("@UserID", userID);
|
||||||
"SELECT FirstName + ' ' + LastName AS FullName, * FROM Users WHERE UserID = @UserID ",
|
parameters.Add("@HasITARAccess", hasITARAccess);
|
||||||
new { UserID = userID }).Take(1).SingleOrDefault();
|
|
||||||
}
|
|
||||||
|
|
||||||
public string GetUserEmailByID(string userID)
|
db.Execute("ITARAccessUpdateInsert", parameters, commandType: CommandType.StoredProcedure);
|
||||||
{
|
}
|
||||||
return this.db.Query<string>(
|
|
||||||
"SELECT Email FROM Users WHERE UserID = @UserID ",
|
|
||||||
new { UserID = userID }).Take(1).SingleOrDefault();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
internal bool GetITARAccess(int userID) {
|
||||||
///
|
DynamicParameters parameters = new();
|
||||||
/// </summary>
|
parameters.Add("@UserID", userID);
|
||||||
/// <param name="model"></param>
|
|
||||||
internal void UpdateUser(LoginModel model)
|
|
||||||
{
|
|
||||||
string sql;
|
|
||||||
sql = "UPDATE Users SET LoginID = @LoginID, FirstName = @FirstName, LastName = @LastName, Email = @Email, IsActive = @IsActive, IsAdmin = @IsAdmin WHERE UserID = @UserID";
|
|
||||||
var parameters = new DynamicParameters();
|
|
||||||
parameters.Add("@UserID", model.UserID);
|
|
||||||
parameters.Add("@LoginID", model.LoginID);
|
|
||||||
parameters.Add("@FirstName", model.FirstName);
|
|
||||||
parameters.Add("@LastName", model.LastName );
|
|
||||||
parameters.Add("@Email", model.Email);
|
|
||||||
parameters.Add("@IsAdmin", model.IsAdmin);
|
|
||||||
parameters.Add("@IsActive", model.IsActive);
|
|
||||||
|
|
||||||
this.db.Execute(sql, parameters);
|
var results = db.Query<string>(
|
||||||
}
|
"SELECT HasITARAccess FROM SAMUsers, Users WHERE Users.UserID = @UserID AND SAMUsers.UserID = Users.LoginID",
|
||||||
|
parameters, commandType: CommandType.Text);
|
||||||
|
if ((results != null) && (results.Count() > 0) && (results.First() == "1"))
|
||||||
|
return true;
|
||||||
|
|
||||||
/// <summary>
|
return false;
|
||||||
///
|
}
|
||||||
/// </summary>
|
|
||||||
/// <param name="model"></param>
|
|
||||||
internal void DeleteUser(LoginModel model)
|
|
||||||
{
|
|
||||||
string sql;
|
|
||||||
//sql = "DELETE Users WHERE UserID = @UserID";
|
|
||||||
sql = "UPDATE Users SET IsActive = 0 WHERE UserID = @UserID";
|
|
||||||
var parameters = new DynamicParameters();
|
|
||||||
parameters.Add("@UserID", model.UserID);
|
|
||||||
|
|
||||||
this.db.Execute(sql, parameters);
|
internal bool GetEC_AD_Users(string userID) {
|
||||||
}
|
DynamicParameters parameters = new();
|
||||||
|
parameters.Add("@UserID", userID);
|
||||||
|
|
||||||
|
var results = db.Query<string>(
|
||||||
|
"SELECT UserID FROM EC_AD_Users WHERE UserID = @UserID",
|
||||||
|
parameters, commandType: CommandType.Text);
|
||||||
|
if ((results != null) && (results.Count() > 0))
|
||||||
|
return true;
|
||||||
|
|
||||||
/// <summary>
|
return false;
|
||||||
///
|
}
|
||||||
/// </summary>
|
|
||||||
/// <param name="model"></param>
|
|
||||||
internal void InsertUser(LoginModel model)
|
|
||||||
{
|
|
||||||
//string sql;
|
|
||||||
//sql = "INSERT Users (LoginID, FirstName, LastName, IsAdmin) VALUES (@LoginID, @FirstName, @LastName, @IsAdmin )";
|
|
||||||
var parameters = new DynamicParameters();
|
|
||||||
parameters.Add("@UserID", model.UserID, DbType.Int32, direction: ParameterDirection.InputOutput);
|
|
||||||
parameters.Add("@LoginID", model.LoginID);
|
|
||||||
parameters.Add("@FirstName", model.FirstName);
|
|
||||||
parameters.Add("@LastName", model.LastName);
|
|
||||||
parameters.Add("@Email", model.Email);
|
|
||||||
parameters.Add("@IsAdmin", model.IsAdmin);
|
|
||||||
|
|
||||||
this.db.Execute("InsertUsers", parameters, commandType: CommandType.StoredProcedure);
|
internal void ProcessOoO() {
|
||||||
int userid = parameters.Get<int>("@UserID");
|
DynamicParameters parameters = new();
|
||||||
model.UserID = userid;
|
db.Execute("ProcesOOOEnableStatus", commandType: CommandType.StoredProcedure);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
internal void ExpireOoO() {
|
||||||
|
DynamicParameters parameters = new();
|
||||||
/// <summary>
|
db.Execute("ProcesOOOExpiration", commandType: CommandType.StoredProcedure);
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="userID"></param>
|
|
||||||
/// <param name="hasITARAccess"></param>
|
|
||||||
internal void UpdateInsertITARAccess(string userID, string hasITARAccess)
|
|
||||||
{
|
|
||||||
|
|
||||||
var parameters = new DynamicParameters();
|
|
||||||
parameters.Add("@UserID", userID);
|
|
||||||
parameters.Add("@HasITARAccess", hasITARAccess);
|
|
||||||
|
|
||||||
this.db.Execute("ITARAccessUpdateInsert", parameters, commandType: CommandType.StoredProcedure);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="userID"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
internal bool GetITARAccess(int userID)
|
|
||||||
{
|
|
||||||
var parameters = new DynamicParameters();
|
|
||||||
parameters.Add("@UserID", userID);
|
|
||||||
|
|
||||||
var results = this.db.Query<string>(
|
|
||||||
"SELECT HasITARAccess FROM SAMUsers, Users WHERE Users.UserID = @UserID AND SAMUsers.UserID = Users.LoginID",
|
|
||||||
parameters, commandType: CommandType.Text);
|
|
||||||
if ((results != null) && (results.Count() > 0) && (results.First() == "1"))
|
|
||||||
return true;
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="userID"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
internal bool GetEC_AD_Users(string userID)
|
|
||||||
{
|
|
||||||
var parameters = new DynamicParameters();
|
|
||||||
parameters.Add("@UserID", userID);
|
|
||||||
|
|
||||||
var results = this.db.Query<string>(
|
|
||||||
"SELECT UserID FROM EC_AD_Users WHERE UserID = @UserID",
|
|
||||||
parameters, commandType: CommandType.Text);
|
|
||||||
if ((results != null) && (results.Count() > 0))
|
|
||||||
return true;
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
internal void ProcessOoO()
|
|
||||||
{
|
|
||||||
var parameters = new DynamicParameters();
|
|
||||||
this.db.Execute("ProcesOOOEnableStatus", commandType: CommandType.StoredProcedure);
|
|
||||||
|
|
||||||
}
|
|
||||||
internal void ExpireOoO()
|
|
||||||
{
|
|
||||||
var parameters = new DynamicParameters();
|
|
||||||
this.db.Execute("ProcesOOOExpiration", commandType: CommandType.StoredProcedure);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,165 +1,128 @@
|
|||||||
using Fab2ApprovalSystem.Misc;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Configuration;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Web;
|
using System.Web;
|
||||||
using System.Web.Hosting;
|
using System.Web.Hosting;
|
||||||
|
using System.Web.Http;
|
||||||
using System.Web.Mvc;
|
using System.Web.Mvc;
|
||||||
using System.Web.Optimization;
|
using System.Web.Optimization;
|
||||||
using System.Web.Routing;
|
using System.Web.Routing;
|
||||||
using System.Web.Security;
|
using System.Web.Security;
|
||||||
using System.Configuration;
|
|
||||||
using Fab2ApprovalSystem.DMO;
|
using Fab2ApprovalSystem.DMO;
|
||||||
using System.Web.Http;
|
|
||||||
using Fab2ApprovalSystem.JobSchedules;
|
using Fab2ApprovalSystem.JobSchedules;
|
||||||
|
using Fab2ApprovalSystem.Misc;
|
||||||
|
using Fab2ApprovalSystem.Models;
|
||||||
|
|
||||||
namespace Fab2ApprovalSystem
|
namespace Fab2ApprovalSystem;
|
||||||
{
|
|
||||||
public class MvcApplication : System.Web.HttpApplication
|
|
||||||
{
|
|
||||||
protected void Application_Start()
|
|
||||||
{
|
|
||||||
AreaRegistration.RegisterAllAreas();
|
|
||||||
GlobalConfiguration.Configure(WebApiConfig.Register);
|
|
||||||
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
|
|
||||||
RouteConfig.RegisterRoutes(RouteTable.Routes);
|
|
||||||
BundleConfig.RegisterBundles(BundleTable.Bundles);
|
|
||||||
|
|
||||||
string hostName = System.Net.Dns.GetHostEntry("").HostName;
|
public class MvcApplication : System.Web.HttpApplication {
|
||||||
GlobalVars.IS_INFINEON_DOMAIN = hostName.ToLower().Contains("infineon");
|
|
||||||
|
|
||||||
string DevWebSiteUrl = ConfigurationManager.AppSettings["DevWebSiteURL"].ToString();
|
protected void Application_Start() {
|
||||||
string ProdWebSiteUrlEC = ConfigurationManager.AppSettings["ProdWebSiteURLEC"].ToString();
|
AreaRegistration.RegisterAllAreas();
|
||||||
string ProdWebSiteUrlStealth = ConfigurationManager.AppSettings["ProdWebSiteURLStealth"].ToString();
|
GlobalConfiguration.Configure(WebApiConfig.Register);
|
||||||
|
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
|
||||||
|
RouteConfig.RegisterRoutes(RouteTable.Routes);
|
||||||
|
BundleConfig.RegisterBundles(BundleTable.Bundles);
|
||||||
|
|
||||||
GlobalVars.SENDER_EMAIL = "FabApprovalSystem@Infineon.com"; // put in the Config File
|
string hostName = System.Net.Dns.GetHostEntry("").HostName;
|
||||||
if (ConfigurationManager.AppSettings["Notification Sender"] != null)
|
GlobalVars.IS_INFINEON_DOMAIN = hostName.ToLower().Contains("infineon");
|
||||||
GlobalVars.SENDER_EMAIL = ConfigurationManager.AppSettings["Notification Sender"].ToString();
|
|
||||||
|
|
||||||
GlobalVars.NDriveURL = ConfigurationManager.AppSettings["NDrive"].ToString();
|
string DevWebSiteUrl = ConfigurationManager.AppSettings["DevWebSiteURL"].ToString();
|
||||||
GlobalVars.WSR_URL = ConfigurationManager.AppSettings["WSR_URL"].ToString();
|
string ProdWebSiteUrlEC = ConfigurationManager.AppSettings["ProdWebSiteURLEC"].ToString();
|
||||||
GlobalVars.CA_BlankFormsLocation = ConfigurationManager.AppSettings["CA_BlankFormsLocation"].ToString();
|
string ProdWebSiteUrlStealth = ConfigurationManager.AppSettings["ProdWebSiteURLStealth"].ToString();
|
||||||
|
|
||||||
//GlobalVars.AttachmentUrl = connectionstring.ToUpper().Contains("TEST") ? @"http://" + DevAttachmentUrl + "/" : @"http://" + ProdAttachmentUrl + "/"; ;
|
GlobalVars.SENDER_EMAIL = "FabApprovalSystem@Infineon.com"; // put in the Config File
|
||||||
|
if (ConfigurationManager.AppSettings["Notification Sender"] != null)
|
||||||
|
GlobalVars.SENDER_EMAIL = ConfigurationManager.AppSettings["Notification Sender"].ToString();
|
||||||
|
|
||||||
|
GlobalVars.NDriveURL = ConfigurationManager.AppSettings["NDrive"].ToString();
|
||||||
|
GlobalVars.WSR_URL = ConfigurationManager.AppSettings["WSR_URL"].ToString();
|
||||||
|
GlobalVars.CA_BlankFormsLocation = ConfigurationManager.AppSettings["CA_BlankFormsLocation"].ToString();
|
||||||
|
|
||||||
#if (!DEBUG)
|
#if (!DEBUG)
|
||||||
OOOTrainingReportJobSchedule.Start();
|
OOOTrainingReportJobSchedule.Start();
|
||||||
|
|
||||||
if (GlobalVars.IS_INFINEON_DOMAIN) {
|
if (GlobalVars.IS_INFINEON_DOMAIN) {
|
||||||
GlobalVars.DB_CONNECTION_STRING = ConfigurationManager.ConnectionStrings["FabApprovalConnectionStealth"].ConnectionString.ToString();
|
GlobalVars.DB_CONNECTION_STRING = ConfigurationManager.ConnectionStrings["FabApprovalConnectionStealth"].ConnectionString.ToString();
|
||||||
GlobalVars.hostURL = @"https://" + ProdWebSiteUrlStealth;
|
GlobalVars.hostURL = @"https://" + ProdWebSiteUrlStealth;
|
||||||
} else {
|
} else {
|
||||||
GlobalVars.DB_CONNECTION_STRING = ConfigurationManager.ConnectionStrings["FabApprovalConnectionEC"].ConnectionString.ToString();
|
GlobalVars.DB_CONNECTION_STRING = ConfigurationManager.ConnectionStrings["FabApprovalConnectionEC"].ConnectionString.ToString();
|
||||||
GlobalVars.hostURL = @"https://" + ProdWebSiteUrlEC;
|
GlobalVars.hostURL = @"https://" + ProdWebSiteUrlEC;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
GlobalVars.DB_CONNECTION_STRING = ConfigurationManager.ConnectionStrings["FabApprovalConnectionDev"].ConnectionString.ToString();
|
GlobalVars.DB_CONNECTION_STRING = ConfigurationManager.ConnectionStrings["FabApprovalConnectionDev"].ConnectionString.ToString();
|
||||||
GlobalVars.hostURL = @"https://" + DevWebSiteUrl;
|
GlobalVars.hostURL = @"https://" + DevWebSiteUrl;
|
||||||
#endif
|
#endif
|
||||||
GlobalVars.DBConnection = GlobalVars.DB_CONNECTION_STRING.ToUpper().Contains("TEST") ? "TEST" : GlobalVars.DB_CONNECTION_STRING.ToUpper().Contains("QUALITY") ? "QUALITY" : "PROD";
|
GlobalVars.DBConnection = GlobalVars.DB_CONNECTION_STRING.ToUpper().Contains("TEST") ? "TEST" : GlobalVars.DB_CONNECTION_STRING.ToUpper().Contains("QUALITY") ? "QUALITY" : "PROD";
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//void Application_BeginRequest(Object source, EventArgs e)
|
|
||||||
//{
|
|
||||||
|
|
||||||
// HttpApplication app = (HttpApplication)source;
|
|
||||||
// HttpContext context = app.Context;
|
|
||||||
// GlobalVars.hostURL = context.Request.Url.AbsoluteUri;
|
|
||||||
// // Attempt to peform first request initialization
|
|
||||||
|
|
||||||
//}
|
|
||||||
|
|
||||||
protected void Application_EndRequest()
|
|
||||||
{
|
|
||||||
var context = new HttpContextWrapper(Context);
|
|
||||||
|
|
||||||
//Do a direct 401 unautorized
|
|
||||||
if (Context.Response.StatusCode == 301 && context.Request.IsAjaxRequest())
|
|
||||||
{
|
|
||||||
Context.Response.Clear();
|
|
||||||
Context.Response.StatusCode = 401;
|
|
||||||
}
|
|
||||||
|
|
||||||
else if (FormsAuthentication.IsEnabled && context.Response.StatusCode == 302
|
|
||||||
&& context.Request.IsAjaxRequest())
|
|
||||||
{
|
|
||||||
context.Response.Clear();
|
|
||||||
context.Response.StatusCode = 401;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void Session_Start(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
Session[GlobalVars.ECN_VIEW_OPTION] = "Pending Approvals"; ;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void Session_End(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
//FormsAuthentication.SignOut();
|
|
||||||
try
|
|
||||||
{
|
|
||||||
Session[GlobalVars.SESSION_USERNAME] = "";
|
|
||||||
Session[GlobalVars.SESSION_USERID] = "";
|
|
||||||
Session[GlobalVars.IS_ADMIN] = "";
|
|
||||||
|
|
||||||
//LotTravelerDMO LotTravDMO = new LotTravelerDMO();
|
|
||||||
//LotTravDMO.ReleaseLockOnDocument((int)Session[GlobalVars.SESSION_USERID], -1);
|
|
||||||
}
|
|
||||||
|
|
||||||
catch(Exception ex)
|
|
||||||
{
|
|
||||||
Functions.WriteEvent(@User.Identity.Name + "\r\n Session Closed - \r\n" + ex.Message.ToString(), System.Diagnostics.EventLogEntryType.Error);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// This code is to allow hyperlinks from Office products to load the site without always forcing the user to log in
|
|
||||||
// It makes the browser reload the page so that the session cookies are sent properly
|
|
||||||
private static string MSUserAgentsRegex = @"[^\w](Word|Excel|PowerPoint|ms-office)([^\w]|\z)";
|
|
||||||
protected void Application_OnPostAuthenticateRequest(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
if (System.Text.RegularExpressions.Regex.IsMatch(Request.UserAgent, MSUserAgentsRegex))
|
|
||||||
{
|
|
||||||
Response.Write("<html><head><meta http-equiv='refresh' content='0'/></head><body></body></html>");
|
|
||||||
Response.End();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Application_Error(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
var ex = Server.GetLastError();
|
|
||||||
|
|
||||||
var exString = "Caught unhandled exception:\r\n";
|
|
||||||
exString += String.Format("User: {0}\r\n", @User.Identity.Name);
|
|
||||||
Exception x = ex;
|
|
||||||
while (x != null)
|
|
||||||
{
|
|
||||||
exString += x.ToString();
|
|
||||||
exString += "=====\r\n";
|
|
||||||
x = x.InnerException;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Misc.Functions.WriteEvent(exString, System.Diagnostics.EventLogEntryType.Error);
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if (exString.Length > 500)
|
|
||||||
exString = exString.Substring(0, 500);
|
|
||||||
|
|
||||||
EventLogDMO.Add(new Fab2ApprovalSystem.Models.WinEventLog()
|
|
||||||
{
|
|
||||||
UserID = @User.Identity.Name,
|
|
||||||
OperationType = "Error",
|
|
||||||
Comments = exString
|
|
||||||
});
|
|
||||||
}
|
|
||||||
catch (Exception ex2)
|
|
||||||
{
|
|
||||||
Misc.Functions.WriteEvent("Failed to write error to event log in database: " + ex2.ToString(), System.Diagnostics.EventLogEntryType.Error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
GlobalVars.AppSettings = Models.AppSettings.LoadConfigurationManager();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void Application_EndRequest() {
|
||||||
|
var context = new HttpContextWrapper(Context);
|
||||||
|
|
||||||
|
//Do a direct 401 unauthorized
|
||||||
|
if (Context.Response.StatusCode == 301 && context.Request.IsAjaxRequest()) {
|
||||||
|
Context.Response.Clear();
|
||||||
|
Context.Response.StatusCode = 401;
|
||||||
|
} else if (FormsAuthentication.IsEnabled && context.Response.StatusCode == 302
|
||||||
|
&& context.Request.IsAjaxRequest()) {
|
||||||
|
context.Response.Clear();
|
||||||
|
context.Response.StatusCode = 401;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void Session_Start(object sender, EventArgs e) {
|
||||||
|
Session[GlobalVars.ECN_VIEW_OPTION] = "Pending Approvals";
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void Session_End(object sender, EventArgs e) {
|
||||||
|
//FormsAuthentication.SignOut();
|
||||||
|
try {
|
||||||
|
Session[GlobalVars.SESSION_USERNAME] = "";
|
||||||
|
Session[GlobalVars.SESSION_USERID] = "";
|
||||||
|
Session[GlobalVars.IS_ADMIN] = "";
|
||||||
|
} catch (Exception ex) {
|
||||||
|
Functions.WriteEvent(null, @User.Identity.Name + "\r\n Session Closed - \r\n" + ex.Message.ToString(), System.Diagnostics.EventLogEntryType.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// This code is to allow hyperlinks from Office products to load the site without always forcing the user to log in
|
||||||
|
// It makes the browser reload the page so that the session cookies are sent properly
|
||||||
|
private static string MSUserAgentsRegex = @"[^\w](Word|Excel|PowerPoint|ms-office)([^\w]|\z)";
|
||||||
|
protected void Application_OnPostAuthenticateRequest(object sender, EventArgs e) {
|
||||||
|
if (System.Text.RegularExpressions.Regex.IsMatch(Request.UserAgent, MSUserAgentsRegex)) {
|
||||||
|
Response.Write("<html><head><meta http-equiv='refresh' content='0'/></head><body></body></html>");
|
||||||
|
Response.End();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Application_Error(object sender, EventArgs e) {
|
||||||
|
var ex = Server.GetLastError();
|
||||||
|
|
||||||
|
var exString = "Caught unhandled exception:\r\n";
|
||||||
|
exString += String.Format("User: {0}\r\n", @User.Identity.Name);
|
||||||
|
Exception x = ex;
|
||||||
|
while (x != null) {
|
||||||
|
exString += x.ToString();
|
||||||
|
exString += "=====\r\n";
|
||||||
|
x = x.InnerException;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
if (exString.Length > 500)
|
||||||
|
exString = exString.Substring(0, 500);
|
||||||
|
|
||||||
|
EventLogDMO.Add(new Fab2ApprovalSystem.Models.WinEventLog() {
|
||||||
|
UserID = @User.Identity.Name,
|
||||||
|
OperationType = "Error",
|
||||||
|
Comments = exString
|
||||||
|
});
|
||||||
|
} catch (Exception ex2) {
|
||||||
|
Misc.Functions.WriteEvent(null, "Failed to write error to event log in database: " + ex2.ToString(), System.Diagnostics.EventLogEntryType.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -1,33 +1,28 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Web;
|
|
||||||
using Fab2ApprovalSystem.Workers;
|
using Fab2ApprovalSystem.Workers;
|
||||||
using Quartz.Impl;
|
|
||||||
using Quartz;
|
using Quartz;
|
||||||
|
using Quartz.Impl;
|
||||||
|
|
||||||
namespace Fab2ApprovalSystem.JobSchedules
|
namespace Fab2ApprovalSystem.JobSchedules;
|
||||||
{
|
|
||||||
public class OOOTrainingReportJobSchedule
|
|
||||||
{
|
|
||||||
public static void Start()
|
|
||||||
{
|
|
||||||
ISchedulerFactory schedulerFactory = new StdSchedulerFactory();
|
|
||||||
|
|
||||||
IScheduler scheduler = schedulerFactory.GetScheduler().GetAwaiter().GetResult();
|
public class OOOTrainingReportJobSchedule {
|
||||||
scheduler.Start();
|
|
||||||
|
|
||||||
IJobDetail oooTrainingReportJob = JobBuilder.Create<OOOTrainingReportJob>()
|
public static void Start() {
|
||||||
.WithIdentity("oooTrainingReportJob", "trainingReportGroup")
|
ISchedulerFactory schedulerFactory = new StdSchedulerFactory();
|
||||||
.Build();
|
|
||||||
|
|
||||||
ITrigger oooTrainingReportTrigger = TriggerBuilder.Create()
|
IScheduler scheduler = schedulerFactory.GetScheduler().GetAwaiter().GetResult();
|
||||||
.WithIdentity("oooTrainingReportTrigger", "trainingReportGroup")
|
scheduler.Start();
|
||||||
.WithCronSchedule("0 0 12 ? * 2 *")
|
|
||||||
.ForJob(oooTrainingReportJob)
|
|
||||||
.Build();
|
|
||||||
|
|
||||||
scheduler.ScheduleJob(oooTrainingReportJob, oooTrainingReportTrigger);
|
IJobDetail oooTrainingReportJob = JobBuilder.Create<OOOTrainingReportJob>()
|
||||||
}
|
.WithIdentity("oooTrainingReportJob", "trainingReportGroup")
|
||||||
|
.Build();
|
||||||
|
|
||||||
|
ITrigger oooTrainingReportTrigger = TriggerBuilder.Create()
|
||||||
|
.WithIdentity("oooTrainingReportTrigger", "trainingReportGroup")
|
||||||
|
.WithCronSchedule("0 0 12 ? * 2 *")
|
||||||
|
.ForJob(oooTrainingReportJob)
|
||||||
|
.Build();
|
||||||
|
|
||||||
|
scheduler.ScheduleJob(oooTrainingReportJob, oooTrainingReportTrigger);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -8,69 +8,61 @@ using Fab2ApprovalSystem.Utilities;
|
|||||||
|
|
||||||
using Quartz;
|
using Quartz;
|
||||||
|
|
||||||
namespace Fab2ApprovalSystem.Workers
|
namespace Fab2ApprovalSystem.Workers;
|
||||||
{
|
|
||||||
public class OOOTrainingReportJob:IJob
|
|
||||||
{
|
|
||||||
UserAccountDMO userDMO = new UserAccountDMO();
|
|
||||||
AdminDMO adminDMO = new AdminDMO();
|
|
||||||
TrainingDMO trainingDMO = new TrainingDMO();
|
|
||||||
ECN_DMO ecnDMO = new ECN_DMO();
|
|
||||||
public EmailUtilities emailer = new EmailUtilities();
|
|
||||||
|
|
||||||
async Task IJob.Execute(IJobExecutionContext context)
|
public class OOOTrainingReportJob : IJob {
|
||||||
{
|
|
||||||
await Task.Run(() => {
|
|
||||||
|
|
||||||
string emailBody = "<h1>Mesa Approval Open Training Assignments Report - OOO</h1> <br />";
|
private readonly UserAccountDMO userDMO = new();
|
||||||
emailBody += "<p>The following contains open training assignments in the Mesa Approval system for out of office users.";
|
private readonly AdminDMO adminDMO = new();
|
||||||
emailBody += " Please ensure they complete their training assignments promptly upon their return.</p><br />";
|
private readonly TrainingDMO trainingDMO = new();
|
||||||
emailBody += "<style>table,th,td{border: 1px solid black;}</style>";
|
private readonly ECN_DMO ecnDMO = new();
|
||||||
//Get all users set up to receive the training report email.
|
|
||||||
List<TrainingReportUser> trainingReportUsers = adminDMO.GetTrainingReportUsers();
|
|
||||||
List<string> emailList = new List<string>();
|
|
||||||
foreach (var user in trainingReportUsers)
|
|
||||||
{
|
|
||||||
string userEmail = userDMO.GetUserByID(user.UserId).Email;
|
|
||||||
emailList.Add(userEmail);
|
|
||||||
}
|
|
||||||
//emailList.Add("Chase.Tucker@infineon.com");
|
|
||||||
//Get a list of open trainings
|
|
||||||
List<Training> openTrainings = trainingDMO.GetAllOpenTrainings();
|
|
||||||
|
|
||||||
foreach (Training training in openTrainings)
|
async Task IJob.Execute(IJobExecutionContext context) {
|
||||||
{
|
await Task.Run(() => {
|
||||||
string trainingSection = "";
|
string emailBody = "<h1>Mesa Approval Open Training Assignments Report - OOO</h1> <br />";
|
||||||
int trainingSectionUserCount = 0;
|
emailBody += "<p>The following contains open training assignments in the Mesa Approval system for out of office users.";
|
||||||
string ecnTitle = ecnDMO.GetECN(training.ECN).Title;
|
emailBody += " Please ensure they complete their training assignments promptly upon their return.</p><br />";
|
||||||
trainingSection += "<h3>" + training.ECN + " - " + ecnTitle + "</h3>";
|
emailBody += "<style>table,th,td{border: 1px solid black;}</style>";
|
||||||
|
//Get all users set up to receive the training report email.
|
||||||
|
List<TrainingReportUser> trainingReportUsers = adminDMO.GetTrainingReportUsers();
|
||||||
|
List<string> emailList = new();
|
||||||
|
foreach (TrainingReportUser user in trainingReportUsers) {
|
||||||
|
string userEmail = userDMO.GetUserByID(user.UserId).Email;
|
||||||
|
emailList.Add(userEmail);
|
||||||
|
}
|
||||||
|
//emailList.Add("Chase.Tucker@infineon.com");
|
||||||
|
//Get a list of open trainings
|
||||||
|
List<Training> openTrainings = trainingDMO.GetAllOpenTrainings();
|
||||||
|
|
||||||
trainingSection += "<table>";
|
foreach (Training training in openTrainings) {
|
||||||
trainingSection += "<tr><th>Name</th><th>Date Assigned</th></tr>";
|
string trainingSection = "";
|
||||||
List<TrainingAssignment> openAssignments = trainingDMO.GetOpenAssignmentsByTrainingID(training.TrainingID);
|
int trainingSectionUserCount = 0;
|
||||||
foreach (TrainingAssignment assignment in openAssignments)
|
string ecnTitle = ecnDMO.GetECN(training.ECN).Title;
|
||||||
{
|
trainingSection += "<h3>" + training.ECN + " - " + ecnTitle + "</h3>";
|
||||||
|
|
||||||
if (userDMO.GetUserByID(assignment.UserID).OOO)
|
trainingSection += "<table>";
|
||||||
{
|
trainingSection += "<tr><th>Name</th><th>Date Assigned</th></tr>";
|
||||||
trainingSectionUserCount++;
|
List<TrainingAssignment> openAssignments = trainingDMO.GetOpenAssignmentsByTrainingID(training.TrainingID);
|
||||||
|
foreach (TrainingAssignment assignment in openAssignments) {
|
||||||
|
if (userDMO.GetUserByID(assignment.UserID).OOO) {
|
||||||
|
trainingSectionUserCount++;
|
||||||
|
|
||||||
DateTime? assignmentDate = assignment.DateAssigned;
|
DateTime? assignmentDate = assignment.DateAssigned;
|
||||||
|
|
||||||
string DateAssigned = assignmentDate.HasValue ? assignmentDate.Value.ToString("MM/dd/yyyy") : "<not available>";
|
string DateAssigned = assignmentDate.HasValue ? assignmentDate.Value.ToString("MM/dd/yyyy") : "<not available>";
|
||||||
|
|
||||||
trainingSection += "<tr><td>" + assignment.FullName + "</td><td>" + DateAssigned + "</td>";
|
trainingSection += "<tr><td>" + assignment.FullName + "</td><td>" + DateAssigned + "</td>";
|
||||||
|
|
||||||
trainingSection += "</tr>";
|
trainingSection += "</tr>";
|
||||||
}
|
|
||||||
}
|
}
|
||||||
trainingSection += "</table>";
|
|
||||||
if (trainingSectionUserCount > 0) emailBody += trainingSection;
|
|
||||||
}
|
}
|
||||||
string recipientEmail = "";
|
trainingSection += "</table>";
|
||||||
List<string> ccRecipients = emailList;
|
if (trainingSectionUserCount > 0)
|
||||||
emailer.SendNotification("MesaFabApproval@infineon.com", ccRecipients, "Mesa Approval Open Training Report - OOO", emailBody, "Open Training Report - OOO");
|
emailBody += trainingSection;
|
||||||
});
|
}
|
||||||
}
|
string recipientEmail = "";
|
||||||
|
List<string> ccRecipients = emailList;
|
||||||
|
EmailUtilities.SendNotification("MesaFabApproval@infineon.com", ccRecipients, "Open Training Report - OOO", emailBody);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,39 +1,32 @@
|
|||||||
using Fab2ApprovalSystem.Models;
|
using System.Collections.Generic;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Web;
|
|
||||||
|
|
||||||
namespace Fab2ApprovalSystem.Misc
|
using Fab2ApprovalSystem.Models;
|
||||||
{
|
|
||||||
public class DemoHelper
|
|
||||||
{
|
|
||||||
public static List<string> GetCountries()
|
|
||||||
{
|
|
||||||
return new List<string>
|
|
||||||
{
|
|
||||||
"USA", "England", "Belguim", "France", "Italy"
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<TestModel> ListOfModels = new List<TestModel>();
|
namespace Fab2ApprovalSystem.Misc;
|
||||||
|
|
||||||
private static DemoHelper m_dHelper = new DemoHelper();
|
public class DemoHelper {
|
||||||
public static DemoHelper Instance
|
|
||||||
{
|
|
||||||
get { return m_dHelper; }
|
|
||||||
}
|
|
||||||
|
|
||||||
private DemoHelper()
|
|
||||||
{
|
|
||||||
TestModel A1 = new TestModel();
|
|
||||||
A1.Name = "Eran";
|
|
||||||
A1.Countries = new List<string>();
|
|
||||||
A1.Countries.Add("England");
|
|
||||||
A1.Countries.Add("Belguim");
|
|
||||||
ListOfModels.Add(A1);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
public static List<string> GetCountries() {
|
||||||
|
return new List<string>
|
||||||
|
{
|
||||||
|
"USA", "England", "Belguim", "France", "Italy"
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<TestModel> ListOfModels = new();
|
||||||
|
|
||||||
|
private static readonly DemoHelper m_dHelper = new();
|
||||||
|
public static DemoHelper Instance {
|
||||||
|
get { return m_dHelper; }
|
||||||
|
}
|
||||||
|
|
||||||
|
private DemoHelper() {
|
||||||
|
TestModel A1 = new();
|
||||||
|
A1.Name = "Eran";
|
||||||
|
A1.Countries = new List<string>();
|
||||||
|
A1.Countries.Add("England");
|
||||||
|
A1.Countries.Add("Belguim");
|
||||||
|
ListOfModels.Add(A1);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -1,168 +1,3 @@
|
|||||||
using System;
|
namespace Fab2ApprovalSystem.Misc;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Web;
|
|
||||||
|
|
||||||
//using DFClib.DfException;
|
public class Documentum { }
|
||||||
//using DFCLib.DfId;
|
|
||||||
//using DFCLib.IDfId;
|
|
||||||
//using DFCLib.IDfList;
|
|
||||||
//using DFCLib.IDfLoginInfo;
|
|
||||||
|
|
||||||
//using DFCLib.IDfClient;
|
|
||||||
//using DFCLib.IDfDocument;
|
|
||||||
//using DFCLib.IDfSession;
|
|
||||||
//using DFCLib.IDfSessionManager;
|
|
||||||
|
|
||||||
//using DFCLib.DfClientX;
|
|
||||||
//using DFCLib.IDfClientX;
|
|
||||||
//using DFCLib.IDfFile;
|
|
||||||
//using DFCLib.IDfImportNode;
|
|
||||||
//using DFCLib.IDfImportOperation;
|
|
||||||
|
|
||||||
namespace Fab2ApprovalSystem.Misc
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
public class Documentum
|
|
||||||
{
|
|
||||||
|
|
||||||
//public static void Process(string m_fileName)
|
|
||||||
//{
|
|
||||||
// String username = "rkotian1";
|
|
||||||
// String password = "";
|
|
||||||
// String repoName = "globaldocudms";
|
|
||||||
// String filename = m_fileName; // for example {"C:\\devprog\\ECN12345.zip"};
|
|
||||||
// String destFldrId = "0c00359980061536";
|
|
||||||
|
|
||||||
// try
|
|
||||||
// {
|
|
||||||
// DFCLib.IDfSessionManager sessMgr = createSessionManager();
|
|
||||||
// addIdentity(sessMgr, username, password, repoName);
|
|
||||||
// importFiles(sessMgr, repoName, filename, destFldrId);
|
|
||||||
// }
|
|
||||||
// catch (Exception ex)
|
|
||||||
// {
|
|
||||||
// //string s = ex.InnerException.ToString();
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
//}
|
|
||||||
|
|
||||||
///**
|
|
||||||
// * Imports a single file in the repository
|
|
||||||
// *
|
|
||||||
// */
|
|
||||||
//private static void importFiles(DFCLib.IDfSessionManager sessMgr, String repoName, String filename, String destFldrId)
|
|
||||||
//{
|
|
||||||
// DFCLib.IDfSession sess = null;
|
|
||||||
// try
|
|
||||||
// {
|
|
||||||
// DFCLib.IDfClientX clientX = new DFCLib.DfClientX();
|
|
||||||
|
|
||||||
// DFCLib.IDfImportOperation impOper = clientX.getImportOperation();
|
|
||||||
|
|
||||||
// //DFCLib.IDfId destId = new DfId(destFldrId);
|
|
||||||
// DFCLib.IDfId destId = clientX.getId(destFldrId);
|
|
||||||
|
|
||||||
// //This will import all files to a single destination.
|
|
||||||
// //To import each file to a different destination
|
|
||||||
// //set call this method on the import node.
|
|
||||||
// //impOper.setDestinationFolderId(destId);
|
|
||||||
// DFCLib.IDfFile localFile = clientX.getFile(filename);
|
|
||||||
// DFCLib.IDfImportNode impNode = (DFCLib.IDfImportNode)impOper.add(localFile);
|
|
||||||
|
|
||||||
// //You can set different destination ids here for each import node
|
|
||||||
// //This way files get imported to different destinations.
|
|
||||||
// impNode.setDestinationFolderId(destId);
|
|
||||||
|
|
||||||
// //set custom object type. If not called dm_document is used.
|
|
||||||
// impNode.setDocbaseObjectType("dp_text");
|
|
||||||
|
|
||||||
// int randomName = ((int)(new Random().Next(int.MinValue, int.MaxValue) * 100));
|
|
||||||
// //set custom object name.
|
|
||||||
// impNode.setNewObjectName(localFile.getName() + "" + randomName.ToString());
|
|
||||||
// //The import operation determines the file format.
|
|
||||||
// //It is also possible to explicitly set the format.
|
|
||||||
// //impNode.setFormat("");
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// sess = sessMgr.getSession(repoName);
|
|
||||||
// impOper.setSession(sess);
|
|
||||||
|
|
||||||
// if (impOper.execute())
|
|
||||||
// {
|
|
||||||
// Console.WriteLine("Import Operation Succeeded");
|
|
||||||
// DFCLib.IDfList newObjLst = impOper.getNewObjects();
|
|
||||||
// for (int i = 0; i < newObjLst.getCount(); i++)
|
|
||||||
// {
|
|
||||||
// DFCLib.IDfDocument newObj = (DFCLib.IDfDocument)newObjLst.get(i);
|
|
||||||
// //you can set any custom/standard attr values on the document now
|
|
||||||
// //newObj.setString("my_attr","someValue");
|
|
||||||
// //newObj.save();
|
|
||||||
// Console.WriteLine("Created Object: " + newObj.getObjectId());
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// Console.WriteLine("Import Operation Failed");
|
|
||||||
// DFCLib.IDfList errList = impOper.getErrors();
|
|
||||||
// for (int i = 0; i < errList.getCount(); i++)
|
|
||||||
// {
|
|
||||||
// DFCLib.IDfOperationError err = (DFCLib.IDfOperationError)errList.get(i);
|
|
||||||
// Console.WriteLine(err.getMessage());
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// finally
|
|
||||||
// {
|
|
||||||
// if (sess != null)
|
|
||||||
// {
|
|
||||||
// sessMgr.release(sess);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
//}
|
|
||||||
|
|
||||||
///**
|
|
||||||
// * Creates a new session manager instance. The session manager does not have
|
|
||||||
// * any identities associated with it.
|
|
||||||
// * @return a new session manager object.
|
|
||||||
//*/
|
|
||||||
//private static DFCLib.IDfSessionManager createSessionManager()
|
|
||||||
//{
|
|
||||||
// DFCLib.IDfClientX clientX = new DFCLib.DfClientX();
|
|
||||||
// DFCLib.IDfClient localClient = clientX.getLocalClient();
|
|
||||||
// DFCLib.IDfSessionManager sessMgr = localClient.newSessionManager();
|
|
||||||
// return sessMgr;
|
|
||||||
//}
|
|
||||||
|
|
||||||
///**
|
|
||||||
// * Adds a new identity to the session manager.
|
|
||||||
// *
|
|
||||||
// */
|
|
||||||
//private static void addIdentity(DFCLib.IDfSessionManager sm, String username,
|
|
||||||
// String password, String repoName)
|
|
||||||
//{
|
|
||||||
// DFCLib.IDfClientX clientX = new DFCLib.DfClientX();
|
|
||||||
|
|
||||||
// DFCLib.IDfLoginInfo li = clientX.getLoginInfo();
|
|
||||||
// li.setUser(username);
|
|
||||||
// li.setPassword(password);
|
|
||||||
|
|
||||||
// // check if session manager already has an identity.
|
|
||||||
// // if yes, remove it.
|
|
||||||
// if (sm.hasIdentity(repoName))
|
|
||||||
// {
|
|
||||||
// sm.clearIdentity(repoName);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// sm.setIdentity(repoName, li);
|
|
||||||
//}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,7 @@
|
|||||||
using Excel;
|
#if !NET8
|
||||||
|
|
||||||
|
using Excel;
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
@ -6,18 +9,15 @@ using System.IO;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Web;
|
using System.Web;
|
||||||
|
|
||||||
namespace Fab2ApprovalSystem.Misc
|
namespace Fab2ApprovalSystem.Misc {
|
||||||
{
|
|
||||||
public class ExcelData
|
public class ExcelData {
|
||||||
{
|
|
||||||
string _path;
|
string _path;
|
||||||
public ExcelData(string path)
|
public ExcelData(string path) {
|
||||||
{
|
|
||||||
_path = path;
|
_path = path;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IExcelDataReader getExcelReader()
|
public IExcelDataReader getExcelReader() {
|
||||||
{
|
|
||||||
// ExcelDataReader works with the binary Excel file, so it needs a FileStream
|
// ExcelDataReader works with the binary Excel file, so it needs a FileStream
|
||||||
// to get started. This is how we avoid dependencies on ACE or Interop:
|
// to get started. This is how we avoid dependencies on ACE or Interop:
|
||||||
|
|
||||||
@ -25,27 +25,21 @@ namespace Fab2ApprovalSystem.Misc
|
|||||||
// We return the interface, so that
|
// We return the interface, so that
|
||||||
IExcelDataReader reader = null;
|
IExcelDataReader reader = null;
|
||||||
|
|
||||||
try
|
try {
|
||||||
{
|
if (_path.EndsWith(".xls")) {
|
||||||
if (_path.EndsWith(".xls"))
|
|
||||||
{
|
|
||||||
reader = ExcelReaderFactory.CreateBinaryReader(stream);
|
reader = ExcelReaderFactory.CreateBinaryReader(stream);
|
||||||
}
|
}
|
||||||
if (_path.EndsWith(".xlsx"))
|
if (_path.EndsWith(".xlsx")) {
|
||||||
{
|
|
||||||
reader = ExcelReaderFactory.CreateOpenXmlReader(stream);
|
reader = ExcelReaderFactory.CreateOpenXmlReader(stream);
|
||||||
}
|
}
|
||||||
return reader;
|
return reader;
|
||||||
}
|
} catch (Exception) {
|
||||||
catch (Exception)
|
|
||||||
{
|
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class ExcelLotInfo
|
public class ExcelLotInfo {
|
||||||
{
|
|
||||||
public string LotNo { get; set; }
|
public string LotNo { get; set; }
|
||||||
public string LotDispo { get; set; }
|
public string LotDispo { get; set; }
|
||||||
}
|
}
|
||||||
@ -54,29 +48,23 @@ namespace Fab2ApprovalSystem.Misc
|
|||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public IEnumerable<ExcelLotInfo> ReadData()
|
public IEnumerable<ExcelLotInfo> ReadData() {
|
||||||
{
|
|
||||||
var r = new List<ExcelLotInfo>();
|
var r = new List<ExcelLotInfo>();
|
||||||
var excelData = new ExcelData(_path);
|
var excelData = new ExcelData(_path);
|
||||||
var lots = excelData.getData().ToList();
|
var lots = excelData.getData().ToList();
|
||||||
|
|
||||||
int lotDispoColumnIndex = -1;
|
int lotDispoColumnIndex = -1;
|
||||||
foreach (DataColumn col in lots[0].Table.Columns)
|
foreach (DataColumn col in lots[0].Table.Columns) {
|
||||||
{
|
if (col.ColumnName.ToLower().Contains("dispo")) {
|
||||||
if (col.ColumnName.ToLower().Contains("dispo"))
|
|
||||||
{
|
|
||||||
lotDispoColumnIndex = col.Ordinal;
|
lotDispoColumnIndex = col.Ordinal;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var row in lots)
|
foreach (var row in lots) {
|
||||||
{
|
|
||||||
string temValue = row[0].ToString();
|
string temValue = row[0].ToString();
|
||||||
if (temValue.Trim().Length > 0 && temValue.Trim().Length <= 10 )
|
if (temValue.Trim().Length > 0 && temValue.Trim().Length <= 10) {
|
||||||
{
|
r.Add(new ExcelLotInfo() {
|
||||||
r.Add(new ExcelLotInfo()
|
|
||||||
{
|
|
||||||
LotNo = row[0].ToString(),
|
LotNo = row[0].ToString(),
|
||||||
LotDispo = (lotDispoColumnIndex >= 0 ? row[lotDispoColumnIndex].ToString() : "")
|
LotDispo = (lotDispoColumnIndex >= 0 ? row[lotDispoColumnIndex].ToString() : "")
|
||||||
});
|
});
|
||||||
@ -86,25 +74,18 @@ namespace Fab2ApprovalSystem.Misc
|
|||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public IEnumerable<string> ReadQDBFlagData() {
|
||||||
public IEnumerable<string> ReadQDBFlagData()
|
|
||||||
{
|
|
||||||
List<string> s = new List<string>();
|
List<string> s = new List<string>();
|
||||||
// We return the interface, so that
|
// We return the interface, so that
|
||||||
var excelData = new ExcelData(_path);
|
var excelData = new ExcelData(_path);
|
||||||
//var albums = excelData.getData("Sheet1");
|
//var albums = excelData.getData("Sheet1");
|
||||||
var lotNos = excelData.getData();
|
var lotNos = excelData.getData();
|
||||||
foreach (var row in lotNos)
|
foreach (var row in lotNos) {
|
||||||
{
|
|
||||||
string temValue = row[0].ToString();
|
string temValue = row[0].ToString();
|
||||||
if (temValue.Trim().Length > 0 && temValue.Trim().Length == 9)
|
if (temValue.Trim().Length > 0 && temValue.Trim().Length == 9) {
|
||||||
{
|
if (row[2].ToString().ToUpper() != "YES" && row[2].ToString().ToUpper() != "NO") {
|
||||||
if (row[2].ToString().ToUpper() != "YES" && row[2].ToString().ToUpper() != "NO")
|
|
||||||
{
|
|
||||||
throw new Exception("Invalid data in the file");
|
throw new Exception("Invalid data in the file");
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
s.Add(row[0].ToString() + "~" + row[1] + "~" + row[2]);
|
s.Add(row[0].ToString() + "~" + row[1] + "~" + row[2]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -113,23 +94,12 @@ namespace Fab2ApprovalSystem.Misc
|
|||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
//public IEnumerable<DataRow> getData(string sheet, bool firstRowIsColumnNames = true)
|
|
||||||
//{
|
|
||||||
// var reader = this.getExcelReader();
|
|
||||||
// reader.IsFirstRowAsColumnNames = firstRowIsColumnNames;
|
|
||||||
// var workSheet = reader.AsDataSet().Tables[sheet];
|
|
||||||
// var rows = from DataRow a in workSheet.Rows select a;
|
|
||||||
// return rows;
|
|
||||||
|
|
||||||
//}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="firstRowIsColumnNames"></param>
|
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public IEnumerable<DataRow> getData(bool firstRowIsColumnNames = true)
|
public IEnumerable<DataRow> getData(bool firstRowIsColumnNames = true) {
|
||||||
{
|
|
||||||
var reader = this.getExcelReader();
|
var reader = this.getExcelReader();
|
||||||
reader.IsFirstRowAsColumnNames = firstRowIsColumnNames;
|
reader.IsFirstRowAsColumnNames = firstRowIsColumnNames;
|
||||||
var workSheet = reader.AsDataSet().Tables[0];
|
var workSheet = reader.AsDataSet().Tables[0];
|
||||||
@ -138,7 +108,7 @@ namespace Fab2ApprovalSystem.Misc
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
@ -1,59 +1,48 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Web;
|
|
||||||
|
|
||||||
namespace Fab2ApprovalSystem.Misc
|
using Fab2ApprovalSystem.Models;
|
||||||
{
|
|
||||||
class FTPWrapper
|
|
||||||
{
|
|
||||||
string m_OutputFile;
|
|
||||||
string m_DestinationFileName;
|
|
||||||
//Functions functions = new Functions();
|
|
||||||
public FTPWrapper(string outputFile, string destinationFileName)
|
|
||||||
{
|
|
||||||
m_OutputFile = outputFile;
|
|
||||||
m_DestinationFileName = destinationFileName;
|
|
||||||
|
|
||||||
|
namespace Fab2ApprovalSystem.Misc;
|
||||||
|
|
||||||
|
internal class FTPWrapper {
|
||||||
|
|
||||||
|
private readonly string _OutputFile;
|
||||||
|
private readonly string _DestinationFileName;
|
||||||
|
private readonly AppSettings _AppSettings;
|
||||||
|
|
||||||
|
public FTPWrapper(AppSettings appSettings, string outputFile, string destinationFileName) {
|
||||||
|
_OutputFile = outputFile;
|
||||||
|
_AppSettings = appSettings;
|
||||||
|
_DestinationFileName = destinationFileName;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public void FTPToSPN() {
|
||||||
|
FTP ftpLib = new();
|
||||||
|
|
||||||
|
//Connect to the FTP server
|
||||||
|
try {
|
||||||
|
ftpLib.Connect(_AppSettings.FTPServer, _AppSettings.FTPUser, _AppSettings.FTPPassword);
|
||||||
|
} catch (Exception ec) {
|
||||||
|
Functions.WriteEvent(_AppSettings, "Listener - ProcessFile(): FTP Connection Error " + _OutputFile + " - " + ec.Source +
|
||||||
|
": " + ec.Message, System.Diagnostics.EventLogEntryType.Error);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
//Upload the file
|
||||||
///
|
try {
|
||||||
/// </summary>
|
int pct = 0;
|
||||||
public void FTPToSPN()
|
ftpLib.OpenUpload(_OutputFile, _DestinationFileName);
|
||||||
{
|
while (ftpLib.DoUpload() > 0)
|
||||||
FTP ftpLib = new FTP();
|
pct = (int)((ftpLib.BytesTotal * 100) / ftpLib.FileSize);
|
||||||
|
Functions.WriteEvent(_AppSettings, _OutputFile + " was sucessfully FTPed to SPN.", System.Diagnostics.EventLogEntryType.Information);
|
||||||
//Connect to the FTP server
|
} catch (Exception eu) {
|
||||||
try
|
Functions.WriteEvent(_AppSettings, "MRB - FTPToSPN(): FTP Upload Error " + _OutputFile + " - " + eu.Source +
|
||||||
{
|
": " + eu.Message, System.Diagnostics.EventLogEntryType.Error);
|
||||||
ftpLib.Connect(Functions.FTPServer(), Functions.FTPUser(), Functions.FTPPassword());
|
throw new Exception(eu.Source + ": " + eu.Message);
|
||||||
}
|
|
||||||
catch (Exception ec)
|
|
||||||
{
|
|
||||||
Functions.WriteEvent("Listener - ProcessFile(): FTP Connection Error " + m_OutputFile + " - " + ec.Source +
|
|
||||||
": " + ec.Message, System.Diagnostics.EventLogEntryType.Error);
|
|
||||||
}
|
|
||||||
|
|
||||||
//Upload the file
|
|
||||||
try
|
|
||||||
{
|
|
||||||
int pct = 0;
|
|
||||||
ftpLib.OpenUpload(m_OutputFile, m_DestinationFileName);
|
|
||||||
while (ftpLib.DoUpload() > 0)
|
|
||||||
pct = (int)((ftpLib.BytesTotal * 100) / ftpLib.FileSize);
|
|
||||||
Functions.WriteEvent(m_OutputFile + " was sucessfully FTPed to SPN.", System.Diagnostics.EventLogEntryType.Information);
|
|
||||||
}
|
|
||||||
catch (Exception eu)
|
|
||||||
{
|
|
||||||
Functions.WriteEvent("MRB - FTPToSPN(): FTP Upload Error " + m_OutputFile + " - " + eu.Source +
|
|
||||||
": " + eu.Message, System.Diagnostics.EventLogEntryType.Error);
|
|
||||||
throw new Exception(eu.Source + ": " + eu.Message);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -1,261 +1,199 @@
|
|||||||
|
#pragma warning disable CS8019
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Configuration;
|
using System.Configuration;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Web;
|
using System.Web;
|
||||||
|
|
||||||
|
#if !NET8
|
||||||
using System.Web.Security;
|
using System.Web.Security;
|
||||||
|
#endif
|
||||||
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Net.Mail;
|
using System.Net.Mail;
|
||||||
using System.DirectoryServices;
|
using System.DirectoryServices;
|
||||||
using System.DirectoryServices.AccountManagement;
|
using System.DirectoryServices.AccountManagement;
|
||||||
|
|
||||||
namespace Fab2ApprovalSystem.Misc {
|
#pragma warning restore CS8019
|
||||||
public static class Functions {
|
|
||||||
/// <summary>
|
|
||||||
/// Writes to the Application Event Log and sends an email notification if appropriate
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="logtext"></param>
|
|
||||||
/// <param name="eventType"></param>
|
|
||||||
public static void WriteEvent(string logtext, System.Diagnostics.EventLogEntryType eventType) {
|
|
||||||
//#if(!DEBUG)
|
|
||||||
EmailNotification en = new EmailNotification();
|
|
||||||
EventLog ev = new EventLog("Application");
|
|
||||||
ev.Source = "Fab Approval System";
|
|
||||||
|
|
||||||
try {
|
using Fab2ApprovalSystem.Models;
|
||||||
//Write to the Event Log
|
|
||||||
ev.WriteEntry(logtext, eventType);
|
|
||||||
|
|
||||||
////Send an email notification if appropriate
|
namespace Fab2ApprovalSystem.Misc;
|
||||||
////Don't attempt to send an email if the error is pertaining to an email problem
|
|
||||||
if (!logtext.Contains("SendEmailNotification()")) {
|
public static class Functions {
|
||||||
//Only send email notifications for Error and Warning level events
|
/// <summary>
|
||||||
if (eventType == System.Diagnostics.EventLogEntryType.Error)
|
/// Writes to the Application Event Log and sends an email notification if appropriate
|
||||||
en.SendNotificationEmailToAdmin(ev.Source + " - Error Notification", logtext, MailPriority.High);
|
/// </summary>
|
||||||
//else if (eventType == System.Diagnostics.EventLogEntryType.Warning)
|
|
||||||
// SendEmailNotification(ErrorRecipient(), ev.Source + " Warning Event Logged", logtext, NORMAL_PRI);
|
public static void WriteEvent(AppSettings? appSettings, string logtext, EventLogEntryType eventType) {
|
||||||
}
|
//#if(!DEBUG)
|
||||||
} catch {
|
#if !NET8
|
||||||
//throw;
|
EmailNotification? en = appSettings is null ? null : new EmailNotification(appSettings);
|
||||||
} finally {
|
#endif
|
||||||
ev = null;
|
EventLog ev = new("Application");
|
||||||
|
ev.Source = "Fab Approval System";
|
||||||
|
|
||||||
|
try {
|
||||||
|
//Write to the Event Log
|
||||||
|
ev.WriteEntry(logtext, eventType);
|
||||||
|
|
||||||
|
////Send an email notification if appropriate
|
||||||
|
////Don't attempt to send an email if the error is pertaining to an email problem
|
||||||
|
if (!logtext.Contains("SendEmailNotification()")) {
|
||||||
|
//Only send email notifications for Error and Warning level events
|
||||||
|
#if !NET8
|
||||||
|
if (appSettings is not null && eventType == System.Diagnostics.EventLogEntryType.Error)
|
||||||
|
en.SendNotificationEmailToAdmin(ev.Source + " - Error Notification", logtext, MailPriority.High);
|
||||||
|
#endif
|
||||||
|
//else if (eventType == System.Diagnostics.EventLogEntryType.Warning)
|
||||||
|
// SendEmailNotification(ErrorRecipient(), ev.Source + " Warning Event Logged", logtext, NORMAL_PRI);
|
||||||
}
|
}
|
||||||
}
|
} catch {
|
||||||
|
//throw;
|
||||||
/// <summary>
|
} finally {
|
||||||
/// Returns the FTP Server Name
|
ev = null;
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
public static string FTPServer() {
|
|
||||||
ConfigurationManager.RefreshSection("appSettings");
|
|
||||||
return ConfigurationManager.AppSettings["FTP Server"];
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns the FTP User Name
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
public static string FTPUser() {
|
|
||||||
ConfigurationManager.RefreshSection("appSettings");
|
|
||||||
return ConfigurationManager.AppSettings["FTP User"];
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns the FTP Password
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
public static string FTPPassword() {
|
|
||||||
ConfigurationManager.RefreshSection("appSettings");
|
|
||||||
return ConfigurationManager.AppSettings["FTP Password"];
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
public static string GetAttachmentFolder() {
|
|
||||||
ConfigurationManager.RefreshSection("appSettings");
|
|
||||||
return ConfigurationManager.AppSettings["AttachmentFolder"];
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="oldECNNumber"></param>
|
|
||||||
/// <param name="newECNNumber"></param>
|
|
||||||
public static void CopyAttachments(int oldECNNumber, int newECNNumber) {
|
|
||||||
// The Name of the Upload component is "files"
|
|
||||||
string oldFolderPath = Functions.GetAttachmentFolder() + "ECN\\" + oldECNNumber.ToString();
|
|
||||||
string newFolderPath = Functions.GetAttachmentFolder() + "ECN\\" + newECNNumber.ToString();
|
|
||||||
|
|
||||||
DirectoryInfo newdi = new DirectoryInfo(newFolderPath);
|
|
||||||
|
|
||||||
if (!newdi.Exists)
|
|
||||||
newdi.Create();
|
|
||||||
|
|
||||||
FileInfo[] existingFiles = new DirectoryInfo(oldFolderPath).GetFiles();
|
|
||||||
foreach (FileInfo file in existingFiles) {
|
|
||||||
if (!file.Name.Contains("ECNApprovalLog_" + oldECNNumber.ToString()) && !file.Name.Contains("ECNForm_" + oldECNNumber.ToString()))
|
|
||||||
//var fileName = Path.GetFileName(file.FullName);
|
|
||||||
file.CopyTo(Path.Combine(newFolderPath, file.Name));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="userID"></param>
|
|
||||||
/// <param name="pwd"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public static bool NA_ADAuthenticate(string userID, string pwd) {
|
|
||||||
|
|
||||||
string naContainer = ConfigurationManager.AppSettings["NAContainer"];
|
|
||||||
string naDomain = ConfigurationManager.AppSettings["NADomain"];
|
|
||||||
try {
|
|
||||||
PrincipalContext contextUser = new PrincipalContext(ContextType.Domain,
|
|
||||||
naDomain,
|
|
||||||
naContainer,
|
|
||||||
ContextOptions.Negotiate, userID, pwd);
|
|
||||||
|
|
||||||
UserPrincipal up = UserPrincipal.FindByIdentity(contextUser, userID);
|
|
||||||
if (null == up)
|
|
||||||
return false;
|
|
||||||
else
|
|
||||||
return true;
|
|
||||||
} catch {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="userID"></param>
|
|
||||||
/// <param name="pwd"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public static bool IFX_ADAuthenticate(string userID, string pwd) {
|
|
||||||
|
|
||||||
string container = ConfigurationManager.AppSettings["IFXContainer"];
|
|
||||||
string domain = ConfigurationManager.AppSettings["IFXDomain"];
|
|
||||||
try {
|
|
||||||
PrincipalContext contextUser = new PrincipalContext(ContextType.Domain,
|
|
||||||
domain,
|
|
||||||
container,
|
|
||||||
ContextOptions.Negotiate, userID, pwd);
|
|
||||||
|
|
||||||
UserPrincipal up = UserPrincipal.FindByIdentity(contextUser, userID);
|
|
||||||
if (null == up)
|
|
||||||
return false;
|
|
||||||
else
|
|
||||||
return true;
|
|
||||||
} catch {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static string FTPSPNBatch() {
|
|
||||||
ConfigurationManager.RefreshSection("appSettings");
|
|
||||||
return ConfigurationManager.AppSettings["FTPSPNBatchFileName"];
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
public static string FTPSPNBatch_Test() {
|
|
||||||
ConfigurationManager.RefreshSection("appSettings");
|
|
||||||
return ConfigurationManager.AppSettings["FTPSPNBatchFileName_Test"];
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="casection"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public static string CASectionMapper(GlobalVars.CASection casection) {
|
|
||||||
switch (casection) {
|
|
||||||
case GlobalVars.CASection.Main:
|
|
||||||
return "Main";
|
|
||||||
|
|
||||||
case GlobalVars.CASection.D1:
|
|
||||||
return "D1";
|
|
||||||
|
|
||||||
case GlobalVars.CASection.D2:
|
|
||||||
return "D2";
|
|
||||||
|
|
||||||
case GlobalVars.CASection.D3:
|
|
||||||
return "D3";
|
|
||||||
|
|
||||||
case GlobalVars.CASection.D4:
|
|
||||||
return "D4";
|
|
||||||
|
|
||||||
case GlobalVars.CASection.D5:
|
|
||||||
return "D5";
|
|
||||||
|
|
||||||
case GlobalVars.CASection.D6:
|
|
||||||
return "D6";
|
|
||||||
|
|
||||||
case GlobalVars.CASection.D7:
|
|
||||||
return "D7";
|
|
||||||
|
|
||||||
case GlobalVars.CASection.D8:
|
|
||||||
return "D8";
|
|
||||||
case GlobalVars.CASection.CF: // CA Findings
|
|
||||||
return "CF";
|
|
||||||
}
|
|
||||||
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
public static string DocumentTypeMapper(GlobalVars.DocumentType docType) {
|
|
||||||
switch (docType) {
|
|
||||||
case GlobalVars.DocumentType.Audit:
|
|
||||||
return "Audit";
|
|
||||||
case GlobalVars.DocumentType.ChangeControl:
|
|
||||||
return "ChangeControl";
|
|
||||||
case GlobalVars.DocumentType.CorrectiveAction:
|
|
||||||
return "CorrectiveAction";
|
|
||||||
case GlobalVars.DocumentType.ECN:
|
|
||||||
return "ECN";
|
|
||||||
case GlobalVars.DocumentType.EECN:
|
|
||||||
return "EECN";
|
|
||||||
case GlobalVars.DocumentType.LotDisposition:
|
|
||||||
return "LotDisposition";
|
|
||||||
case GlobalVars.DocumentType.MRB:
|
|
||||||
return "MRB";
|
|
||||||
case GlobalVars.DocumentType.TECNCancelledExpired:
|
|
||||||
return "TECNCancelledExpired";
|
|
||||||
}
|
|
||||||
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Converts the CA No to the C00000 format
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="caNo"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public static string ReturnCANoStringFormat(int caNo) {
|
|
||||||
string caNoString = "";
|
|
||||||
if (caNo == 0)
|
|
||||||
return "";
|
|
||||||
caNoString = "C" + caNo.ToString().PadLeft(5, '0');
|
|
||||||
return caNoString;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static string ReturnAuditNoStringFormat(int auditNo) {
|
|
||||||
string auditNoString = "";
|
|
||||||
if (auditNo == 0)
|
|
||||||
return "";
|
|
||||||
auditNoString = "A" + auditNo.ToString().PadLeft(5, '0');
|
|
||||||
return auditNoString;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static string ReturnPartsRequestNoStringFormat(int PRNumber) {
|
|
||||||
if (PRNumber == 0)
|
|
||||||
return "";
|
|
||||||
return String.Format("PR{0:000000}", PRNumber);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void CopyAttachments(AppSettings appSettings, int oldECNNumber, int newECNNumber) {
|
||||||
|
// The Name of the Upload component is "files"
|
||||||
|
string oldFolderPath = appSettings.AttachmentFolder + "ECN\\" + oldECNNumber.ToString();
|
||||||
|
string newFolderPath = appSettings.AttachmentFolder + "ECN\\" + newECNNumber.ToString();
|
||||||
|
|
||||||
|
DirectoryInfo newdi = new(newFolderPath);
|
||||||
|
|
||||||
|
if (!newdi.Exists)
|
||||||
|
newdi.Create();
|
||||||
|
|
||||||
|
FileInfo[] existingFiles = new DirectoryInfo(oldFolderPath).GetFiles();
|
||||||
|
foreach (FileInfo file in existingFiles) {
|
||||||
|
if (!file.Name.Contains("ECNApprovalLog_" + oldECNNumber.ToString()) && !file.Name.Contains("ECNForm_" + oldECNNumber.ToString()))
|
||||||
|
//var fileName = Path.GetFileName(file.FullName);
|
||||||
|
file.CopyTo(Path.Combine(newFolderPath, file.Name));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool NA_ADAuthenticate(AppSettings appSettings, string userID, string pwd) {
|
||||||
|
string naContainer = appSettings.NAContainer;
|
||||||
|
string naDomain = appSettings.NADomain;
|
||||||
|
try {
|
||||||
|
PrincipalContext contextUser = new(ContextType.Domain,
|
||||||
|
naDomain,
|
||||||
|
naContainer,
|
||||||
|
ContextOptions.Negotiate, userID, pwd);
|
||||||
|
|
||||||
|
UserPrincipal up = UserPrincipal.FindByIdentity(contextUser, userID);
|
||||||
|
if (null == up)
|
||||||
|
return false;
|
||||||
|
else
|
||||||
|
return true;
|
||||||
|
} catch {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool IFX_ADAuthenticate(AppSettings appSettings, string userID, string pwd) {
|
||||||
|
string container = appSettings.IFXContainer;
|
||||||
|
string domain = appSettings.IFXDomain;
|
||||||
|
try {
|
||||||
|
PrincipalContext contextUser = new(ContextType.Domain,
|
||||||
|
domain,
|
||||||
|
container,
|
||||||
|
ContextOptions.Negotiate, userID, pwd);
|
||||||
|
|
||||||
|
UserPrincipal up = UserPrincipal.FindByIdentity(contextUser, userID);
|
||||||
|
if (null == up)
|
||||||
|
return false;
|
||||||
|
else
|
||||||
|
return true;
|
||||||
|
} catch {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string CASectionMapper(GlobalVars.CASection casection) {
|
||||||
|
switch (casection) {
|
||||||
|
case GlobalVars.CASection.Main:
|
||||||
|
return "Main";
|
||||||
|
|
||||||
|
case GlobalVars.CASection.D1:
|
||||||
|
return "D1";
|
||||||
|
|
||||||
|
case GlobalVars.CASection.D2:
|
||||||
|
return "D2";
|
||||||
|
|
||||||
|
case GlobalVars.CASection.D3:
|
||||||
|
return "D3";
|
||||||
|
|
||||||
|
case GlobalVars.CASection.D4:
|
||||||
|
return "D4";
|
||||||
|
|
||||||
|
case GlobalVars.CASection.D5:
|
||||||
|
return "D5";
|
||||||
|
|
||||||
|
case GlobalVars.CASection.D6:
|
||||||
|
return "D6";
|
||||||
|
|
||||||
|
case GlobalVars.CASection.D7:
|
||||||
|
return "D7";
|
||||||
|
|
||||||
|
case GlobalVars.CASection.D8:
|
||||||
|
return "D8";
|
||||||
|
case GlobalVars.CASection.CF: // CA Findings
|
||||||
|
return "CF";
|
||||||
|
}
|
||||||
|
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string DocumentTypeMapper(GlobalVars.DocumentType docType) {
|
||||||
|
switch (docType) {
|
||||||
|
case GlobalVars.DocumentType.Audit:
|
||||||
|
return "Audit";
|
||||||
|
case GlobalVars.DocumentType.ChangeControl:
|
||||||
|
return "ChangeControl";
|
||||||
|
case GlobalVars.DocumentType.CorrectiveAction:
|
||||||
|
return "CorrectiveAction";
|
||||||
|
case GlobalVars.DocumentType.ECN:
|
||||||
|
return "ECN";
|
||||||
|
case GlobalVars.DocumentType.EECN:
|
||||||
|
return "EECN";
|
||||||
|
case GlobalVars.DocumentType.LotDisposition:
|
||||||
|
return "LotDisposition";
|
||||||
|
case GlobalVars.DocumentType.MRB:
|
||||||
|
return "MRB";
|
||||||
|
case GlobalVars.DocumentType.TECNCancelledExpired:
|
||||||
|
return "TECNCancelledExpired";
|
||||||
|
}
|
||||||
|
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Converts the CA No to the C00000 format
|
||||||
|
/// </summary>
|
||||||
|
|
||||||
|
public static string ReturnCANoStringFormat(int caNo) {
|
||||||
|
string caNoString = "";
|
||||||
|
if (caNo == 0)
|
||||||
|
return "";
|
||||||
|
caNoString = "C" + caNo.ToString().PadLeft(5, '0');
|
||||||
|
return caNoString;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string ReturnAuditNoStringFormat(int auditNo) {
|
||||||
|
string auditNoString = "";
|
||||||
|
if (auditNo == 0)
|
||||||
|
return "";
|
||||||
|
auditNoString = "A" + auditNo.ToString().PadLeft(5, '0');
|
||||||
|
return auditNoString;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string ReturnPartsRequestNoStringFormat(int PRNumber) {
|
||||||
|
if (PRNumber == 0)
|
||||||
|
return "";
|
||||||
|
return string.Format("PR{0:000000}", PRNumber);
|
||||||
|
}
|
||||||
}
|
}
|
@ -1,118 +1,101 @@
|
|||||||
using System;
|
using Fab2ApprovalSystem.Models;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Web;
|
|
||||||
|
|
||||||
namespace Fab2ApprovalSystem.Misc
|
namespace Fab2ApprovalSystem.Misc;
|
||||||
{
|
|
||||||
public class GlobalVars
|
|
||||||
{
|
|
||||||
|
|
||||||
public int USER_ID;
|
#if !NET8
|
||||||
public const string SESSION_USERNAME = "UserName";
|
public class GlobalVars {
|
||||||
public const string ApplicationName = "LotDisposition";
|
|
||||||
public const string SESSION_USERID = "UserID";
|
|
||||||
public const string ECN_VIEW_OPTION = "ECN_ViewOption";
|
|
||||||
public const string IS_ADMIN = "IsAdmin";
|
|
||||||
public const string IS_MANAGER = "IsManager";
|
|
||||||
public const string OOO = "OOO";
|
|
||||||
public const string SUCCESS = "Success";
|
|
||||||
public const string CAN_CREATE_PARTS_REQUEST = "CanCreatePartsRequest";
|
|
||||||
|
|
||||||
public static bool USER_ISADMIN = false;
|
public int USER_ID;
|
||||||
public static bool IS_INFINEON_DOMAIN = false;
|
#else
|
||||||
public static string hostURL = "";
|
public static class GlobalVars {
|
||||||
public static string DBConnection = "TEST";
|
|
||||||
public static string DB_CONNECTION_STRING = "";
|
|
||||||
|
|
||||||
public static string AttachmentUrl = "";
|
public static int USER_ID = 0;
|
||||||
public static string NDriveURL = "";
|
#endif
|
||||||
public static string WSR_URL = "";
|
public const string SESSION_USERNAME = "UserName";
|
||||||
public static string CA_BlankFormsLocation = "";
|
public const string ApplicationName = "LotDisposition";
|
||||||
public static string MesaTemplateFiles = "D:\\WebSites\\FabApprovalAttachments\\Template5Why";
|
public const string SESSION_USERID = "UserID";
|
||||||
|
public const string ECN_VIEW_OPTION = "ECN_ViewOption";
|
||||||
|
public const string IS_ADMIN = "IsAdmin";
|
||||||
|
public const string IS_MANAGER = "IsManager";
|
||||||
|
public const string OOO = "OOO";
|
||||||
|
public const string SUCCESS = "Success";
|
||||||
|
public const string CAN_CREATE_PARTS_REQUEST = "CanCreatePartsRequest";
|
||||||
|
public const string LOT_NO = "LotNo";
|
||||||
|
public const string LOCATION = "Location";
|
||||||
|
|
||||||
//public static string DevWebSiteUrl = "";
|
public static AppSettings? AppSettings = null;
|
||||||
//public static string ProdWebSiteUrl = "";
|
|
||||||
|
|
||||||
//public static string DevAttachmentUrl = "";
|
public static bool USER_ISADMIN = false;
|
||||||
//public static string ProdAttachmentUrl = "";
|
public static bool IS_INFINEON_DOMAIN = false;
|
||||||
|
public static string hostURL = "";
|
||||||
|
public static string DBConnection = "TEST";
|
||||||
|
public static string DB_CONNECTION_STRING = "";
|
||||||
|
|
||||||
|
public static string AttachmentUrl = "";
|
||||||
|
public static string NDriveURL = "";
|
||||||
|
public static string WSR_URL = "";
|
||||||
|
public static string CA_BlankFormsLocation = "";
|
||||||
|
public static string SENDER_EMAIL = "MesaFabApproval@infineon.com";
|
||||||
|
public static string MesaTemplateFiles = "D:\\WebSites\\FabApprovalAttachments\\Template5Why";
|
||||||
|
|
||||||
public static string LOT_NO = "LotNo";
|
public enum LotStatusOption {
|
||||||
public static string LOCATION = "Location";
|
Release = 1,
|
||||||
public static string SENDER_EMAIL = "MesaFabApproval@infineon.com";
|
Scrap,
|
||||||
|
NotAvailable,
|
||||||
|
M_Suffix,
|
||||||
//public static List<UserProfileDTO> UserProfileDTO { get; set; }
|
Select_Wafers,
|
||||||
public enum LotStatusOption
|
CloseToQDB,
|
||||||
{
|
SplitOffHold
|
||||||
Release = 1,
|
|
||||||
Scrap,
|
|
||||||
NotAvailable,
|
|
||||||
M_Suffix,
|
|
||||||
Select_Wafers,
|
|
||||||
CloseToQDB,
|
|
||||||
SplitOffHold
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public enum ApprovalOption
|
|
||||||
{
|
|
||||||
Pending = 0,
|
|
||||||
Approved = 1,
|
|
||||||
Denied = 2,
|
|
||||||
Waiting = 3, //waiting on other approver to approve first
|
|
||||||
Skipped = 4, //set to this state if the original approval is no longer needed.
|
|
||||||
ReAssigned = 5, //set to this state if current approver got reassigned
|
|
||||||
Terminated = 6, //future use
|
|
||||||
Closed = 7,
|
|
||||||
Recalled = 8
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum WorkFLowStepNumber
|
|
||||||
{
|
|
||||||
Step1 = 1,
|
|
||||||
Step2,
|
|
||||||
Step3
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum DocumentType
|
|
||||||
{
|
|
||||||
LotDisposition = 1,
|
|
||||||
MRB=2,
|
|
||||||
ECN=3,
|
|
||||||
EECN = 4,
|
|
||||||
TECNCancelledExpired = 5,
|
|
||||||
LotTraveler = 6,
|
|
||||||
ChangeControl = 7,
|
|
||||||
Audit = 8,
|
|
||||||
CorrectiveAction = 9,
|
|
||||||
PartsRequest = 10,
|
|
||||||
CorrectiveActionSection = 12
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum TECNExpirationCancellation
|
|
||||||
{
|
|
||||||
Cancellation = 1,
|
|
||||||
Expiration = 2
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum Colors { None = 0, Red = 1, Green = 2, Blue = 4 };
|
|
||||||
|
|
||||||
|
|
||||||
public enum NotificationType
|
|
||||||
{
|
|
||||||
WorkRequest = 1,
|
|
||||||
LotTraveler = 2
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum CASection
|
|
||||||
{
|
|
||||||
Main, D1, D2, D3, D4, D5,D6, D7, D8, CF
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public enum ApprovalOption {
|
||||||
|
Pending = 0,
|
||||||
|
Approved = 1,
|
||||||
|
Denied = 2,
|
||||||
|
Waiting = 3, //waiting on other approver to approve first
|
||||||
|
Skipped = 4, //set to this state if the original approval is no longer needed.
|
||||||
|
ReAssigned = 5, //set to this state if current approver got reassigned
|
||||||
|
Terminated = 6, //future use
|
||||||
|
Closed = 7,
|
||||||
|
Recalled = 8
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum WorkFLowStepNumber {
|
||||||
|
Step1 = 1,
|
||||||
|
Step2,
|
||||||
|
Step3
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum DocumentType {
|
||||||
|
LotDisposition = 1,
|
||||||
|
MRB = 2,
|
||||||
|
ECN = 3,
|
||||||
|
EECN = 4,
|
||||||
|
TECNCancelledExpired = 5,
|
||||||
|
LotTraveler = 6,
|
||||||
|
ChangeControl = 7,
|
||||||
|
Audit = 8,
|
||||||
|
CorrectiveAction = 9,
|
||||||
|
PartsRequest = 10,
|
||||||
|
CorrectiveActionSection = 12
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum TECNExpirationCancellation {
|
||||||
|
Cancellation = 1,
|
||||||
|
Expiration = 2
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum Colors { None = 0, Red = 1, Green = 2, Blue = 4 };
|
||||||
|
|
||||||
|
public enum NotificationType {
|
||||||
|
WorkRequest = 1,
|
||||||
|
LotTraveler = 2
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum CASection {
|
||||||
|
Main, D1, D2, D3, D4, D5, D6, D7, D8, CF
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -1,12 +1,7 @@
|
|||||||
using System;
|
namespace Fab2ApprovalSystem.Misc;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
public class LotNoTemplate {
|
||||||
using System.Web;
|
|
||||||
|
public string LotNo { get; set; }
|
||||||
|
|
||||||
namespace Fab2ApprovalSystem.Misc
|
|
||||||
{
|
|
||||||
public class LotNoTemplate
|
|
||||||
{
|
|
||||||
public string LotNo { get; set; }
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -1,26 +1,22 @@
|
|||||||
using System;
|
#if !NET8
|
||||||
|
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Web;
|
using System.Web;
|
||||||
using System.Web.Mvc;
|
using System.Web.Mvc;
|
||||||
|
|
||||||
|
namespace Fab2ApprovalSystem.Misc {
|
||||||
|
|
||||||
namespace Fab2ApprovalSystem.Misc
|
public class SessionExpireFilterAttribute : ActionFilterAttribute {
|
||||||
{
|
public override void OnActionExecuting(ActionExecutingContext filterContext) {
|
||||||
public class SessionExpireFilterAttribute : ActionFilterAttribute
|
|
||||||
{
|
|
||||||
public override void OnActionExecuting(ActionExecutingContext filterContext)
|
|
||||||
{
|
|
||||||
HttpSessionStateBase session = filterContext.HttpContext.Session;
|
HttpSessionStateBase session = filterContext.HttpContext.Session;
|
||||||
HttpContext ctx = HttpContext.Current;
|
HttpContext ctx = HttpContext.Current;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// check if session is supported
|
// check if session is supported
|
||||||
|
|
||||||
|
if (session[GlobalVars.SESSION_USERNAME] == null) {
|
||||||
if (session[GlobalVars.SESSION_USERNAME] == null)
|
|
||||||
{
|
|
||||||
// check if a new session id was generated
|
// check if a new session id was generated
|
||||||
|
|
||||||
// this will force MVC to use the standard login redirect, enabling ReturnURL functionality
|
// this will force MVC to use the standard login redirect, enabling ReturnURL functionality
|
||||||
@ -32,8 +28,9 @@ namespace Fab2ApprovalSystem.Misc
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
base.OnActionExecuting(filterContext);
|
base.OnActionExecuting(filterContext);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
@ -1,27 +1,14 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
|
||||||
using System.Web;
|
|
||||||
|
|
||||||
namespace Fab2ApprovalSystem.Misc
|
namespace Fab2ApprovalSystem.Misc;
|
||||||
{
|
|
||||||
//public class UserProfileDTO
|
|
||||||
//{
|
|
||||||
// public int SysUserId { get; set; }
|
|
||||||
// public string UserName { get; set; }
|
|
||||||
// public string FullName { get; set; }
|
|
||||||
//}
|
|
||||||
|
|
||||||
public static class CollectionExtensions
|
public static class CollectionExtensions {
|
||||||
{
|
|
||||||
public static IEnumerable<T> SetValue<T>(this IEnumerable<T> items, Action<T> updateMethod)
|
public static IEnumerable<T> SetValue<T>(this IEnumerable<T> items, Action<T> updateMethod) {
|
||||||
{
|
foreach (T item in items) {
|
||||||
foreach (T item in items)
|
updateMethod(item);
|
||||||
{
|
|
||||||
updateMethod(item);
|
|
||||||
}
|
|
||||||
return items;
|
|
||||||
}
|
}
|
||||||
|
return items;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -1,99 +1,79 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Web;
|
|
||||||
using ICSharpCode.SharpZipLib.Core;
|
|
||||||
using ICSharpCode.SharpZipLib.Zip;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
|
||||||
|
using ICSharpCode.SharpZipLib.Core;
|
||||||
|
using ICSharpCode.SharpZipLib.Zip;
|
||||||
|
|
||||||
|
namespace Fab2ApprovalSystem.Misc;
|
||||||
|
|
||||||
|
public class Zipper {
|
||||||
|
|
||||||
namespace Fab2ApprovalSystem.Misc
|
|
||||||
{
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
/// Compresses the files in the nominated folder, and creates a zip file on disk named as outPathname.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class Zipper
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public void CreateZip(string outPathname, string folderName) {
|
||||||
|
// TODO Try and Catch block
|
||||||
|
Directory.CreateDirectory(Path.GetDirectoryName(outPathname));
|
||||||
|
|
||||||
/// <summary>
|
FileStream fsOut = File.Create(outPathname);
|
||||||
/// Compresses the files in the nominated folder, and creates a zip file on disk named as outPathname.
|
ZipOutputStream zipStream = new(fsOut);
|
||||||
/// </summary>
|
|
||||||
/// <param name="outPathname"></param>
|
|
||||||
/// <param name="folderName"></param>
|
|
||||||
public void CreateZip(string outPathname, string folderName) {
|
|
||||||
// TODO Try and Catch block
|
|
||||||
Directory.CreateDirectory(Path.GetDirectoryName(outPathname));
|
|
||||||
|
|
||||||
FileStream fsOut = File.Create(outPathname);
|
zipStream.SetLevel(3); //0-9, 9 being the highest level of compression
|
||||||
ZipOutputStream zipStream = new ZipOutputStream(fsOut);
|
|
||||||
|
|
||||||
zipStream.SetLevel(3); //0-9, 9 being the highest level of compression
|
//zipStream.Password = password; // optional. Null is the same as not setting. Required if using AES.
|
||||||
|
|
||||||
//zipStream.Password = password; // optional. Null is the same as not setting. Required if using AES.
|
|
||||||
|
|
||||||
// This setting will strip the leading part of the folder path in the entries, to
|
|
||||||
// make the entries relative to the starting folder.
|
|
||||||
// To include the full path for each entry up to the drive root, assign folderOffset = 0.
|
|
||||||
int folderOffset = folderName.Length + (folderName.EndsWith("\\") ? 0 : 1);
|
|
||||||
|
|
||||||
CompressFolder(folderName, zipStream, folderOffset);
|
|
||||||
|
|
||||||
zipStream.IsStreamOwner = true; // Makes the Close also Close the underlying stream
|
|
||||||
zipStream.Close();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Recurses down the folder structure
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="path"></param>
|
|
||||||
/// <param name="zipStream"></param>
|
|
||||||
/// <param name="folderOffset"></param>
|
|
||||||
private void CompressFolder(string path, ZipOutputStream zipStream, int folderOffset)
|
|
||||||
{
|
|
||||||
// TODO Try and Catch block
|
|
||||||
string[] files = Directory.GetFiles(path);
|
|
||||||
|
|
||||||
foreach (string filename in files)
|
|
||||||
{
|
|
||||||
|
|
||||||
FileInfo fi = new FileInfo(filename);
|
|
||||||
|
|
||||||
string entryName = filename.Substring(folderOffset); // Makes the name in zip based on the folder
|
|
||||||
entryName = ZipEntry.CleanName(entryName); // Removes drive from name and fixes slash direction
|
|
||||||
ZipEntry newEntry = new ZipEntry(entryName);
|
|
||||||
newEntry.DateTime = fi.LastWriteTime; // Note the zip format stores 2 second granularity
|
|
||||||
|
|
||||||
// Specifying the AESKeySize triggers AES encryption. Allowable values are 0 (off), 128 or 256.
|
|
||||||
// A password on the ZipOutputStream is required if using AES.
|
|
||||||
// newEntry.AESKeySize = 256;
|
|
||||||
|
|
||||||
// To permit the zip to be unpacked by built-in extractor in WinXP and Server2003, WinZip 8, Java, and other older code,
|
|
||||||
// you need to do one of the following: Specify UseZip64.Off, or set the Size.
|
|
||||||
// If the file may be bigger than 4GB, or you do not need WinXP built-in compatibility, you do not need either,
|
|
||||||
// but the zip will be in Zip64 format which not all utilities can understand.
|
|
||||||
// zipStream.UseZip64 = UseZip64.Off;
|
|
||||||
newEntry.Size = fi.Length;
|
|
||||||
|
|
||||||
zipStream.PutNextEntry(newEntry);
|
|
||||||
|
|
||||||
// Zip the file in buffered chunks
|
|
||||||
// the "using" will close the stream even if an exception occurs
|
|
||||||
byte[] buffer = new byte[4096];
|
|
||||||
using (FileStream streamReader = File.OpenRead(filename))
|
|
||||||
{
|
|
||||||
StreamUtils.Copy(streamReader, zipStream, buffer);
|
|
||||||
}
|
|
||||||
zipStream.CloseEntry();
|
|
||||||
}
|
|
||||||
string[] folders = Directory.GetDirectories(path);
|
|
||||||
foreach (string folder in folders)
|
|
||||||
{
|
|
||||||
CompressFolder(folder, zipStream, folderOffset);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
// This setting will strip the leading part of the folder path in the entries, to
|
||||||
|
// make the entries relative to the starting folder.
|
||||||
|
// To include the full path for each entry up to the drive root, assign folderOffset = 0.
|
||||||
|
int folderOffset = folderName.Length + (folderName.EndsWith("\\") ? 0 : 1);
|
||||||
|
|
||||||
|
CompressFolder(folderName, zipStream, folderOffset);
|
||||||
|
|
||||||
|
zipStream.IsStreamOwner = true; // Makes the Close also Close the underlying stream
|
||||||
|
zipStream.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Recurses down the folder structure
|
||||||
|
/// </summary>
|
||||||
|
|
||||||
|
private void CompressFolder(string path, ZipOutputStream zipStream, int folderOffset) {
|
||||||
|
// TODO Try and Catch block
|
||||||
|
string[] files = Directory.GetFiles(path);
|
||||||
|
|
||||||
|
foreach (string filename in files) {
|
||||||
|
FileInfo fi = new(filename);
|
||||||
|
|
||||||
|
string entryName = filename.Substring(folderOffset); // Makes the name in zip based on the folder
|
||||||
|
entryName = ZipEntry.CleanName(entryName); // Removes drive from name and fixes slash direction
|
||||||
|
ZipEntry newEntry = new(entryName);
|
||||||
|
newEntry.DateTime = fi.LastWriteTime; // Note the zip format stores 2 second granularity
|
||||||
|
|
||||||
|
// Specifying the AESKeySize triggers AES encryption. Allowable values are 0 (off), 128 or 256.
|
||||||
|
// A password on the ZipOutputStream is required if using AES.
|
||||||
|
// newEntry.AESKeySize = 256;
|
||||||
|
|
||||||
|
// To permit the zip to be unpacked by built-in extractor in WinXP and Server2003, WinZip 8, Java, and other older code,
|
||||||
|
// you need to do one of the following: Specify UseZip64.Off, or set the Size.
|
||||||
|
// If the file may be bigger than 4GB, or you do not need WinXP built-in compatibility, you do not need either,
|
||||||
|
// but the zip will be in Zip64 format which not all utilities can understand.
|
||||||
|
// zipStream.UseZip64 = UseZip64.Off;
|
||||||
|
newEntry.Size = fi.Length;
|
||||||
|
|
||||||
|
zipStream.PutNextEntry(newEntry);
|
||||||
|
|
||||||
|
// Zip the file in buffered chunks
|
||||||
|
// the "using" will close the stream even if an exception occurs
|
||||||
|
byte[] buffer = new byte[4096];
|
||||||
|
using (FileStream streamReader = File.OpenRead(filename)) {
|
||||||
|
StreamUtils.Copy(streamReader, zipStream, buffer);
|
||||||
|
}
|
||||||
|
zipStream.CloseEntry();
|
||||||
|
}
|
||||||
|
string[] folders = Directory.GetDirectories(path);
|
||||||
|
foreach (string folder in folders) {
|
||||||
|
CompressFolder(folder, zipStream, folderOffset);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
File diff suppressed because it is too large
Load Diff
@ -1,118 +1,48 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
namespace Fab2ApprovalSystem.Models
|
namespace Fab2ApprovalSystem.Models;
|
||||||
{
|
|
||||||
public class LoginModel
|
|
||||||
{
|
|
||||||
[Key]
|
|
||||||
public int UserID { get; set; }
|
|
||||||
|
|
||||||
[Required]
|
public class LoginModel {
|
||||||
[Display(Name = "Login ID")]
|
[Key]
|
||||||
public string LoginID { get; set; }
|
public int UserID { get; set; }
|
||||||
|
|
||||||
//[Required]
|
[Required]
|
||||||
[DataType(DataType.Password)]
|
[Display(Name = "Login ID")]
|
||||||
[Display(Name = "Password")]
|
public string LoginID { get; set; }
|
||||||
public string Password { get; set; }
|
|
||||||
|
|
||||||
public string FirstName { get; set; }
|
//[Required]
|
||||||
public string LastName { get; set; }
|
[DataType(DataType.Password)]
|
||||||
|
[Display(Name = "Password")]
|
||||||
|
public string Password { get; set; }
|
||||||
|
public string FirstName { get; set; }
|
||||||
|
public string LastName { get; set; }
|
||||||
|
public string FullName { get; set; }
|
||||||
|
public bool IsAdmin { get; set; }
|
||||||
|
public bool IsManager { get; set; }
|
||||||
|
public bool IsActive { get; set; }
|
||||||
|
public DateTime? LastLogin { get; set; }
|
||||||
|
public bool OOO { get; set; }
|
||||||
|
public DateTime? OOOStartDate { get; set; }
|
||||||
|
public DateTime? OOOExpirationDate { get; set; }
|
||||||
|
public int DelegatedTo { get; set; }
|
||||||
|
public string Email { get; set; }
|
||||||
|
|
||||||
public string FullName { get; set; }
|
[Display(Name = "Delegated To")]
|
||||||
|
public string DelegatedToFullName { get; set; }
|
||||||
|
|
||||||
public bool IsAdmin { get; set; }
|
[Display(Name = "OOO Action")]
|
||||||
public bool IsManager { get; set; }
|
public virtual string OOOStatusWithUserID {
|
||||||
public bool IsActive { get; set; }
|
get {
|
||||||
public DateTime? LastLogin { get; set; }
|
return UserID.ToString() + "~" + (OOO ? "1" : "0") + "~" + FullName;
|
||||||
|
|
||||||
public bool OOO { get; set; }
|
|
||||||
|
|
||||||
public DateTime? OOOStartDate { get; set; }
|
|
||||||
public DateTime? OOOExpirationDate { get; set; }
|
|
||||||
|
|
||||||
public int DelegatedTo { get; set; }
|
|
||||||
|
|
||||||
public string Email { get; set; }
|
|
||||||
|
|
||||||
[Display(Name="Delegated To")]
|
|
||||||
public string DelegatedToFullName { get; set; }
|
|
||||||
|
|
||||||
[Display(Name = "OOO Action")]
|
|
||||||
public virtual string OOOStatusWithUserID
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return UserID.ToString() + "~" + (OOO ? "1" : "0") + "~" + FullName;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class UserProfile
|
}
|
||||||
{
|
|
||||||
public int UserId { get; set; }
|
public class UserProfile {
|
||||||
public string FullName { get; set; }
|
|
||||||
}
|
public int UserId { get; set; }
|
||||||
|
public string FullName { get; set; }
|
||||||
|
|
||||||
//public class ExternalLoginConfirmationViewModel
|
|
||||||
//{
|
|
||||||
// [Required]
|
|
||||||
// [Display(Name = "User name")]
|
|
||||||
// public string UserName { get; set; }
|
|
||||||
//}
|
|
||||||
|
|
||||||
//public class ManageUserViewModel
|
|
||||||
//{
|
|
||||||
// [Required]
|
|
||||||
// [DataType(DataType.Password)]
|
|
||||||
// [Display(Name = "Current password")]
|
|
||||||
// public string OldPassword { get; set; }
|
|
||||||
|
|
||||||
// [Required]
|
|
||||||
// [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
|
|
||||||
// [DataType(DataType.Password)]
|
|
||||||
// [Display(Name = "New password")]
|
|
||||||
// public string NewPassword { get; set; }
|
|
||||||
|
|
||||||
// [DataType(DataType.Password)]
|
|
||||||
// [Display(Name = "Confirm new password")]
|
|
||||||
// [Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")]
|
|
||||||
// public string ConfirmPassword { get; set; }
|
|
||||||
//}
|
|
||||||
|
|
||||||
//public class LoginViewModel
|
|
||||||
//{
|
|
||||||
// [Required]
|
|
||||||
// [Display(Name = "User name")]
|
|
||||||
// public string UserName { get; set; }
|
|
||||||
|
|
||||||
// [Required]
|
|
||||||
// [DataType(DataType.Password)]
|
|
||||||
// [Display(Name = "Password")]
|
|
||||||
// public string Password { get; set; }
|
|
||||||
|
|
||||||
// [Display(Name = "Remember me?")]
|
|
||||||
// public bool RememberMe { get; set; }
|
|
||||||
//}
|
|
||||||
|
|
||||||
//public class RegisterViewModel
|
|
||||||
//{
|
|
||||||
// [Required]
|
|
||||||
// [Display(Name = "User name")]
|
|
||||||
// public string UserName { get; set; }
|
|
||||||
|
|
||||||
// [Required]
|
|
||||||
// [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
|
|
||||||
// [DataType(DataType.Password)]
|
|
||||||
// [Display(Name = "Password")]
|
|
||||||
// public string Password { get; set; }
|
|
||||||
|
|
||||||
// [DataType(DataType.Password)]
|
|
||||||
// [Display(Name = "Confirm password")]
|
|
||||||
// [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")]
|
|
||||||
// public string ConfirmPassword { get; set; }
|
|
||||||
//}
|
|
||||||
}
|
}
|
@ -1,73 +1,42 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
|
||||||
using System.Web;
|
|
||||||
|
|
||||||
namespace Fab2ApprovalSystem.Models
|
|
||||||
{
|
|
||||||
//public class DocumentType
|
|
||||||
//{
|
|
||||||
//}
|
|
||||||
|
|
||||||
public class WorkFlow
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public class Role
|
|
||||||
{
|
|
||||||
public int RoleID { get; set; }
|
|
||||||
public string RoleName { get; set; }
|
|
||||||
public List<SubRole> SubRoles { get; set; }
|
|
||||||
|
|
||||||
public Role()
|
|
||||||
{
|
|
||||||
SubRoles = new List<SubRole>();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public class WorkFlowSteps
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public class SubRole
|
|
||||||
{
|
|
||||||
public int SubRoleID { get; set; }
|
|
||||||
public string SubRoleCategoryItem { get; set; }
|
|
||||||
public int RoleID { get; set; }
|
|
||||||
public bool Inactive { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public class UserSubRole
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public class ParentChildModel
|
|
||||||
{
|
|
||||||
public int id { get; set; }
|
|
||||||
public int parentid { get; set; }
|
|
||||||
public string text { get; set; }
|
|
||||||
public string value { get; set; }
|
|
||||||
|
|
||||||
public List<ParentChildModel> Children = new List<ParentChildModel>();
|
|
||||||
|
|
||||||
}
|
|
||||||
//public class TrainingGroup
|
|
||||||
//{
|
|
||||||
// public int TrainingGroupID { get; set; }
|
|
||||||
// public string TrainingGroupName { get; set; }
|
|
||||||
//}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
namespace Fab2ApprovalSystem.Models;
|
||||||
|
|
||||||
|
public class WorkFlow {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class Role {
|
||||||
|
|
||||||
|
public int RoleID { get; set; }
|
||||||
|
public string RoleName { get; set; }
|
||||||
|
public List<SubRole> SubRoles { get; set; }
|
||||||
|
public Role() => SubRoles = new List<SubRole>();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class WorkFlowSteps {
|
||||||
|
}
|
||||||
|
|
||||||
|
public class SubRole {
|
||||||
|
|
||||||
|
public int SubRoleID { get; set; }
|
||||||
|
public string SubRoleCategoryItem { get; set; }
|
||||||
|
public int RoleID { get; set; }
|
||||||
|
public bool Inactive { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class UserSubRole {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ParentChildModel {
|
||||||
|
|
||||||
|
public int id { get; set; }
|
||||||
|
public int parentid { get; set; }
|
||||||
|
public string text { get; set; }
|
||||||
|
public string value { get; set; }
|
||||||
|
public List<ParentChildModel> Children = new();
|
||||||
|
|
||||||
|
}
|
@ -1,16 +1,11 @@
|
|||||||
using System;
|
namespace Fab2ApprovalSystem.Models;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
public class AllUserModel {
|
||||||
using System.Web;
|
|
||||||
|
public string UserName { get; set; }
|
||||||
|
public string FirstName { get; set; }
|
||||||
|
public string LastName { get; set; }
|
||||||
|
public string Email { get; set; }
|
||||||
|
public string DisplayName { get; set; }
|
||||||
|
|
||||||
namespace Fab2ApprovalSystem.Models
|
|
||||||
{
|
|
||||||
public class AllUserModel
|
|
||||||
{
|
|
||||||
public string UserName { get; set; }
|
|
||||||
public string FirstName { get; set; }
|
|
||||||
public string LastName { get; set; }
|
|
||||||
public string Email { get; set; }
|
|
||||||
public string DisplayName { get; set; }
|
|
||||||
}
|
|
||||||
}
|
}
|
189
Fab2ApprovalSystem/Models/AppSettings.cs
Normal file
189
Fab2ApprovalSystem/Models/AppSettings.cs
Normal file
@ -0,0 +1,189 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Configuration;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
|
namespace Fab2ApprovalSystem.Models;
|
||||||
|
|
||||||
|
public class AppSettings {
|
||||||
|
|
||||||
|
internal AppSettings(string adminNotificationRecepient,
|
||||||
|
string? apiBaseUrl,
|
||||||
|
string attachmentFolder,
|
||||||
|
string? attachmentUrl,
|
||||||
|
string caBlankFormsLocation,
|
||||||
|
string? company,
|
||||||
|
string dBConnection,
|
||||||
|
string dbConnectionString,
|
||||||
|
string ftpPassword,
|
||||||
|
string ftpServer,
|
||||||
|
string ftpUser,
|
||||||
|
string holdFlagDirectory,
|
||||||
|
string hostURL,
|
||||||
|
string ifxContainer,
|
||||||
|
string ifxDomain,
|
||||||
|
bool isInfineonDomain,
|
||||||
|
string lotTempPipeLine,
|
||||||
|
string mesaTemplateFiles,
|
||||||
|
string naContainer,
|
||||||
|
string naDomain,
|
||||||
|
string nDriveURL,
|
||||||
|
string notificationSender,
|
||||||
|
string senderEmail,
|
||||||
|
string? smtpServer,
|
||||||
|
string spnMRBHoldFlagFTPLogDirectory,
|
||||||
|
string testEmailRecipients,
|
||||||
|
string urls,
|
||||||
|
int userId,
|
||||||
|
bool userIsAdmin,
|
||||||
|
string wsrURL,
|
||||||
|
string? workingDirectoryName) {
|
||||||
|
AdminNotificationRecepient = adminNotificationRecepient;
|
||||||
|
ApiBaseUrl = apiBaseUrl;
|
||||||
|
AttachmentFolder = attachmentFolder;
|
||||||
|
AttachmentUrl = attachmentUrl;
|
||||||
|
CABlankFormsLocation = caBlankFormsLocation;
|
||||||
|
Company = company;
|
||||||
|
DBConnection = dBConnection;
|
||||||
|
DBConnectionString = dbConnectionString;
|
||||||
|
FTPPassword = ftpPassword;
|
||||||
|
FTPServer = ftpServer;
|
||||||
|
FTPUser = ftpUser;
|
||||||
|
HoldFlagDirectory = holdFlagDirectory;
|
||||||
|
HostURL = hostURL;
|
||||||
|
IFXContainer = ifxContainer;
|
||||||
|
IFXDomain = ifxDomain;
|
||||||
|
IsInfineonDomain = isInfineonDomain;
|
||||||
|
LotTempPipeLine = lotTempPipeLine;
|
||||||
|
MesaTemplateFiles = mesaTemplateFiles;
|
||||||
|
NAContainer = naContainer;
|
||||||
|
NADomain = naDomain;
|
||||||
|
NDriveURL = nDriveURL;
|
||||||
|
NotificationSender = notificationSender;
|
||||||
|
SenderEmail = senderEmail;
|
||||||
|
SMTPServer = smtpServer;
|
||||||
|
SPNMRBHoldFlagFTPLogDirectory = spnMRBHoldFlagFTPLogDirectory;
|
||||||
|
TestEmailRecipients = testEmailRecipients;
|
||||||
|
URLs = urls;
|
||||||
|
UserId = userId;
|
||||||
|
UserIsAdmin = userIsAdmin;
|
||||||
|
WSR_URL = wsrURL;
|
||||||
|
WorkingDirectoryName = workingDirectoryName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public string AdminNotificationRecepient { get; }
|
||||||
|
public string? ApiBaseUrl { get; }
|
||||||
|
public string AttachmentFolder { get; }
|
||||||
|
public string? AttachmentUrl { get; }
|
||||||
|
public string CABlankFormsLocation { get; }
|
||||||
|
public string? Company { get; }
|
||||||
|
public string DBConnection { get; }
|
||||||
|
public string DBConnectionString { get; }
|
||||||
|
public string FTPPassword { get; }
|
||||||
|
public string FTPServer { get; }
|
||||||
|
public string FTPUser { get; }
|
||||||
|
public string HoldFlagDirectory { get; }
|
||||||
|
public string HostURL { get; }
|
||||||
|
public string IFXContainer { get; }
|
||||||
|
public string IFXDomain { get; }
|
||||||
|
public bool IsInfineonDomain { get; }
|
||||||
|
public string LotTempPipeLine { get; }
|
||||||
|
public string MesaTemplateFiles { get; }
|
||||||
|
public string NAContainer { get; }
|
||||||
|
public string NADomain { get; }
|
||||||
|
public string NDriveURL { get; }
|
||||||
|
public string NotificationSender { get; }
|
||||||
|
public string SenderEmail { get; }
|
||||||
|
public string? SMTPServer { get; }
|
||||||
|
public string SPNMRBHoldFlagFTPLogDirectory { get; }
|
||||||
|
public string TestEmailRecipients { get; }
|
||||||
|
public string URLs { get; }
|
||||||
|
public int UserId { get; }
|
||||||
|
public bool UserIsAdmin { get; }
|
||||||
|
public string WSR_URL { get; }
|
||||||
|
public string? WorkingDirectoryName { get; }
|
||||||
|
|
||||||
|
#if NET8
|
||||||
|
|
||||||
|
public static AppSettings Get(Microsoft.Extensions.Configuration.IConfigurationRoot configurationRoot) {
|
||||||
|
AppSettings? result;
|
||||||
|
try {
|
||||||
|
#pragma warning disable IL3050, IL2026
|
||||||
|
result = Microsoft.Extensions.Configuration.ConfigurationBinder.Get<AppSettings>(configurationRoot) ?? throw new Exception();
|
||||||
|
#pragma warning restore IL3050, IL2026
|
||||||
|
} catch (Exception) {
|
||||||
|
List<string> paths = [];
|
||||||
|
foreach (Microsoft.Extensions.Configuration.IConfigurationProvider configurationProvider in configurationRoot.Providers) {
|
||||||
|
if (configurationProvider is not Microsoft.Extensions.Configuration.Json.JsonConfigurationProvider jsonConfigurationProvider)
|
||||||
|
continue;
|
||||||
|
if (jsonConfigurationProvider.Source.FileProvider is not Microsoft.Extensions.FileProviders.PhysicalFileProvider physicalFileProvider)
|
||||||
|
continue;
|
||||||
|
paths.Add(physicalFileProvider.Root);
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new NotSupportedException($"Not found!{Environment.NewLine}{string.Join(Environment.NewLine, paths.Distinct())}");
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
internal static AppSettings LoadConfigurationManager() {
|
||||||
|
AppSettings result;
|
||||||
|
int userId = 0;
|
||||||
|
string adminNotificationRecepient = ConfigurationManager.ConnectionStrings["Admin Notification Recepient"].ToString();
|
||||||
|
string attachmentFolder = ConfigurationManager.ConnectionStrings["AttachmentFolder"].ToString();
|
||||||
|
string ftpPassword = ConfigurationManager.ConnectionStrings["FTP Password"].ToString();
|
||||||
|
string ftpServer = ConfigurationManager.ConnectionStrings["FTP Server"].ToString();
|
||||||
|
string ftpUser = ConfigurationManager.ConnectionStrings["FTP User"].ToString();
|
||||||
|
string holdFlagDirectory = ConfigurationManager.ConnectionStrings["HoldFlagDirectory"].ToString();
|
||||||
|
string ifxContainer = ConfigurationManager.ConnectionStrings["IFXContainer"].ToString();
|
||||||
|
string ifxDomain = ConfigurationManager.ConnectionStrings["IFXDomain"].ToString();
|
||||||
|
string lotTempPipeLine = ConfigurationManager.ConnectionStrings["LotTempPipeLine"].ToString();
|
||||||
|
string naContainer = ConfigurationManager.ConnectionStrings["NAContainer"].ToString();
|
||||||
|
string naDomain = ConfigurationManager.ConnectionStrings["NADomain"].ToString();
|
||||||
|
string notificationSender = ConfigurationManager.ConnectionStrings["Notification Sender"].ToString();
|
||||||
|
string spnMRBHoldFlagFTPLogDirectory = ConfigurationManager.ConnectionStrings["SPNMRBHoldFlagFTPLogDirectory"].ToString();
|
||||||
|
string testEmailRecipients = ConfigurationManager.ConnectionStrings["Test Email Recipients"].ToString();
|
||||||
|
string? apiBaseUrl = ConfigurationManager.ConnectionStrings["FabApprovalApiBaseUrl"]?.ToString();
|
||||||
|
string? attachmentUrl = ConfigurationManager.ConnectionStrings["AttachmentUrl"]?.ToString();
|
||||||
|
string? company = ConfigurationManager.ConnectionStrings["Company"]?.ToString();
|
||||||
|
string? smtpServer = ConfigurationManager.ConnectionStrings["SMTP Server"]?.ToString();
|
||||||
|
string? urls = ConfigurationManager.ConnectionStrings["URLs"]?.ToString();
|
||||||
|
string? workingDirectoryName = ConfigurationManager.ConnectionStrings["WorkingDirectoryName"]?.ToString();
|
||||||
|
result = new(adminNotificationRecepient: adminNotificationRecepient,
|
||||||
|
apiBaseUrl: apiBaseUrl,
|
||||||
|
attachmentFolder: attachmentFolder,
|
||||||
|
attachmentUrl: attachmentUrl,
|
||||||
|
caBlankFormsLocation: Misc.GlobalVars.CA_BlankFormsLocation,
|
||||||
|
company: company,
|
||||||
|
dBConnection: Misc.GlobalVars.DBConnection,
|
||||||
|
dbConnectionString: Misc.GlobalVars.DB_CONNECTION_STRING,
|
||||||
|
ftpPassword: ftpPassword,
|
||||||
|
ftpServer: ftpServer,
|
||||||
|
ftpUser: ftpUser,
|
||||||
|
holdFlagDirectory: holdFlagDirectory,
|
||||||
|
hostURL: Misc.GlobalVars.hostURL,
|
||||||
|
ifxContainer: ifxContainer,
|
||||||
|
ifxDomain: ifxDomain,
|
||||||
|
isInfineonDomain: Misc.GlobalVars.IS_INFINEON_DOMAIN,
|
||||||
|
lotTempPipeLine: lotTempPipeLine,
|
||||||
|
mesaTemplateFiles: Misc.GlobalVars.MesaTemplateFiles,
|
||||||
|
naContainer: naContainer,
|
||||||
|
naDomain: naDomain,
|
||||||
|
nDriveURL: Misc.GlobalVars.NDriveURL,
|
||||||
|
notificationSender: notificationSender,
|
||||||
|
senderEmail: Misc.GlobalVars.SENDER_EMAIL,
|
||||||
|
smtpServer: smtpServer,
|
||||||
|
spnMRBHoldFlagFTPLogDirectory: spnMRBHoldFlagFTPLogDirectory,
|
||||||
|
testEmailRecipients: testEmailRecipients,
|
||||||
|
urls: urls,
|
||||||
|
userId: userId,
|
||||||
|
userIsAdmin: Misc.GlobalVars.USER_ISADMIN,
|
||||||
|
wsrURL: Misc.GlobalVars.WSR_URL,
|
||||||
|
workingDirectoryName: workingDirectoryName);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,20 +1,13 @@
|
|||||||
using System;
|
namespace Fab2ApprovalSystem.Models;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Web;
|
|
||||||
|
|
||||||
namespace Fab2ApprovalSystem.Models
|
public class ApprovalLog {
|
||||||
{
|
|
||||||
public class ApprovalLog
|
|
||||||
{
|
|
||||||
|
|
||||||
public int ApprovalLogID;
|
public int ApprovalLogID;
|
||||||
public int IssueID;
|
public int IssueID;
|
||||||
public int UserID;
|
public int UserID;
|
||||||
public string OperationType;
|
public string OperationType;
|
||||||
public int SubRoleID;
|
public int SubRoleID;
|
||||||
public string OperationLog;
|
public string OperationLog;
|
||||||
public int DocumentTypeID;
|
public int DocumentTypeID;
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -1,21 +1,16 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Web;
|
|
||||||
using System.ComponentModel.DataAnnotations;
|
|
||||||
|
|
||||||
namespace Fab2ApprovalSystem.Models
|
namespace Fab2ApprovalSystem.Models;
|
||||||
{
|
|
||||||
public class ApprovalLogHistory
|
|
||||||
{
|
|
||||||
public int ApprovalLogID { get; set; }
|
|
||||||
public string FullName { get; set; }
|
|
||||||
public string Operation { get; set; }
|
|
||||||
public string SubRole { get; set; }
|
|
||||||
|
|
||||||
//[Display(Name = "Operation Time")]
|
public class ApprovalLogHistory {
|
||||||
public DateTime OperationTime { get; set; }
|
|
||||||
public string Comments { get; set; }
|
public int ApprovalLogID { get; set; }
|
||||||
|
public string FullName { get; set; }
|
||||||
|
public string Operation { get; set; }
|
||||||
|
public string SubRole { get; set; }
|
||||||
|
|
||||||
|
//[Display(Name = "Operation Time")]
|
||||||
|
public DateTime OperationTime { get; set; }
|
||||||
|
public string Comments { get; set; }
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -1,22 +1,18 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Web;
|
|
||||||
|
|
||||||
namespace Fab2ApprovalSystem.Models
|
namespace Fab2ApprovalSystem.Models;
|
||||||
{
|
|
||||||
public class ApproveListModel
|
public class ApproveListModel {
|
||||||
{
|
|
||||||
public int ApprovalKey { get; set; }
|
public int ApprovalKey { get; set; }
|
||||||
public int IssueID { get; set; }
|
public int IssueID { get; set; }
|
||||||
public string AssignedName { get; set; }
|
public string AssignedName { get; set; }
|
||||||
public string AssignedEmail { get; set; }
|
public string AssignedEmail { get; set; }
|
||||||
public string AssignedFullName { get; set; }
|
public string AssignedFullName { get; set; }
|
||||||
public DateTime LastNotification { get; set; }
|
public DateTime LastNotification { get; set; }
|
||||||
public DateTime AssignedDate { get; set; }
|
public DateTime AssignedDate { get; set; }
|
||||||
public DateTime RoleAssignedDate { get; set; }
|
public DateTime RoleAssignedDate { get; set; }
|
||||||
public string DocType { get; set; }
|
public string DocType { get; set; }
|
||||||
public string Title { get; set; }
|
public string Title { get; set; }
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
21
Fab2ApprovalSystem/Models/AuditModels.cs
Normal file
21
Fab2ApprovalSystem/Models/AuditModels.cs
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace Fab2ApprovalSystem.Models;
|
||||||
|
|
||||||
|
public class AuditEdit {
|
||||||
|
|
||||||
|
public Audit Audit { get; set; }
|
||||||
|
public IEnumerable<AuditedArea> AuditAreaList { get; set; }
|
||||||
|
public List<string> AuditeeNames { get; set; }
|
||||||
|
public List<AuditFindingCategory> AuditFindingCategoryList { get; set; }
|
||||||
|
public IEnumerable<Auditor> AuditorList { get; set; }
|
||||||
|
public IEnumerable<AuditType> AuditTypeList { get; set; }
|
||||||
|
public IEnumerable<CANoList> CANoList { get; set; }
|
||||||
|
public string Is8DQA { get; set; }
|
||||||
|
public bool IsAdmin { get; set; }
|
||||||
|
public bool IsSubmitter { get; set; }
|
||||||
|
public List<AllUserModel> MesaUsers { get; set; }
|
||||||
|
public IEnumerable<CAUserList> UserList { get; set; }
|
||||||
|
public bool RedirectToAction { get; set; }
|
||||||
|
|
||||||
|
}
|
@ -1,7 +1,9 @@
|
|||||||
namespace Fab2ApprovalSystem.Models {
|
namespace Fab2ApprovalSystem.Models;
|
||||||
public class AuthAttempt {
|
|
||||||
public string LoginID { get; set; }
|
public class AuthAttempt {
|
||||||
public string Password { get; set; } = "";
|
|
||||||
public AuthTokens AuthTokens { get; set; }
|
public string LoginID { get; set; }
|
||||||
}
|
public string Password { get; set; } = "";
|
||||||
|
public AuthTokens AuthTokens { get; set; }
|
||||||
|
|
||||||
}
|
}
|
@ -1,6 +1,8 @@
|
|||||||
namespace Fab2ApprovalSystem.Models {
|
namespace Fab2ApprovalSystem.Models;
|
||||||
public class AuthTokens {
|
|
||||||
public string JwtToken { get; set; }
|
public class AuthTokens {
|
||||||
public string RefreshToken { get; set; }
|
|
||||||
}
|
public string JwtToken { get; set; }
|
||||||
|
public string RefreshToken { get; set; }
|
||||||
|
|
||||||
}
|
}
|
@ -1,376 +1,321 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.Linq;
|
|
||||||
using System.Web;
|
|
||||||
|
|
||||||
namespace Fab2ApprovalSystem.Models
|
namespace Fab2ApprovalSystem.Models;
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public class CCChangeControl
|
|
||||||
{
|
|
||||||
public int PlanNumber { get; set; }
|
|
||||||
public int OwnerID { get; set; }
|
|
||||||
public byte CurrentStep { get; set; }
|
|
||||||
public int Status { get; set; }
|
|
||||||
|
|
||||||
[DisplayFormat(DataFormatString = "{0:MM/dd/yyyy}")]
|
public class CCChangeControl {
|
||||||
public DateTime? ClosedDate { get; set; }
|
|
||||||
|
|
||||||
public int ChangeLevel { get; set; }
|
public int PlanNumber { get; set; }
|
||||||
public string Notes { get; set; }
|
public int OwnerID { get; set; }
|
||||||
public int IsITAR { get; set; }
|
public byte CurrentStep { get; set; }
|
||||||
public int IsMedical { get; set; }
|
public int Status { get; set; }
|
||||||
public int IsRadHard { get; set; }
|
|
||||||
public int IsAutomotive { get; set; }
|
|
||||||
public string Title { get; set; }
|
|
||||||
public string PartNumbers { get; set; }
|
|
||||||
public string ToolTypes { get; set; }
|
|
||||||
public bool RecordLockIndicator { get; set; }
|
|
||||||
public int RecordLockedBy { get; set; }
|
|
||||||
public bool RecordLocked { get; set; }
|
|
||||||
public DateTime RecordLockedDate { get; set; }
|
|
||||||
public string ReasonForChange { get; set; }
|
|
||||||
public string ChangeDescription { get; set; }
|
|
||||||
public DateTime LastUpdateDate { get; set; }
|
|
||||||
public int PCR1ID { get; set; }
|
|
||||||
public int PCR2ID { get; set; }
|
|
||||||
public int PCR3ID {get;set;}
|
|
||||||
public string PlanTitle { get; set; }
|
|
||||||
|
|
||||||
}
|
[DisplayFormat(DataFormatString = "{0:MM/dd/yyyy}")]
|
||||||
|
public DateTime? ClosedDate { get; set; }
|
||||||
|
public int ChangeLevel { get; set; }
|
||||||
|
public string Notes { get; set; }
|
||||||
|
public int IsITAR { get; set; }
|
||||||
|
public int IsMedical { get; set; }
|
||||||
|
public int IsRadHard { get; set; }
|
||||||
|
public int IsAutomotive { get; set; }
|
||||||
|
public string Title { get; set; }
|
||||||
|
public string PartNumbers { get; set; }
|
||||||
|
public string ToolTypes { get; set; }
|
||||||
|
public bool RecordLockIndicator { get; set; }
|
||||||
|
public int RecordLockedBy { get; set; }
|
||||||
|
public bool RecordLocked { get; set; }
|
||||||
|
public DateTime RecordLockedDate { get; set; }
|
||||||
|
public string ReasonForChange { get; set; }
|
||||||
|
public string ChangeDescription { get; set; }
|
||||||
|
public DateTime LastUpdateDate { get; set; }
|
||||||
|
public int PCR1ID { get; set; }
|
||||||
|
public int PCR2ID { get; set; }
|
||||||
|
public int PCR3ID { get; set; }
|
||||||
|
public string PlanTitle { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
public class CCAttachment {
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public class CCAttachment
|
|
||||||
{
|
|
||||||
public int ID { get; set; }
|
|
||||||
public string FileGUID { get; set; }
|
|
||||||
public string FileName { get; set; }
|
|
||||||
public int UploadedByID { get; set; }
|
|
||||||
public string UploadedByName { get; set; }
|
|
||||||
public DateTime? UploadDateTime { get; set; }
|
|
||||||
public string Title { get; set; }
|
|
||||||
public string RequirementsNotes { get; set; }
|
|
||||||
public string Comments { get; set; }
|
|
||||||
public int PlanNumber { get; set; }
|
|
||||||
|
|
||||||
}
|
public int ID { get; set; }
|
||||||
|
public string FileGUID { get; set; }
|
||||||
|
public string FileName { get; set; }
|
||||||
|
public int UploadedByID { get; set; }
|
||||||
|
public string UploadedByName { get; set; }
|
||||||
|
public DateTime? UploadDateTime { get; set; }
|
||||||
|
public string Title { get; set; }
|
||||||
|
public string RequirementsNotes { get; set; }
|
||||||
|
public string Comments { get; set; }
|
||||||
|
public int PlanNumber { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
public class CCGeneration {
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public class CCGeneration
|
|
||||||
{
|
|
||||||
public int GenerationID { get; set; }
|
|
||||||
public string Generation { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
public int GenerationID { get; set; }
|
||||||
|
public string Generation { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
}
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public class CCLogistics
|
|
||||||
{
|
|
||||||
public int LogisticsID { get; set; }
|
|
||||||
public string Logistics { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
public class CCLogistics {
|
||||||
|
|
||||||
|
public int LogisticsID { get; set; }
|
||||||
|
public string Logistics { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
}
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public class CCProcess
|
|
||||||
{
|
|
||||||
public int ProcessID { get; set; }
|
|
||||||
public string Process { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
public class CCProcess {
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
//public class CCToolType
|
|
||||||
//{
|
|
||||||
// public int ToolTypeID { get; set; }
|
|
||||||
// public string ToolType { get; set; }
|
|
||||||
//}
|
|
||||||
|
|
||||||
public class CCPartNumber
|
public int ProcessID { get; set; }
|
||||||
{
|
public string Process { get; set; }
|
||||||
public string PartNumberID { get; set; }
|
|
||||||
public string PartNumber { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class CCPartNumber {
|
||||||
|
|
||||||
|
public string PartNumberID { get; set; }
|
||||||
|
public string PartNumber { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
#region Meeting
|
#region Meeting
|
||||||
|
|
||||||
/// <summary>
|
public class CCMeeting {
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public class CCMeeting
|
|
||||||
{
|
|
||||||
public int MeetingID { get; set; }
|
|
||||||
public List<string> PCRValueIDs { get; set; }
|
|
||||||
public string PCRValueIDsDisplay { get
|
|
||||||
{
|
|
||||||
if(PCRValueIDs.Count < 1)
|
|
||||||
{
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
return string.Join(",", PCRValueIDs);
|
|
||||||
} }
|
|
||||||
public int PlanNumber { get; set; }
|
|
||||||
public byte CurrentStep { get; set; }
|
|
||||||
public string Title {get;set;}
|
|
||||||
public int? ChangeLevel
|
|
||||||
{
|
|
||||||
get;set;
|
|
||||||
}
|
|
||||||
public string PCRB { get; set; }
|
|
||||||
[DisplayFormat(DataFormatString = "{0:MM/dd/yyyy}")]
|
|
||||||
public DateTime? MeetingDate { get; set; }
|
|
||||||
public int Decision { get; set; }
|
|
||||||
public string Notes { get; set; }
|
|
||||||
public int Status { get; set; }
|
|
||||||
|
|
||||||
[DisplayFormat(DataFormatString = "{0:MM/dd/yyyy}")]
|
public int MeetingID { get; set; }
|
||||||
public DateTime? ClosedDate { get; set;}
|
public List<string> PCRValueIDs { get; set; }
|
||||||
|
public string PCRValueIDsDisplay {
|
||||||
[DisplayFormat(DataFormatString = "{0:MM/dd/yyyy}")]
|
get {
|
||||||
public DateTime? CancelledDate { get; set; }
|
if (PCRValueIDs.Count < 1) {
|
||||||
public bool RecordLockIndicator { get; set; }
|
return "";
|
||||||
public int RecordLockedBy { get; set; }
|
}
|
||||||
public DateTime RecordLockedDate { get; set; }
|
return string.Join(",", PCRValueIDs);
|
||||||
public DateTime LastUpdateDate { get; set; }
|
|
||||||
public string RecordLockByName { get; set; }
|
|
||||||
public bool PCRBClosed { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
public CCMeeting()
|
|
||||||
{
|
|
||||||
PCRValueIDs = new List<string>();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class CCPCRB
|
public int PlanNumber { get; set; }
|
||||||
{
|
public byte CurrentStep { get; set; }
|
||||||
public int PCRBID { get; set; }
|
public string Title { get; set; }
|
||||||
public int PlanNumber { get; set; }
|
public int? ChangeLevel {
|
||||||
public string PCRB { get; set; }
|
get; set;
|
||||||
public DateTime Date { get; set; }
|
|
||||||
public int Decision { get; set; }
|
|
||||||
public string Notes { get; set; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
public string PCRB { get; set; }
|
||||||
///
|
[DisplayFormat(DataFormatString = "{0:MM/dd/yyyy}")]
|
||||||
/// </summary>
|
public DateTime? MeetingDate { get; set; }
|
||||||
public class CCMeetingAttendee
|
public int Decision { get; set; }
|
||||||
{
|
public string Notes { get; set; }
|
||||||
public int ID { get; set; }
|
public int Status { get; set; }
|
||||||
public int MeetingID { get; set; }
|
|
||||||
public string AttendeeName { get; set; }
|
|
||||||
public string JobTitle { get; set; }
|
|
||||||
public string Location { get; set; }
|
|
||||||
public int AttendeeID { get; set; }
|
|
||||||
|
|
||||||
}
|
[DisplayFormat(DataFormatString = "{0:MM/dd/yyyy}")]
|
||||||
public class CCPCRBAttendee
|
public DateTime? ClosedDate { get; set; }
|
||||||
{
|
|
||||||
public int ID { get; set; }
|
|
||||||
public int PCRBID { get; set; }
|
|
||||||
public string AttendeeName { get; set; }
|
|
||||||
public string JobTitle { get; set; }
|
|
||||||
public string Location { get; set; }
|
|
||||||
public bool Approved { get; set; }
|
|
||||||
public int AttendeeID { get; set; }
|
|
||||||
|
|
||||||
}
|
[DisplayFormat(DataFormatString = "{0:MM/dd/yyyy}")]
|
||||||
/// <summary>
|
public DateTime? CancelledDate { get; set; }
|
||||||
/// /
|
public bool RecordLockIndicator { get; set; }
|
||||||
/// </summary>
|
public int RecordLockedBy { get; set; }
|
||||||
public class CCMeetingAttachment
|
public DateTime RecordLockedDate { get; set; }
|
||||||
{
|
public DateTime LastUpdateDate { get; set; }
|
||||||
public int ID { get; set; }
|
public string RecordLockByName { get; set; }
|
||||||
public string FileGUID { get; set; }
|
public bool PCRBClosed { get; set; }
|
||||||
public string FileName { get; set; }
|
public CCMeeting() =>
|
||||||
public int UploadedByID { get; set; }
|
PCRValueIDs = new List<string>();
|
||||||
public string UploadedByName { get; set; }
|
|
||||||
public DateTime UploadDateTime { get; set; }
|
|
||||||
public string Title { get; set; }
|
|
||||||
public int MeetingID { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public class CCDecisionSummary
|
|
||||||
{
|
|
||||||
public int ID { get; set; }
|
|
||||||
public int MeetingID { get; set; }
|
|
||||||
public string DecisionNotes { get; set; }
|
|
||||||
public string ECNLinks { get; set; }
|
|
||||||
public string LotDispoLinks { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public class CCDecisionSummaryLink
|
|
||||||
{
|
|
||||||
public string Link { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public class CCMeetingActionItem
|
|
||||||
{
|
|
||||||
public int ID { get; set; }
|
|
||||||
public int MeetingID { get; set; }
|
|
||||||
public string ActionItemName { get; set; }
|
|
||||||
public string ResponsiblePerson { get; set; }
|
|
||||||
public string Gating { get; set; }
|
|
||||||
public DateTime? DueDate { get; set; }
|
|
||||||
public string ResponsibleID { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
public class CCPCRBActionItem
|
|
||||||
{
|
|
||||||
public int ID { get; set; }
|
|
||||||
public int PCRBID { get; set; }
|
|
||||||
public string ActionItemName { get; set; }
|
|
||||||
public string ResponsiblePerson { get; set; }
|
|
||||||
public string Gating { get; set; }
|
|
||||||
public DateTime? DueDate { get; set; }
|
|
||||||
public string ResponsibleID { get; set; }
|
|
||||||
|
|
||||||
}
|
|
||||||
public class CCPCRBActionItemAll
|
|
||||||
{
|
|
||||||
[Key]
|
|
||||||
public int ID { get; set; }
|
|
||||||
|
|
||||||
public int MeetingID { get; set; }
|
|
||||||
public string ActionItemName { get; set; }
|
|
||||||
public string ResponsiblePerson { get; set; }
|
|
||||||
public string Gating { get; set; }
|
|
||||||
public DateTime? DueDate { get; set; }
|
|
||||||
public string PCRB { get; set; }
|
|
||||||
public string Updates { get; set; }
|
|
||||||
public bool ClosedStatus { get; set; }
|
|
||||||
public DateTime? ClosedDate { get; set; }
|
|
||||||
public int ClosedBy { get; set; }
|
|
||||||
public string FileGUID { get; set; }
|
|
||||||
public string FileName { get; set; }
|
|
||||||
public int UploadedByID { get; set; }
|
|
||||||
public string UploadedByName { get; set; }
|
|
||||||
public DateTime UploadDateTime { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public class CCMeetingActionItemAll
|
|
||||||
{
|
|
||||||
[Key]
|
|
||||||
public int ID { get; set; }
|
|
||||||
|
|
||||||
public int MeetingID { get; set; }
|
|
||||||
public string ActionItemName { get; set; }
|
|
||||||
public string ResponsiblePerson { get; set; }
|
|
||||||
public string Gating { get; set; }
|
|
||||||
public DateTime? DueDate { get; set; }
|
|
||||||
public string PCRB { get; set; }
|
|
||||||
public string Updates { get; set; }
|
|
||||||
public bool ClosedStatus { get; set; }
|
|
||||||
public DateTime? ClosedDate { get; set; }
|
|
||||||
public int ClosedBy { get; set; }
|
|
||||||
public string FileGUID { get; set; }
|
|
||||||
public string FileName { get; set; }
|
|
||||||
public int UploadedByID { get; set; }
|
|
||||||
public string UploadedByName { get; set; }
|
|
||||||
public DateTime UploadDateTime { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public class MeetingList
|
|
||||||
{
|
|
||||||
public int MeetingID { get; set; }
|
|
||||||
public string MeetingInfo{ get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public class MeetingDecisionSummaryList
|
|
||||||
{
|
|
||||||
public string PCRB { get; set; }
|
|
||||||
public DateTime? MeetingDate { get; set; }
|
|
||||||
public string DecisionNotes { get; set; }
|
|
||||||
public string ECNLinks { get; set; }
|
|
||||||
public string LotDispoLinks { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public class UserList
|
|
||||||
{
|
|
||||||
public int AttendeeID { set; get; }
|
|
||||||
public string AttendeeName { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public class ActionItemResponsible
|
|
||||||
{
|
|
||||||
public string ResponsibleID { set; get; }
|
|
||||||
public string ResponsibleName { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public class SiteList
|
|
||||||
{
|
|
||||||
public string SiteID { set; get; }
|
|
||||||
public string SiteName { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public class ChangeControlList
|
|
||||||
{
|
|
||||||
public string IssueID { get; set; }
|
|
||||||
public string Title { get; set; }
|
|
||||||
public string MesaIdTitle { get; set; }
|
|
||||||
public string Owner { get; set; }
|
|
||||||
public string ChangeLevel { get; set; }
|
|
||||||
public DateTime? StartDate { get; set; }
|
|
||||||
public DateTime? StatusDate { get; set; }
|
|
||||||
public string PCRBStatus { get; set; }
|
|
||||||
public string Generations { get; set; }
|
|
||||||
public string Logistics { get; set; }
|
|
||||||
public string Processes { get; set; }
|
|
||||||
public string ToolTypes { get; set; }
|
|
||||||
public string ActionItemResponsibility { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public class PCRValue
|
|
||||||
{
|
|
||||||
public string PCRValueID { set; get; }
|
|
||||||
public string PCRValueName { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class CCPCRB {
|
||||||
|
|
||||||
|
public int PCRBID { get; set; }
|
||||||
|
public int PlanNumber { get; set; }
|
||||||
|
public string PCRB { get; set; }
|
||||||
|
public DateTime Date { get; set; }
|
||||||
|
public int Decision { get; set; }
|
||||||
|
public string Notes { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class CCMeetingAttendee {
|
||||||
|
|
||||||
|
public int ID { get; set; }
|
||||||
|
public int MeetingID { get; set; }
|
||||||
|
public string AttendeeName { get; set; }
|
||||||
|
public string JobTitle { get; set; }
|
||||||
|
public string Location { get; set; }
|
||||||
|
public int AttendeeID { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class CCPCRBAttendee {
|
||||||
|
|
||||||
|
public int ID { get; set; }
|
||||||
|
public int PCRBID { get; set; }
|
||||||
|
public string AttendeeName { get; set; }
|
||||||
|
public string JobTitle { get; set; }
|
||||||
|
public string Location { get; set; }
|
||||||
|
public bool Approved { get; set; }
|
||||||
|
public int AttendeeID { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// /
|
||||||
|
/// </summary>
|
||||||
|
public class CCMeetingAttachment {
|
||||||
|
|
||||||
|
public int ID { get; set; }
|
||||||
|
public string FileGUID { get; set; }
|
||||||
|
public string FileName { get; set; }
|
||||||
|
public int UploadedByID { get; set; }
|
||||||
|
public string UploadedByName { get; set; }
|
||||||
|
public DateTime UploadDateTime { get; set; }
|
||||||
|
public string Title { get; set; }
|
||||||
|
public int MeetingID { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class CCDecisionSummary {
|
||||||
|
|
||||||
|
public int ID { get; set; }
|
||||||
|
public int MeetingID { get; set; }
|
||||||
|
public string DecisionNotes { get; set; }
|
||||||
|
public string ECNLinks { get; set; }
|
||||||
|
public string LotDispoLinks { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class CCDecisionSummaryLink {
|
||||||
|
|
||||||
|
public string Link { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class CCMeetingActionItem {
|
||||||
|
|
||||||
|
public int ID { get; set; }
|
||||||
|
public int MeetingID { get; set; }
|
||||||
|
public string ActionItemName { get; set; }
|
||||||
|
public string ResponsiblePerson { get; set; }
|
||||||
|
public string Gating { get; set; }
|
||||||
|
public DateTime? DueDate { get; set; }
|
||||||
|
public string ResponsibleID { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class CCPCRBActionItem {
|
||||||
|
|
||||||
|
public int ID { get; set; }
|
||||||
|
public int PCRBID { get; set; }
|
||||||
|
public string ActionItemName { get; set; }
|
||||||
|
public string ResponsiblePerson { get; set; }
|
||||||
|
public string Gating { get; set; }
|
||||||
|
public DateTime? DueDate { get; set; }
|
||||||
|
public string ResponsibleID { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class CCPCRBActionItemAll {
|
||||||
|
[Key]
|
||||||
|
public int ID { get; set; }
|
||||||
|
public int MeetingID { get; set; }
|
||||||
|
public string ActionItemName { get; set; }
|
||||||
|
public string ResponsiblePerson { get; set; }
|
||||||
|
public string Gating { get; set; }
|
||||||
|
public DateTime? DueDate { get; set; }
|
||||||
|
public string PCRB { get; set; }
|
||||||
|
public string Updates { get; set; }
|
||||||
|
public bool ClosedStatus { get; set; }
|
||||||
|
public DateTime? ClosedDate { get; set; }
|
||||||
|
public int ClosedBy { get; set; }
|
||||||
|
public string FileGUID { get; set; }
|
||||||
|
public string FileName { get; set; }
|
||||||
|
public int UploadedByID { get; set; }
|
||||||
|
public string UploadedByName { get; set; }
|
||||||
|
public DateTime UploadDateTime { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class CCMeetingActionItemAll {
|
||||||
|
[Key]
|
||||||
|
public int ID { get; set; }
|
||||||
|
public int MeetingID { get; set; }
|
||||||
|
public string ActionItemName { get; set; }
|
||||||
|
public string ResponsiblePerson { get; set; }
|
||||||
|
public string Gating { get; set; }
|
||||||
|
public DateTime? DueDate { get; set; }
|
||||||
|
public string PCRB { get; set; }
|
||||||
|
public string Updates { get; set; }
|
||||||
|
public bool ClosedStatus { get; set; }
|
||||||
|
public DateTime? ClosedDate { get; set; }
|
||||||
|
public int ClosedBy { get; set; }
|
||||||
|
public string FileGUID { get; set; }
|
||||||
|
public string FileName { get; set; }
|
||||||
|
public int UploadedByID { get; set; }
|
||||||
|
public string UploadedByName { get; set; }
|
||||||
|
public DateTime UploadDateTime { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class MeetingList {
|
||||||
|
|
||||||
|
public int MeetingID { get; set; }
|
||||||
|
public string MeetingInfo { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class MeetingDecisionSummaryList {
|
||||||
|
|
||||||
|
public string PCRB { get; set; }
|
||||||
|
public DateTime? MeetingDate { get; set; }
|
||||||
|
public string DecisionNotes { get; set; }
|
||||||
|
public string ECNLinks { get; set; }
|
||||||
|
public string LotDispoLinks { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class UserList {
|
||||||
|
|
||||||
|
public int AttendeeID { set; get; }
|
||||||
|
public string AttendeeName { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ActionItemResponsible {
|
||||||
|
|
||||||
|
public string ResponsibleID { set; get; }
|
||||||
|
public string ResponsibleName { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class SiteList {
|
||||||
|
|
||||||
|
public string SiteID { set; get; }
|
||||||
|
public string SiteName { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ChangeControlList {
|
||||||
|
|
||||||
|
public string IssueID { get; set; }
|
||||||
|
public string Title { get; set; }
|
||||||
|
public string MesaIdTitle { get; set; }
|
||||||
|
public string Owner { get; set; }
|
||||||
|
public string ChangeLevel { get; set; }
|
||||||
|
public DateTime? StartDate { get; set; }
|
||||||
|
public DateTime? StatusDate { get; set; }
|
||||||
|
public string PCRBStatus { get; set; }
|
||||||
|
public string Generations { get; set; }
|
||||||
|
public string Logistics { get; set; }
|
||||||
|
public string Processes { get; set; }
|
||||||
|
public string ToolTypes { get; set; }
|
||||||
|
public string ActionItemResponsibility { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class PCRValue {
|
||||||
|
|
||||||
|
public string PCRValueID { set; get; }
|
||||||
|
public string PCRValueName { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
@ -1,218 +1,202 @@
|
|||||||
using System;
|
#pragma warning disable CS8019
|
||||||
|
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Web;
|
|
||||||
using Fab2ApprovalSystem.ViewModels;
|
using Fab2ApprovalSystem.ViewModels;
|
||||||
|
|
||||||
|
#if !NET8
|
||||||
using System.Web.Mvc;
|
using System.Web.Mvc;
|
||||||
|
#endif
|
||||||
|
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
|
|
||||||
namespace Fab2ApprovalSystem.Models
|
#pragma warning restore CS8019
|
||||||
{
|
|
||||||
public class CredentialsStorage
|
|
||||||
{
|
|
||||||
public string UserName { get; set; }
|
|
||||||
public string Password { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Lot
|
namespace Fab2ApprovalSystem.Models;
|
||||||
{
|
|
||||||
public int LotID { get; set; }
|
|
||||||
[Display(Name = "Wafer Lot#")]
|
|
||||||
public string LotNumber { get; set; }
|
|
||||||
// public string ParentLotNumber { set; get { return LotNumber.Length >= 7 ? LotNumber.Substring(0, 7) : LotNumber; } }
|
|
||||||
public string ParentLotNumber { set; get; }
|
|
||||||
|
|
||||||
public int MRBNumber { get; set; }
|
public class CredentialsStorage {
|
||||||
public string MRBDispoType { get; set; }
|
|
||||||
public bool GoodToSubmit { get; set; }
|
|
||||||
public string SubmitErrorMessage { get; set; }
|
|
||||||
// Lot Disposition Issue Number
|
|
||||||
public int IssueID { get; set; }
|
|
||||||
public string IssueIDWithoutMRB { get; set; }
|
|
||||||
public string DieLotNumber { get; set; }
|
|
||||||
public string Description { get; set; }
|
|
||||||
[Display(Name = "New PN#")]
|
|
||||||
public string NewPartNo { get; set; }
|
|
||||||
[Display(Name = "WIP PN#")]
|
|
||||||
public string WipPartNo { get; set; }
|
|
||||||
[Display(Name = "Die PN#")]
|
|
||||||
public string DiePartNo { get; set; }
|
|
||||||
[Display(Name = "Device Type")]
|
|
||||||
public string ProductFamily { get; set; }
|
|
||||||
public string Gen { get; set; }
|
|
||||||
public string Channel { get; set; }
|
|
||||||
public string Hexsize { get; set; }
|
|
||||||
public double Voltage { get; set; }
|
|
||||||
public int WaferCount { get; set; }
|
|
||||||
public int ReleaseCount { get; set; }
|
|
||||||
public int ScrapCount { get; set; }
|
|
||||||
public int DieCount { get; set; }
|
|
||||||
public string Location { get; set; }
|
|
||||||
public double TotalCost { get; set; }
|
|
||||||
public int LotStatusOptionID { get; set; }
|
|
||||||
public string LotStatusOptionName { get; set; }
|
|
||||||
public double WaferCost { get; set; }
|
|
||||||
public double DieCost { get; set; }
|
|
||||||
|
|
||||||
[UIHint("LotStatusOptionTemplate")]
|
public string UserName { get; set; }
|
||||||
[Display(Name = "Lot Status")]
|
public string Password { get; set; }
|
||||||
public LotStatusOptionViewModel LotStatusOption { get; set; }
|
|
||||||
|
}
|
||||||
public ScrapLot ScrapLotWafer { get; set; }
|
|
||||||
|
public class Lot {
|
||||||
[Display(Name = "Lot Dispos")]
|
|
||||||
public string OtherLotDispos { get; set; }
|
public int LotID { get; set; }
|
||||||
|
[Display(Name = "Wafer Lot#")]
|
||||||
//MRB Lot
|
public string LotNumber { get; set; }
|
||||||
//[CustomDispoTypeValidationAttribute(ErrorMessage = "The values can only either A or B or C or D")]
|
public string ParentLotNumber { set; get; }
|
||||||
public char? DispoType { get; set; }
|
public int MRBNumber { get; set; }
|
||||||
[Display(Name = "Lot Dispos")]
|
public string MRBDispoType { get; set; }
|
||||||
public string LotDispositionsLinkedToLot { get; set; }
|
public bool GoodToSubmit { get; set; }
|
||||||
|
public string SubmitErrorMessage { get; set; }
|
||||||
[Display(Name = "MRBs")]
|
// Lot Disposition Issue Number
|
||||||
public string MRBsLinkedToLot { get; set; }
|
public int IssueID { get; set; }
|
||||||
|
public string IssueIDWithoutMRB { get; set; }
|
||||||
public string Status { get; set; }
|
public string DieLotNumber { get; set; }
|
||||||
|
public string Description { get; set; }
|
||||||
public int OpenIssueWithExistingLots { get; set; }
|
[Display(Name = "New PN#")]
|
||||||
public string QualityCode { get; set; }
|
public string NewPartNo { get; set; }
|
||||||
|
[Display(Name = "WIP PN#")]
|
||||||
[Display(Name = "Source Lot#")]
|
public string WipPartNo { get; set; }
|
||||||
public string SourceLot { get; set; }
|
[Display(Name = "Die PN#")]
|
||||||
public string SourceAction { get; set; }
|
public string DiePartNo { get; set; }
|
||||||
public DateTime? SourceActionTime { get; set; }
|
[Display(Name = "Device Type")]
|
||||||
public DateTime? SPNTransmitTime { get; set; }
|
public string ProductFamily { get; set; }
|
||||||
public string SPNTransmitMsg { get; set; }
|
public string Gen { get; set; }
|
||||||
[Display(Name = "MRBs")]
|
public string Channel { get; set; }
|
||||||
public string OtherMRBs { get; set; }
|
public string Hexsize { get; set; }
|
||||||
|
public double Voltage { get; set; }
|
||||||
public Lot()
|
public int WaferCount { get; set; }
|
||||||
{
|
public int ReleaseCount { get; set; }
|
||||||
LotStatusOption = new LotStatusOptionViewModel();
|
public int ScrapCount { get; set; }
|
||||||
ScrapLotWafer = new ScrapLot();
|
public int DieCount { get; set; }
|
||||||
|
public string Location { get; set; }
|
||||||
}
|
public double TotalCost { get; set; }
|
||||||
|
public int LotStatusOptionID { get; set; }
|
||||||
public bool IsDirty { get; set; }
|
public string LotStatusOptionName { get; set; }
|
||||||
|
public double WaferCost { get; set; }
|
||||||
}
|
public double DieCost { get; set; }
|
||||||
|
|
||||||
public class MRBHoldFlagReport
|
[UIHint("LotStatusOptionTemplate")]
|
||||||
{
|
[Display(Name = "Lot Status")]
|
||||||
public string LotNo { get; set; }
|
public LotStatusOptionViewModel LotStatusOption { get; set; }
|
||||||
public string TransactionType { get; set; }
|
public ScrapLot ScrapLotWafer { get; set; }
|
||||||
|
|
||||||
public string PartNo { get; set; }
|
[Display(Name = "Lot Dispos")]
|
||||||
public string CurrentLocation { get; set; }
|
public string OtherLotDispos { get; set; }
|
||||||
public string CurrentOperation { get; set; }
|
|
||||||
public int StartQty { get; set; }
|
//MRB Lot
|
||||||
public int CurrentQty { get; set; }
|
//[CustomDispoTypeValidationAttribute(ErrorMessage = "The values can only either A or B or C or D")]
|
||||||
public string LotStatus { get; set; }
|
public char? DispoType { get; set; }
|
||||||
public string OperStatus { get; set; }
|
[Display(Name = "Lot Dispos")]
|
||||||
public string Successful { get; set; }
|
public string LotDispositionsLinkedToLot { get; set; }
|
||||||
public string Comment { get; set; }
|
|
||||||
|
[Display(Name = "MRBs")]
|
||||||
public string PriorMRBHoldLocation { get; set; }
|
public string MRBsLinkedToLot { get; set; }
|
||||||
public string PriorMRBHoldOperation { get; set; }
|
public string Status { get; set; }
|
||||||
public string PriorMRB_DispoType { get; set; }
|
public int OpenIssueWithExistingLots { get; set; }
|
||||||
|
public string QualityCode { get; set; }
|
||||||
public string CurrentMRBHoldLocation { get; set; }
|
|
||||||
public string CurrentMRBHoldOperation { get; set; }
|
[Display(Name = "Source Lot#")]
|
||||||
public string CurrentMRB_DispoType { get; set; }
|
public string SourceLot { get; set; }
|
||||||
|
public string SourceAction { get; set; }
|
||||||
|
public DateTime? SourceActionTime { get; set; }
|
||||||
public string MRB_DispoType { get; set; }
|
public DateTime? SPNTransmitTime { get; set; }
|
||||||
public DateTime TransactionDateTime { get; set; }
|
public string SPNTransmitMsg { get; set; }
|
||||||
public string MRBLocation { get; set; }
|
[Display(Name = "MRBs")]
|
||||||
public string MRBOperation { get; set; }
|
public string OtherMRBs { get; set; }
|
||||||
|
public Lot() {
|
||||||
public bool Reprocess { get; set; }
|
LotStatusOption = new LotStatusOptionViewModel();
|
||||||
|
ScrapLotWafer = new ScrapLot();
|
||||||
public bool HasErrors { get; set; }
|
}
|
||||||
|
|
||||||
|
public bool IsDirty { get; set; }
|
||||||
}
|
|
||||||
|
}
|
||||||
public class MRBLotsTobeSentToSPN
|
|
||||||
{
|
public class MRBHoldFlagReport {
|
||||||
public string LotNumber { get; set; }
|
|
||||||
public int MRBNumber { get; set; }
|
public string LotNo { get; set; }
|
||||||
public char? DispoType { get; set; }
|
public string TransactionType { get; set; }
|
||||||
public char AddRemoveChangeMRBFlag { get; set; }
|
public string PartNo { get; set; }
|
||||||
public bool IsDirty { get; set; }
|
public string CurrentLocation { get; set; }
|
||||||
public bool SentToSPN { get; set; }
|
public string CurrentOperation { get; set; }
|
||||||
public DateTime MRBLotLastSentToSPNDatetime { get; set; }
|
public int StartQty { get; set; }
|
||||||
|
public int CurrentQty { get; set; }
|
||||||
}
|
public string LotStatus { get; set; }
|
||||||
|
public string OperStatus { get; set; }
|
||||||
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false, Inherited = true)]
|
public string Successful { get; set; }
|
||||||
public class CustomDispoTypeValidationAttribute : ValidationAttribute, IClientValidatable
|
public string Comment { get; set; }
|
||||||
{
|
public string PriorMRBHoldLocation { get; set; }
|
||||||
public override bool IsValid(object value)
|
public string PriorMRBHoldOperation { get; set; }
|
||||||
{
|
public string PriorMRB_DispoType { get; set; }
|
||||||
char tem = (char)value;
|
public string CurrentMRBHoldLocation { get; set; }
|
||||||
var productName = tem.ToString();
|
public string CurrentMRBHoldOperation { get; set; }
|
||||||
if (!string.IsNullOrEmpty(productName))
|
public string CurrentMRB_DispoType { get; set; }
|
||||||
{
|
public string MRB_DispoType { get; set; }
|
||||||
return Regex.IsMatch(productName, "^[A,B,C,D]");
|
public DateTime TransactionDateTime { get; set; }
|
||||||
}
|
public string MRBLocation { get; set; }
|
||||||
return true;
|
public string MRBOperation { get; set; }
|
||||||
}
|
public bool Reprocess { get; set; }
|
||||||
|
public bool HasErrors { get; set; }
|
||||||
public IEnumerable<ModelClientValidationRule> GetClientValidationRules(ModelMetadata metadata, ControllerContext context)
|
|
||||||
{
|
}
|
||||||
yield return new ModelClientValidationRule
|
|
||||||
{
|
public class MRBLotsTobeSentToSPN {
|
||||||
ErrorMessage = ErrorMessage,
|
|
||||||
ValidationType = "dispotypevalidation"
|
public string LotNumber { get; set; }
|
||||||
};
|
public int MRBNumber { get; set; }
|
||||||
}
|
public char? DispoType { get; set; }
|
||||||
}
|
public char AddRemoveChangeMRBFlag { get; set; }
|
||||||
|
public bool IsDirty { get; set; }
|
||||||
/// <summary>
|
public bool SentToSPN { get; set; }
|
||||||
///
|
public DateTime MRBLotLastSentToSPNDatetime { get; set; }
|
||||||
/// </summary>
|
|
||||||
public class Department
|
}
|
||||||
{
|
|
||||||
//public int LotDispoDepartmentID { get; set; }
|
#if !NET8
|
||||||
//public int IssueID { get; set; }
|
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false, Inherited = true)]
|
||||||
public int DepartmentID { get; set; }
|
public class CustomDispoTypeValidationAttribute : ValidationAttribute, IClientValidatable {
|
||||||
public string DepartmentName { get; set; }
|
public override bool IsValid(object value) {
|
||||||
}
|
char tem = (char)value;
|
||||||
|
var productName = tem.ToString();
|
||||||
/// <summary>
|
if (!string.IsNullOrEmpty(productName)) {
|
||||||
///
|
return Regex.IsMatch(productName, "^[A,B,C,D]");
|
||||||
/// </summary>
|
}
|
||||||
public class AffectedModule
|
return true;
|
||||||
{
|
}
|
||||||
public int ModuleID { get; set; }
|
|
||||||
public string ModuleName { get; set; }
|
public IEnumerable<ModelClientValidationRule> GetClientValidationRules(ModelMetadata metadata, ControllerContext context) {
|
||||||
|
yield return new ModelClientValidationRule {
|
||||||
}
|
ErrorMessage = ErrorMessage,
|
||||||
|
ValidationType = "dispotypevalidation"
|
||||||
public class WIPPart
|
};
|
||||||
{
|
}
|
||||||
public string WIPPartData { get; set; }
|
}
|
||||||
public string PartNumber { get; set; }
|
#endif
|
||||||
public string SiliconPartNumber { get; set; }
|
|
||||||
public string ProcessFlow { get; set; }
|
public class Department {
|
||||||
}
|
|
||||||
|
public int DepartmentID { get; set; }
|
||||||
public class ProductFamilies
|
public string DepartmentName { get; set; }
|
||||||
{
|
|
||||||
public int ProductFamilyID { get; set; }
|
}
|
||||||
public string ProductFamily { get; set; }
|
|
||||||
}
|
public class AffectedModule {
|
||||||
|
|
||||||
public class LotSplitAnalysisResult
|
public int ModuleID { get; set; }
|
||||||
{
|
public string ModuleName { get; set; }
|
||||||
public int ID { get; set; }
|
|
||||||
public string ParentLotNo { get; set; }
|
}
|
||||||
public string LotNo { get; set; }
|
|
||||||
public DateTime ActionTime { get; set; }
|
public class WIPPart {
|
||||||
public string ActionType { get; set; }
|
|
||||||
public bool? IsAffected { get; set; }
|
public string WIPPartData { get; set; }
|
||||||
}
|
public string PartNumber { get; set; }
|
||||||
|
public string SiliconPartNumber { get; set; }
|
||||||
|
public string ProcessFlow { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ProductFamilies {
|
||||||
|
|
||||||
|
public int ProductFamilyID { get; set; }
|
||||||
|
public string ProductFamily { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class LotSplitAnalysisResult {
|
||||||
|
|
||||||
|
public int ID { get; set; }
|
||||||
|
public string ParentLotNo { get; set; }
|
||||||
|
public string LotNo { get; set; }
|
||||||
|
public DateTime ActionTime { get; set; }
|
||||||
|
public string ActionType { get; set; }
|
||||||
|
public bool? IsAffected { get; set; }
|
||||||
|
|
||||||
}
|
}
|
@ -1,239 +1,208 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.Linq;
|
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Web;
|
|
||||||
|
|
||||||
namespace Fab2ApprovalSystem.Models
|
namespace Fab2ApprovalSystem.Models;
|
||||||
{
|
|
||||||
public class ECN :System.Object
|
|
||||||
{
|
|
||||||
public string Title { get; set; }
|
|
||||||
public int ECNNumber {get;set;}
|
|
||||||
|
|
||||||
[DataType(DataType.Date)]
|
public class ECN : object {
|
||||||
public DateTime IssueDate {get;set;}
|
|
||||||
|
|
||||||
|
public string Title { get; set; }
|
||||||
|
public int ECNNumber { get; set; }
|
||||||
|
|
||||||
[DisplayFormat(DataFormatString = "{0:MM/dd/yyyy}")]
|
[DataType(DataType.Date)]
|
||||||
public DateTime? SubmitedDate { get; set; }
|
public DateTime IssueDate { get; set; }
|
||||||
|
|
||||||
[DisplayFormat(DataFormatString = "{0:MM/dd/yyyy}")]
|
[DisplayFormat(DataFormatString = "{0:MM/dd/yyyy}")]
|
||||||
public DateTime? CloseDate { get; set; }
|
public DateTime? SubmitedDate { get; set; }
|
||||||
|
|
||||||
public int OriginatorID { get; set; }
|
[DisplayFormat(DataFormatString = "{0:MM/dd/yyyy}")]
|
||||||
public string OriginatorName { get; set; }
|
public DateTime? CloseDate { get; set; }
|
||||||
// important!!make sure the id of the control matches the name of the field in the model it is being binded to,
|
public int OriginatorID { get; set; }
|
||||||
// in order to get the selected items from the control
|
public string OriginatorName { get; set; }
|
||||||
public List<int> DepartmentIDs { get; set; }
|
// important!!make sure the id of the control matches the name of the field in the model it is being binded to,
|
||||||
|
// in order to get the selected items from the control
|
||||||
|
public List<int> DepartmentIDs { get; set; }
|
||||||
|
public List<int> ModuleIDs { get; set; }
|
||||||
|
public List<int> AreaIDs { get; set; }
|
||||||
|
public List<int> TechnologyIDs { get; set; }
|
||||||
|
public List<int> AcknowledgementByIDs { get; set; }
|
||||||
|
public List<int> TrainingByIDs { get; set; }
|
||||||
|
public bool IsECN { get; set; }
|
||||||
|
public bool IsTECN { get; set; }
|
||||||
|
public bool IsEmergencyTECN { get; set; }
|
||||||
|
|
||||||
public List<int> ModuleIDs { get; set; }
|
[DataType(DataType.Date)]
|
||||||
public List<int> AreaIDs { get; set; }
|
//[DisplayFormat(DataFormatString = "{0:MM/dd/yyyy}")]
|
||||||
public List<int> TechnologyIDs { get; set; }
|
public DateTime? ExpirationDate { get; set; }
|
||||||
public List<int> AcknowledgementByIDs { get; set; }
|
|
||||||
public List<int> TrainingByIDs { get; set; }
|
|
||||||
|
|
||||||
public bool IsECN { get; set; }
|
[DisplayFormat(DataFormatString = "{0:MM/dd/yyyy}")]
|
||||||
public bool IsTECN { get; set; }
|
public DateTime? ExtensionDate { get; set; }
|
||||||
public bool IsEmergencyTECN { get; set; }
|
|
||||||
|
|
||||||
[DataType(DataType.Date)]
|
[DisplayFormat(DataFormatString = "{0:MM/dd/yyyy}")]
|
||||||
//[DisplayFormat(DataFormatString = "{0:MM/dd/yyyy}")]
|
public DateTime? CancellationDate { get; set; }
|
||||||
public DateTime? ExpirationDate { get; set; }
|
public bool AcknowledgementRequired { get; set; }
|
||||||
|
public bool TrainingRequired { get; set; }
|
||||||
[DisplayFormat(DataFormatString = "{0:MM/dd/yyyy}")]
|
public int? AreaID { get; set; }
|
||||||
public DateTime? ExtensionDate { get; set; }
|
public int? TechnologyID { get; set; }
|
||||||
|
public bool PCRBRequired { get; set; }
|
||||||
[DisplayFormat(DataFormatString = "{0:MM/dd/yyyy}")]
|
public string PCRBNumber { get; set; }
|
||||||
public DateTime? CancellationDate { get; set; }
|
public bool TestProgramChangeRequired { get; set; }
|
||||||
|
public bool SPCChangeRequired { get; set; }
|
||||||
public bool AcknowledgementRequired { get; set; }
|
public bool NewPartFlowRequired { get; set; }
|
||||||
public bool TrainingRequired { get; set; }
|
public bool SPNChangeRequired { get; set; }
|
||||||
public int? AreaID { get; set; }
|
public string ImplementationDetails { get; set; }
|
||||||
public int? TechnologyID { get; set; }
|
public int ImpactOnEnvironment { get; set; }
|
||||||
public bool PCRBRequired { get; set; }
|
public string ImpactOnEnvironmentDescription { get; set; }
|
||||||
public string PCRBNumber { get; set; }
|
public int ImpactOnCapacity { get; set; }
|
||||||
public bool TestProgramChangeRequired { get; set; }
|
public string ImpactOnCapacityDescription { get; set; }
|
||||||
public bool SPCChangeRequired { get; set; }
|
public bool IsMA { get; set; }
|
||||||
public bool NewPartFlowRequired { get; set; }
|
public bool IsRH { get; set; }
|
||||||
public bool SPNChangeRequired { get; set; }
|
public bool IsAU { get; set; }
|
||||||
public string ImplementationDetails { get; set; }
|
public bool IsIndustrial { get; set; }
|
||||||
public int ImpactOnEnvironment { get; set; }
|
public int MaterialConsumptionChangeRequired { get; set; }
|
||||||
public string ImpactOnEnvironmentDescription { get; set; }
|
public string MaterialConsumptionChangeDescription { get; set; }
|
||||||
public int ImpactOnCapacity { get; set; }
|
public string ReasonForChange { get; set; }
|
||||||
public string ImpactOnCapacityDescription { get; set; }
|
public string DescriptionOfChange { get; set; }
|
||||||
public bool IsMA { get; set; }
|
public bool NotAFlowChange { get; set; }
|
||||||
public bool IsRH { get; set; }
|
public bool AttachECN_TECNToLots { get; set; }
|
||||||
public bool IsAU { get; set; }
|
public bool SPNFlowChangeAtSingleStep { get; set; }
|
||||||
public bool IsIndustrial { get; set; }
|
public bool SPNFlowChangeAtMultipleSteps { get; set; }
|
||||||
public int MaterialConsumptionChangeRequired { get; set; }
|
public byte CurrentStep { get; set; }
|
||||||
public string MaterialConsumptionChangeDescription { get; set; }
|
public bool TECNExtensionState { get; set; }
|
||||||
public string ReasonForChange { get; set; }
|
public bool Cancelled { get; set; }
|
||||||
public string DescriptionOfChange { get; set; }
|
public bool CancellationApproved { get; set; }
|
||||||
public bool NotAFlowChange { get; set; }
|
public bool CancellationInProgress { get; set; }
|
||||||
public bool AttachECN_TECNToLots { get; set; }
|
public DateTime? CancellationApprovalDate { get; set; }
|
||||||
public bool SPNFlowChangeAtSingleStep { get; set; }
|
public bool ExpirationProcessed { get; set; }
|
||||||
public bool SPNFlowChangeAtMultipleSteps { get; set; }
|
public bool ExpirationInProgress { get; set; }
|
||||||
public byte CurrentStep{ get; set; }
|
public DateTime? ExpirationProcessedlDate { get; set; }
|
||||||
public bool TECNExtensionState { get; set; }
|
public bool ReSubmitted { get; set; }
|
||||||
public bool Cancelled { get; set; }
|
public bool Converted { get; set; }
|
||||||
|
public string ConvertedToType { get; set; }
|
||||||
public bool CancellationApproved { get; set; }
|
public int? ConvertedToNumber { get; set; }
|
||||||
public bool CancellationInProgress { get; set; }
|
public int? ConvertedFromNumber { get; set; }
|
||||||
public DateTime? CancellationApprovalDate { get; set; }
|
public int WorkFlowNumber { get; set; }
|
||||||
public bool ExpirationProcessed {get;set;}
|
public bool LockedForConversion { get; set; }
|
||||||
public bool ExpirationInProgress { get; set; }
|
public bool ConversionRejected { get; set; }
|
||||||
public DateTime? ExpirationProcessedlDate { get; set; }
|
public bool ConversionApprovalInProgress { get; set; }
|
||||||
public bool ReSubmitted { get; set; }
|
public bool RecordLockIndicator { get; set; }
|
||||||
public bool Converted { get; set; }
|
public int RecordLockedBy { get; set; }
|
||||||
public string ConvertedToType { get; set; }
|
public string RecordLockByName { get; set; }
|
||||||
public int? ConvertedToNumber { get; set; }
|
public DateTime? RecordLockedDate { get; set; }
|
||||||
public int? ConvertedFromNumber { get; set; }
|
public int LastUpdatedBy { get; set; }
|
||||||
public int WorkFlowNumber { get; set; }
|
public DateTime? LastUpdateDate { get; set; }
|
||||||
public bool LockedForConversion { get; set; }
|
public DateTime LastUpdateTimeStamp { get; set; }
|
||||||
public bool ConversionRejected { get; set; }
|
public int? CategoryID { get; set; }
|
||||||
public bool ConversionApprovalInProgress { get; set; }
|
public bool FIChangeRequired { get; set; }
|
||||||
public bool RecordLockIndicator { get; set; }
|
public string NumberOfLotsAffected { get; set; }
|
||||||
public int RecordLockedBy { get; set; }
|
public bool? RecipeChange { get; set; }
|
||||||
public string RecordLockByName { get; set; }
|
public List<int> ProductFamilyIDs { get; set; }
|
||||||
public DateTime? RecordLockedDate { get; set; }
|
public bool Deleted { get; set; }
|
||||||
public int LastUpdatedBy { get; set; }
|
public bool IsDocEC { get; set; }
|
||||||
public DateTime? LastUpdateDate { get; set; }
|
public bool MetrologyChangeRequired { get; set; }
|
||||||
public DateTime LastUpdateTimeStamp { get; set; }
|
public ECN() {
|
||||||
|
DepartmentIDs = new List<int>();
|
||||||
public int? CategoryID { get; set; }
|
ModuleIDs = new List<int>();
|
||||||
|
AreaIDs = new List<int>();
|
||||||
public bool FIChangeRequired { get; set; }
|
TechnologyIDs = new List<int>();
|
||||||
public string NumberOfLotsAffected { get; set; }
|
AcknowledgementByIDs = new List<int>();
|
||||||
public bool? RecipeChange { get; set; }
|
TrainingByIDs = new List<int>();
|
||||||
public List<int> ProductFamilyIDs { get; set; }
|
ProductFamilyIDs = new List<int>();
|
||||||
|
}
|
||||||
public bool Deleted { get; set; }
|
|
||||||
public bool IsDocEC { get; set; }
|
|
||||||
public bool MetrologyChangeRequired { get; set; }
|
|
||||||
public ECN()
|
|
||||||
{
|
|
||||||
DepartmentIDs = new List<int>();
|
|
||||||
ModuleIDs = new List<int>();
|
|
||||||
AreaIDs = new List<int>();
|
|
||||||
TechnologyIDs = new List<int>();
|
|
||||||
AcknowledgementByIDs = new List<int>();
|
|
||||||
TrainingByIDs = new List<int>();
|
|
||||||
ProductFamilyIDs = new List<int>();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public override bool Equals(System.Object obj)
|
|
||||||
{
|
|
||||||
// If parameter is null return false.
|
|
||||||
if (obj == null)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// If parameter cannot be cast to Point return false.
|
|
||||||
ECN p = obj as ECN;
|
|
||||||
if ((System.Object)p == null)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Return true if the fields match:
|
|
||||||
return (IsECN == p.IsECN) && (IsEmergencyTECN == p.IsEmergencyTECN);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="p"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public bool Equals(ECN p)
|
|
||||||
{
|
|
||||||
// If parameter is null return false:
|
|
||||||
if ((object)p == null)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
foreach (PropertyInfo pi in p.GetType().GetProperties())
|
|
||||||
{
|
|
||||||
foreach(PropertyInfo px in this.GetType().GetProperties())
|
|
||||||
{
|
|
||||||
if (pi.Name.ToLower() == px.Name.ToLower())
|
|
||||||
{
|
|
||||||
if (pi.GetValue(p).Equals(px.GetValue(this)))
|
|
||||||
break;
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
public override bool Equals(object obj) {
|
||||||
|
// If parameter is null return false.
|
||||||
|
if (obj == null) {
|
||||||
return false;
|
return false;
|
||||||
// Return true if the fields match:
|
}
|
||||||
//return (IsECN == p.IsECN) && (IsEmergencyTECN == p.IsEmergencyTECN);
|
|
||||||
|
// If parameter cannot be cast to Point return false.
|
||||||
|
ECN p = obj as ECN;
|
||||||
|
if (p == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Return true if the fields match:
|
||||||
|
return (IsECN == p.IsECN) && (IsEmergencyTECN == p.IsEmergencyTECN);
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool Equals(ECN p) {
|
||||||
|
// If parameter is null return false:
|
||||||
|
if (p == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (PropertyInfo pi in p.GetType().GetProperties()) {
|
||||||
|
foreach (PropertyInfo px in GetType().GetProperties()) {
|
||||||
|
if (pi.Name.ToLower() == px.Name.ToLower()) {
|
||||||
|
if (pi.GetValue(p).Equals(px.GetValue(this)))
|
||||||
|
break;
|
||||||
|
else
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
// Return true if the fields match:
|
||||||
|
//return (IsECN == p.IsECN) && (IsEmergencyTECN == p.IsEmergencyTECN);
|
||||||
|
|
||||||
public class ECNAffectedDeparmtent
|
|
||||||
{
|
|
||||||
//public int LotDispoDepartmentID { get; set; }
|
|
||||||
//public int IssueID { get; set; }
|
|
||||||
public int DepartmentID { get; set; }
|
|
||||||
public string DepartmentName { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public class ECNAffectedModule
|
|
||||||
{
|
|
||||||
public int ModuleID { get; set; }
|
|
||||||
public string ModuleName { get; set; }
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public class ECNCategory
|
|
||||||
{
|
|
||||||
public int CategoryID { get; set; }
|
|
||||||
public string CategoryName { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public class ECNAttachment
|
|
||||||
{
|
|
||||||
public int AttachmentID { set; get; }
|
|
||||||
public int ECNNumber { get; set; }
|
|
||||||
public string FileName { get; set; }
|
|
||||||
public int UserID { get; set; }
|
|
||||||
// extrafield
|
|
||||||
public string FullName { get; set; }
|
|
||||||
public string UploadDate { get; set; }
|
|
||||||
public string Path { get; set; }
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public class ECNArea
|
|
||||||
{
|
|
||||||
public int AreaID { set; get; }
|
|
||||||
public string Area { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public class ECNTechnology
|
|
||||||
{
|
|
||||||
public int TechnologyID { get; set; }
|
|
||||||
public string Technology { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public class ECNAcknowledgementTrainingBy
|
|
||||||
{
|
|
||||||
public int AcknowledgementTrainingByID { get; set; }
|
|
||||||
public string AcknowledgementTrainingBy { get; set; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class ECNAffectedDeparmtent {
|
||||||
|
|
||||||
|
public int DepartmentID { get; set; }
|
||||||
|
public string DepartmentName { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ECNAffectedModule {
|
||||||
|
|
||||||
|
public int ModuleID { get; set; }
|
||||||
|
public string ModuleName { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ECNCategory {
|
||||||
|
|
||||||
|
public int CategoryID { get; set; }
|
||||||
|
public string CategoryName { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ECNAttachment {
|
||||||
|
|
||||||
|
public int AttachmentID { set; get; }
|
||||||
|
public int ECNNumber { get; set; }
|
||||||
|
public string FileName { get; set; }
|
||||||
|
public int UserID { get; set; }
|
||||||
|
// extrafield
|
||||||
|
public string FullName { get; set; }
|
||||||
|
public string UploadDate { get; set; }
|
||||||
|
public string Path { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ECNArea {
|
||||||
|
|
||||||
|
public int AreaID { set; get; }
|
||||||
|
public string Area { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ECNTechnology {
|
||||||
|
|
||||||
|
public int TechnologyID { get; set; }
|
||||||
|
public string Technology { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ECNAcknowledgementTrainingBy {
|
||||||
|
|
||||||
|
public int AcknowledgementTrainingByID { get; set; }
|
||||||
|
public string AcknowledgementTrainingBy { get; set; }
|
||||||
|
|
||||||
|
}
|
@ -1,17 +1,10 @@
|
|||||||
using System;
|
namespace Fab2ApprovalSystem.Models;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Web;
|
|
||||||
|
|
||||||
namespace Fab2ApprovalSystem.Models
|
public class ECNTypeChangeLog {
|
||||||
{
|
|
||||||
public class ECNTypeChangeLog
|
|
||||||
{
|
|
||||||
public int ECNNumber;
|
|
||||||
public int UserID;
|
|
||||||
public string ECNTypeFrom;
|
|
||||||
public string ECNTypeTo;
|
|
||||||
|
|
||||||
|
public int ECNNumber;
|
||||||
|
public int UserID;
|
||||||
|
public string ECNTypeFrom;
|
||||||
|
public string ECNTypeTo;
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -1,464 +1,408 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
|
||||||
using System.Web;
|
|
||||||
|
|
||||||
namespace Fab2ApprovalSystem.Models
|
namespace Fab2ApprovalSystem.Models;
|
||||||
{
|
|
||||||
public class AuditList
|
public class AuditList {
|
||||||
{
|
|
||||||
public string AuditNo { get; set; }
|
public string AuditNo { get; set; }
|
||||||
public string AuditTitle { get; set; }
|
public string AuditTitle { get; set; }
|
||||||
public string AuditType { get; set; }
|
public string AuditType { get; set; }
|
||||||
public string Auditors { get; set; }
|
public string Auditors { get; set; }
|
||||||
public string PendingCAFindingsAIOwners { get; set; }
|
public string PendingCAFindingsAIOwners { get; set; }
|
||||||
public string PendingCAOwners { get; set; }
|
public string PendingCAOwners { get; set; }
|
||||||
public DateTime? AuditDate { get; set; }
|
public DateTime? AuditDate { get; set; }
|
||||||
public string FindingCategories { get; set; }
|
public string FindingCategories { get; set; }
|
||||||
public string AuditedAreas { get; set; }
|
public string AuditedAreas { get; set; }
|
||||||
public string CADisp { get; set; }
|
public string CADisp { get; set; }
|
||||||
public string CorrectiveActions { get; set; }
|
public string CorrectiveActions { get; set; }
|
||||||
public string AuditScore { get; set; }
|
public string AuditScore { get; set; }
|
||||||
public string AuditStatus { get; set; }
|
public string AuditStatus { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Audit {
|
||||||
|
|
||||||
|
public int AuditNo { set; get; }
|
||||||
|
public int OriginatorID { get; set; }
|
||||||
|
public string OriginatorName { get; set; }
|
||||||
|
public string AuditTitle { get; set; }
|
||||||
|
public int AuditScore { get; set; }
|
||||||
|
public DateTime? AuditDate { get; set; }
|
||||||
|
public string AuditFindingCategories { get; set; }
|
||||||
|
public int AuditStatus { get; set; }
|
||||||
|
public string NoOfMajorNonConformities { get; set; }
|
||||||
|
public string NoOfMinorNonConformities { get; set; }
|
||||||
|
public string NoOf5SFindings { get; set; }
|
||||||
|
public string NoOfOFIFindings { get; set; }
|
||||||
|
public string Auditees { get; set; }
|
||||||
|
public List<int> AuditorIDs { get; set; }
|
||||||
|
public List<int> AuditTypeIDs { get; set; }
|
||||||
|
public List<int> AuditedAreaIDs { get; set; }
|
||||||
|
public List<int> AuditedStandardIDs { get; set; }
|
||||||
|
public bool RecordLockIndicator { get; set; }
|
||||||
|
public int RecordLockedBy { get; set; }
|
||||||
|
public bool RecordLocked { get; set; }
|
||||||
|
public DateTime RecordLockedDate { get; set; }
|
||||||
|
public DateTime LastUpdateDate { get; set; }
|
||||||
|
public CAFindings CAFindings { get; set; }
|
||||||
|
public Audit() {
|
||||||
|
AuditorIDs = new List<int>();
|
||||||
|
AuditTypeIDs = new List<int>();
|
||||||
|
AuditedAreaIDs = new List<int>();
|
||||||
|
CAFindings = new CAFindings();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Auditees {
|
||||||
|
private string UserName { get; set; }
|
||||||
|
|
||||||
public class Audit
|
}
|
||||||
{
|
|
||||||
public int AuditNo { set; get; }
|
|
||||||
public int OriginatorID { get; set; }
|
|
||||||
public string OriginatorName { get; set; }
|
|
||||||
public string AuditTitle { get; set; }
|
|
||||||
//public int AuditTypeID { get; set; }
|
|
||||||
public int AuditScore { get; set; }
|
|
||||||
public DateTime? AuditDate { get; set; }
|
|
||||||
//public int Auditors { get; set; } // List of Auditors
|
|
||||||
public string AuditFindingCategories { get; set; }
|
|
||||||
public int AuditStatus { get; set; }
|
|
||||||
//public int AuditedAreaID { get; set; }
|
|
||||||
public string NoOfMajorNonConformities { get; set; }
|
|
||||||
public string NoOfMinorNonConformities { get; set; }
|
|
||||||
public string NoOf5SFindings { get; set; }
|
|
||||||
public string NoOfOFIFindings { get; set; }
|
|
||||||
public string Auditees { get; set; }
|
|
||||||
public List<int> AuditorIDs { get; set; }
|
|
||||||
public List<int> AuditTypeIDs { get; set; }
|
|
||||||
public List<int> AuditedAreaIDs { get; set; }
|
|
||||||
public List<int> AuditedStandardIDs { get; set; }
|
|
||||||
public bool RecordLockIndicator { get; set; }
|
|
||||||
public int RecordLockedBy { get; set; }
|
|
||||||
public bool RecordLocked { get; set; }
|
|
||||||
public DateTime RecordLockedDate { get; set; }
|
|
||||||
public DateTime LastUpdateDate { get; set; }
|
|
||||||
public CAFindings CAFindings { get; set; }
|
|
||||||
public Audit()
|
|
||||||
{
|
|
||||||
AuditorIDs = new List<int>();
|
|
||||||
AuditTypeIDs = new List<int>();
|
|
||||||
AuditedAreaIDs = new List<int>();
|
|
||||||
CAFindings = new CAFindings();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public class Auditees
|
|
||||||
{
|
|
||||||
string UserName { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public class AuditType
|
public class AuditType {
|
||||||
{
|
|
||||||
public int AuditTypeID { get; set; }
|
|
||||||
public string AuditTypeName { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Auditor
|
public int AuditTypeID { get; set; }
|
||||||
{
|
public string AuditTypeName { get; set; }
|
||||||
public int AuditorID { get; set; }
|
|
||||||
public string AuditorName { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
}
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
|
|
||||||
public class AuditedArea
|
public class Auditor {
|
||||||
{
|
|
||||||
public int AuditedAreaID { get; set; }
|
|
||||||
public string AuditedAreaName { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
public int AuditorID { get; set; }
|
||||||
///
|
public string AuditorName { get; set; }
|
||||||
/// </summary>
|
|
||||||
public class AuditFindings
|
|
||||||
{
|
|
||||||
public int ID { get; set; }
|
|
||||||
public int AuditNo { get; set; }
|
|
||||||
public string Findings { get; set; }
|
|
||||||
public string ViolatedClause { get; set; }
|
|
||||||
public string FindingType { get; set; }
|
|
||||||
public string AuditFindingCategoryID { get; set; }
|
|
||||||
public string FindingCategories { get; set; }
|
|
||||||
public int CANo { get; set; }
|
|
||||||
public string CANoDisp { get; set; }
|
|
||||||
public string CAStatus { get; set; }
|
|
||||||
public int CAOwnerID { get; set; }
|
|
||||||
public string CAOwner { get; set; }
|
|
||||||
public DateTime AssignedDate { get; set; }
|
|
||||||
public string Title { get; set; }
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class AuditFindingCategory
|
|
||||||
{
|
|
||||||
public int AuditFindingCategoryID { get; set; }
|
|
||||||
public string AuditFindingCategoryName { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
public class AuditedArea {
|
||||||
|
|
||||||
public class AuditReportAttachment
|
public int AuditedAreaID { get; set; }
|
||||||
{
|
public string AuditedAreaName { get; set; }
|
||||||
public int ID { get; set; }
|
|
||||||
public string FileGUID { get; set; }
|
|
||||||
public string FileName { get; set; }
|
|
||||||
public int UploadedByID { get; set; }
|
|
||||||
public int? CAFindingsID { get; set; }
|
|
||||||
public string UploadedByName { get; set; }
|
|
||||||
public DateTime? UploadDateTime { get; set; }
|
|
||||||
public string Title { get; set; }
|
|
||||||
public string RequirementsNotes { get; set; }
|
|
||||||
public string Comments { get; set; }
|
|
||||||
public int AuditNo { get; set; }
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class AuditFindings {
|
||||||
|
|
||||||
|
public int ID { get; set; }
|
||||||
|
public int AuditNo { get; set; }
|
||||||
|
public string Findings { get; set; }
|
||||||
|
public string ViolatedClause { get; set; }
|
||||||
|
public string FindingType { get; set; }
|
||||||
|
public string AuditFindingCategoryID { get; set; }
|
||||||
|
public string FindingCategories { get; set; }
|
||||||
|
public int CANo { get; set; }
|
||||||
|
public string CANoDisp { get; set; }
|
||||||
|
public string CAStatus { get; set; }
|
||||||
|
public int CAOwnerID { get; set; }
|
||||||
|
public string CAOwner { get; set; }
|
||||||
|
public DateTime AssignedDate { get; set; }
|
||||||
|
public string Title { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
}
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public class CorrectiveAction
|
|
||||||
{
|
|
||||||
public int CANo { get; set; }
|
|
||||||
public string CANoDisp { get; set; }
|
|
||||||
public int AuditNo { get; set; }
|
|
||||||
public int RequestorID { get; set; }
|
|
||||||
public string RequestorName { get; set; }
|
|
||||||
public string CATitle { get; set; }
|
|
||||||
public bool D0Completed { get; set; }
|
|
||||||
public DateTime? D0CompleteDate { get; set; }
|
|
||||||
public bool D0Approved { get; set; }
|
|
||||||
public DateTime? D0ApprovedDate { get; set; }
|
|
||||||
public bool TriggerApproval { get; set; }
|
|
||||||
public bool TriggerSectionApproval { get; set; }
|
|
||||||
public string SectionApproval { get; set; }
|
|
||||||
public DateTime? IssueDate { get; set; }
|
|
||||||
public string CAType { get; set; }
|
|
||||||
public bool IsCACompleted { get; set; }
|
|
||||||
public DateTime CACompletedDate { get; set; }
|
|
||||||
public int ApprovalStatus { get; set; }
|
|
||||||
public int WorkFlowNumber { get; set; }
|
|
||||||
public byte CurrentStep { get; set; }
|
|
||||||
public int D1AssigneeID { get; set; }
|
|
||||||
public int CurrentD1AssigneeID { get; set; }
|
|
||||||
public string D1AssigneeName { get; set; }
|
|
||||||
public int CASourceID { get; set; }
|
|
||||||
public string CASource { get; set; }
|
|
||||||
public int ModuleID { get; set; }
|
|
||||||
public int Status { get; set; }
|
|
||||||
public string StatusName { get; set; }
|
|
||||||
public string Stage { get; set; }
|
|
||||||
public int QAID { get; set; }
|
|
||||||
public string PendingApprovers { get; set; }
|
|
||||||
public string PendingAIOwners { get; set; }
|
|
||||||
public string Tools { get; set; }
|
|
||||||
public string RelatedMRB { get; set; }
|
|
||||||
public int RelatedAudit { get; set; }
|
|
||||||
public string D2ProblemDescription { get; set; }
|
|
||||||
public List<int> RiskAssessmentAreaIDs { get; set; }
|
|
||||||
public List<int> ModuleIDs { get; set; }
|
|
||||||
public string D3RiskAssessmentNotes { get; set; }
|
|
||||||
public bool D3Completed { get; set; }
|
|
||||||
public DateTime? D3CompleteDate { get; set; }
|
|
||||||
public bool D3Approved { get; set; }
|
|
||||||
public DateTime? D3ApprovedDate { get; set; }
|
|
||||||
public DateTime? D3DueDate { get; set; }
|
|
||||||
public string D4RootCause1 { get; set; }
|
|
||||||
public string D4RootCause2 { get; set; }
|
|
||||||
public string D4RootCause3 { get; set; }
|
|
||||||
public string D4RootCause4 { get; set; }
|
|
||||||
public DateTime? D4CompleteDate { get; set; }
|
|
||||||
public bool D4Completed { get; set; }
|
|
||||||
public bool D4Approved { get; set; }
|
|
||||||
public DateTime? D4ApprovedDate { get; set; }
|
|
||||||
public DateTime? D5CompleteDate { get; set; }
|
|
||||||
public bool D5Completed { get; set; }
|
|
||||||
public DateTime? D6ValidatedDate { get; set; }
|
|
||||||
public bool D6Validated { get; set; }
|
|
||||||
public DateTime? D7CompleteDate { get; set; }
|
|
||||||
public bool D7Completed { get; set; }
|
|
||||||
public bool D5Approved { get; set; }
|
|
||||||
public DateTime? D5ApprovedDate { get; set; }
|
|
||||||
public DateTime? D5D7DueDate { get; set; }
|
|
||||||
public DateTime? D8DueDate { get; set; }
|
|
||||||
public DateTime? D8CompletedDate { get; set; }
|
|
||||||
public bool D8Completed { get; set; }
|
|
||||||
public DateTime? D8ApprovedDate { get; set; }
|
|
||||||
public bool D8Approved { get; set; }
|
|
||||||
public string D8TeamRecognition { get; set; }
|
|
||||||
public string D8LessonsLearned { get; set; }
|
|
||||||
public string TeamMembers { get; set; }
|
|
||||||
public DateTime? ApprovedDate { get; set; }
|
|
||||||
public bool RecordLockIndicator { get; set; }
|
|
||||||
public int RecordLockedBy { get; set; }
|
|
||||||
public string RecordLockByName { get; set; }
|
|
||||||
public bool RecordLocked { get; set; }
|
|
||||||
public DateTime RecordLockedDate { get; set; }
|
|
||||||
public DateTime LastUpdateDate { get; set; }
|
|
||||||
public List<int> TeamMemberIDs { get; set; }
|
|
||||||
public D5D6CorrectivetAction D5D6CorrectivetAction { get; set; }
|
|
||||||
public D7PreventiveAction D7PreventiveAction { get; set; }
|
|
||||||
public string D0Comments { get; set; }
|
|
||||||
public int TeamCaptainID { get; set; }
|
|
||||||
public string TeamCaptainName { get; set; }
|
|
||||||
public int CASponsorID { get; set; }
|
|
||||||
public string CASponsorName { get; set; }
|
|
||||||
public string CustomerName { get; set; }
|
|
||||||
public string CustomerPartNo { get; set; }
|
|
||||||
public string IFXPartNo { get; set; }
|
|
||||||
public int PartQty { get; set; }
|
|
||||||
public string InvoiceNo { get; set; }
|
|
||||||
public string PurchaseOrderNo { get; set; }
|
|
||||||
public string SalesOrderNo { get; set; }
|
|
||||||
public double DollarImpact { get; set; }
|
|
||||||
public string BackgroundInfo { get; set; }
|
|
||||||
public string Analysis { get; set; }
|
|
||||||
public string VisualVerification { get; set; }
|
|
||||||
public string InterimContainmentAction { get; set; }
|
|
||||||
public string ICAVerificationResults { get; set; }
|
|
||||||
public string ICAValidationActivities { get; set; }
|
|
||||||
public string RootCauseVerification { get; set; }
|
|
||||||
public string EscapePoint { get; set; }
|
|
||||||
public DateTime? NextDueDate { get; set; }
|
|
||||||
public DateTime? FollowUpDate { get; set; }
|
|
||||||
public bool CASubmitted { get; set; }
|
|
||||||
|
|
||||||
public DateTime? ClosedDate { get; set; }
|
public class AuditFindingCategory {
|
||||||
|
|
||||||
public CorrectiveAction()
|
public int AuditFindingCategoryID { get; set; }
|
||||||
{
|
public string AuditFindingCategoryName { get; set; }
|
||||||
TeamMemberIDs = new List<int>();
|
|
||||||
ModuleIDs = new List<int>();
|
|
||||||
RiskAssessmentAreaIDs = new List<int>();
|
|
||||||
D5D6CorrectivetAction = new D5D6CorrectivetAction();
|
|
||||||
D7PreventiveAction = new D7PreventiveAction();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
public class AuditReportAttachment {
|
||||||
|
|
||||||
/// <summary>
|
public int ID { get; set; }
|
||||||
///
|
public string FileGUID { get; set; }
|
||||||
/// </summary>
|
public string FileName { get; set; }
|
||||||
public class CASource
|
public int UploadedByID { get; set; }
|
||||||
{
|
public int? CAFindingsID { get; set; }
|
||||||
public int CASourceID { get; set; }
|
public string UploadedByName { get; set; }
|
||||||
public string CASourceName { get; set; }
|
public DateTime? UploadDateTime { get; set; }
|
||||||
}
|
public string Title { get; set; }
|
||||||
|
public string RequirementsNotes { get; set; }
|
||||||
|
public string Comments { get; set; }
|
||||||
|
public int AuditNo { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
public class CorrectiveAction {
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public class CAUserList
|
|
||||||
{
|
|
||||||
public int UserID { get; set; }
|
|
||||||
public string UserName { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
public int CANo { get; set; }
|
||||||
/// <summary>
|
public string CANoDisp { get; set; }
|
||||||
///
|
public int AuditNo { get; set; }
|
||||||
/// </summary>
|
public int RequestorID { get; set; }
|
||||||
public class CAModule
|
public string RequestorName { get; set; }
|
||||||
{
|
public string CATitle { get; set; }
|
||||||
public int ModuleID { get; set; }
|
public bool D0Completed { get; set; }
|
||||||
public string ModuleName { get; set; }
|
public DateTime? D0CompleteDate { get; set; }
|
||||||
}
|
public bool D0Approved { get; set; }
|
||||||
|
public DateTime? D0ApprovedDate { get; set; }
|
||||||
|
public bool TriggerApproval { get; set; }
|
||||||
/// <summary>
|
public bool TriggerSectionApproval { get; set; }
|
||||||
///
|
public string SectionApproval { get; set; }
|
||||||
/// </summary>
|
public DateTime? IssueDate { get; set; }
|
||||||
public class CA_Attachment
|
public string CAType { get; set; }
|
||||||
{
|
public bool IsCACompleted { get; set; }
|
||||||
public int ID { get; set; }
|
public DateTime CACompletedDate { get; set; }
|
||||||
public string FileGUID { get; set; }
|
public int ApprovalStatus { get; set; }
|
||||||
public string FileName { get; set; }
|
public int WorkFlowNumber { get; set; }
|
||||||
public string FileExtension { get; set; }
|
public byte CurrentStep { get; set; }
|
||||||
public string Section { get; set; }
|
public int D1AssigneeID { get; set; }
|
||||||
public int UploadedByID { get; set; }
|
public int CurrentD1AssigneeID { get; set; }
|
||||||
public string UploadedByName { get; set; }
|
public string D1AssigneeName { get; set; }
|
||||||
public DateTime? UploadDateTime { get; set; }
|
public int CASourceID { get; set; }
|
||||||
public string Title { get; set; }
|
public string CASource { get; set; }
|
||||||
public string RequirementsNotes { get; set; }
|
public int ModuleID { get; set; }
|
||||||
public string Comments { get; set; }
|
public int Status { get; set; }
|
||||||
public int? CANo { get; set; }
|
public string StatusName { get; set; }
|
||||||
public int? D5D6CAID { get; set; }
|
public string Stage { get; set; }
|
||||||
public int? D7PAID { get; set; }
|
public int QAID { get; set; }
|
||||||
public int? CAFindingsID { get; set; }
|
public string PendingApprovers { get; set; }
|
||||||
}
|
public string PendingAIOwners { get; set; }
|
||||||
|
public string Tools { get; set; }
|
||||||
|
public string RelatedMRB { get; set; }
|
||||||
/// <summary>
|
public int RelatedAudit { get; set; }
|
||||||
///
|
public string D2ProblemDescription { get; set; }
|
||||||
/// </summary>
|
public List<int> RiskAssessmentAreaIDs { get; set; }
|
||||||
public class D3ContainmentAction
|
public List<int> ModuleIDs { get; set; }
|
||||||
{
|
public string D3RiskAssessmentNotes { get; set; }
|
||||||
public int ID { get; set; }
|
public bool D3Completed { get; set; }
|
||||||
public int CANo { get; set; }
|
public DateTime? D3CompleteDate { get; set; }
|
||||||
public string Section { get; set; }
|
public bool D3Approved { get; set; }
|
||||||
public string ContainmentAction { get; set; }
|
public DateTime? D3ApprovedDate { get; set; }
|
||||||
public string Result { get; set; }
|
public DateTime? D3DueDate { get; set; }
|
||||||
public string ECNLinks { get; set; }
|
public string D4RootCause1 { get; set; }
|
||||||
public int ResponsibilityOwnerID { get; set; }
|
public string D4RootCause2 { get; set; }
|
||||||
public int CurrentResponsibilityOwnerID { get; set; }
|
public string D4RootCause3 { get; set; }
|
||||||
public string ResponsibilityOwnerName { get; set; }
|
public string D4RootCause4 { get; set; }
|
||||||
public DateTime? ECD { get; set; }
|
public DateTime? D4CompleteDate { get; set; }
|
||||||
public DateTime? ImplementedDate { get; set; }
|
public bool D4Completed { get; set; }
|
||||||
public DateTime AssignedDate { get; set; }
|
public bool D4Approved { get; set; }
|
||||||
|
public DateTime? D4ApprovedDate { get; set; }
|
||||||
|
public DateTime? D5CompleteDate { get; set; }
|
||||||
}
|
public bool D5Completed { get; set; }
|
||||||
|
public DateTime? D6ValidatedDate { get; set; }
|
||||||
|
public bool D6Validated { get; set; }
|
||||||
/// <summary>
|
public DateTime? D7CompleteDate { get; set; }
|
||||||
///
|
public bool D7Completed { get; set; }
|
||||||
/// </summary>
|
public bool D5Approved { get; set; }
|
||||||
public class RiskAssessmentArea
|
public DateTime? D5ApprovedDate { get; set; }
|
||||||
{
|
public DateTime? D5D7DueDate { get; set; }
|
||||||
public int RiskAssessmentAreaID { get; set; }
|
public DateTime? D8DueDate { get; set; }
|
||||||
public string RiskAssessmentAreaName { get; set; }
|
public DateTime? D8CompletedDate { get; set; }
|
||||||
}
|
public bool D8Completed { get; set; }
|
||||||
|
public DateTime? D8ApprovedDate { get; set; }
|
||||||
|
public bool D8Approved { get; set; }
|
||||||
/// <summary>
|
public string D8TeamRecognition { get; set; }
|
||||||
///
|
public string D8LessonsLearned { get; set; }
|
||||||
/// </summary>
|
public string TeamMembers { get; set; }
|
||||||
public class D5D6CorrectivetAction
|
public DateTime? ApprovedDate { get; set; }
|
||||||
{
|
public bool RecordLockIndicator { get; set; }
|
||||||
public int ID { get; set; }
|
public int RecordLockedBy { get; set; }
|
||||||
public int CANo { get; set; }
|
public string RecordLockByName { get; set; }
|
||||||
public string CorrectiveAction { get; set; }
|
public bool RecordLocked { get; set; }
|
||||||
public string CARequired { get; set; }
|
public DateTime RecordLockedDate { get; set; }
|
||||||
public string Result { get; set; }
|
public DateTime LastUpdateDate { get; set; }
|
||||||
public string ECNLinks { get; set; }
|
public List<int> TeamMemberIDs { get; set; }
|
||||||
public string AttachmentLinks { get; set; }
|
public D5D6CorrectivetAction D5D6CorrectivetAction { get; set; }
|
||||||
public int ResponsibilityOwnerID { get; set; }
|
public D7PreventiveAction D7PreventiveAction { get; set; }
|
||||||
public int CurrentResponsibilityOwnerID { get; set; }
|
public string D0Comments { get; set; }
|
||||||
public string ResponsibilityOwnerName { get; set; }
|
public int TeamCaptainID { get; set; }
|
||||||
public DateTime? ECD { get; set; }
|
public string TeamCaptainName { get; set; }
|
||||||
public DateTime? ImplementedDate { get; set; }
|
public int CASponsorID { get; set; }
|
||||||
public bool IsImplemented { get; set; }
|
public string CASponsorName { get; set; }
|
||||||
public string ImprovementID { get; set; }
|
public string CustomerName { get; set; }
|
||||||
public string Improvement { get; set; }
|
public string CustomerPartNo { get; set; }
|
||||||
public CA_Attachment CA_Attachment { get; set; }
|
public string IFXPartNo { get; set; }
|
||||||
public DateTime AssignedDate { get; set; }
|
public int PartQty { get; set; }
|
||||||
public bool Approved { get; set; }
|
public string InvoiceNo { get; set; }
|
||||||
|
public string PurchaseOrderNo { get; set; }
|
||||||
public D5D6CorrectivetAction()
|
public string SalesOrderNo { get; set; }
|
||||||
{
|
public double DollarImpact { get; set; }
|
||||||
CA_Attachment = new CA_Attachment();
|
public string BackgroundInfo { get; set; }
|
||||||
}
|
public string Analysis { get; set; }
|
||||||
public string ActionType { get; set; }
|
public string VisualVerification { get; set; }
|
||||||
|
public string InterimContainmentAction { get; set; }
|
||||||
}
|
public string ICAVerificationResults { get; set; }
|
||||||
|
public string ICAValidationActivities { get; set; }
|
||||||
|
public string RootCauseVerification { get; set; }
|
||||||
/// <summary>
|
public string EscapePoint { get; set; }
|
||||||
///
|
public DateTime? NextDueDate { get; set; }
|
||||||
/// </summary>
|
public DateTime? FollowUpDate { get; set; }
|
||||||
public class D5D6Improvement
|
public bool CASubmitted { get; set; }
|
||||||
{
|
public DateTime? ClosedDate { get; set; }
|
||||||
public int D5D6ImprovementID { get; set; }
|
public CorrectiveAction() {
|
||||||
public string D5D6ImprovementName { get; set; }
|
TeamMemberIDs = new List<int>();
|
||||||
}
|
ModuleIDs = new List<int>();
|
||||||
|
RiskAssessmentAreaIDs = new List<int>();
|
||||||
/// <summary>
|
D5D6CorrectivetAction = new D5D6CorrectivetAction();
|
||||||
///
|
D7PreventiveAction = new D7PreventiveAction();
|
||||||
/// </summary>
|
|
||||||
public class D7PreventiveAction
|
|
||||||
{
|
|
||||||
public int ID { get; set; }
|
|
||||||
public int CANo { get; set; }
|
|
||||||
public string PreventiveAction { get; set; }
|
|
||||||
public string Result { get; set; }
|
|
||||||
public string ECNLinks { get; set; }
|
|
||||||
public string AttachmentLinks { get; set; }
|
|
||||||
public int ResponsibilityOwnerID { get; set; }
|
|
||||||
public int CurrentResponsibilityOwnerID { get; set; }
|
|
||||||
public string ResponsibilityOwnerName { get; set; }
|
|
||||||
public DateTime? ECD { get; set; }
|
|
||||||
public DateTime? ImplementedDate { get; set; }
|
|
||||||
public CA_Attachment CA_Attachment { get; set; }
|
|
||||||
public DateTime AssignedDate { get; set; }
|
|
||||||
|
|
||||||
public D7PreventiveAction()
|
|
||||||
{
|
|
||||||
CA_Attachment = new CA_Attachment();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public class CAFindings
|
|
||||||
{
|
|
||||||
public int ID { get; set; }
|
|
||||||
public int AuditNo { get; set; }
|
|
||||||
public string CAFinding { get; set; }
|
|
||||||
public string CorrectiveAction { get; set; }
|
|
||||||
public string Result { get; set; }
|
|
||||||
public string AttachmentLinks { get; set; }
|
|
||||||
public int? CurrentResponsibilityOwnerID { get; set; }
|
|
||||||
public int? ResponsibilityOwnerID { get; set; }
|
|
||||||
public string ResponsibilityOwnerName { get; set; }
|
|
||||||
public DateTime? ECD { get; set; }
|
|
||||||
public DateTime? ImplementedDate { get; set; }
|
|
||||||
public AuditReportAttachment Audit_Attachment { get; set; }
|
|
||||||
public DateTime AssignedDate { get; set; }
|
|
||||||
|
|
||||||
public CAFindings()
|
|
||||||
{
|
|
||||||
Audit_Attachment = new AuditReportAttachment();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
public class CASectionApproval
|
|
||||||
{
|
|
||||||
public string DSection { get; set; }
|
|
||||||
public string Fullname { get; set; }
|
|
||||||
public string ApprovalStatus { get; set; }
|
|
||||||
public DateTime? DateAssigned { get; set; }
|
|
||||||
public DateTime? DateCompleted { get; set; }
|
|
||||||
public string Comments { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public class CANoList
|
|
||||||
{
|
|
||||||
public int CANo { get; set; }
|
|
||||||
public string CANoDisp { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public class CAD3D5D7Due
|
|
||||||
{
|
|
||||||
public int CANo { get; set; }
|
|
||||||
public DateTime DueDate { get; set; }
|
|
||||||
public string ItemDue { get; set; }
|
|
||||||
public string ExpiryType { get; set; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class CASource {
|
||||||
|
|
||||||
|
public int CASourceID { get; set; }
|
||||||
|
public string CASourceName { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class CAUserList {
|
||||||
|
|
||||||
|
public int UserID { get; set; }
|
||||||
|
public string UserName { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class CAModule {
|
||||||
|
|
||||||
|
public int ModuleID { get; set; }
|
||||||
|
public string ModuleName { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class CA_Attachment {
|
||||||
|
|
||||||
|
public int ID { get; set; }
|
||||||
|
public string FileGUID { get; set; }
|
||||||
|
public string FileName { get; set; }
|
||||||
|
public string FileExtension { get; set; }
|
||||||
|
public string Section { get; set; }
|
||||||
|
public int UploadedByID { get; set; }
|
||||||
|
public string UploadedByName { get; set; }
|
||||||
|
public DateTime? UploadDateTime { get; set; }
|
||||||
|
public string Title { get; set; }
|
||||||
|
public string RequirementsNotes { get; set; }
|
||||||
|
public string Comments { get; set; }
|
||||||
|
public int? CANo { get; set; }
|
||||||
|
public int? D5D6CAID { get; set; }
|
||||||
|
public int? D7PAID { get; set; }
|
||||||
|
public int? CAFindingsID { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class D3ContainmentAction {
|
||||||
|
|
||||||
|
public int ID { get; set; }
|
||||||
|
public int CANo { get; set; }
|
||||||
|
public string Section { get; set; }
|
||||||
|
public string ContainmentAction { get; set; }
|
||||||
|
public string Result { get; set; }
|
||||||
|
public string ECNLinks { get; set; }
|
||||||
|
public int ResponsibilityOwnerID { get; set; }
|
||||||
|
public int CurrentResponsibilityOwnerID { get; set; }
|
||||||
|
public string ResponsibilityOwnerName { get; set; }
|
||||||
|
public DateTime? ECD { get; set; }
|
||||||
|
public DateTime? ImplementedDate { get; set; }
|
||||||
|
public DateTime AssignedDate { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class RiskAssessmentArea {
|
||||||
|
|
||||||
|
public int RiskAssessmentAreaID { get; set; }
|
||||||
|
public string RiskAssessmentAreaName { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class D5D6CorrectivetAction {
|
||||||
|
|
||||||
|
public int ID { get; set; }
|
||||||
|
public int CANo { get; set; }
|
||||||
|
public string CorrectiveAction { get; set; }
|
||||||
|
public string CARequired { get; set; }
|
||||||
|
public string Result { get; set; }
|
||||||
|
public string ECNLinks { get; set; }
|
||||||
|
public string AttachmentLinks { get; set; }
|
||||||
|
public int ResponsibilityOwnerID { get; set; }
|
||||||
|
public int CurrentResponsibilityOwnerID { get; set; }
|
||||||
|
public string ResponsibilityOwnerName { get; set; }
|
||||||
|
public DateTime? ECD { get; set; }
|
||||||
|
public DateTime? ImplementedDate { get; set; }
|
||||||
|
public bool IsImplemented { get; set; }
|
||||||
|
public string ImprovementID { get; set; }
|
||||||
|
public string Improvement { get; set; }
|
||||||
|
public CA_Attachment CA_Attachment { get; set; }
|
||||||
|
public DateTime AssignedDate { get; set; }
|
||||||
|
public bool Approved { get; set; }
|
||||||
|
public D5D6CorrectivetAction() =>
|
||||||
|
CA_Attachment = new CA_Attachment();
|
||||||
|
public string ActionType { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class D5D6Improvement {
|
||||||
|
|
||||||
|
public int D5D6ImprovementID { get; set; }
|
||||||
|
public string D5D6ImprovementName { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class D7PreventiveAction {
|
||||||
|
|
||||||
|
public int ID { get; set; }
|
||||||
|
public int CANo { get; set; }
|
||||||
|
public string PreventiveAction { get; set; }
|
||||||
|
public string Result { get; set; }
|
||||||
|
public string ECNLinks { get; set; }
|
||||||
|
public string AttachmentLinks { get; set; }
|
||||||
|
public int ResponsibilityOwnerID { get; set; }
|
||||||
|
public int CurrentResponsibilityOwnerID { get; set; }
|
||||||
|
public string ResponsibilityOwnerName { get; set; }
|
||||||
|
public DateTime? ECD { get; set; }
|
||||||
|
public DateTime? ImplementedDate { get; set; }
|
||||||
|
public CA_Attachment CA_Attachment { get; set; }
|
||||||
|
public DateTime AssignedDate { get; set; }
|
||||||
|
public D7PreventiveAction() =>
|
||||||
|
CA_Attachment = new CA_Attachment();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class CAFindings {
|
||||||
|
|
||||||
|
public int ID { get; set; }
|
||||||
|
public int AuditNo { get; set; }
|
||||||
|
public string CAFinding { get; set; }
|
||||||
|
public string CorrectiveAction { get; set; }
|
||||||
|
public string Result { get; set; }
|
||||||
|
public string AttachmentLinks { get; set; }
|
||||||
|
public int? CurrentResponsibilityOwnerID { get; set; }
|
||||||
|
public int? ResponsibilityOwnerID { get; set; }
|
||||||
|
public string ResponsibilityOwnerName { get; set; }
|
||||||
|
public DateTime? ECD { get; set; }
|
||||||
|
public DateTime? ImplementedDate { get; set; }
|
||||||
|
public AuditReportAttachment Audit_Attachment { get; set; }
|
||||||
|
public DateTime AssignedDate { get; set; }
|
||||||
|
public CAFindings() =>
|
||||||
|
Audit_Attachment = new AuditReportAttachment();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class CASectionApproval {
|
||||||
|
|
||||||
|
public string DSection { get; set; }
|
||||||
|
public string Fullname { get; set; }
|
||||||
|
public string ApprovalStatus { get; set; }
|
||||||
|
public DateTime? DateAssigned { get; set; }
|
||||||
|
public DateTime? DateCompleted { get; set; }
|
||||||
|
public string Comments { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class CANoList {
|
||||||
|
|
||||||
|
public int CANo { get; set; }
|
||||||
|
public string CANoDisp { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class CAD3D5D7Due {
|
||||||
|
|
||||||
|
public int CANo { get; set; }
|
||||||
|
public DateTime DueDate { get; set; }
|
||||||
|
public string ItemDue { get; set; }
|
||||||
|
public string ExpiryType { get; set; }
|
||||||
|
|
||||||
|
}
|
@ -1,3 +1,5 @@
|
|||||||
|
#if !NET8
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// This code was generated from a template.
|
// This code was generated from a template.
|
||||||
@ -36,3 +38,5 @@ namespace Fab2ApprovalSystem.Models
|
|||||||
public virtual DbSet<C_8DAuditedStandardByAudit> C_8DAuditedStandardByAudit { get; set; }
|
public virtual DbSet<C_8DAuditedStandardByAudit> C_8DAuditedStandardByAudit { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
@ -1,17 +1,17 @@
|
|||||||
using Microsoft.AspNet.Identity.EntityFramework;
|
#if !NET8
|
||||||
|
|
||||||
namespace Fab2ApprovalSystem.Models
|
using Microsoft.AspNet.Identity.EntityFramework;
|
||||||
{
|
|
||||||
|
namespace Fab2ApprovalSystem.Models {
|
||||||
// You can add profile data for the user by adding more properties to your ApplicationUser class, please visit http://go.microsoft.com/fwlink/?LinkID=317594 to learn more.
|
// You can add profile data for the user by adding more properties to your ApplicationUser class, please visit http://go.microsoft.com/fwlink/?LinkID=317594 to learn more.
|
||||||
public class ApplicationUser : IdentityUser
|
public class ApplicationUser : IdentityUser {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class ApplicationDbContext : IdentityDbContext<ApplicationUser>
|
public class ApplicationDbContext : IdentityDbContext<ApplicationUser> {
|
||||||
{
|
|
||||||
public ApplicationDbContext()
|
public ApplicationDbContext()
|
||||||
: base("DefaultConnection")
|
: base("DefaultConnection") {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
@ -1,6 +1,8 @@
|
|||||||
namespace Fab2ApprovalSystem.Models {
|
namespace Fab2ApprovalSystem.Models;
|
||||||
public class LoginResult {
|
|
||||||
public bool IsAuthenticated { get; set; }
|
public class LoginResult {
|
||||||
public AuthTokens AuthTokens { get; set; }
|
|
||||||
}
|
public bool IsAuthenticated { get; set; }
|
||||||
|
public AuthTokens AuthTokens { get; set; }
|
||||||
|
|
||||||
}
|
}
|
@ -1,281 +1,202 @@
|
|||||||
using Fab2ApprovalSystem.ViewModels;
|
using System;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.Linq;
|
|
||||||
using System.Web;
|
#if !NET8
|
||||||
using System.Web.Mvc;
|
using System.Web.Mvc;
|
||||||
using System.Web.Script.Serialization;
|
using System.Web.Script.Serialization;
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace Fab2ApprovalSystem.Models
|
namespace Fab2ApprovalSystem.Models;
|
||||||
{
|
|
||||||
|
|
||||||
|
[Serializable]
|
||||||
|
public class LotDisposition {
|
||||||
|
//[Editable(false)]
|
||||||
|
[Display(Name = "Issue Number")]
|
||||||
|
public int IssueID { get; set; }
|
||||||
|
//[Editable(false)]
|
||||||
|
public string Title { get; set; }
|
||||||
|
public bool PERequired { get; set; }
|
||||||
|
public string IssueDescription { get; set; }
|
||||||
|
[ReadOnly(true)]
|
||||||
|
public DateTime? IssueDate { get; set; }
|
||||||
|
public DateTime? SubmitedDate { get; set; }
|
||||||
|
public DateTime? CloseDate { get; set; }
|
||||||
|
public int OriginatorID { get; set; }
|
||||||
|
public string OriginatorName { get; set; }
|
||||||
|
public string ReasonForDisposition { get; set; }
|
||||||
|
public int ResponsibilityID { get; set; }
|
||||||
|
public int ResponsibilityIssueID { get; set; }
|
||||||
|
public string SPNScrapCode { get; set; }
|
||||||
|
public byte CurrentStep { get; set; }
|
||||||
|
// Extra field Defined for Scraping wafer for a given lot
|
||||||
|
public Lot Lot { get; set; }
|
||||||
|
//Extra field defined for Attachments
|
||||||
|
public Attachment DocumentAttachment { get; set; }
|
||||||
|
|
||||||
[Serializable]
|
// important!!make sure the id of the control matches the name of the field in the model it is being binded to,
|
||||||
public class LotDisposition
|
// in order to get the selected items from the control
|
||||||
{
|
public List<int> DepartmentIDs { get; set; }
|
||||||
//[Editable(false)]
|
public List<Attachment> Attachments { get; set; }
|
||||||
[Display(Name = "Issue Number")]
|
public List<Approval> Approvals { get; set; }
|
||||||
public int IssueID { get; set; }
|
public List<ScrapLot> ScrapLots { get; set; }
|
||||||
//[Editable(false)]
|
public int CANo { get; set; }
|
||||||
public string Title { get; set; }
|
[Display(Name = "MRB Required")]
|
||||||
public bool PERequired { get; set; }
|
public bool MRBRequired { get; set; }
|
||||||
public string IssueDescription { get; set; }
|
public int WorkFlowNumber { get; set; }
|
||||||
[ReadOnly(true)]
|
|
||||||
public DateTime? IssueDate { get; set; }
|
|
||||||
public DateTime? SubmitedDate { get; set; }
|
|
||||||
public DateTime? CloseDate { get; set; }
|
|
||||||
public int OriginatorID { get; set; }
|
|
||||||
public string OriginatorName { get; set; }
|
|
||||||
public string ReasonForDisposition { get; set; }
|
|
||||||
public int ResponsibilityID { get; set; }
|
|
||||||
public int ResponsibilityIssueID { get; set; }
|
|
||||||
public string SPNScrapCode { get; set; }
|
|
||||||
public byte CurrentStep { get; set; }
|
|
||||||
// Extra field Defined for Scraping wafer for a given lot
|
|
||||||
public Lot Lot { get; set; }
|
|
||||||
//Extra field defined for Attachments
|
|
||||||
public Attachment DocumentAttachment { get; set; }
|
|
||||||
|
|
||||||
// important!!make sure the id of the control matches the name of the field in the model it is being binded to,
|
|
||||||
// in order to get the selected items from the control
|
|
||||||
public List<int> DepartmentIDs { get; set; }
|
|
||||||
|
|
||||||
public List<Attachment> Attachments { get; set; }
|
|
||||||
public List<Approval> Approvals { get; set; }
|
|
||||||
public List<ScrapLot> ScrapLots { get; set; }
|
|
||||||
|
|
||||||
public int CANo { get; set; }
|
|
||||||
[Display(Name = "MRB Required")]
|
|
||||||
public bool MRBRequired { get; set; }
|
|
||||||
public int WorkFlowNumber { get; set; }
|
|
||||||
|
|
||||||
[Display(Name = "Dispositon By OCAP")]
|
|
||||||
public bool DispositionByOCAP { get; set; }
|
|
||||||
|
|
||||||
public bool RecordLockIndicator { get; set; }
|
|
||||||
public int RecordLockedBy { get; set; }
|
|
||||||
public string RecordLockByName { get; set; }
|
|
||||||
public DateTime? RecordLockedDate { get; set; }
|
|
||||||
public int LastUpdatedBy { get; set; }
|
|
||||||
public DateTime? LastUpdateDate { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public LotDisposition()
|
|
||||||
{
|
|
||||||
DepartmentIDs = new List<int>();
|
|
||||||
Lot = new Lot();
|
|
||||||
DocumentAttachment = new Attachment();
|
|
||||||
//Lots = new List<Lot>();
|
|
||||||
Attachments = new List<Attachment>();
|
|
||||||
Approvals = new List<Approval>();
|
|
||||||
ScrapLots = new List<ScrapLot>();
|
|
||||||
IssueDate = DateTime.Now;
|
|
||||||
CurrentStep = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//public class Lot
|
|
||||||
//{
|
|
||||||
// public int LotID { get; set; }
|
|
||||||
// [Display(Name = "Wafer Lot#")]
|
|
||||||
// public string LotNumber { get; set; }
|
|
||||||
// public string ParentLotNumber { get { return LotNumber.Length >= 7 ? LotNumber.Substring(0, 7) : LotNumber; } }
|
|
||||||
|
|
||||||
// public int MRBNumber { get; set; }
|
|
||||||
// public int IssueID { get; set; }
|
|
||||||
// public string DieLotNumber { get; set; }
|
|
||||||
// public string Description { get; set; }
|
|
||||||
// [Display(Name="New PN#")]
|
|
||||||
// public string NewPartNo { get; set; }
|
|
||||||
// [Display(Name = "WIP PN#")]
|
|
||||||
// public string WipPartNo { get; set; }
|
|
||||||
// [Display(Name = "Die PN#")]
|
|
||||||
// public string DiePartNo { get; set; }
|
|
||||||
// [Display(Name="Family")]
|
|
||||||
// public string ProductFamily { get; set; }
|
|
||||||
// public double Gen { get; set; }
|
|
||||||
// public string Channel { get; set; }
|
|
||||||
// public double Hexsize { get; set; }
|
|
||||||
// public double Voltage { get; set; }
|
|
||||||
// public int WaferCount { get; set; }
|
|
||||||
// public int ReleaseCount { get; set; }
|
|
||||||
// public int ScrapCount { get; set; }
|
|
||||||
// public int DieCount { get; set; }
|
|
||||||
// public string Location { get; set; }
|
|
||||||
// public double TotalCost { get; set; }
|
|
||||||
// public int LotStatusOptionID { get; set; }
|
|
||||||
// public string LotStatusOptionName { get; set; }
|
|
||||||
// public double WaferCost { get; set; }
|
|
||||||
// public double DieCost { get; set; }
|
|
||||||
|
|
||||||
// [UIHint("LotStatusOptionTemplate")]
|
|
||||||
// [Display(Name="Lot Status")]
|
|
||||||
// public LotStatusOptionViewModel LotStatusOption { get; set; }
|
|
||||||
|
|
||||||
// public ScrapLot ScrapLotWafer { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
// public Lot()
|
|
||||||
// {
|
|
||||||
// LotStatusOption = new LotStatusOptionViewModel();
|
|
||||||
// ScrapLotWafer = new ScrapLot();
|
|
||||||
// }
|
|
||||||
|
|
||||||
//}
|
|
||||||
|
|
||||||
public class LotDispoDepartment
|
|
||||||
{
|
|
||||||
//public int LotDispoDepartmentID { get; set; }
|
|
||||||
//public int IssueID { get; set; }
|
|
||||||
public int DepartmentID { get; set; }
|
|
||||||
public string DepartmentName { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Attachment
|
|
||||||
{
|
|
||||||
public int AttachmentID { set; get; }
|
|
||||||
public int IssueID { get; set; }
|
|
||||||
public string FileName { get; set; }
|
|
||||||
public int UserID { get; set; }
|
|
||||||
// extrafield
|
|
||||||
public string FullName { get; set; }
|
|
||||||
public string UploadDate { get; set; }
|
|
||||||
public string Path { get; set; }
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public class Approval
|
|
||||||
{
|
|
||||||
public int ApprovalID { get; set; }
|
|
||||||
public int IssueID { get; set; }
|
|
||||||
string StateName { get; set; }
|
|
||||||
public int UserID { get; set; }
|
|
||||||
public int SubRoleID { get; set; }
|
|
||||||
public int ItemStatus { get; set; }
|
|
||||||
public int Step { get; set; }
|
|
||||||
public DateTime? NotifyDate { get; set; }
|
|
||||||
public DateTime? AssignedDate { get; set; }
|
|
||||||
public DateTime? RoleAssignedDate { get; set; }
|
|
||||||
public DateTime? CompleteDateTime { get; set; }
|
|
||||||
public string UserComments { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public class ScrapLot
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
public string LotNo { get; set; }
|
|
||||||
public int IssueID { get; set; }
|
|
||||||
public int ScrapCount { get; set; }
|
|
||||||
public int ReleaseCount { get; set; }
|
|
||||||
public int SplitOfHoldCount { get; set; }
|
|
||||||
public int CloseToQDBCount { get; set; }
|
|
||||||
|
|
||||||
// extra field ( a viewmodel can be created)
|
|
||||||
public int WaferCount { get; set; }
|
|
||||||
|
|
||||||
public byte Lot1State { get; set; }
|
|
||||||
public byte Lot2State { get; set; }
|
|
||||||
public byte Lot3State { get; set; }
|
|
||||||
public byte Lot4State { get; set; }
|
|
||||||
public byte Lot5State { get; set; }
|
|
||||||
public byte Lot6State { get; set; }
|
|
||||||
public byte Lot7State { get; set; }
|
|
||||||
public byte Lot8State { get; set; }
|
|
||||||
public byte Lot9State { get; set; }
|
|
||||||
public byte Lot10State { get; set; }
|
|
||||||
public byte Lot11State { get; set; }
|
|
||||||
public byte Lot12State { get; set; }
|
|
||||||
public byte Lot13State { get; set; }
|
|
||||||
public byte Lot14State { get; set; }
|
|
||||||
public byte Lot15State { get; set; }
|
|
||||||
public byte Lot16State { get; set; }
|
|
||||||
public byte Lot17State { get; set; }
|
|
||||||
public byte Lot18State { get; set; }
|
|
||||||
public byte Lot19State { get; set; }
|
|
||||||
public byte Lot20State { get; set; }
|
|
||||||
public byte Lot21State { get; set; }
|
|
||||||
public byte Lot22State { get; set; }
|
|
||||||
public byte Lot23State { get; set; }
|
|
||||||
public byte Lot24State { get; set; }
|
|
||||||
public byte Lot25State { get; set; }
|
|
||||||
public byte Lot26State { get; set; }
|
|
||||||
public byte Lot27State { get; set; }
|
|
||||||
public byte Lot28State { get; set; }
|
|
||||||
public byte Lot29State { get; set; }
|
|
||||||
public byte Lot30State { get; set; }
|
|
||||||
public byte Lot31State { get; set; }
|
|
||||||
public byte Lot32State { get; set; }
|
|
||||||
public byte Lot33State { get; set; }
|
|
||||||
public byte Lot34State { get; set; }
|
|
||||||
public byte Lot35State { get; set; }
|
|
||||||
public byte Lot36State { get; set; }
|
|
||||||
public byte Lot37State { get; set; }
|
|
||||||
public byte Lot38State { get; set; }
|
|
||||||
public byte Lot39State { get; set; }
|
|
||||||
public byte Lot40State { get; set; }
|
|
||||||
public byte Lot41State { get; set; }
|
|
||||||
public byte Lot42State { get; set; }
|
|
||||||
public byte Lot43State { get; set; }
|
|
||||||
public byte Lot44State { get; set; }
|
|
||||||
public byte Lot45State { get; set; }
|
|
||||||
public byte Lot46State { get; set; }
|
|
||||||
public byte Lot47State { get; set; }
|
|
||||||
public byte Lot48State { get; set; }
|
|
||||||
public byte Lot49State { get; set; }
|
|
||||||
public byte Lot50State { get; set; }
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public class Users
|
|
||||||
{
|
|
||||||
public int OriginatorID { get; set; }
|
|
||||||
public string Originatorname { get;set;}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public class Responsibility
|
|
||||||
{
|
|
||||||
public int ResponsibilityID { get; set; }
|
|
||||||
public string ResponsibilityName { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public class ResponsibilityIssue
|
|
||||||
{
|
|
||||||
public int ResponsibilityIssueID { get; set; }
|
|
||||||
public string Issue { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public class Comments
|
|
||||||
{
|
|
||||||
public int ID { get; set; }
|
|
||||||
public int IssueID {get; set;}
|
|
||||||
public string CommentedBy { get; set; }
|
|
||||||
public string UserName{ get; set; }
|
|
||||||
public string UserComments { get; set; }
|
|
||||||
public DateTime TimeStamp { get; set; }
|
|
||||||
|
|
||||||
|
[Display(Name = "Dispositon By OCAP")]
|
||||||
|
public bool DispositionByOCAP { get; set; }
|
||||||
|
public bool RecordLockIndicator { get; set; }
|
||||||
|
public int RecordLockedBy { get; set; }
|
||||||
|
public string RecordLockByName { get; set; }
|
||||||
|
public DateTime? RecordLockedDate { get; set; }
|
||||||
|
public int LastUpdatedBy { get; set; }
|
||||||
|
public DateTime? LastUpdateDate { get; set; }
|
||||||
|
public LotDisposition() {
|
||||||
|
DepartmentIDs = new List<int>();
|
||||||
|
Lot = new Lot();
|
||||||
|
DocumentAttachment = new Attachment();
|
||||||
|
//Lots = new List<Lot>();
|
||||||
|
Attachments = new List<Attachment>();
|
||||||
|
Approvals = new List<Approval>();
|
||||||
|
ScrapLots = new List<ScrapLot>();
|
||||||
|
IssueDate = DateTime.Now;
|
||||||
|
CurrentStep = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class LotDispoDepartment {
|
||||||
|
|
||||||
|
public int DepartmentID { get; set; }
|
||||||
|
public string DepartmentName { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Attachment {
|
||||||
|
|
||||||
|
public int AttachmentID { set; get; }
|
||||||
|
public int IssueID { get; set; }
|
||||||
|
public string FileName { get; set; }
|
||||||
|
public int UserID { get; set; }
|
||||||
|
// extrafield
|
||||||
|
public string FullName { get; set; }
|
||||||
|
public string UploadDate { get; set; }
|
||||||
|
public string Path { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Approval {
|
||||||
|
|
||||||
|
public int ApprovalID { get; set; }
|
||||||
|
public int IssueID { get; set; }
|
||||||
|
private string StateName { get; set; }
|
||||||
|
public int UserID { get; set; }
|
||||||
|
public int SubRoleID { get; set; }
|
||||||
|
public int ItemStatus { get; set; }
|
||||||
|
public int Step { get; set; }
|
||||||
|
public DateTime? NotifyDate { get; set; }
|
||||||
|
public DateTime? AssignedDate { get; set; }
|
||||||
|
public DateTime? RoleAssignedDate { get; set; }
|
||||||
|
public DateTime? CompleteDateTime { get; set; }
|
||||||
|
public string UserComments { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ScrapLot {
|
||||||
|
|
||||||
|
public string LotNo { get; set; }
|
||||||
|
public int IssueID { get; set; }
|
||||||
|
public int ScrapCount { get; set; }
|
||||||
|
public int ReleaseCount { get; set; }
|
||||||
|
public int SplitOfHoldCount { get; set; }
|
||||||
|
public int CloseToQDBCount { get; set; }
|
||||||
|
|
||||||
|
// extra field ( a viewmodel can be created)
|
||||||
|
public int WaferCount { get; set; }
|
||||||
|
public byte Lot1State { get; set; }
|
||||||
|
public byte Lot2State { get; set; }
|
||||||
|
public byte Lot3State { get; set; }
|
||||||
|
public byte Lot4State { get; set; }
|
||||||
|
public byte Lot5State { get; set; }
|
||||||
|
public byte Lot6State { get; set; }
|
||||||
|
public byte Lot7State { get; set; }
|
||||||
|
public byte Lot8State { get; set; }
|
||||||
|
public byte Lot9State { get; set; }
|
||||||
|
public byte Lot10State { get; set; }
|
||||||
|
public byte Lot11State { get; set; }
|
||||||
|
public byte Lot12State { get; set; }
|
||||||
|
public byte Lot13State { get; set; }
|
||||||
|
public byte Lot14State { get; set; }
|
||||||
|
public byte Lot15State { get; set; }
|
||||||
|
public byte Lot16State { get; set; }
|
||||||
|
public byte Lot17State { get; set; }
|
||||||
|
public byte Lot18State { get; set; }
|
||||||
|
public byte Lot19State { get; set; }
|
||||||
|
public byte Lot20State { get; set; }
|
||||||
|
public byte Lot21State { get; set; }
|
||||||
|
public byte Lot22State { get; set; }
|
||||||
|
public byte Lot23State { get; set; }
|
||||||
|
public byte Lot24State { get; set; }
|
||||||
|
public byte Lot25State { get; set; }
|
||||||
|
public byte Lot26State { get; set; }
|
||||||
|
public byte Lot27State { get; set; }
|
||||||
|
public byte Lot28State { get; set; }
|
||||||
|
public byte Lot29State { get; set; }
|
||||||
|
public byte Lot30State { get; set; }
|
||||||
|
public byte Lot31State { get; set; }
|
||||||
|
public byte Lot32State { get; set; }
|
||||||
|
public byte Lot33State { get; set; }
|
||||||
|
public byte Lot34State { get; set; }
|
||||||
|
public byte Lot35State { get; set; }
|
||||||
|
public byte Lot36State { get; set; }
|
||||||
|
public byte Lot37State { get; set; }
|
||||||
|
public byte Lot38State { get; set; }
|
||||||
|
public byte Lot39State { get; set; }
|
||||||
|
public byte Lot40State { get; set; }
|
||||||
|
public byte Lot41State { get; set; }
|
||||||
|
public byte Lot42State { get; set; }
|
||||||
|
public byte Lot43State { get; set; }
|
||||||
|
public byte Lot44State { get; set; }
|
||||||
|
public byte Lot45State { get; set; }
|
||||||
|
public byte Lot46State { get; set; }
|
||||||
|
public byte Lot47State { get; set; }
|
||||||
|
public byte Lot48State { get; set; }
|
||||||
|
public byte Lot49State { get; set; }
|
||||||
|
public byte Lot50State { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Users {
|
||||||
|
|
||||||
|
public int OriginatorID { get; set; }
|
||||||
|
public string Originatorname { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Responsibility {
|
||||||
|
|
||||||
|
public int ResponsibilityID { get; set; }
|
||||||
|
public string ResponsibilityName { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ResponsibilityIssue {
|
||||||
|
|
||||||
|
public int ResponsibilityIssueID { get; set; }
|
||||||
|
public string Issue { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Comments {
|
||||||
|
|
||||||
|
public int ID { get; set; }
|
||||||
|
public int IssueID { get; set; }
|
||||||
|
public string CommentedBy { get; set; }
|
||||||
|
public string UserName { get; set; }
|
||||||
|
public string UserComments { get; set; }
|
||||||
|
public DateTime TimeStamp { get; set; }
|
||||||
|
|
||||||
|
}
|
@ -1,463 +1,381 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.Linq;
|
|
||||||
using System.Web;
|
|
||||||
|
|
||||||
namespace Fab2ApprovalSystem.Models
|
namespace Fab2ApprovalSystem.Models;
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
[Serializable]
|
|
||||||
public class LTWorkRequest
|
|
||||||
{
|
|
||||||
|
|
||||||
public int ID{ get; set; }
|
/// <summary>
|
||||||
public int SWRNumber{ get; set; }
|
///
|
||||||
public bool RecordLockIndicator{ get; set; }
|
/// </summary>
|
||||||
public int RecordLockedBy { get; set; }
|
[Serializable]
|
||||||
public string RecordLockByName { get; set; }
|
public class LTWorkRequest {
|
||||||
public byte CurrentStep { get; set; }
|
|
||||||
public int Revision{ get; set; }
|
|
||||||
public bool IsCurrentRevision { get; set; }
|
|
||||||
public int OriginatorID{ get; set; }
|
|
||||||
public DateTime? OriginatedDate { get; set; }
|
|
||||||
public DateTime? SubmitedDate { get; set; }
|
|
||||||
public DateTime? CloseDate { get; set; }
|
|
||||||
public int Status{ get; set; }
|
|
||||||
public bool IsITAR{ get; set; }
|
|
||||||
public string Title{ get; set; }
|
|
||||||
public char? LotType{ get; set; }
|
|
||||||
public string PCRBNumber{ get; set; }
|
|
||||||
public int? EngLotStartRequired{ get; set; }
|
|
||||||
public int? LotTypeConversion{ get; set; }
|
|
||||||
public int? QualLot{ get; set; }
|
|
||||||
public string PurposeOfRequest{ get; set; }
|
|
||||||
public DateTime? PlannedLotStartDate{ get; set; }
|
|
||||||
public DateTime? PlannedScheduledCloseDate{ get; set; }
|
|
||||||
public string ChargeDepartment{ get; set; }
|
|
||||||
public string AllocationToUse{ get; set; }
|
|
||||||
public int? PredictedCyleTime{ get; set; }
|
|
||||||
public string ChargesForRawWafers{ get; set; }
|
|
||||||
public string DeptChargedForRawWafers{ get; set; }
|
|
||||||
public string DeptOwnerForRawWafers{ get; set; }
|
|
||||||
public string FabCost{ get; set; }
|
|
||||||
public string DeptChargedForFabCost{ get; set; }
|
|
||||||
public string SignOn{ get; set; }
|
|
||||||
public string Verb1{ get; set; }
|
|
||||||
public DateTime? EstimatedBinCLoseDate { get; set; }
|
|
||||||
public int? TotalQty { get; set; }
|
|
||||||
public int? StartQty{ get; set; }
|
|
||||||
public string Verb2{ get; set; }
|
|
||||||
public string WIPArea{ get; set; }
|
|
||||||
public DateTime? LotStartDate{ get; set; }
|
|
||||||
public string LotNumber { get; set; }
|
|
||||||
public string WIPPartNumber{ get; set; }
|
|
||||||
public string PartDescription { get; set; }
|
|
||||||
public string DefaultEPISiliconPartNumber { get; set; }
|
|
||||||
public string ProcessFlow{ get; set; }
|
|
||||||
public string EmployeeID{ get; set; }
|
|
||||||
public string VerbComment{ get; set; }
|
|
||||||
public int? RecordSiliconLotInSPNTapeTagTotrav { get;set;}
|
|
||||||
public string SiliconLotNoCassette1 { get; set; }
|
|
||||||
|
|
||||||
public bool SiliconOnHand { get; set; }
|
public int ID { get; set; }
|
||||||
public DateTime? SiliconExpectedDueDate { get; set; }
|
public int SWRNumber { get; set; }
|
||||||
public string SiliconComments { get; set; }
|
public bool RecordLockIndicator { get; set; }
|
||||||
|
public int RecordLockedBy { get; set; }
|
||||||
|
public string RecordLockByName { get; set; }
|
||||||
|
public byte CurrentStep { get; set; }
|
||||||
|
public int Revision { get; set; }
|
||||||
|
public bool IsCurrentRevision { get; set; }
|
||||||
|
public int OriginatorID { get; set; }
|
||||||
|
public DateTime? OriginatedDate { get; set; }
|
||||||
|
public DateTime? SubmitedDate { get; set; }
|
||||||
|
public DateTime? CloseDate { get; set; }
|
||||||
|
public int Status { get; set; }
|
||||||
|
public bool IsITAR { get; set; }
|
||||||
|
public string Title { get; set; }
|
||||||
|
public char? LotType { get; set; }
|
||||||
|
public string PCRBNumber { get; set; }
|
||||||
|
public int? EngLotStartRequired { get; set; }
|
||||||
|
public int? LotTypeConversion { get; set; }
|
||||||
|
public int? QualLot { get; set; }
|
||||||
|
public string PurposeOfRequest { get; set; }
|
||||||
|
public DateTime? PlannedLotStartDate { get; set; }
|
||||||
|
public DateTime? PlannedScheduledCloseDate { get; set; }
|
||||||
|
public string ChargeDepartment { get; set; }
|
||||||
|
public string AllocationToUse { get; set; }
|
||||||
|
public int? PredictedCyleTime { get; set; }
|
||||||
|
public string ChargesForRawWafers { get; set; }
|
||||||
|
public string DeptChargedForRawWafers { get; set; }
|
||||||
|
public string DeptOwnerForRawWafers { get; set; }
|
||||||
|
public string FabCost { get; set; }
|
||||||
|
public string DeptChargedForFabCost { get; set; }
|
||||||
|
public string SignOn { get; set; }
|
||||||
|
public string Verb1 { get; set; }
|
||||||
|
public DateTime? EstimatedBinCLoseDate { get; set; }
|
||||||
|
public int? TotalQty { get; set; }
|
||||||
|
public int? StartQty { get; set; }
|
||||||
|
public string Verb2 { get; set; }
|
||||||
|
public string WIPArea { get; set; }
|
||||||
|
public DateTime? LotStartDate { get; set; }
|
||||||
|
public string LotNumber { get; set; }
|
||||||
|
public string WIPPartNumber { get; set; }
|
||||||
|
public string PartDescription { get; set; }
|
||||||
|
public string DefaultEPISiliconPartNumber { get; set; }
|
||||||
|
public string ProcessFlow { get; set; }
|
||||||
|
public string EmployeeID { get; set; }
|
||||||
|
public string VerbComment { get; set; }
|
||||||
|
public int? RecordSiliconLotInSPNTapeTagTotrav { get; set; }
|
||||||
|
public string SiliconLotNoCassette1 { get; set; }
|
||||||
|
public bool SiliconOnHand { get; set; }
|
||||||
|
public DateTime? SiliconExpectedDueDate { get; set; }
|
||||||
|
public string SiliconComments { get; set; }
|
||||||
|
public bool ReticleOnHand { get; set; }
|
||||||
|
public DateTime? ReticleExpectedDueDate { get; set; }
|
||||||
|
public string ReticleComments { get; set; }
|
||||||
|
public bool SPNTransferOnHand { get; set; }
|
||||||
|
public DateTime? SPNTransferExpectedDueDate { get; set; }
|
||||||
|
public string SPNTransferComments { get; set; }
|
||||||
|
public bool ProbeCardOnHand { get; set; }
|
||||||
|
public DateTime? ProbeCardExpectedDueDate { get; set; }
|
||||||
|
public string ProbeCardComments { get; set; }
|
||||||
|
public bool ProbeRecipeOnHand { get; set; }
|
||||||
|
public DateTime? ProbeRecipeExpectedDueDate { get; set; }
|
||||||
|
public string ProbeRecipeComments { get; set; }
|
||||||
|
public bool ProcessChangeDetailsOnHand { get; set; }
|
||||||
|
public DateTime? ProcessChangeDetailsDueDate { get; set; }
|
||||||
|
public string LotStartCheckListComments { get; set; }
|
||||||
|
public LTHoldStep LTHoldStep { get; set; }
|
||||||
|
public LTWorkRequestAttachment WorkRequestAttachment { get; set; }
|
||||||
|
public int LotCount { get; set; }
|
||||||
|
|
||||||
public bool ReticleOnHand { get; set; }
|
// View Model attributes
|
||||||
public DateTime? ReticleExpectedDueDate { get; set; }
|
public List<int> DepartmentIDs { get; set; }
|
||||||
public string ReticleComments { get; set; }
|
public List<int> ModuleIDs { get; set; }
|
||||||
|
public string OriginatorName { get; set; }
|
||||||
public bool SPNTransferOnHand { get; set; }
|
public string RevisionComments { get; set; }
|
||||||
public DateTime? SPNTransferExpectedDueDate { get; set; }
|
public LTMaterial LTMaterial { get; set; }
|
||||||
public string SPNTransferComments { get; set; }
|
public int PreviousWorkRequestID { get; set; }
|
||||||
|
public int WorkFlowNumber { get; set; }
|
||||||
public bool ProbeCardOnHand { get; set; }
|
public string ApprovalStatus {
|
||||||
public DateTime? ProbeCardExpectedDueDate { get; set; }
|
get {
|
||||||
public string ProbeCardComments { get; set; }
|
return Status == 1 ? "Approved" : "Pending";
|
||||||
|
|
||||||
public bool ProbeRecipeOnHand { get; set; }
|
|
||||||
public DateTime? ProbeRecipeExpectedDueDate { get; set; }
|
|
||||||
public string ProbeRecipeComments { get; set; }
|
|
||||||
|
|
||||||
public bool ProcessChangeDetailsOnHand { get; set; }
|
|
||||||
public DateTime? ProcessChangeDetailsDueDate { get; set; }
|
|
||||||
|
|
||||||
public string LotStartCheckListComments { get; set; }
|
|
||||||
|
|
||||||
public LTHoldStep LTHoldStep { get; set; }
|
|
||||||
public LTWorkRequestAttachment WorkRequestAttachment { get; set; }
|
|
||||||
public int LotCount { get; set; }
|
|
||||||
|
|
||||||
// View Model attributes
|
|
||||||
public List<int> DepartmentIDs { get; set; }
|
|
||||||
public List<int> ModuleIDs { get; set; }
|
|
||||||
public string OriginatorName { get; set; }
|
|
||||||
public string RevisionComments { get; set; }
|
|
||||||
public LTMaterial LTMaterial { get; set; }
|
|
||||||
public int PreviousWorkRequestID { get; set; }
|
|
||||||
public int WorkFlowNumber { get; set; }
|
|
||||||
public string ApprovalStatus
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return Status == 1? "Approved" : "Pending";
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public LTWorkRequest()
|
|
||||||
{
|
|
||||||
DepartmentIDs = new List<int>();
|
|
||||||
ModuleIDs = new List<int>();
|
|
||||||
LTHoldStep = new LTHoldStep();
|
|
||||||
LTMaterial = new LTMaterial();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public LTWorkRequest() {
|
||||||
public class LTMaterial
|
DepartmentIDs = new List<int>();
|
||||||
{
|
ModuleIDs = new List<int>();
|
||||||
public int ID { get; set; }
|
LTHoldStep = new LTHoldStep();
|
||||||
[Display(Name = "WIP Part #")]
|
LTMaterial = new LTMaterial();
|
||||||
public string WIPPartNumber { get; set; }
|
|
||||||
[Display(Name = "EPI Silicon Part#")]
|
|
||||||
public string EPISiliconPartNumber { get; set; }
|
|
||||||
public int Quantity { get; set; }
|
|
||||||
public string Supplier { get; set; }
|
|
||||||
public string Source { get; set; }
|
|
||||||
public int LTWorkRequestID { get; set; }
|
|
||||||
public int PreviousMaterialID { get; set; }
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
}
|
||||||
///
|
|
||||||
/// </summary>
|
public class LTMaterial {
|
||||||
public class LTAffectedDepartment
|
|
||||||
{
|
public int ID { get; set; }
|
||||||
public int ID { get; set; }
|
[Display(Name = "WIP Part #")]
|
||||||
public int DepartmentID { get; set; }
|
public string WIPPartNumber { get; set; }
|
||||||
public int LTWorkRequestID { get; set; }
|
[Display(Name = "EPI Silicon Part#")]
|
||||||
|
public string EPISiliconPartNumber { get; set; }
|
||||||
}
|
public int Quantity { get; set; }
|
||||||
|
public string Supplier { get; set; }
|
||||||
/// <summary>
|
public string Source { get; set; }
|
||||||
///
|
public int LTWorkRequestID { get; set; }
|
||||||
/// </summary>
|
public int PreviousMaterialID { get; set; }
|
||||||
public class LTAffectedModule
|
|
||||||
{
|
}
|
||||||
public int ID { get; set; }
|
|
||||||
public int ModuleID { get; set; }
|
public class LTAffectedDepartment {
|
||||||
public int LTWorkRequestID { get; set; }
|
|
||||||
}
|
public int ID { get; set; }
|
||||||
|
public int DepartmentID { get; set; }
|
||||||
/// <summary>
|
public int LTWorkRequestID { get; set; }
|
||||||
///
|
|
||||||
/// </summary>
|
}
|
||||||
//public class LTMaterial
|
|
||||||
//{
|
public class LTAffectedModule {
|
||||||
// public int ID { get; set; }
|
|
||||||
// public string WIPPartNumber { get; set; }
|
public int ID { get; set; }
|
||||||
// public string Description { get; set; }
|
public int ModuleID { get; set; }
|
||||||
// public string EPISiliconPartNumber { get; set; }
|
public int LTWorkRequestID { get; set; }
|
||||||
// public int Quantity { get; set; }
|
|
||||||
// public string Supplier { get; set; }
|
}
|
||||||
// public int LTWorkRequestID { get; set; }
|
|
||||||
|
public class LTLotStartCheckList {
|
||||||
// public LTMaterial()
|
|
||||||
// {
|
public int ID { get; set; }
|
||||||
// Description = "";
|
public string Item { get; set; }
|
||||||
// }
|
public bool OnHand { get; set; }
|
||||||
|
public DateTime? ExpectedDueDate { get; set; }
|
||||||
//}
|
public int LTWorkRequestID { get; set; }
|
||||||
|
public string Comments { get; set; }
|
||||||
/// <summary>
|
|
||||||
///
|
}
|
||||||
/// </summary>
|
|
||||||
public class LTLotStartCheckList
|
public class LTHoldStep {
|
||||||
{
|
|
||||||
public int ID { get; set; }
|
public int ID { get; set; }
|
||||||
public string Item { get; set; }
|
public string BaseFlow { get; set; }
|
||||||
public bool OnHand { get; set; }
|
public string Location { get; set; }
|
||||||
public DateTime? ExpectedDueDate { get; set; }
|
|
||||||
public int LTWorkRequestID { get; set; }
|
[Display(Name = "Seq")]
|
||||||
public string Comments { get; set; }
|
public string OperSequence { get; set; }
|
||||||
}
|
public string Operation { get; set; }
|
||||||
|
public string OperationDescription { get; set; }
|
||||||
/// <summary>
|
public string ChangeInstructions { get; set; }
|
||||||
///
|
public string FileNames { get; set; }
|
||||||
/// </summary>
|
public int LTWorkRequestID { get; set; }
|
||||||
public class LTHoldStep
|
public int UpdatedBy { get; set; }
|
||||||
{
|
public LTWorkRequestAttachment LTWorkRequestAttachment { get; set; }
|
||||||
public int ID { get; set; }
|
public int Revision { get; set; }
|
||||||
public string BaseFlow { get; set; }
|
public int SWRNumber { get; set; }
|
||||||
public string Location { get; set; }
|
public int currentStep { get; set; }
|
||||||
|
public int PreviousHoldStepID { get; set; }
|
||||||
[Display(Name="Seq")]
|
public LTHoldStep() =>
|
||||||
public string OperSequence { get; set; }
|
LTWorkRequestAttachment = new LTWorkRequestAttachment();
|
||||||
|
|
||||||
public string Operation { get; set; }
|
}
|
||||||
public string OperationDescription { get; set; }
|
|
||||||
public string ChangeInstructions { get; set; }
|
public class LTWorkRequestAttachment {
|
||||||
public string FileNames { get; set; }
|
|
||||||
public int LTWorkRequestID { get; set; }
|
public int ID { get; set; }
|
||||||
public int UpdatedBy { get; set; }
|
public string FileGUID { get; set; }
|
||||||
public LTWorkRequestAttachment LTWorkRequestAttachment { get; set; }
|
public string FileName { get; set; }
|
||||||
public int Revision { get; set; }
|
public string DocType { get; set; }
|
||||||
public int SWRNumber { get; set; }
|
public string Comments { get; set; }
|
||||||
public int currentStep { get; set; }
|
public DateTime? UploadDateTime { get; set; }
|
||||||
public int PreviousHoldStepID { get; set; }
|
public int LTHoldStepID { get; set; }
|
||||||
public LTHoldStep()
|
public string UploadedByName { get; set; }
|
||||||
{
|
public int UploadedByID { get; set; }
|
||||||
LTWorkRequestAttachment = new LTWorkRequestAttachment();
|
public int Revision { get; set; }
|
||||||
}
|
public int WorkRequestID { get; set; }
|
||||||
}
|
public int SWRNumber { get; set; }
|
||||||
|
public string FileExtension { get; set; }
|
||||||
/// <summary>
|
public int PreviousWorkRequestAttachmentID { get; set; }
|
||||||
///
|
|
||||||
/// </summary>
|
}
|
||||||
public class LTWorkRequestAttachment
|
|
||||||
{
|
public class LTLotTravelerHeaderViewModel {
|
||||||
public int ID { get; set; }
|
|
||||||
public string FileGUID { get; set; }
|
public int ID { get; set; }
|
||||||
public string FileName { get; set; }
|
public int SWRNumber { get; set; }
|
||||||
public string DocType { get; set; }
|
public string LotNumber { get; set; }
|
||||||
public string Comments { get; set; }
|
public string Title { get; set; } //
|
||||||
public DateTime? UploadDateTime { get; set; }
|
public string Status { get; set; } //
|
||||||
public int LTHoldStepID { get; set; }
|
public string Originator { get; set; } //
|
||||||
public string UploadedByName { get; set; }
|
public string WIPPartNumber { get; set; }
|
||||||
public int UploadedByID { get; set; }
|
public string PartDescription { get; set; }
|
||||||
public int Revision { get; set; }
|
public string BaseFlow { set; get; }
|
||||||
public int WorkRequestID { get; set; }
|
public bool IsITAR { set; get; }
|
||||||
public int SWRNumber { get; set; }
|
public DateTime? LastUpdate { get; set; }
|
||||||
public string FileExtension { get; set; }
|
public string LastUpdatedBy { get; set; }
|
||||||
public int PreviousWorkRequestAttachmentID { get; set; }
|
public string PurposeOfRequest { get; set; }
|
||||||
}
|
public int LotTravCurrentRevision { get; set; }
|
||||||
|
public LTLotTravelerHoldSteps LTLotTravelerHoldStep { get; set; }
|
||||||
/// <summary>
|
public bool IsCurrentRevision { get; set; }
|
||||||
///
|
public int LTWorkRequestID { get; set; }
|
||||||
/// </summary>
|
public int LotTravRevID { get; set; }
|
||||||
public class LTLotTravelerHeaderViewModel
|
public bool RecordLockIndicator { get; set; }
|
||||||
{
|
public int RecordLockedBy { get; set; }
|
||||||
public int ID { get; set; }
|
public int RecordLockedByName { get; set; }
|
||||||
public int SWRNumber { get; set; }
|
public List<Revision> Revisions { get; set; }
|
||||||
public string LotNumber { get; set; }
|
public bool TravelerClosed { get; set; }
|
||||||
public string Title { get; set; } //
|
public DateTime? TravelerClosedDate { get; set; }
|
||||||
public string Status { get; set; } //
|
public string TravelerClosedBy { get; set; }
|
||||||
public string Originator { get; set; } //
|
public string TravelerClosedReason { get; set; }
|
||||||
public string WIPPartNumber { get; set; }
|
public int WorkReqRevision { get; set; }
|
||||||
public string PartDescription { get; set; }
|
public string TravelerStatus {
|
||||||
public string BaseFlow { set; get; }
|
get {
|
||||||
public bool IsITAR { set; get; }
|
return TravelerClosedDate == null ? "Open" : "Closed";
|
||||||
public DateTime? LastUpdate { get; set; }
|
}
|
||||||
public string LastUpdatedBy { get; set; }
|
}
|
||||||
public string PurposeOfRequest { get; set; }
|
|
||||||
//public int Quantity { get; set; }
|
public LTLotTravelerHeaderViewModel() =>
|
||||||
//public bool TravelerAttachedToLot { get; set; }
|
LTLotTravelerHoldStep = new LTLotTravelerHoldSteps();
|
||||||
public int LotTravCurrentRevision { get; set; }
|
|
||||||
public LTLotTravelerHoldSteps LTLotTravelerHoldStep { get; set; }
|
}
|
||||||
public bool IsCurrentRevision { get; set; }
|
|
||||||
//public string Comments { get; set; }
|
public class LTLot {
|
||||||
public int LTWorkRequestID { get; set; }
|
|
||||||
public int LotTravRevID { get; set; }
|
public int ID { get; set; }
|
||||||
public bool RecordLockIndicator { get; set; }
|
public int WorkRequestID { get; set; }
|
||||||
public int RecordLockedBy { get; set; }
|
public string LotNumber { get; set; }
|
||||||
public int RecordLockedByName { get; set; }
|
public string WIPPartNumber { get; set; }
|
||||||
public List<Revision> Revisions { get; set; }
|
public int WaferQty { get; set; }
|
||||||
public bool TravelerClosed { get; set; }
|
public string PartDescription { get; set; }
|
||||||
public DateTime? TravelerClosedDate { get; set; }
|
public string Process { get; set; }
|
||||||
public string TravelerClosedBy { get; set; }
|
public string Location { get; set; }
|
||||||
public string TravelerClosedReason { get; set; }
|
public string Operation { get; set; }
|
||||||
public int WorkReqRevision { get; set; }
|
public string LotStatus { get; set; }
|
||||||
|
public bool IsTravelerGenerated { get; set; }
|
||||||
public string TravelerStatus
|
[Display(Name = "Revision")]
|
||||||
{
|
public int LotTravelerCurrentRevision { get; set; }
|
||||||
get
|
public int LotUploadedBy { get; set; }
|
||||||
{
|
public string UploadedByName { get; set; }
|
||||||
return TravelerClosedDate == null ? "Open" : "Closed";
|
public DateTime LotUploadDatetime { get; set; }
|
||||||
}
|
public int WRWithExistingLot { get; set; }
|
||||||
}
|
public string TravelerStatus { get; set; }
|
||||||
|
public bool TravelerClosed { get; set; }
|
||||||
|
public DateTime? TravelerClosedDate { get; set; }
|
||||||
public LTLotTravelerHeaderViewModel()
|
|
||||||
{
|
[Display(Name = "")]
|
||||||
LTLotTravelerHoldStep = new LTLotTravelerHoldSteps();
|
public string ButtonAttrib {
|
||||||
}
|
get {
|
||||||
}
|
return (IsTravelerGenerated ? "True" : "False") + "~" + ID + "~" + WorkRequestID + "~" + LotStatus + "~" + TravelerStatus;
|
||||||
|
}
|
||||||
/// <summary>
|
}
|
||||||
///
|
|
||||||
/// </summary>
|
}
|
||||||
public class LTLot
|
|
||||||
{
|
public class LTLotTravelerRevisionAttrib {
|
||||||
public int ID { get; set; }
|
|
||||||
public int WorkRequestID { get; set; }
|
public int ID { get; set; }
|
||||||
public string LotNumber { get; set; }
|
public int LTLotID { get; set; }
|
||||||
public string WIPPartNumber { get; set; }
|
public int RevisionNumber { get; set; }
|
||||||
public int WaferQty { get; set; }
|
public bool IsCurrentRevision { get; set; }
|
||||||
public string PartDescription { get; set; }
|
public string Comments { get; set; }
|
||||||
public string Process { get; set; }
|
public int RecordLockIndicator { get; set; }
|
||||||
public string Location { get; set; }
|
public int RecordLockedBy { get; set; }
|
||||||
public string Operation { get; set; }
|
public DateTime? RecordLockedDate { get; set; }
|
||||||
public string LotStatus { get; set; }
|
public int TravelerLastUpdatedBy { get; set; }
|
||||||
public bool IsTravelerGenerated { get; set; }
|
public DateTime? TraverlerLastUpdatedDatetime { get; set; }
|
||||||
[Display(Name="Revision")]
|
|
||||||
public int LotTravelerCurrentRevision { get; set; }
|
}
|
||||||
public int LotUploadedBy { get; set; }
|
|
||||||
public string UploadedByName { get; set; }
|
public class LTLotTravlerHistory {
|
||||||
public DateTime LotUploadDatetime { get; set; }
|
|
||||||
public int WRWithExistingLot { get; set; }
|
}
|
||||||
public string TravelerStatus { get; set; }
|
|
||||||
public bool TravelerClosed { get; set; }
|
public class LTLotTravelerHoldSteps {
|
||||||
public DateTime? TravelerClosedDate { get; set; }
|
|
||||||
//public int RecordLockIndicator { get; set; }
|
public int ID { get; set; }
|
||||||
//public int RecordLockedBy { get; set; }
|
public string Location { get; set; }
|
||||||
//public DateTime? RecordLockedDateTime { get; set; }
|
public string Operation { get; set; }
|
||||||
//public bool IsCurrentRevision { get; set;}
|
public string OperSequence { get; set; }
|
||||||
//public int Revision { get; set; }
|
public string Description { get; set; }
|
||||||
[Display(Name = "")]
|
public string OperationDescription { get; set; }
|
||||||
public string ButtonAttrib
|
public string ChangeInstructions { get; set; }
|
||||||
{
|
public bool OLHoldInSPN { get; set; }
|
||||||
get
|
public string ExecutionTaskComments { get; set; }
|
||||||
{
|
public string EmployeeID { get; set; }
|
||||||
return (IsTravelerGenerated ? "True" : "False") + "~" + ID + "~" + WorkRequestID + "~" + LotStatus + "~" + TravelerStatus;
|
public bool Completed { get; set; }
|
||||||
}
|
public DateTime? SignOffTime { get; set; }
|
||||||
}
|
public int SignedOffBy { get; set; }
|
||||||
|
[Display(Name = "SignedOff By")]
|
||||||
}
|
public string SignedOffByName { get; set; }
|
||||||
|
public int LotTravelerRevisionID { get; set; }
|
||||||
/// <summary>
|
public string RevisionComments { get; set; }
|
||||||
///
|
public DateTime? UpdatedDateTime { get; set; }
|
||||||
/// </summary>
|
public int? UpdatedBy { get; set; }
|
||||||
public class LTLotTravelerRevisionAttrib
|
public int CurrentRevision { get; set; }
|
||||||
{
|
// view model fields
|
||||||
public int ID { get; set; }
|
public string FileNames { get; set; }
|
||||||
public int LTLotID { get; set; }
|
public int SWRNumber { get; set; }
|
||||||
public int RevisionNumber { get; set; }
|
public int LTLotID { get; set; }
|
||||||
public bool IsCurrentRevision { get; set; }
|
public int WorkRequestID { get; set; }
|
||||||
public string Comments { get; set; }
|
|
||||||
public int RecordLockIndicator { get; set; }
|
}
|
||||||
public int RecordLockedBy { get; set; }
|
|
||||||
public DateTime? RecordLockedDate { get; set; }
|
public class LTLotTravAttachment {
|
||||||
public int TravelerLastUpdatedBy { get; set; }
|
|
||||||
public DateTime? TraverlerLastUpdatedDatetime { get; set; }
|
public int ID { get; set; }
|
||||||
|
public string FileGUID { get; set; }
|
||||||
|
public string FileName { get; set; }
|
||||||
|
public string DocType { get; set; }
|
||||||
}
|
public string Comments { get; set; }
|
||||||
|
public int LotTravelerRevisionID { get; set; }
|
||||||
public class LTLotTravlerHistory
|
public int LTLotTravHoldStepID { get; set; }
|
||||||
{
|
public DateTime? UploadTime { get; set; }
|
||||||
|
public int UploadedByID { get; set; }
|
||||||
}
|
public string UploadedByName { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
}
|
||||||
///
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class LTLotTravelerHoldSteps
|
public class BaseFlowLocation {
|
||||||
{
|
|
||||||
public int ID { get; set; }
|
public string Location { get; set; }
|
||||||
public string Location { get; set; }
|
|
||||||
public string Operation { get; set; }
|
}
|
||||||
public string OperSequence { get; set; }
|
|
||||||
public string Description { get; set; }
|
public class BaseFlowOperations {
|
||||||
public string OperationDescription { get; set; }
|
|
||||||
public string ChangeInstructions { get; set; }
|
public string Operation { get; set; }
|
||||||
public bool OLHoldInSPN { get; set; }
|
public string OperationDesc { get; set; }
|
||||||
public string ExecutionTaskComments { get; set; }
|
public string OperCode { get; set; }
|
||||||
public string EmployeeID { get; set; }
|
public string SeqCode { get; set; }
|
||||||
public bool Completed { get; set; }
|
|
||||||
public DateTime? SignOffTime { get; set; }
|
}
|
||||||
public int SignedOffBy { get; set; }
|
|
||||||
[Display(Name="SignedOff By")]
|
/// </summary>
|
||||||
public string SignedOffByName { get; set; }
|
public class BaseFlowLocationOperation {
|
||||||
public int LotTravelerRevisionID { get; set; }
|
|
||||||
public string RevisionComments { get; set; }
|
public string BaseFlow { get; set; }
|
||||||
public DateTime? UpdatedDateTime { get; set; }
|
public string Location { get; set; }
|
||||||
public int? UpdatedBy { get; set; }
|
public string Operation { get; set; }
|
||||||
public int CurrentRevision { get; set; }
|
|
||||||
// view model fields
|
}
|
||||||
public string FileNames { get; set; }
|
|
||||||
public int SWRNumber { get; set; }
|
public class PartNumberAttrib {
|
||||||
public int LTLotID { get; set; }
|
|
||||||
public int WorkRequestID { get; set; }
|
public string PartNumber { get; set; }
|
||||||
}
|
public string SiliconAndDesc { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
}
|
||||||
///
|
|
||||||
/// </summary>
|
public class Revision {
|
||||||
public class LTLotTravAttachment
|
|
||||||
{
|
public int ID { get; set; }
|
||||||
public int ID { get; set; }
|
public int RevisionNumber { get; set; }
|
||||||
public string FileGUID { get; set; }
|
|
||||||
public string FileName { get; set; }
|
}
|
||||||
public string DocType { get; set; }
|
|
||||||
public string Comments { get; set; }
|
public class LotWithTraveler {
|
||||||
public int LotTravelerRevisionID { get; set; }
|
|
||||||
public int LTLotTravHoldStepID { get; set; }
|
public int LotID { get; set; }
|
||||||
public DateTime? UploadTime { get; set; }
|
public string LotNumber { get; set; }
|
||||||
public int UploadedByID { get; set; }
|
|
||||||
public string UploadedByName { get; set; }
|
}
|
||||||
|
|
||||||
|
public class RevisionHistory {
|
||||||
}
|
|
||||||
|
public int ID { get; set; }
|
||||||
|
public string RevisionedBy { get; set; }
|
||||||
|
public string Comments { get; set; }
|
||||||
|
public DateTime RevisionCreateDate { get; set; }
|
||||||
/// </summary>
|
|
||||||
public class BaseFlowLocation
|
|
||||||
{
|
|
||||||
public string Location { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public class BaseFlowOperations
|
|
||||||
{
|
|
||||||
public string Operation { get; set; }
|
|
||||||
public string OperationDesc { get; set; }
|
|
||||||
public string OperCode { get; set; }
|
|
||||||
public string SeqCode { get; set; }
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// </summary>
|
|
||||||
public class BaseFlowLocationOperation
|
|
||||||
{
|
|
||||||
public string BaseFlow { get; set; }
|
|
||||||
public string Location { get; set; }
|
|
||||||
public string Operation { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public class PartNumberAttrib
|
|
||||||
{
|
|
||||||
public string PartNumber { get; set; }
|
|
||||||
public string SiliconAndDesc { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Revision
|
|
||||||
{
|
|
||||||
public int ID { get; set; }
|
|
||||||
public int RevisionNumber { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public class LotWithTraveler
|
|
||||||
{
|
|
||||||
public int LotID { get; set; }
|
|
||||||
public string LotNumber { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public class RevisionHistory
|
|
||||||
{
|
|
||||||
public int ID { get; set; }
|
|
||||||
public string RevisionedBy { get; set; }
|
|
||||||
public string Comments { get; set; }
|
|
||||||
public DateTime RevisionCreateDate { get; set; }
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -1,226 +1,167 @@
|
|||||||
using Fab2ApprovalSystem.ViewModels;
|
using System;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.Linq;
|
|
||||||
using System.Web;
|
|
||||||
|
|
||||||
namespace Fab2ApprovalSystem.Models
|
using Fab2ApprovalSystem.ViewModels;
|
||||||
{
|
|
||||||
|
namespace Fab2ApprovalSystem.Models;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[Serializable]
|
||||||
|
public class MRB {
|
||||||
|
|
||||||
|
public int MRBNumber { get; set; }
|
||||||
|
public string Title { get; set; }
|
||||||
|
public int MRBRaisedAreaID { get; set; }
|
||||||
|
public int OriginatorID { get; set; }
|
||||||
|
public int Owner { get; set; }
|
||||||
|
public int Module { get; set; }
|
||||||
|
public DateTime? MRBRaisedDate { get; set; }
|
||||||
|
public string Process { get; set; }
|
||||||
|
public int ApprovalStatus { get; set; }
|
||||||
|
public string Tool { get; set; }
|
||||||
|
public string ToolCSV { get; set; }
|
||||||
|
public int NumberOfLotsAffected { get; set; }
|
||||||
|
public int NumberOfWafersAffected { get; set; }
|
||||||
|
public int NumberOfDiesAffected { get; set; }
|
||||||
|
public DateTime? ApprovalDate { get; set; }
|
||||||
|
public int CANo { get; set; }
|
||||||
|
public string IssueDescription { get; set; }
|
||||||
|
public DateTime? IssueDetectedDate { get; set; }
|
||||||
|
public DateTime? IssueStartDate { get; set; }
|
||||||
|
public DateTime? IssueEndDate { get; set; }
|
||||||
|
|
||||||
|
// viewmodel
|
||||||
|
public string OwnerName { get; set; }
|
||||||
|
public List<int> PartGroupIDs { get; set; }
|
||||||
|
public List<int> ModuleIDs { get; set; }
|
||||||
|
public List<int> DispositionIDs { get; set; }
|
||||||
|
public List<int> RiskAssessmentIDs { get; set; }
|
||||||
|
public string Notes { get; set; }
|
||||||
|
public string OwnerApprover { get; set; }
|
||||||
|
public string MfgEngineeringAppover { get; set; }
|
||||||
|
public string YEApprover { get; set; }
|
||||||
|
public string PEApprover { get; set; }
|
||||||
|
public string OtherApprovers { get; set; }
|
||||||
|
public string QualityApprovers { get; set; }
|
||||||
|
public byte CurrentStep { get; set; }
|
||||||
|
public string DetailsFolder { get; set; }
|
||||||
|
public bool CustomerImpacted { get; set; }
|
||||||
|
public int WorkFlowNumber { get; set; }
|
||||||
|
public string ApprovalStatusString {
|
||||||
|
get {
|
||||||
|
switch (ApprovalStatus) {
|
||||||
|
case 0:
|
||||||
|
return "PENDING";
|
||||||
|
case 1:
|
||||||
|
return "APPROVED";
|
||||||
|
default:
|
||||||
|
return "CLOSED";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Serializable]
|
public MRB() {
|
||||||
public class MRB
|
PartGroupIDs = new List<int>();
|
||||||
{
|
ModuleIDs = new List<int>();
|
||||||
|
DispositionIDs = new List<int>();
|
||||||
public int MRBNumber {get;set;}
|
RiskAssessmentIDs = new List<int>();
|
||||||
public string Title { get; set; }
|
|
||||||
public int MRBRaisedAreaID { get; set; }
|
|
||||||
public int OriginatorID { get; set; }
|
|
||||||
public int Owner { get; set; }
|
|
||||||
public int Module { get; set; }
|
|
||||||
public DateTime? MRBRaisedDate { get; set; }
|
|
||||||
public string Process { get; set; }
|
|
||||||
public int ApprovalStatus { get; set; }
|
|
||||||
public string Tool { get; set; }
|
|
||||||
public string ToolCSV { get; set; }
|
|
||||||
public int NumberOfLotsAffected { get; set; }
|
|
||||||
public int NumberOfWafersAffected { get; set; }
|
|
||||||
public int NumberOfDiesAffected { get; set; }
|
|
||||||
public DateTime? ApprovalDate { get; set; }
|
|
||||||
public int CANo { get; set; }
|
|
||||||
public string IssueDescription { get; set; }
|
|
||||||
public DateTime? IssueDetectedDate { get; set; }
|
|
||||||
public DateTime? IssueStartDate { get; set; }
|
|
||||||
public DateTime? IssueEndDate { get; set; }
|
|
||||||
|
|
||||||
// viewmodel
|
|
||||||
public string OwnerName { get; set; }
|
|
||||||
public List<int> PartGroupIDs { get; set; }
|
|
||||||
public List<int> ModuleIDs { get; set; }
|
|
||||||
public List<int> DispositionIDs { get; set; }
|
|
||||||
public List<int> RiskAssessmentIDs { get; set; }
|
|
||||||
|
|
||||||
//public List<PartGroup> PartGroups { get; set; }
|
|
||||||
//public List<Module> Modules { get; set; }
|
|
||||||
//public List<Disposition> Dispositions { get; set; }
|
|
||||||
//public List<RiskAssessment> RiskAssessments { get; set; }
|
|
||||||
|
|
||||||
public string Notes { get; set; }
|
|
||||||
public string OwnerApprover { get; set; }
|
|
||||||
public string MfgEngineeringAppover { get; set; }
|
|
||||||
public string YEApprover { get; set; }
|
|
||||||
public string PEApprover { get; set; }
|
|
||||||
public string OtherApprovers { get; set; }
|
|
||||||
public string QualityApprovers { get; set; }
|
|
||||||
//public string Details { get; set; }
|
|
||||||
public byte CurrentStep { get; set; }
|
|
||||||
public string DetailsFolder { get; set; }
|
|
||||||
public bool CustomerImpacted { get; set; }
|
|
||||||
public int WorkFlowNumber { get; set; }
|
|
||||||
|
|
||||||
public string ApprovalStatusString {
|
|
||||||
get
|
|
||||||
{
|
|
||||||
switch (ApprovalStatus)
|
|
||||||
{
|
|
||||||
case 0:
|
|
||||||
return "PENDING";
|
|
||||||
case 1:
|
|
||||||
return "APPROVED";
|
|
||||||
default:
|
|
||||||
return "CLOSED";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public MRB()
|
|
||||||
{
|
|
||||||
PartGroupIDs = new List<int>();
|
|
||||||
ModuleIDs = new List<int>();
|
|
||||||
DispositionIDs = new List<int>();
|
|
||||||
RiskAssessmentIDs = new List<int>();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//public class zMRBLot
|
}
|
||||||
//{
|
|
||||||
// public int LotID { get; set; }
|
public class PartGroup {
|
||||||
// [Display(Name = "Wafer Lot#")]
|
|
||||||
// public string LotNumber { get; set; }
|
public int PartGroupID { get; set; }
|
||||||
// public string ParentLotNumber { get { return LotNumber.Length >= 7 ? LotNumber.Substring(0, 7) : LotNumber; } }
|
public string PartGroupName { get; set; }
|
||||||
|
|
||||||
// public int MRBNumber { get; set; }
|
}
|
||||||
// public string DieLotNumber { get; set; }
|
|
||||||
// public string Description { get; set; }
|
public class Module {
|
||||||
// [Display(Name = "New PN#")]
|
|
||||||
// public string NewPartNo { get; set; }
|
public int ModuleID { get; set; }
|
||||||
// [Display(Name = "WIP PN#")]
|
public string ModuleName { get; set; }
|
||||||
// public string WipPartNo { get; set; }
|
|
||||||
// [Display(Name = "Die PN#")]
|
}
|
||||||
// public string DiePartNo { get; set; }
|
|
||||||
// [Display(Name = "Family")]
|
public class RiskAssessment {
|
||||||
// public string ProductFamily { get; set; }
|
|
||||||
// public double Gen { get; set; }
|
public int RiskAssessmentID { get; set; }
|
||||||
// public string Channel { get; set; }
|
public string RiskAssessmentName { get; set; }
|
||||||
// public double Hexsize { get; set; }
|
|
||||||
// public double Voltage { get; set; }
|
}
|
||||||
// public int WaferCount { get; set; }
|
|
||||||
// public int ReleaseCount { get; set; }
|
public class Disposition {
|
||||||
// public int ScrapCount { get; set; }
|
|
||||||
// public int DieCount { get; set; }
|
public int DispositionID { get; set; }
|
||||||
// public string Location { get; set; }
|
public int MRBNumber { get; set; }
|
||||||
// public double TotalCost { get; set; }
|
[Display(Name = "Type")]
|
||||||
// public string LotStatusOptionName { get; set; }
|
public string DispositionType { get; set; }
|
||||||
// public double WaferCost { get; set; }
|
[Display(Name = "Dispo Desc")]
|
||||||
// public double DieCost { get; set; }
|
public string DispositionName { get; set; }
|
||||||
//}
|
public string DispositionNotes { get; set; }
|
||||||
|
|
||||||
|
//Duplicated as the CloseToQDBOptionID is being used in the dropdown in the Grid kept the old code
|
||||||
public class PartGroup
|
public int CloseToQDBOption_ID { get; set; }
|
||||||
{
|
|
||||||
public int PartGroupID { get; set; }
|
[UIHint("CloseToQDBTemplate")]
|
||||||
public string PartGroupName { get; set; }
|
[Display(Name = "Close To QDB(Yes/No)")]
|
||||||
|
public CloseToQDBOptionViewModel CloseToQDBOption { get; set; }
|
||||||
}
|
|
||||||
|
[Display(Name = "MRB Flag to SPN")]
|
||||||
public class Module
|
public string CloseToQDBOptionString {
|
||||||
{
|
get {
|
||||||
public int ModuleID { get; set; }
|
switch (CloseToQDBOption_ID) {
|
||||||
//public int MRBNumber { get; set; }
|
case 0:
|
||||||
public string ModuleName { get; set; }
|
return "No";
|
||||||
|
case 1:
|
||||||
}
|
return "Yes";
|
||||||
|
default:
|
||||||
|
return "No";
|
||||||
public class RiskAssessment
|
}
|
||||||
{
|
}
|
||||||
|
}
|
||||||
public int RiskAssessmentID { get; set; }
|
|
||||||
//public int MRBNumber { get; set; }
|
}
|
||||||
public string RiskAssessmentName { get; set; }
|
|
||||||
|
public class MRBAttachment {
|
||||||
}
|
|
||||||
|
public int AttachmentID { set; get; }
|
||||||
|
public int MRBNumber { get; set; }
|
||||||
public class Disposition
|
public string FileName { get; set; }
|
||||||
{
|
public int UserID { get; set; }
|
||||||
|
// extrafield
|
||||||
public int DispositionID { get; set; }
|
public string FullName { get; set; }
|
||||||
public int MRBNumber { get; set; }
|
public string UploadDate { get; set; }
|
||||||
[Display(Name = "Type")]
|
public string Path { get; set; }
|
||||||
public string DispositionType { get; set; }
|
|
||||||
[Display(Name="Dispo Desc")]
|
}
|
||||||
public string DispositionName { get; set; }
|
|
||||||
public string DispositionNotes { get; set; }
|
public class ContainmentActionObj {
|
||||||
|
|
||||||
//Duplicated as the CloseToQDBOptionID is being used in the dropdown in the Grid kept the old code
|
public int ContainmentActionID { get; set; }
|
||||||
public int CloseToQDBOption_ID { get; set; }
|
public int MRBNumber { get; set; }
|
||||||
//public string CloseToQDBOption { get; set; }
|
public string ContainmentAction { get; set; }
|
||||||
|
public int ResponsibilityOwnerID { get; set; }
|
||||||
[UIHint("CloseToQDBTemplate")]
|
public int CurrentResponsibilityOwnerID { get; set; }
|
||||||
[Display(Name = "Close To QDB(Yes/No)")]
|
public string ResponsibilityOwner { get; set; }
|
||||||
public CloseToQDBOptionViewModel CloseToQDBOption { get; set; }
|
|
||||||
|
//[DataType(DataType.Date)]
|
||||||
[Display(Name = "MRB Flag to SPN")]
|
public DateTime? ECD { get; set; }
|
||||||
public string CloseToQDBOptionString
|
|
||||||
{
|
[DataType(DataType.Date)]
|
||||||
get
|
public DateTime? ImplementedDate { get; set; }
|
||||||
{
|
|
||||||
switch (CloseToQDBOption_ID)
|
}
|
||||||
{
|
|
||||||
case 0:
|
public class SPN_MRB {
|
||||||
return "No";
|
|
||||||
case 1:
|
public int MRBNumber;
|
||||||
return "Yes";
|
public char? DispoType;
|
||||||
default:
|
|
||||||
return "No";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public class MRBAttachment
|
|
||||||
{
|
|
||||||
public int AttachmentID { set; get; }
|
|
||||||
public int MRBNumber { get; set; }
|
|
||||||
public string FileName { get; set; }
|
|
||||||
public int UserID { get; set; }
|
|
||||||
// extrafield
|
|
||||||
public string FullName { get; set; }
|
|
||||||
public string UploadDate { get; set; }
|
|
||||||
public string Path { get; set; }
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public class ContainmentActionObj
|
|
||||||
{
|
|
||||||
public int ContainmentActionID { get; set; }
|
|
||||||
public int MRBNumber { get; set; }
|
|
||||||
public string ContainmentAction { get; set; }
|
|
||||||
public int ResponsibilityOwnerID { get; set; }
|
|
||||||
public int CurrentResponsibilityOwnerID { get; set; }
|
|
||||||
public string ResponsibilityOwner { get; set; }
|
|
||||||
|
|
||||||
//[DataType(DataType.Date)]
|
|
||||||
public DateTime? ECD { get; set; }
|
|
||||||
|
|
||||||
[DataType(DataType.Date)]
|
|
||||||
public DateTime? ImplementedDate { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public class SPN_MRB
|
|
||||||
{
|
|
||||||
public int MRBNumber;
|
|
||||||
public char? DispoType;
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -1,85 +1,77 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel.DataAnnotations;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Web;
|
|
||||||
|
|
||||||
namespace Fab2ApprovalSystem.Models
|
namespace Fab2ApprovalSystem.Models;
|
||||||
{
|
|
||||||
|
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class PartsRequest
|
public class PartsRequest {
|
||||||
{
|
|
||||||
public int PRNumber { get; set; }
|
|
||||||
public string Title { get; set; }
|
|
||||||
|
|
||||||
public DateTime CreateDate { get; set; }
|
public int PRNumber { get; set; }
|
||||||
public DateTime? SubmitDate { get; set; }
|
public string Title { get; set; }
|
||||||
public DateTime? CloseDate { get; set; }
|
public DateTime CreateDate { get; set; }
|
||||||
|
public DateTime? SubmitDate { get; set; }
|
||||||
public int OriginatorID { get; set; }
|
public DateTime? CloseDate { get; set; }
|
||||||
public int RequestorID { get; set; }
|
public int OriginatorID { get; set; }
|
||||||
public int TechLeadID { get; set; }
|
public int RequestorID { get; set; }
|
||||||
public string Description { get; set; }
|
public int TechLeadID { get; set; }
|
||||||
|
public string Description { get; set; }
|
||||||
public DateTime? LastUpdateDate { get; set; }
|
public DateTime? LastUpdateDate { get; set; }
|
||||||
|
public int CurrentStep { get; set; }
|
||||||
public int CurrentStep { get; set; }
|
public string Status { get; set; }
|
||||||
|
|
||||||
public string Status { get; set; }
|
}
|
||||||
}
|
|
||||||
|
[Serializable]
|
||||||
[Serializable]
|
public class PartsRequestAttachment {
|
||||||
public class PartsRequestAttachment
|
|
||||||
{
|
public int AttachmentID { set; get; }
|
||||||
public int AttachmentID { set; get; }
|
public int PRNumber { get; set; }
|
||||||
public int PRNumber { get; set; }
|
public string FileName { get; set; }
|
||||||
public string FileName { get; set; }
|
public int UserID { get; set; }
|
||||||
public int UserID { get; set; }
|
public string UploadDate { get; set; }
|
||||||
public string UploadDate { get; set; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class PartsRequestAttachmentList
|
public class PartsRequestAttachmentList {
|
||||||
{
|
|
||||||
public int AttachmentID { set; get; }
|
public int AttachmentID { set; get; }
|
||||||
public int PRNumber { get; set; }
|
public int PRNumber { get; set; }
|
||||||
public string FileName { get; set; }
|
public string FileName { get; set; }
|
||||||
public int UserID { get; set; }
|
public int UserID { get; set; }
|
||||||
public string UploadDate { get; set; }
|
public string UploadDate { get; set; }
|
||||||
|
public string FullName { get; set; }
|
||||||
public string FullName { get; set; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class PartsRequestList
|
public class PartsRequestList {
|
||||||
{
|
|
||||||
public int PRNumber { get; set; }
|
public int PRNumber { get; set; }
|
||||||
public string Title { get; set; }
|
public string Title { get; set; }
|
||||||
public DateTime CreateDate { get; set; }
|
public DateTime CreateDate { get; set; }
|
||||||
public DateTime SubmitDate { get; set; }
|
public DateTime SubmitDate { get; set; }
|
||||||
public DateTime CloseDate { get; set; }
|
public DateTime CloseDate { get; set; }
|
||||||
public string Originator { get; set; }
|
public string Originator { get; set; }
|
||||||
public string Requestor { get; set; }
|
public string Requestor { get; set; }
|
||||||
public string TechLead { get; set; }
|
public string TechLead { get; set; }
|
||||||
public string Description { get; set; }
|
public string Description { get; set; }
|
||||||
public string Status { get; set; }
|
public string Status { get; set; }
|
||||||
public string PendingApprovers { get; set; }
|
public string PendingApprovers { get; set; }
|
||||||
}
|
|
||||||
|
}
|
||||||
public class MyPartsRequestList
|
|
||||||
{
|
public class MyPartsRequestList {
|
||||||
public int PRNumber { get; set; }
|
|
||||||
public string Title { get; set; }
|
public int PRNumber { get; set; }
|
||||||
public string Description { get; set; }
|
public string Title { get; set; }
|
||||||
public DateTime CreateDate { get; set; }
|
public string Description { get; set; }
|
||||||
public DateTime? SubmitDate { get; set; }
|
public DateTime CreateDate { get; set; }
|
||||||
public DateTime? CloseDate { get; set; }
|
public DateTime? SubmitDate { get; set; }
|
||||||
public string Originator { get; set; }
|
public DateTime? CloseDate { get; set; }
|
||||||
public string Requestor { get; set; }
|
public string Originator { get; set; }
|
||||||
public string TechLead { get; set; }
|
public string Requestor { get; set; }
|
||||||
public string Status { get; set; }
|
public string TechLead { get; set; }
|
||||||
public string PendingApprovers { get; set; }
|
public string Status { get; set; }
|
||||||
public string WorkFlowStepName { get; set; }
|
public string PendingApprovers { get; set; }
|
||||||
}
|
public string WorkFlowStepName { get; set; }
|
||||||
|
|
||||||
}
|
}
|
@ -1,68 +1,56 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.Linq;
|
|
||||||
using System.Web;
|
|
||||||
|
|
||||||
namespace Fab2ApprovalSystem.Models
|
namespace Fab2ApprovalSystem.Models;
|
||||||
{
|
|
||||||
public class ProductViewModel
|
|
||||||
{
|
|
||||||
[ScaffoldColumn(false)]
|
|
||||||
public int ProductID
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
set;
|
|
||||||
}
|
|
||||||
|
|
||||||
[Required]
|
public class ProductViewModel {
|
||||||
[DisplayName("Product name")]
|
[ScaffoldColumn(false)]
|
||||||
public string ProductName
|
public int ProductID {
|
||||||
{
|
get;
|
||||||
get;
|
set;
|
||||||
set;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
[DisplayName("Unit price")]
|
[DisplayName("Product name")]
|
||||||
[DataType(DataType.Currency)]
|
public string ProductName {
|
||||||
[Range(0, int.MaxValue)]
|
get;
|
||||||
public decimal UnitPrice
|
set;
|
||||||
{
|
}
|
||||||
get;
|
|
||||||
set;
|
|
||||||
}
|
|
||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
[DisplayName("Units in stock")]
|
[DisplayName("Unit price")]
|
||||||
[DataType("Integer")]
|
[DataType(DataType.Currency)]
|
||||||
[Range(0, int.MaxValue)]
|
[Range(0, int.MaxValue)]
|
||||||
public int UnitsInStock
|
public decimal UnitPrice {
|
||||||
{
|
get;
|
||||||
get;
|
set;
|
||||||
set;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public bool Discontinued
|
[Required]
|
||||||
{
|
[DisplayName("Units in stock")]
|
||||||
get;
|
[DataType("Integer")]
|
||||||
set;
|
[Range(0, int.MaxValue)]
|
||||||
}
|
public int UnitsInStock {
|
||||||
|
get;
|
||||||
|
set;
|
||||||
|
}
|
||||||
|
|
||||||
[DisplayName("Last supply")]
|
public bool Discontinued {
|
||||||
[DataType(DataType.Date)]
|
get;
|
||||||
public DateTime LastSupply
|
set;
|
||||||
{
|
}
|
||||||
get;
|
|
||||||
set;
|
|
||||||
}
|
|
||||||
|
|
||||||
[DataType("Integer")]
|
[DisplayName("Last supply")]
|
||||||
public int UnitsOnOrder
|
[DataType(DataType.Date)]
|
||||||
{
|
public DateTime LastSupply {
|
||||||
get;
|
get;
|
||||||
set;
|
set;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[DataType("Integer")]
|
||||||
|
public int UnitsOnOrder {
|
||||||
|
get;
|
||||||
|
set;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,15 +1,10 @@
|
|||||||
using System;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Web;
|
|
||||||
|
|
||||||
namespace Fab2ApprovalSystem.Models
|
namespace Fab2ApprovalSystem.Models;
|
||||||
{
|
|
||||||
public class TestModel
|
|
||||||
{
|
|
||||||
public string Name { get; set; }
|
|
||||||
|
|
||||||
public List<string> Countries { get; set; }
|
public class TestModel {
|
||||||
|
|
||||||
|
public string Name { get; set; }
|
||||||
|
public List<string> Countries { get; set; }
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -28,7 +28,6 @@ namespace Fab2ApprovalSystem.Models
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
|
|
||||||
ECN_DMO ecnDMO = new ECN_DMO();
|
ECN_DMO ecnDMO = new ECN_DMO();
|
||||||
string ECNTitle = ecnDMO.GetECN(ECN).Title;
|
string ECNTitle = ecnDMO.GetECN(ECN).Title;
|
||||||
|
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#if !NET8
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// This code was generated from a template.
|
// This code was generated from a template.
|
||||||
@ -42,3 +44,5 @@ namespace Fab2ApprovalSystem.Models
|
|||||||
public virtual DbSet<TECNNotificationsUser> TECNNotificationsUsers { get; set; }
|
public virtual DbSet<TECNNotificationsUser> TECNNotificationsUsers { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
@ -1,14 +1,9 @@
|
|||||||
using System;
|
namespace Fab2ApprovalSystem.Models;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
public class UserSubRoles {
|
||||||
using System.Web;
|
|
||||||
|
public int SubRoleID { get; set; }
|
||||||
|
public string RoleName { get; set; }
|
||||||
|
public string SubRoleName { get; set; }
|
||||||
|
|
||||||
namespace Fab2ApprovalSystem.Models
|
|
||||||
{
|
|
||||||
public class UserSubRoles
|
|
||||||
{
|
|
||||||
public int SubRoleID { get; set; }
|
|
||||||
public string RoleName { get; set; }
|
|
||||||
public string SubRoleName { get; set; }
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -1,22 +1,13 @@
|
|||||||
using System;
|
namespace Fab2ApprovalSystem.Models;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel.DataAnnotations;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Web;
|
|
||||||
|
|
||||||
namespace Fab2ApprovalSystem.Models
|
public class WinEventLog {
|
||||||
{
|
//[Key]
|
||||||
public class WinEventLog
|
|
||||||
{
|
|
||||||
//[Key]
|
|
||||||
|
|
||||||
public int SysDocumentID{ get; set; }
|
public int SysDocumentID { get; set; }
|
||||||
public int IssueID { get; set; }
|
public int IssueID { get; set; }
|
||||||
public string DocumentType { get; set; }
|
public string DocumentType { get; set; }
|
||||||
public string UserID { get; set; }
|
public string UserID { get; set; }
|
||||||
public string OperationType { get; set; }
|
public string OperationType { get; set; }
|
||||||
public string Comments { get; set; }
|
public string Comments { get; set; }
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -1,43 +1,39 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Web;
|
|
||||||
|
|
||||||
namespace Fab2ApprovalSystem.Models
|
namespace Fab2ApprovalSystem.Models;
|
||||||
{
|
|
||||||
public class ApprovalModel
|
public class ApprovalModel {
|
||||||
{
|
|
||||||
public int ApprovalID { get; set; }
|
public int ApprovalID { get; set; }
|
||||||
public int? IssueID { get; set; }
|
public int? IssueID { get; set; }
|
||||||
public string RoleName { get; set; } // nullable
|
public string RoleName { get; set; } // nullable
|
||||||
public string SubRole { get; set; }
|
public string SubRole { get; set; }
|
||||||
public int UserID { get; set; }
|
public int UserID { get; set; }
|
||||||
public int SubRoleID { get; set; }
|
public int SubRoleID { get; set; }
|
||||||
public int? ItemStatus { get; set; }
|
public int? ItemStatus { get; set; }
|
||||||
public int? Step { get; set; }
|
public int? Step { get; set; }
|
||||||
public DateTime NotifyDate { get; set; } // nullable
|
public DateTime NotifyDate { get; set; } // nullable
|
||||||
public DateTime AssignedDate { get; set; } // nullable
|
public DateTime AssignedDate { get; set; } // nullable
|
||||||
public DateTime RoleAssignedDate { get; set; } // nullable
|
public DateTime RoleAssignedDate { get; set; } // nullable
|
||||||
public DateTime CompletedDate { get; set; } // nullable
|
public DateTime CompletedDate { get; set; } // nullable
|
||||||
public string Comments { get; set; } // nullable
|
public string Comments { get; set; } // nullable
|
||||||
public byte? ApprovalType { get; set; }
|
public byte? ApprovalType { get; set; }
|
||||||
public Guid? BackToApprovalID { get; set; }
|
public Guid? BackToApprovalID { get; set; }
|
||||||
public int DocumentTypeID { get; set; }
|
public int DocumentTypeID { get; set; }
|
||||||
public bool DisplayDeniedDocument { get; set; }
|
public bool DisplayDeniedDocument { get; set; }
|
||||||
public bool Delegated { get; set; }
|
public bool Delegated { get; set; }
|
||||||
}
|
|
||||||
|
|
||||||
public class WorkflowSteps
|
|
||||||
{
|
|
||||||
public int WorkflowStepID { get; set; }
|
|
||||||
public int WorkflowID { get; set; }
|
|
||||||
public int WorkflowStepNumber { get; set; }
|
|
||||||
public string WorkFlowStepName { get; set; } // nullable
|
|
||||||
public int RoleID { get; set; }
|
|
||||||
public bool RulesApply { get; set; }
|
|
||||||
public int ApprovalType { get; set; }
|
|
||||||
public bool? AllowReject { get; set; }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class WorkflowSteps {
|
||||||
|
|
||||||
|
public int WorkflowStepID { get; set; }
|
||||||
|
public int WorkflowID { get; set; }
|
||||||
|
public int WorkflowStepNumber { get; set; }
|
||||||
|
public string WorkFlowStepName { get; set; } // nullable
|
||||||
|
public int RoleID { get; set; }
|
||||||
|
public bool RulesApply { get; set; }
|
||||||
|
public int ApprovalType { get; set; }
|
||||||
|
public bool? AllowReject { get; set; }
|
||||||
|
|
||||||
|
}
|
@ -1,4 +1,6 @@
|
|||||||
// --------------------------------------------------------------------------------------------------------------------
|
#if !NET8
|
||||||
|
|
||||||
|
// --------------------------------------------------------------------------------------------------------------------
|
||||||
// <copyright file="BinaryContentResult.cs" company="SemanticArchitecture">
|
// <copyright file="BinaryContentResult.cs" company="SemanticArchitecture">
|
||||||
// http://www.SemanticArchitecture.net pkalkie@gmail.com
|
// http://www.SemanticArchitecture.net pkalkie@gmail.com
|
||||||
// </copyright>
|
// </copyright>
|
||||||
@ -7,8 +9,7 @@
|
|||||||
// </summary>
|
// </summary>
|
||||||
// --------------------------------------------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
namespace Fab2ApprovalSystem.PdfGenerator
|
namespace Fab2ApprovalSystem.PdfGenerator {
|
||||||
{
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Web;
|
using System.Web;
|
||||||
using System.Web.Mvc;
|
using System.Web.Mvc;
|
||||||
@ -16,29 +17,27 @@ namespace Fab2ApprovalSystem.PdfGenerator
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// An ActionResult used to send binary data to the browser.
|
/// An ActionResult used to send binary data to the browser.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class BinaryContentResult : ActionResult
|
public class BinaryContentResult : ActionResult {
|
||||||
{
|
|
||||||
private readonly string contentType;
|
private readonly string contentType;
|
||||||
private readonly byte[] contentBytes;
|
private readonly byte[] contentBytes;
|
||||||
|
|
||||||
public BinaryContentResult(byte[] contentBytes, string contentType)
|
public BinaryContentResult(byte[] contentBytes, string contentType) {
|
||||||
{
|
|
||||||
this.contentBytes = contentBytes;
|
this.contentBytes = contentBytes;
|
||||||
this.contentType = contentType;
|
this.contentType = contentType;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void ExecuteResult(ControllerContext context)
|
public override void ExecuteResult(ControllerContext context) {
|
||||||
{
|
|
||||||
var response = context.HttpContext.Response;
|
var response = context.HttpContext.Response;
|
||||||
response.Clear();
|
response.Clear();
|
||||||
response.Cache.SetCacheability(HttpCacheability.Public);
|
response.Cache.SetCacheability(HttpCacheability.Public);
|
||||||
response.ContentType = this.contentType;
|
response.ContentType = this.contentType;
|
||||||
|
|
||||||
using (var stream = new MemoryStream(this.contentBytes))
|
using (var stream = new MemoryStream(this.contentBytes)) {
|
||||||
{
|
|
||||||
stream.WriteTo(response.OutputStream);
|
stream.WriteTo(response.OutputStream);
|
||||||
stream.Flush();
|
stream.Flush();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user