예제 #1
0
        public void Reset()
        {
            BasisWeight     = false;
            BurstStrength   = false;
            Caliper         = false;
            FeetPerMin      = false;
            MoistureContent = false;
            OutTurnForm     = false;
            TensileStrength = false;
            WaterImmersion  = false;
            ZDT             = false;

            AllDates  = false;
            StartDate = null;
            EndDate   = null;
            AllDatesChk();

            SelectedEmployees.Clear();
            EmployeeSelectAll = true;

            SelectedDepartments.Clear();
            DepartmentSelectAll = true;

            SelectedFunctions.Clear();
            FunctionSelectAll = true;

            NotifyOfPropertyChange(() => CanPrint);
            NotifyOfPropertyChange(() => CanReset);
        }
예제 #2
0
 public void RemoveEmployee()
 {
     AvailableEmployees.Add(SelectedEmployeeToRemove);
     SelectedEmployees.Remove(SelectedEmployeeToRemove);
     NotifyOfPropertyChange(() => SelectedEmployees);
     NotifyOfPropertyChange(() => CanPrint);
     NotifyOfPropertyChange(() => CanReset);
 }
예제 #3
0
 public void Reset()
 {
     AquiredDate = null;
     SelectedEmployees.Clear();
     SelectedDepartment = null;
     SelectedFunction   = null;
     AvailableFunctions.Clear();
     NotifyOfPropertyChange(() => CanSave);
     NotifyOfPropertyChange(() => CanReset);
 }
        private void AddEmployee()
        {
            EmployeeSelectDialog dlg = new EmployeeSelectDialog(true);

            dlg.AddTriggered += ep => {
                if (!SelectedEmployees.Contains(ep))
                {
                    SelectedEmployees.Add(ep);
                }
            };
            dlg.ShowDialog();
        }
예제 #5
0
 public void AddEmployee()
 {
     foreach (var item in AvailableEmployees.Where(x => x.IsSelected).Reverse())
     {
         SelectedEmployeeToAdd.IsSelected = false;
         SelectedEmployees.Add(SelectedEmployeeToAdd);
         AvailableEmployees.Remove(SelectedEmployeeToAdd);
     }
     NotifyOfPropertyChange(() => SelectedEmployees);
     NotifyOfPropertyChange(() => AvailableEmployees);
     NotifyOfPropertyChange(() => CanSave);
     NotifyOfPropertyChange(() => CanReset);
     SortEmployees(SelectedEmployees);
     SortEmployees(AvailableEmployees);
 }
        // GET: Emp
        public ActionResult AddorEdit(int Id = 0)
        {
            SelectedEmployees selectedEmployees = new SelectedEmployees();

            using (DemoContext db = new DemoContext())
            {
                if (Id != 0)
                {
                    selectedEmployees = db.SelectedEmployees.Where(x => x.Id == Id).FirstOrDefault();

                    //This code is for the show the multiple values
                    selectedEmployees.SelectedEmployeeArray = selectedEmployees.SelectedEmployeeID.Split(',').ToArray();
                }
                selectedEmployees.EmployeeCollection = db.Employees.ToList();
            }
            return(View(selectedEmployees));
        }
        public ActionResult AddorEdit(SelectedEmployees selected)
        {
            using (DemoContext _context = new DemoContext())
            {
                //Add Multi Selected Value into One string
                selected.SelectedEmployeeID = string.Join(",", selected.SelectedEmployeeArray);

                if (selected.Id == 0)
                {
                    _context.SelectedEmployees.Add(selected);
                }
                else
                {
                    _context.Entry(selected).State = System.Data.Entity.EntityState.Modified;
                }
                _context.SaveChanges();
            }
            return(RedirectToAction("AddorEdit", new { id = 0 }));
        }
예제 #8
0
        public void Print()
        {
            DateTime?startDate;
            DateTime?endDate;
            string   empoloyees;
            string   departments;
            string   functions;

            startDate   = StartDate;
            endDate     = EndDate;
            empoloyees  = String.Join(", ", SelectedEmployees.Select(o => o.Id));
            departments = String.Join(", ", SelectedDepartments.Select(o => o.Id));
            functions   = String.Join(", ", SelectedFunctions.Select(o => o.Id));

            ReportResults = new BindableCollection <ReportResultsModel>(GlobalConfig.Connection.GetReportResults(startDate, endDate, empoloyees, departments, functions));


            //EventAggregationProvider.OutTurnEventAggregator.PublishOnUIThread(ReportResults);

            GetReportToPrint();

            manager.ShowDialog(new ReportShowViewModel(ReportResults, reportName), null, null);
        }
예제 #9
0
        private bool IsExistInCurrentList(Employee o)
        {
            var flag = SelectedEmployees.Any(e => e.Id == o.Id);

            return(flag);
        }
예제 #10
0
        public NewAuditViewModel()
        {
            Audit = new NewAudit();
            MessagingCenter.Subscribe <CalendarPopupViewModel>(this,
                                                               MessageKeys.StartDateAudit, sender =>
            {
                PeriodDateIn       = sender.SelectedDate;
                IsChangedStartDate = true;
            });

            MessagingCenter.Subscribe <CalendarPopupViewModel>(this,
                                                               MessageKeys.EndDateAudit, sender =>
            {
                PeriodDateOut    = sender.SelectedDate;
                IsChangedEndDate = true;
            });

            MessagingCenter.Subscribe <EmployeeListViewModel>(this,
                                                              MessageKeys.AddEmployeers, sender =>
            {
                var t = new ObservableCollection <Employee>(sender.Employees
                                                            .Where(i => (i is Employee && (((Employee)i)
                                                                                           .IsChecked) && !IsExistInCurrentList(i))));
                if (t.Count != 0)
                {
                    foreach (var item in t)
                    {
                        SelectedEmployees.Add(item);
                    }
                }

                ListViewSelectedEmployeesHeight = (49 * SelectedEmployees.Count);
                if (SelectedEmployees.Count != 0)
                {
                    IsListEmployeesVisible = true;
                }
            });

            MessagingCenter.Subscribe <Employee>(this,
                                                 MessageKeys.AddChairman, sender =>
            {
                Chairman = sender;
                OnPropertyChanged(nameof(ChairmanText));
            });

            MessagingCenter.Subscribe <AuditSubject>(this,
                                                     MessageKeys.AddAuditSubject, sender =>
            {
                AuditSubject = sender;
                OnPropertyChanged(nameof(AuditSubjectText));
            });

            MessagingCenter.Subscribe <AuditBase>(this,
                                                  MessageKeys.AddAuditBase, sender =>
            {
                AuditBase = sender;
                OnPropertyChanged(nameof(AuditBaseText));
            });

            MessagingCenter.Subscribe <AuditType>(this,
                                                  MessageKeys.AddAuditType, sender =>
            {
                AuditType = sender;
                OnPropertyChanged(nameof(AuditTypeText));
            });

            SelectedEmployees = new ObservableCollection <Employee>();
            ListViewSelectedEmployeesHeight = 0;
        }
 private void RemoveEmployee()
 {
     SelectedEmployees.Remove(SelectedEp);
 }