Beispiel #1
0
 public SaveHeatCommand(HeatViewModel viewModel, IHeatRepositories repo,
     IUserNotify notify)
 {
     this.viewModel = viewModel;
     this.notify = notify;
     this.repo = repo;
 }
 public ShipReleaseNoteCommand(ReleaseNoteViewModel viewModel, IReleaseNoteRepositories repo, IUserNotify notify, ISecurityContext ctx)
 {
     this.viewModel = viewModel;
     this.repos     = repo;
     this.notify    = notify;
     this.ctx       = ctx;
 }
 public EditPipeForCutCommand(SpoolViewModel viewModel, ISpoolRepositories repos, IUserNotify notify, ISecurityContext ctx)
 {
     this.viewModel = viewModel;
     this.repos = repos;
     this.notify = notify;
     this.ctx = ctx;
 }
Beispiel #4
0
        public ReleaseNoteViewModel(IReleaseNoteRepositories repos, Guid id, IUserNotify notify, ISecurityContext ctx)
        {
            this.repos  = repos;
            this.notify = notify;
            this.ctx    = ctx;

            saveCommand   = ViewModelSource.Create(() => new SaveReleaseNoteCommand(this, repos, notify, ctx));
            shipCommand   = ViewModelSource.Create(() => new ShipReleaseNoteCommand(this, repos, notify, ctx));
            unshipCommand = ViewModelSource.Create(() => new UnshipReleaseNoteCommand(this, repos, notify, ctx));

            ReleaseNotePipes = new PlainPipeBindingList();
            if (id == Guid.Empty)
            {
                NewRailcar();
            }
            else
            {
                ReleaseNote = repos.ReleaseNoteRepo.Get(id);
                if (ReleaseNote == null)
                {
                    log.Error(string.Format("Release Note (id:{0}) does not exist.", id));
                    // TODO: user message? close document?
                }
                else
                {
                    IList <Pipe> pipes = repos.ReleaseNoteRepo.GetReleasedNotePipe(id);
                    foreach (var p in pipes)
                    {
                        ReleaseNotePipes.Add(new PlainPipe(p));
                    }
                }
            }
        }
        public PartInspectionViewModel(ISession session, IPartInspectionRepository repos, IUserNotify notify, ISecurityContext ctx)
        {
            try
            {
                this.session = session;
                this.repos = repos;
                this.notify = notify;
                this.ctx = ctx;

                this.Inspectors = repos.RepoInspector.GetAll();
                if(this.Inspectors == null || this.Inspectors.Count <= 0)
                    log.Warn("Incoming Inspection of Componentry: List of Inspectors is NULL or empty");

                searchCommand = ViewModelSource.Create(() => new SearchPartForInspectionCommand(this, session, ctx));
                saveInspectionTestResultsCommand = ViewModelSource.Create(() => new SaveInspectionTestResultsCommand(repos.RepoInspectionTestResult, this, notify, ctx));
                saveAndClearTestResultsCommand = ViewModelSource.Create(() => new SaveAndClearTestResultsCommand(this));
                this.Inspectors = repos.RepoInspector.GetAll();
            }
            catch(RepositoryException ex)
            {
                log.Warn(this.GetType().Name + " | " + ex.ToString());
                notify.ShowWarning(Program.LanguageManager.GetString(StringResources.Notification_Error_Db_Message),
            Program.LanguageManager.GetString(StringResources.Notification_Error_Db_Header));
            }
        }
        public PartInspectionViewModel(ISession session, IPartInspectionRepository repos, IUserNotify notify, ISecurityContext ctx)
        {
            try
            {
                this.session = session;
                this.repos   = repos;
                this.notify  = notify;
                this.ctx     = ctx;

                this.Inspectors = repos.RepoInspector.GetAll();
                if (this.Inspectors == null || this.Inspectors.Count <= 0)
                {
                    log.Warn("Incoming Inspection of Componentry: List of Inspectors is NULL or empty");
                }

                searchCommand = ViewModelSource.Create(() => new SearchPartForInspectionCommand(this, session, ctx));
                saveInspectionTestResultsCommand = ViewModelSource.Create(() => new SaveInspectionTestResultsCommand(repos.RepoInspectionTestResult, this, notify, ctx));
                saveAndClearTestResultsCommand   = ViewModelSource.Create(() => new SaveAndClearTestResultsCommand(this));
                this.Inspectors = repos.RepoInspector.GetAll();
            }
            catch (RepositoryException ex)
            {
                log.Warn(this.GetType().Name + " | " + ex.ToString());
                notify.ShowWarning(Program.LanguageManager.GetString(StringResources.Notification_Error_Db_Message),
                                   Program.LanguageManager.GetString(StringResources.Notification_Error_Db_Header));
            }
        }
 public JointSearchViewModel(IJointRepository repo, IUserNotify notify)
 {
     this.repo = repo;
     this.notify = notify;
     searchCommand = ViewModelSource.Create(() => new JointSearchCommand(this, repo, notify));
     LoadStatuses();
 }
 public InspectionReportsViewModel(IMillReportsRepository repo, IUserNotify notify)
 {
     this.repo      = repo;
     this.notify    = notify;
     createCommand  = ViewModelSource.Create <CreateReportCommand>(() => new CreateReportCommand(this, repo, notify));
     previewCommand = ViewModelSource.Create <PreviewReportCommand>(() => new PreviewReportCommand(this, repo, notify));
 }
