public MainWindowViewModel()
 {
     Absen     = new AbsenContext();
     User      = new UserContext();
     UnitKerja = new UnitKerjaContext();
     Anggota   = new AnggotaContext();
 }
示例#2
0
 public MenuUtamaViewModel()
 {
     Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("id-ID");
     Today             = DateTime.Now;
     Absen             = new AbsenContext();
     User              = new UserContext();
     UnitKerja         = new UnitKerjaContext();
     Anggota           = new AnggotaContext();
     SourceView        = (CollectionView)CollectionViewSource.GetDefaultView(Absen.Source);
     AdminLoginCommand = new CommandHandler {
         CanExecuteAction = x => true, ExecuteAction = AdminLoginAction
     };
     AbsenCommand = new CommandHandler {
         CanExecuteAction = AbsenCommandValidate, ExecuteAction = AbsenCommandAction
     };
     SourceView.Filter = TodayFilter;
     SourceView.Refresh();
 }
示例#3
0
 public AnggotaViewModel(user userLogin)
 {
     this.TglLahir   = DateTime.Now;
     DataKepercayaan = new List <Kepercayaan>
     {
         Kepercayaan.Islam,
         Kepercayaan.Protestan,
         Kepercayaan.Katolik,
         Kepercayaan.Hindu,
         Kepercayaan.Budha,
         Kepercayaan.KonghuChu
     };
     DataGender = new List <Gender> {
         Gender.Pria, Gender.Wanita
     };
     Today             = DateTime.Now;
     this.UserLogin    = userLogin;
     contextAnggota    = Helpers.GetMainViewModel().Anggota;
     contextUnitKerja  = Helpers.GetMainViewModel().UnitKerja;
     DataUnitKerja     = contextUnitKerja.Source;
     SourceView        = (CollectionView)CollectionViewSource.GetDefaultView(contextAnggota.Source);
     SourceView.Filter = FilterfromSearch;
     NewCommand        = new CommandHandler {
         CanExecuteAction = x => true, ExecuteAction = NewCommandAction
     };
     SaveCommand = new CommandHandler {
         CanExecuteAction = SaveCommandValidation, ExecuteAction = SaveCommandAction
     };
     EditCommand = new CommandHandler {
         CanExecuteAction = EditCommandValidation, ExecuteAction = EditCommandAction
     };
     DeleteCommand = new CommandHandler {
         CanExecuteAction = DeleteCommandValidation, ExecuteAction = DeleteCommandAction
     };
     IjinCommand = new CommandHandler {
         CanExecuteAction = IjinCommandValidate, ExecuteAction = IjinCommandAction
     };
     SakitCommand = new CommandHandler {
         CanExecuteAction = SakitCommandValidate, ExecuteAction = SakitCommandAction
     };
 }
示例#4
0
 public AnggotaController(AnggotaContext context)
 {
     _context = context;
 }