aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Integration/Observables/ObservablesContext.cs
blob: a21463c9b969d67881eb4e2feb521d9dc67d4e46 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #888888 } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { color: #008800; font-weight: bold } /* Keyword */
.highlight .ch { color: #888888 } /* Comment.Hashbang */
.highlight .cm { color: #888888 } /* Comment.Multiline */
.highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */
.highlight .cpf { color: #888888 } /* Comment.PreprocFile */
.highlight .c1 { color: #888888 } /* Comment.Single */
.highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */
.highlight .gr { color: #aa0000 } /* Generic.Error */
.highlight .gh { color: #333333 } /* Generic.Heading */
.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
.highlight .go { color: #888888 } /* Generic.Output */
.highlight .gp { color: #555555 } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #666666 } /* Generic.Subheading */
.highlight .gt { color: #aa0000 } /* Generic.Traceback */
.highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */
.highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */
.highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */
.highlight .kp { color: #008800 } /* Keyword.Pseudo */
.highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */
.highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */
.highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */
.highlight .na { color: #336699 } /* Name.Attribute */
.highlight .nb { color: #003388 } /* Name.Builtin */
.highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */
.highlight .no { color: #003366; font-weight: bold } /* Name.Constant */
.highlight .nd { color: #555555 } /* Name.Decorator */
.highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */
.highlight .nl { color: #336699; font-style: italic } /* Name.Label */
.highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */
.highlight .py { color: #336699; font-weight: bold } /* Name.Property */
.highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */
.highlight .nv { color: #336699 } /* Name.Variable */
.highlight .ow { color: #008800 } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */
.highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */
.highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */
.highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */
.highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */
.highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */
.highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */
.highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */
.highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */
.highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */
.highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */
.highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */
.highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */
.highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */
.highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */
.highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */
.highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */
.highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */
.highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */
.highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */
.highlight .vc { color: #336699 } /* Name.Variable.Class */
.highlight .vg { color: #dd7700 } /* Name.Variable.Global */
.highlight .vi { color: #3333bb } /* Name.Variable.Instance */
.highlight .vm { color: #336699 } /* Name.Variable.Magic */
.highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
<UserControl x:Class="Tango.PPC.UI.Views.LoginView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:vm="clr-namespace:Tango.PPC.UI.ViewModels"
			 xmlns:global="clr-namespace:Tango.PPC.UI"
             xmlns:controls="clr-namespace:Tango.PPC.Common.Controls;assembly=Tango.PPC.Common"
             xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch"
             xmlns:keyboard="clr-namespace:Tango.Touch.Keyboard;assembly=Tango.Touch"
             xmlns:local="clr-namespace:Tango.PPC.UI.Views"
             mc:Ignorable="d" 
             d:DesignHeight="1280" d:DesignWidth="720" Background="White" d:DataContext="{d:DesignInstance Type=vm:LoginViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.LoginViewVM}">
    <Grid>
        <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" x:Name="keyboardContainer">
            <Image Source="/Images/user-profile.png" Width="128" />
            <TextBlock Margin="0 10 0 0" HorizontalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}">Login to your account</TextBlock>

            <StackPanel Margin="0 60 0 0">
                <StackPanel Visibility="{Binding IsLoading,Converter={StaticResource BooleanToVisibilityInverseConverter}}">
                    <touch:TouchTextBox Text="{Binding Email,UpdateSourceTrigger=PropertyChanged,ValidatesOnDataErrors=True,ValidatesOnNotifyDataErrors=True}" Watermark="Email" KeyboardMode="Email" KeyboardAction="Next" KeyboardContainer="{Binding ElementName=keyboardContainer}" />
                    <touch:TouchTextBox Text="{Binding Password,UpdateSourceTrigger=PropertyChanged,ValidatesOnDataErrors=True,ValidatesOnNotifyDataErrors=True}" IsPassword="True" Margin="0 40 0 0" Watermark="Password" KeyboardMode="AlphaNumeric" KeyboardAction="Go" KeyboardContainer="{Binding ElementName=keyboardContainer}" />

                    <touch:TouchCheckBox Margin="0 30 0 0">Keep me signed in</touch:TouchCheckBox>

                    <touch:TouchButton Height="80" Margin="0 150 0 0" CornerRadius="40" Width="400" IsDefault="True" DelayCommand="{Binding LoginCommand}" DelayCommandDuration="00:00:0.4">LOGIN</touch:TouchButton>

                    <TextBlock HorizontalAlignment="Center" Margin="0 20 0 0">Forgot password?</TextBlock>
                </StackPanel>
                <StackPanel>
                    <controls:AsyncAdornerControl Height="130" Visibility="{Binding IsLoading,Converter={StaticResource BooleanToVisibilityConverter}}">
                        <StackPanel VerticalAlignment="Center">
                            <touch:TouchGifAnimation Source="/Images/preloader_rectangles.gif" EnableAnimation="{Binding IsLoading}" />
                        </StackPanel>
                    </controls:AsyncAdornerControl>
                </StackPanel>
            </StackPanel>
        </StackPanel>
    </Grid>
</UserControl>
#n326'>326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tango.Settings;

namespace Tango.Integration.Observables
{
    public class ObservablesContext : DbContext
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="ObservablesContext" /> class.
        /// </summary>
        /// <param name="path">The server file path.</param>
        /// <param name="isFile">if set to <c>true</c> will try to connect to an .mdf file.</param>
        public ObservablesContext(String path, bool isFile) : base(ComposeConnectionString(path, isFile))
        {

        }

        /// <summary>
        /// Composes the connection string.
        ///</summary>
        /// <param name="source">The source.</param>
        /// <param name="isFile">if set to <c>true</c> [is file].</param>
        /// <returns></returns>
        private static String ComposeConnectionString(String source, bool isFile)
        {
            if (!isFile)
            {
                return String.Format("Data Source={0};Initial Catalog=Tango;Integrated Security=true", source);
            }
            else
            {
                return null;
            }
        }

        /// <summary>
        /// Creates a default remote database context by the address specified in <see cref="SettingsManager.Default.DataBase.SQLServerAddress" />.
        /// </summary>
        /// <returns></returns>
        public static ObservablesContext CreateDefault()
        {
            return new ObservablesContext(SettingsManager.Default.DataBase.SQLServerAddress, false);
        }

        /// <summary>
        /// Gets or sets the ActionTypes.
        /// </summary>
        public DbSet<ActionType> ActionTypes 
        {
            get; set; 
        }

        /// <summary>
        /// Gets or sets the Addresses.
        /// </summary>
        public DbSet<Address> Addresses 
        {
            get; set; 
        }

        /// <summary>
        /// Gets or sets the ApplicationDisplayPanelVersions.
        /// </summary>
        public DbSet<ApplicationDisplayPanelVersion> ApplicationDisplayPanelVersions 
        {
            get; set; 
        }

        /// <summary>
        /// Gets or sets the ApplicationFirmwareVersions.
        /// </summary>
        public DbSet<ApplicationFirmwareVersion> ApplicationFirmwareVersions 
        {
            get; set; 
        }

        /// <summary>
        /// Gets or sets the ApplicationOsVersions.
        /// </summary>
        public DbSet<ApplicationOsVersion> ApplicationOsVersions 
        {
            get; set; 
        }

        /// <summary>
        /// Gets or sets the ApplicationVersions.
        /// </summary>
        public DbSet<ApplicationVersion> ApplicationVersions 
        {
            get; set; 
        }

        /// <summary>
        /// Gets or sets the BrushStops.
        /// </summary>
        public DbSet<BrushStop> BrushStops 
        {
            get; set; 
        }

        /// <summary>
        /// Gets or sets the CartridgeTypes.
        /// </summary>
        public DbSet<CartridgeType> CartridgeTypes 
        {
            get; set; 
        }

        /// <summary>
        /// Gets or sets the Cats.
        /// </summary>
        public DbSet<Cat> Cats 
        {
            get; set; 
        }

        /// <summary>
        /// Gets or sets the Ccts.
        /// </summary>
        public DbSet<Cct> Ccts 
        {
            get; set; 
        }

        /// <summary>
        /// Gets or sets the ColorSpaces.
        /// </summary>
        public DbSet<ColorSpace> ColorSpaces 
        {
            get; set; 
        }

        /// <summary>
        /// Gets or sets the Configurations.
        /// </summary>
        public DbSet<Configuration> Configurations 
        {
            get; set; 
        }

        /// <summary>
        /// Gets or sets the Contacts.
        /// </summary>
        public DbSet<Contact> Contacts 
        {
            get; set; 
        }

        /// <summary>
        /// Gets or sets the DispenserTypes.
        /// </summary>
        public DbSet<DispenserType> DispenserTypes 
        {
            get; set; 
        }

        /// <summary>
        /// Gets or sets the EmbeddedFirmwareVersions.
        /// </summary>
        public DbSet<EmbeddedFirmwareVersion> EmbeddedFirmwareVersions 
        {
            get; set; 
        }

        /// <summary>
        /// Gets or sets the EmbeddedSoftwareVersions.
        /// </summary>
        public DbSet<EmbeddedSoftwareVersion> EmbeddedSoftwareVersions 
        {
            get; set; 
        }

        /// <summary>
        /// Gets or sets the EventTypes.
        /// </summary>
        public DbSet<EventType> EventTypes 
        {
            get; set; 
        }

        /// <summary>
        /// Gets or sets the EventTypesActions.
        /// </summary>
        public DbSet<EventTypesAction> EventTypesActions 
        {
            get; set; 
        }

        /// <summary>
        /// Gets or sets the FiberShapes.
        /// </summary>
        public DbSet<FiberShape> FiberShapes 
        {
            get; set; 
        }

        /// <summary>
        /// Gets or sets the FiberSynths.
        /// </summary>
        public DbSet<FiberSynth> FiberSynths 
        {
            get; set; 
        }

        /// <summary>
        /// Gets or sets the HardwareVersions.
        /// </summary>
        public DbSet<HardwareVersion> HardwareVersions 
        {
            get; set; 
        }

        /// <summary>
        /// Gets or sets the IdsPackFormulas.
        /// </summary>
        public DbSet<IdsPackFormula> IdsPackFormulas 
        {
            get; set; 
        }

        /// <summary>
        /// Gets or sets the IdsPacks.
        /// </summary>
        public DbSet<IdsPack> IdsPacks 
        {
            get; set; 
        }

        /// <summary>
        /// Gets or sets the JobRuns.
        /// </summary>
        public DbSet<JobRun> JobRuns 
        {
            get; set; 
        }

        /// <summary>
        /// Gets or sets the Jobs.
        /// </summary>
        public DbSet<Job> Jobs 
        {
            get; set; 
        }

        /// <summary>
        /// Gets or sets the LinearMassDensityUnits.
        /// </summary>
        public DbSet<LinearMassDensityUnit> LinearMassDensityUnits 
        {
            get; set; 
        }

        /// <summary>
        /// Gets or sets the LiquidTypes.
        /// </summary>
        public DbSet<LiquidType> LiquidTypes 
        {
            get; set; 
        }

        /// <summary>
        /// Gets or sets the LiquidTypesRmls.
        /// </summary>
        public DbSet<LiquidTypesRml> LiquidTypesRmls 
        {
            get; set; 
        }

        /// <summary>
        /// Gets or sets the MachineVersions.
        /// </summary>
        public DbSet<MachineVersion> MachineVersions 
        {
            get; set; 
        }

        /// <summary>
        /// Gets or sets the Machines.
        /// </summary>
        public DbSet<Machine> Machines 
        {
            get; set; 
        }

        /// <summary>
        /// Gets or sets the MachinesConfigurations.
        /// </summary>
        public DbSet<MachinesConfiguration> MachinesConfigurations 
        {
            get; set; 
        }

        /// <summary>
        /// Gets or sets the MachinesEvents.
        /// </summary>
        public DbSet<MachinesEvent> MachinesEvents 
        {
            get; set; 
        }

        /// <summary>
        /// Gets or sets the MediaColors.
        /// </summary>
        public DbSet<MediaColor> MediaColors 
        {
            get; set; 
        }

        /// <summary>
        /// Gets or sets the MediaConditions.
        /// </summary>
        public DbSet<MediaCondition> MediaConditions 
        {
            get; set; 
        }

        /// <summary>
        /// Gets or sets the MediaMaterials.
        /// </summary>
        public DbSet<MediaMaterial> MediaMaterials 
        {
            get; set; 
        }

        /// <summary>
        /// Gets or sets the MediaPurposes.
        /// </summary>
        public DbSet<MediaPurpos> MediaPurposes 
        {
            get; set; 
        }

        /// <summary>
        /// Gets or sets the MidTankTypes.
        /// </summary>
        public DbSet<MidTankType> MidTankTypes 
        {
            get; set; 
        }

        /// <summary>
        /// Gets or sets the Organizations.
        /// </summary>
        public DbSet<Organization> Organizations 
        {
            get; set; 
        }

        /// <summary>
        /// Gets or sets the Permissions.
        /// </summary>
        public DbSet<Permission> Permissions 
        {
            get; set; 
        }

        /// <summary>
        /// Gets or sets the ProcessParametersTables.
        /// </summary>
        public DbSet<ProcessParametersTable> ProcessParametersTables 
        {
            get; set; 
        }

        /// <summary>
        /// Gets or sets the ProcessParametersTablesGroups.
        /// </summary>
        public DbSet<ProcessParametersTablesGroup> ProcessParametersTablesGroups 
        {
            get; set; 
        }

        /// <summary>
        /// Gets or sets the Rmls.
        /// </summary>
        public DbSet<Rml> Rmls 
        {
            get; set; 
        }

        /// <summary>
        /// Gets or sets the Roles.
        /// </summary>
        public DbSet<Role> Roles 
        {
            get; set; 
        }

        /// <summary>
        /// Gets or sets the RolesPermissions.
        /// </summary>
        public DbSet<RolesPermission> RolesPermissions 
        {
            get; set; 
        }

        /// <summary>
        /// Gets or sets the Segments.
        /// </summary>
        public DbSet<Segment> Segments 
        {
            get; set; 
        }

        /// <summary>
        /// Gets or sets the SyncConfigurations.
        /// </summary>
        public DbSet<SyncConfiguration> SyncConfigurations 
        {
            get; set; 
        }

        /// <summary>
        /// Gets or sets the TechDispensers.
        /// </summary>
        public DbSet<TechDispenser> TechDispensers 
        {
            get; set; 
        }

        /// <summary>
        /// Gets or sets the TechIos.
        /// </summary>
        public DbSet<TechIo> TechIos 
        {
            get; set; 
        }

        /// <summary>
        /// Gets or sets the TechMonitors.
        /// </summary>
        public DbSet<TechMonitor> TechMonitors 
        {
            get; set; 
        }

        /// <summary>
        /// Gets or sets the TechMotors.
        /// </summary>
        public DbSet<TechMotor> TechMotors 
        {
            get; set; 
        }

        /// <summary>
        /// Gets or sets the TechValves.
        /// </summary>
        public DbSet<TechValf> TechValves 
        {
            get; set; 
        }

        /// <summary>
        /// Gets or sets the Users.
        /// </summary>
        public DbSet<User> Users 
        {
            get; set; 
        }

        /// <summary>
        /// Gets or sets the UsersRoles.
        /// </summary>
        public DbSet<UsersRole> UsersRoles 
        {
            get; set; 
        }

        /// <summary>
        /// Gets or sets the WindingMethods.
        /// </summary>
        public DbSet<WindingMethod> WindingMethods 
        {
            get; set; 
        }

    }
}