Beispiel #9
0
 public SaveHeatCommand(HeatViewModel viewModel, IHeatRepositories repo,
                        IUserNotify notify)
 {
     this.viewModel = viewModel;
     this.notify    = notify;
     this.repo      = repo;
 }
 public SaveSettingsCommand(SettingsViewModel viewModel, ISettingsRepositories repos, IUserNotify notify, ISecurityContext ctx)
 {
     this.viewModel = viewModel;
     this.repos = repos;
     this.notify = notify;
     this.ctx = ctx;
 }
 public InspectionReportsViewModel(IMillReportsRepository repo, IUserNotify notify)
 {
     this.repo = repo;
     this.notify = notify;
     createCommand = ViewModelSource.Create<CreateReportCommand>(() => new CreateReportCommand(this, repo, notify));
     previewCommand = ViewModelSource.Create<PreviewReportCommand>(() => new PreviewReportCommand(this, repo, notify));
 }
 public SaveInspectionTestResultsCommand(IInspectionTestResultRepository repo, PartInspectionViewModel viewModel, IUserNotify notify, ISecurityContext ctx)
 {
     this.repo = repo;
     this.viewModel = viewModel;
     this.notify = notify;
     this.ctx = ctx;
 }
        public ConstructionReportViewModel(
            IMillReportsRepository repo,
            IJointRepository repoJoint,
            IUserNotify notify)
        {
            this.repo   = repo;
            this.notify = notify;

            this.data = repo.GetPipelineElements(SQLProvider.GetQuery(SQLProvider.SQLStatic.GetWeldedParts).ToString());
            if (this.data == null || this.data.Rows.Count <= 0)
            {
                log.Warn("Report at Construction: Data Table of Pieces is NULL or empty.");
            }

            this.partDataList = FormWeldedParts(data);

            this.Joints = repoJoint.GetAll()
                          .Where <construct.Joint>(x => x.FirstElement != null && x.SecondElement != null)
                          .ToList <construct.Joint>();
            if (this.Joints == null || this.Joints.Count <= 0)
            {
                log.Warn("Report at Construction: List of Joints is NULL or empty.");
            }


            createCommand = ViewModelSource
                            .Create <CreateReportCommand>(() => new CreateReportCommand(this, repo, notify));

            previewCommand = ViewModelSource
                             .Create <PreviewReportCommand>(() => new PreviewReportCommand(this, repo, notify));

            reportCommand = ViewModelSource
                            .Create <ReportCommand>(() => new ReportCommand(this, repo, notify));
        }
 public SaveReleaseNoteCommand(ReleaseNoteViewModel viewModel, IReleaseNoteRepositories repo, IUserNotify notify, ISecurityContext ctx)
 {
     this.viewModel = viewModel;
     this.repos = repo;
     this.notify = notify;
     this.ctx = ctx;
 }
