Ejemplo n.º 1
0
        public WorkHourVM(
            IRibbonService ribbonService,
            IWorkCodeService workCodeService,
            IEmployeeService employeeService,
            IWorkHourService workHourService
            )
        {
            this.ribbonService   = ribbonService;
            this.saveCommand     = new DelegateCommand <bool?>(this.Save, this.CanSave);
            this.deleteCommand   = new DelegateCommand <bool?>(this.Delete, this.CanDelete);
            this.workCodeService = workCodeService;
            this.workHourService = workHourService;

            WorkCodes = new ObservableCollection <BasicWorkCodeVM>();
            employees = new ObservableCollection <BasicEmployeeVM>();
            workHours = new ObservableCollection <BasicWorkHourVM>();


            DeletedWorkHours = new List <BasicWorkHourVM>();



            Mapper.CreateMap <Employee, BasicEmployeeVM>();
            Mapper.CreateMap <BasicEmployeeVM, Employee>();
            Mapper.CreateMap <ICollection <Employee>, ICollection <BasicEmployeeVM> >();
            Mapper.CreateMap <ICollection <BasicEmployeeVM>, ICollection <Employee> >();

            Mapper.CreateMap <WorkCode, BasicWorkCodeVM>();
            Mapper.CreateMap <ICollection <WorkCode>, ICollection <BasicWorkCodeVM> >();
            Mapper.CreateMap <BasicWorkCodeVM, WorkCode>();
            Mapper.CreateMap <ICollection <BasicWorkCodeVM>, ICollection <WorkCode> >();

            Mapper.CreateMap <WorkHour, BasicWorkHourVM>();
            Mapper.CreateMap <BasicWorkHourVM, WorkHour>();
            Mapper.CreateMap <ICollection <WorkHour>, ICollection <BasicWorkHourVM> >();
            Mapper.CreateMap <ICollection <BasicWorkHourVM>, ICollection <WorkHour> >();

            foreach (Employee data in employeeService.GetAll())
            {
                employees.Add(Mapper.Map <Employee, BasicEmployeeVM>(data));
            }

            foreach (WorkCode data in workCodeService.GetAll())
            {
                WorkCodes.Add(Mapper.Map <WorkCode, BasicWorkCodeVM>(data));
            }

            foreach (WorkHour data in workHourService.GetAll())
            {
                data.ObjectState = ObjectState.Unchanged;
                workHours.Add(Mapper.Map <WorkHour, BasicWorkHourVM>(data));
            }
            WorkHoursCV = new ListCollectionView(WorkHours);
            WorkHoursCV.CurrentChanged += WorkHoursCV_CurrentChanged;
        }
