private void AddSupervisorCommand(object model) { var supervisorModel = model as Supervisor; supervisorModel.SiteId = SiteId; supervisorModel.CreatedDate = DateTime.Now; if (string.IsNullOrWhiteSpace(supervisorModel.SupervisorName)) { NameVisibility = Visibility.Visible; return; } if (supervisorModel.MonthlySalary < 1) { SalaryVisibility = Visibility.Visible; return; } _repositoryManager.AddSupervisor(supervisorModel); Supervisors = new ObservableCollection <Supervisor>(_repositoryManager.GetSupervisorsBySiteId(SiteId)); SupervisorToAdd = new Supervisor(); }