Beispiel #15
0
 public JointSearchViewModel(IJointRepository repo, IUserNotify notify)
 {
     this.repo     = repo;
     this.notify   = notify;
     searchCommand = ViewModelSource.Create(() => new JointSearchCommand(this, repo, notify));
     LoadStatuses();
 }
Beispiel #16
0
 public SaveSettingsCommand(SettingsViewModel viewModel, ISettingsRepositories repos, IUserNotify notify, ISecurityContext ctx)
 {
     this.viewModel = viewModel;
     this.repos     = repos;
     this.notify    = notify;
     this.ctx       = ctx;
 }
Beispiel #17
0
 public JointSearchCommand(JointSearchViewModel vm, IJointRepository repo,
                           IUserNotify notify)
 {
     viewModel   = vm;
     this.repo   = repo;
     this.notify = notify;
 }
        public ConstructionReportViewModel(
            IMillReportsRepository repo, 
            IJointRepository repoJoint, 
            IUserNotify notify)
        {
            this.repo = repo;
            this.notify = notify;
            this.repoJoint = repoJoint;

            this.JointsProjections = repoJoint
                .GetJointsProjections()
                .SetResultTransformer(Transformers.AliasToBean<JointProjection>())
                .List<JointProjection>();

            if (this.JointsProjections == null || this.JointsProjections.Count <= 0)
                log.Warn( "Report at Construction: List of Joints is NULL or empty." );

            createCommand = ViewModelSource
                .Create<CreateReportCommand>(() => new CreateReportCommand(this, repo, notify));

            previewCommand = ViewModelSource
                .Create<PreviewReportCommand>(() => new PreviewReportCommand(this, repo, notify));

            reportCommand = ViewModelSource
                .Create<ReportCommand>(() => new ReportCommand(this, repo, repoJoint, notify));

        }
Beispiel #19
0
 public NewSaveJointCommand(IConstructionRepository repo, JointNewEditViewModel viewModel, IUserNotify notify, ISecurityContext ctx)
 {
     this.repo      = repo;
     this.viewModel = viewModel;
     this.notify    = notify;
     this.ctx       = ctx;
 }
        public ConstructionReportViewModel(
            IMillReportsRepository repo,
            IJointRepository repoJoint,
            IUserNotify notify)
        {
            this.repo      = repo;
            this.notify    = notify;
            this.repoJoint = repoJoint;

            this.JointsProjections = repoJoint
                                     .GetJointsProjections()
                                     .SetResultTransformer(Transformers.AliasToBean <JointProjection>())
                                     .List <JointProjection>();

            if (this.JointsProjections == null || this.JointsProjections.Count <= 0)
            {
                log.Warn("Report at Construction: List of Joints is NULL or empty.");
            }

            createCommand = ViewModelSource
                            .Create <CreateReportCommand>(() => new CreateReportCommand(this, repo, notify));

            previewCommand = ViewModelSource
                             .Create <PreviewReportCommand>(() => new PreviewReportCommand(this, repo, notify));

            reportCommand = ViewModelSource
                            .Create <ReportCommand>(() => new ReportCommand(this, repo, repoJoint, notify));
        }
 public JointSearchCommand(JointSearchViewModel vm, IJointRepository repo,
     IUserNotify notify)
 {
     viewModel = vm;
     this.repo = repo;
     this.notify = notify;
 }
Beispiel #22
0
 public SaveInspectionTestResultsCommand(IInspectionTestResultRepository repo, PartInspectionViewModel viewModel, IUserNotify notify, ISecurityContext ctx)
 {
     this.repo      = repo;
     this.viewModel = viewModel;
     this.notify    = notify;
     this.ctx       = ctx;
 }