Ejemplo n.º 2
0
        public WorkHourVM(
            IRibbonService ribbonService,
            IWorkCodeService workCodeService,
            IEmployeeService employeeService,
            IWorkHourService workHourService
            )
        {
            this.ribbonService = ribbonService;
            this.saveCommand = new DelegateCommand<bool?>(this.Save, this.CanSave);
            this.deleteCommand = new DelegateCommand<bool?>(this.Delete, this.CanDelete);
            this.workCodeService=workCodeService;
            this.workHourService = workHourService;

            WorkCodes = new ObservableCollection<BasicWorkCodeVM>();
            employees = new ObservableCollection<BasicEmployeeVM>();
            workHours = new ObservableCollection<BasicWorkHourVM>();


            DeletedWorkHours = new List<BasicWorkHourVM>();

          

            Mapper.CreateMap<Employee, BasicEmployeeVM>();
            Mapper.CreateMap<BasicEmployeeVM, Employee>();
            Mapper.CreateMap<ICollection<Employee>, ICollection<BasicEmployeeVM>>();
            Mapper.CreateMap<ICollection<BasicEmployeeVM>, ICollection<Employee>>();
            
            Mapper.CreateMap<WorkCode, BasicWorkCodeVM>();
            Mapper.CreateMap<ICollection<WorkCode>, ICollection<BasicWorkCodeVM>>();
            Mapper.CreateMap<BasicWorkCodeVM, WorkCode>();
            Mapper.CreateMap<ICollection<BasicWorkCodeVM>, ICollection<WorkCode>>();
            
            Mapper.CreateMap<WorkHour, BasicWorkHourVM>();
            Mapper.CreateMap<BasicWorkHourVM, WorkHour>();
            Mapper.CreateMap<ICollection<WorkHour>, ICollection<BasicWorkHourVM>>();
            Mapper.CreateMap<ICollection<BasicWorkHourVM>, ICollection<WorkHour>>();

            foreach (Employee data in employeeService.GetAll())
            {
                employees.Add(Mapper.Map<Employee, BasicEmployeeVM>(data));
            }
            
            foreach (WorkCode data in workCodeService.GetAll())
            {
                WorkCodes.Add(Mapper.Map<WorkCode, BasicWorkCodeVM>(data));
            }

            foreach (WorkHour data in workHourService.GetAll())
            {
                data.ObjectState = ObjectState.Unchanged;
                workHours.Add(Mapper.Map<WorkHour, BasicWorkHourVM>(data));
            }
            WorkHoursCV = new ListCollectionView(WorkHours);
            WorkHoursCV.CurrentChanged += WorkHoursCV_CurrentChanged;
        }
 public NPITimeCard
     (
     IRegionManager regionManager,
     IRegionViewRegistry regionRegistry,
     IWorkHourService workHourService,
     IEmployeeService employeeService
     )
 {
     InitializeComponent();
     this.regionManager = regionManager;
     this.regionRegistry = regionRegistry;
     this.workHourService = workHourService;
     this.employeeService = employeeService;
 }
Ejemplo n.º 4
0
 public NPITimeCard
 (
     IRegionManager regionManager,
     IRegionViewRegistry regionRegistry,
     IWorkHourService workHourService,
     IEmployeeService employeeService
 )
 {
     InitializeComponent();
     this.regionManager   = regionManager;
     this.regionRegistry  = regionRegistry;
     this.workHourService = workHourService;
     this.employeeService = employeeService;
 }
 public TCDashboardVM(
   IRibbonService ribbonService,
     IRegionManager regionManager,
     IRegionViewRegistry regionRegistry,
     IWorkHourService workHourService,
     IEmployeeService employeeService
   )
 {
     this.ribbonService = ribbonService;
     this.aboutCommand = new DelegateCommand(this.About);
     employeesCommand = new DelegateCommand(this.Employees);
     addEmployeeCommand = new DelegateCommand(this.AddEmployees);
     workHoursCommand = new DelegateCommand(this.WorkHoursEmployees);
     bheCommand = new DelegateCommand(this.BHE);
     nbheCommand = new DelegateCommand(this.NBHE);
     phonesCommand = new DelegateCommand(this.Phones);
     addressCommand = new DelegateCommand(this.Address);
     workCodesCommand = new DelegateCommand(this.WorkCodes);
     this.ViewRequest = new InteractionRequest<INotification>();
     this.regionManager = regionManager;
     this.regionRegistry = regionRegistry;
     this.workHourService = workHourService;
     this.employeeService = employeeService;
 }
 public TCDashboardVM(
     IRibbonService ribbonService,
     IRegionManager regionManager,
     IRegionViewRegistry regionRegistry,
     IWorkHourService workHourService,
     IEmployeeService employeeService
     )
 {
     this.ribbonService   = ribbonService;
     this.aboutCommand    = new DelegateCommand(this.About);
     employeesCommand     = new DelegateCommand(this.Employees);
     addEmployeeCommand   = new DelegateCommand(this.AddEmployees);
     workHoursCommand     = new DelegateCommand(this.WorkHoursEmployees);
     bheCommand           = new DelegateCommand(this.BHE);
     nbheCommand          = new DelegateCommand(this.NBHE);
     phonesCommand        = new DelegateCommand(this.Phones);
     addressCommand       = new DelegateCommand(this.Address);
     workCodesCommand     = new DelegateCommand(this.WorkCodes);
     this.ViewRequest     = new InteractionRequest <INotification>();
     this.regionManager   = regionManager;
     this.regionRegistry  = regionRegistry;
     this.workHourService = workHourService;
     this.employeeService = employeeService;
 }