Beispiel #23
0
 public SpoolDeactivationCommand(ISpoolRepositories repo, SpoolViewModel viewModel, IUserNotify notify, ISecurityContext ctx)
 {
     this.repo      = repo;
     this.viewModel = viewModel;
     this.notify    = notify;
     this.ctx       = ctx;
 }
 public JointDeactivationCommand(IConstructionRepository repo, JointNewEditViewModel viewModel, IUserNotify notify, ISecurityContext ctx)
 {
     this.repo = repo;
     this.viewModel = viewModel;
     this.notify = notify;
     this.ctx = ctx;
 }
 public SpoolDeactivationCommand(ISpoolRepositories repo, SpoolViewModel viewModel, IUserNotify notify, ISecurityContext ctx)
 {
     this.repo = repo;
     this.viewModel = viewModel;
     this.notify = notify;
     this.ctx = ctx;
 }
 public EditPipeForCutCommand(SpoolViewModel viewModel, ISpoolRepositories repos, IUserNotify notify, ISecurityContext ctx)
 {
     this.viewModel = viewModel;
     this.repos     = repos;
     this.notify    = notify;
     this.ctx       = ctx;
 }
 public MainViewModel(VendingMachineCore vendingMachine, User user, IUserNotify userNotify)
 {
     this.vendingMachine = vendingMachine;
     this.user = user;
     this.userNotify = userNotify;
     UserViewModel = new UserViewModel(user);
     VendingMachineViewModel=new VendingMachineViewModel(vendingMachine);
 }
Beispiel #28
0
 public CreatePipeReportCommand(
     PipeConstractionReportViewModel viewModel,
     IMillReportsRepository repo,
     IUserNotify notify)
 {
     this.viewModel = viewModel;
     this.repo      = repo;
     this.notify    = notify;
 }
Beispiel #29
0
 public JointCutCommand(
     IConstructionRepository repo, 
     JointNewEditViewModel viewModel, 
     IUserNotify notify)
 {
     this.repo = repo;
     this.viewModel = viewModel;
     this.notify = notify;
 }
 public MillPipeSearchCommand(
     MillPipeSearchViewModel viewModel,
     IPipeRepository repo,
     IUserNotify notify)
 {
     this.viewModel = viewModel;
     this.repo = repo;
     this.notify = notify;
 }
 public CreateRepoCommand(
     WeldDateReportViewModel viewModel,
     IMillReportsRepository repo,
     IUserNotify notify)
 {
     this.viewModel = viewModel;
     this.repo      = repo;
     this.notify    = notify;
 }
Beispiel #32
0
 public MillPipeSearchCommand(
     MillPipeSearchViewModel viewModel,
     IPipeRepository repo,
     IUserNotify notify)
 {
     this.viewModel = viewModel;
     this.repo      = repo;
     this.notify    = notify;
 }
Beispiel #33
0
 public ExtractCategoriesCommand(
     SettingsViewModel viewModel,
     ISettingsRepositories repos,
     IUserNotify notify)
 {
     this.viewModel = viewModel;
     this.repos     = repos;
     this.notify    = notify;
 }
 public CreateRepoCommand(
     WeldDateReportViewModel viewModel,
     IMillReportsRepository repo,
     IUserNotify notify)
 {
     this.viewModel = viewModel;
     this.repo = repo;
     this.notify = notify;
 }
Beispiel #35
0
 public SearchReleaseNoteCommand(
     ReleaseNoteSearchViewModel viewmodel,
     IReleaseNoteRepository repo,
     IUserNotify notify)
 {
     this.viewModel = viewmodel;
     this.repo      = repo;
     this.notify    = notify;
 }
 public PreviewReportCommand(
     ConstructionReportViewModel viewModel, 
     IMillReportsRepository repo, 
     IUserNotify notify)
 {
     this.viewModel = viewModel;
     this.repo = repo;
     this.notify = notify;
 }
 public PreviewReportCommand(
     ConstructionReportViewModel viewModel,
     IMillReportsRepository repo,
     IUserNotify notify)
 {
     this.viewModel = viewModel;
     this.repo      = repo;
     this.notify    = notify;
 }
 public ExtractCategoriesCommand(
     SettingsViewModel viewModel, 
     ISettingsRepositories repos, 
     IUserNotify notify)
 {
     this.viewModel = viewModel;
     this.repos = repos;
     this.notify = notify;
 }
 public CreatePipeReportCommand(
     PipeConstractionReportViewModel viewModel,
     IMillReportsRepository repo,
     IUserNotify notify)
 {
     this.viewModel = viewModel;
     this.repo = repo;
     this.notify = notify;
 }
Beispiel #40
0
 public JointCutCommand(
     IConstructionRepository repo,
     JointNewEditViewModel viewModel,
     IUserNotify notify)
 {
     this.repo      = repo;
     this.viewModel = viewModel;
     this.notify    = notify;
 }
        public ComponentNewEditViewModel(
            IComponentRepositories repos,
            Guid id,
            IUserNotify notify,
            ISecurityContext context)
        {
            this.repos   = repos;
            this.notify  = notify;
            this.context = context;

            try
            {
                this.componentTypes = new BindingList <ComponentType>(repos.ComponentTypeRepo.GetAll());
                this.Inspectors     = repos.RepoInspector.GetAll();
            }
            catch (RepositoryException ex)
            {
                log.Warn("ComponentNewEditViewModel " + ex.ToString());
                notify.ShowWarning(Program.LanguageManager.GetString(StringResources.Notification_Error_Db_Message),
                                   Program.LanguageManager.GetString(StringResources.Notification_Error_Db_Header));
            }


            saveCommand = ViewModelSource
                          .Create(() => new SaveComponentCommand(this, repos, notify, context));

            newSaveCommand = ViewModelSource
                             .Create(() => new NewSaveComponentCommand(this, repos, notify, context));

            deactivationCommand = ViewModelSource
                                  .Create(() => new ComponentDeactivationCommand(this, repos, notify, context));


            if (id == Guid.Empty)
            {
                NewComponent();
            }
            else
            {
                try
                {
                    this.Component = repos.ComponentRepo.Get(id);
                }
                catch (RepositoryException ex)
                {
                    log.Warn("ComponentNewEditViewModel " + ex.ToString());
                    notify.ShowWarning(Program.LanguageManager.GetString(StringResources.Notification_Error_Db_Message),
                                       Program.LanguageManager.GetString(StringResources.Notification_Error_Db_Header));
                }
            }

            if (this.Inspectors == null || this.Inspectors.Count <= 0)
            {
                log.Warn(string.Format("Componentry (id:{0}) creation: List of Inspectors is NULL or empty", id));
            }
        }
        public ComponentNewEditViewModel(
            IComponentRepositories repos,
            Guid id,
            IUserNotify notify,
            ISecurityContext context)
        {
            this.repos = repos;
            this.notify = notify;
            this.context = context;

            try
            {
                this.componentTypes = new BindingList<ComponentType>(repos.ComponentTypeRepo.GetAll());
                this.Inspectors = repos.RepoInspector.GetAll();
            }
            catch(RepositoryException ex)
            {
                log.Warn("ComponentNewEditViewModel " + ex.ToString());
                notify.ShowWarning(Program.LanguageManager.GetString(StringResources.Notification_Error_Db_Message),
            Program.LanguageManager.GetString(StringResources.Notification_Error_Db_Header));
                
            }
            
            
            saveCommand = ViewModelSource
                .Create(() => new SaveComponentCommand(this, repos, notify, context));

            newSaveCommand = ViewModelSource
                .Create(() => new NewSaveComponentCommand(this, repos, notify, context));

            deactivationCommand = ViewModelSource
                .Create(() => new ComponentDeactivationCommand(this, repos, notify, context));


            if (id == Guid.Empty)
            {
                NewComponent();
            }
            else
            {
                try
                {
                    this.Component = repos.ComponentRepo.Get(id);
                }
                catch(RepositoryException ex)
                {
                    log.Warn("ComponentNewEditViewModel " + ex.ToString());
                    notify.ShowWarning(Program.LanguageManager.GetString(StringResources.Notification_Error_Db_Message),
                Program.LanguageManager.GetString(StringResources.Notification_Error_Db_Header));
                }
                
            }

            if(this.Inspectors == null || this.Inspectors.Count <=0)
                log.Warn(string.Format("Componentry (id:{0}) creation: List of Inspectors is NULL or empty", id));
        }
 public MillReportsViewModel(IMillReportsRepository repo, IUserNotify notify, ICategoryRepository repoCategory)
 {
     this.repo = repo;
     this.notify = notify;
     this.repoCategory = repoCategory;
     createCommand = ViewModelSource.Create<CreateReportCommand>(() => new CreateReportCommand(this, repo, notify));
     previewCommand = ViewModelSource.Create<PreviewReportCommand>(() => new PreviewReportCommand(this, repo, notify));
     GetAllCategories();
     LoadAllReportTypes();
 }
Beispiel #44
0
 public MillReportsViewModel(IMillReportsRepository repo, IUserNotify notify, ICategoryRepository repoCategory)
 {
     this.repo         = repo;
     this.notify       = notify;
     this.repoCategory = repoCategory;
     createCommand     = ViewModelSource.Create <CreateReportCommand>(() => new CreateReportCommand(this, repo, notify));
     previewCommand    = ViewModelSource.Create <PreviewReportCommand>(() => new PreviewReportCommand(this, repo, notify));
     GetAllCategories();
     LoadAllReportTypes();
 }
 public NewSavePipeCommand(
     MillPipeNewEditViewModel viewModel,
     IMillRepository repo,
     IUserNotify notify,
     ISecurityContext ctx)
 {
     this.viewModel = viewModel;
     this.repo = repo;
     this.notify = notify;
     this.ctx = ctx;
 }
 public NewSaveComponentCommand(
     ComponentNewEditViewModel viewModel,
     IComponentRepositories repo, 
     IUserNotify notify,
     ISecurityContext ctx)
 {
     this.viewModel = viewModel;
     this.repos = repo;
     this.notify = notify;
     this.ctx = ctx;
 }
Beispiel #47
0
 public SaveComponentCommand(
     ComponentNewEditViewModel viewModel,
     IComponentRepositories repo,
     IUserNotify notify,
     ISecurityContext ctx)
 {
     this.viewModel = viewModel;
     this.repos     = repo;
     this.notify    = notify;
     this.ctx       = ctx;
 }
Beispiel #48
0
 public NewSavePipeCommand(
     MillPipeNewEditViewModel viewModel,
     IMillRepository repo,
     IUserNotify notify,
     ISecurityContext ctx)
 {
     this.viewModel = viewModel;
     this.repo      = repo;
     this.notify    = notify;
     this.ctx       = ctx;
 }
 public ExternalFilesViewModel(IExternalFilesRepositories repos, IUserNotify notify)
 {
     this.repos = repos;
     this.notify = notify;
    
     addExternalFileCommand =
       ViewModelSource.Create(() => new AddExternalFileCommand(repos.FileRepo, this, notify));
     downloadFileCommand =
       ViewModelSource.Create(() => new DownloadFileCommand(repos.FileRepo, this, notify));
     viewFileCommand =
       ViewModelSource.Create(() => new ViewFileCommand(repos.FileRepo, this, notify));
     sizeLimit = repos.ProjectRepo.GetSingle().DocumentSizeLimit;
 }
Beispiel #50
0
        public ExternalFilesViewModel(IExternalFilesRepositories repos, IUserNotify notify)
        {
            this.repos  = repos;
            this.notify = notify;

            addExternalFileCommand =
                ViewModelSource.Create(() => new AddExternalFileCommand(repos.FileRepo, this, notify));
            downloadFileCommand =
                ViewModelSource.Create(() => new DownloadFileCommand(repos.FileRepo, this, notify));
            viewFileCommand =
                ViewModelSource.Create(() => new ViewFileCommand(repos.FileRepo, this, notify));
            sizeLimit = repos.ProjectRepo.GetSingle().DocumentSizeLimit;
        }
Beispiel #51
0
        public HeatViewModel(IHeatRepositories heatRepository, string heatNumber, IUserNotify notify)
        {
            this.notify = notify;
            this.repo = heatRepository;
            saveCommand = ViewModelSource.Create(() => new SaveHeatCommand(this, repo, notify));

            var heat = GetHeatByNumber(heatNumber);
            if(heat != null)
            {
                Heat = heat;
                SetupManufacturers();
                heats = new List<Prizm.Domain.Entity.Mill.Heat>() { heat };
            }

        }
Beispiel #52
0
        public MillPipeSearchViewModel(
            IMillRepository repoMill,
            IUserNotify notify)
        {
            this.repoMill = repoMill;
            this.notify   = notify;

            searchCommand = ViewModelSource.Create <MillPipeSearchCommand>(
                () => new MillPipeSearchCommand(this, repoMill.RepoPipe, notify));

            pipeTypes        = repoMill.RepoPipeType.GetAll();
            checkedPipeTypes = repoMill.RepoPipeType.GetAll();

            LoadStatuses();
        }
Beispiel #53
0
        public AuditViewModel(IAuditRepository repo, IUserNotify notify)
        {
            this.repo   = repo;
            this.notify = notify;

            try
            {
                UsersList     = repo.AuditLogRepo.GetAllUsers();
                searchCommand = ViewModelSource.Create(() => new AuditSearchCommand(this, repo.AuditLogRepo, notify));
            }
            catch (RepositoryException ex)
            {
                log.Warn("AuditViewModel " + ex.ToString());
                notify.ShowWarning(Program.LanguageManager.GetString(StringResources.Notification_Error_Db_Message),
                                   Program.LanguageManager.GetString(StringResources.Notification_Error_Db_Header));
            }
        }
        public SettingsViewModel(ISettingsRepositories repos, IUserNotify notify, ISecurityContext ctx)
        {
            NewPipeMillSizeType();
            this.repos  = repos;
            this.notify = notify;
            this.ctx    = ctx;

            saveCommand = ViewModelSource
                          .Create <SaveSettingsCommand>(() => new SaveSettingsCommand(this, repos, notify, ctx));

            extractCategoriesCommand = ViewModelSource
                                       .Create <ExtractCategoriesCommand>(() => new ExtractCategoriesCommand(this, repos, notify));

            this.ExtractCategoriesCommand.Execute();
            CategoryTypes.ListChanged += (s, e) => ModifiableView.IsModified = true;
            PipeTests.ListChanged     += (s, e) => ModifiableView.IsModified = true;
        }
        public SettingsViewModel(ISettingsRepositories repos, IUserNotify notify, ISecurityContext ctx)
        {
            NewPipeMillSizeType();
            this.repos = repos;
            this.notify = notify;
            this.ctx = ctx;

            saveCommand = ViewModelSource
                .Create<SaveSettingsCommand>(() => new SaveSettingsCommand(this, repos, notify, ctx));

            extractCategoriesCommand = ViewModelSource
                .Create<ExtractCategoriesCommand>(() => new ExtractCategoriesCommand(this, repos, notify));

            this.ExtractCategoriesCommand.Execute();
            CategoryTypes.ListChanged += (s, e) => ModifiableView.IsModified = true;
            PipeTests.ListChanged += (s, e) => ModifiableView.IsModified = true;

        }
Beispiel #56
0
        public AuditViewModel(IAuditRepository repo, IUserNotify notify)
        {
            this.repo = repo;
            this.notify = notify;

            try
            {
                UsersList = repo.AuditLogRepo.GetAllUsers();
                searchCommand = ViewModelSource.Create(() => new AuditSearchCommand(this, repo.AuditLogRepo, notify));
            }
            catch(RepositoryException ex)
            {
                log.Warn("AuditViewModel " + ex.ToString());
                notify.ShowWarning(Program.LanguageManager.GetString(StringResources.Notification_Error_Db_Message),
            Program.LanguageManager.GetString(StringResources.Notification_Error_Db_Header));
            }

        }
Beispiel #57
0
        public HeatViewModel(IHeatRepositories heatRepository, string heatNumber, IUserNotify notify)
        {
            this.notify = notify;
            this.repo   = heatRepository;
            saveCommand = ViewModelSource.Create(() => new SaveHeatCommand(this, repo, notify));

            var heat = GetHeatByNumber(heatNumber);

            if (heat != null)
            {
                Heat = heat;
                SetupManufacturers();
                heats = new List <Prizm.Domain.Entity.Mill.Heat>()
                {
                    heat
                };
            }
        }
        public PipeConstractionReportViewModel(
            IMillReportsRepository repo, 
            IMillPipeSizeTypeRepository repoPipeType,
            IUserNotify notify)
        {
            this.repo = repo;
            this.notify = notify;
            this.repoPipeType = repoPipeType;

            createCommand = ViewModelSource
                .Create<CreatePipeReportCommand>(() => new CreatePipeReportCommand(this, repo, notify));

            previewCommand = ViewModelSource
                .Create<PreviewPipeReportCommand>(() => new PreviewPipeReportCommand(this, repo, notify));

            pipeTypes = repoPipeType.GetAll();

            foreach (var pt in pipeTypes)
            {
                checkedPipeTypes.Add(pt);
            }
        }
        public PurchaseOrderViewModel(IPurchaseOrderRepository repo, string number, IUserNotify notify)
        {
            this.repo = repo;
            this.notify = notify;
            saveCommand = ViewModelSource.Create(() => new SaveOrderCommand(repo, this, notify));

            if (string.IsNullOrWhiteSpace(number))
            {
                NewOrder(number);
            }
            else 
            {
                var ord = LoadOrder(number);
                if(ord != null)
                {
                    order = ord;
                }
                else
                {
                    NewOrder(number);
                }
            }
        }
Beispiel #60
0
        public SpoolViewModel(ISpoolRepositories repos, Guid id, IUserNotify notify, ISecurityContext ctx)
        {
            this.repos = repos;
            this.ctx = ctx;
            this.notify = notify;
            this.Inspectors = repos.RepoInspector.GetAll();

            if(this.Inspectors == null || this.Inspectors.Count <= 0)
                log.Warn(string.Format("Spool (id:{0}) creation: List of Inspectors is NULL or empty", id));

            searchCommand = ViewModelSource.Create<EditPipeForCutCommand>(
              () => new EditPipeForCutCommand(this, repos, notify, ctx));

            saveCommand = ViewModelSource.Create<SaveSpoolCommand>(
            () => new SaveSpoolCommand(this, repos, notify, ctx));

            deactivateCommand = ViewModelSource.Create<SpoolDeactivationCommand>(
                () => new SpoolDeactivationCommand(repos, this, notify, ctx));

            allPipes = new BindingList<Pipe>();

            foreach(Pipe p in repos.PipeRepo.GetAvailableForCutPipes())
            {
                allPipes.Add(p);
            }

            if(id == Guid.Empty)
            {
                NewSpool();
            }
            else
            {
                Spool = repos.SpoolRepo.Get(id);
                Pipe = Spool.Pipe;
                InitPipeLenght = Spool.Length + Pipe.Length;
            }
        }