Esempio n. 1
0
 public ContactViewModel(INavigation navigation, Contact contact)
 {
     _navigation = navigation;
     _contactData = new ContactDataService();
     FillingCurrentContact(contact);
     AddContactCommand = new Command(() => NewContact(contact));
 }
Esempio n. 2
0
        public void ValidateContact(contact objContact, IContactDataService dataService)
        {
            contactDataService = dataService;

            InitializeValidationRules(objContact);
            ValidateEmailAddress("Email", "Email Address");
        }
Esempio n. 3
0
        public BookViewModel(IContactDataService service)
        {
            _service   = service;
            ContactsVM = new ContactsViewModel();

            LoadContactsCommand  = new RelayCommand(LoadContacts);
            LoadFavoritesCommand = new RelayCommand(LoadFavorites);
        }
Esempio n. 4
0
 public BookViewModel(IContactDataService dataService,
                      IDialogService dialogService)
 {
     ContactsVM           = new ContactsViewModel(dataService, dialogService);
     _dataService         = dataService;
     LoadContactsCommand  = new RelayCommand(LoadContacts);
     LoadFavoritesCommand = new RelayCommand(LoadFavorites);
 }
 public ContactViewModel(IConnectionService connectionService,
                         INavigationService navigationService, IDialogService dialogService,
                         IContactDataService contactDataService, IPhoneService phoneService)
     : base(connectionService, navigationService, dialogService)
 {
     _contactDataService = contactDataService;
     _phoneService       = phoneService;
 }
 public ContactListViewModel (INavigation navigation)
 {
     _navigation = navigation;
     _contactData = new ContactDataService();
     OpenContactPageCommand = new Command(OpenContactPage);
     DeleteCommand = new Command<int>(Delete);
     ReloadDataCommand = new Command(ReloadData);
  }
Esempio n. 7
0
        public ContactViewModel(IContactDataService dataService)
        {
            _dataService = dataService;

            EditCommand   = new RelayCommand(Edit, CanEdit);
            SaveCommand   = new RelayCommand(Save, IsEdit);
            AddCommand    = new RelayCommand(Add);
            DeleteCommand = new RelayCommand(Delete, CanDelete);
        }
Esempio n. 8
0
 public ContactsViewModel(IContactDataService dataService, IDialogService dialogService)
 {
     _dataService       = dataService;
     _dialogService     = dialogService;
     EditCommand        = new RelayCommand(Edit, CanEdit);
     SaveCommand        = new RelayCommand(Save, IsEdit);
     UpdateCommand      = new RelayCommand(Update);
     BrowseImageCommand = new RelayCommand(BrowseImage, IsEdit);
 }
Esempio n. 9
0
        public AppViewModel()
        {
            var dataService = new JsonContactDataService();

            _dataService = dataService;

            NewContactVM = new NewContactViewModel(dataService);
            ContactsVM   = new ContactsViewModel(dataService);
            ListVM       = new ListViewModel(dataService, ContactsVM);
        }
Esempio n. 10
0
 public ContactsViewModel(IContactDataService dataService, IDialogService dialogService)
 {
     _dataService       = dataService;
     _dialogService     = dialogService;
     AddCommand         = new RelayCommand(Add);
     EditCommand        = new RelayCommand(Edit);
     DeleteCommand      = new RelayCommand(Delete);
     UpdateCommand      = new RelayCommand(Update);
     SaveCommand        = new RelayCommand(Save);
     BrowseImageCommand = new RelayCommand(BrowseImage);
 }
 public WidgetsContactDataController(ISettingService settingService, ContactDataSettings contactDataSettings,
                                     IContactDataService widgetContactDataService, ILocalizationService localizationService,
                                     INotificationService notificationService, IPermissionService permissionService)
 {
     this._settingService           = settingService;
     this._contactDataSettings      = contactDataSettings;
     this._widgetContactDataService = widgetContactDataService;
     this._localizationService      = localizationService;
     this._notificationService      = notificationService;
     this._permissionService        = permissionService;
 }
Esempio n. 12
0
        public BookViewModel(JsonDataService service)
        {
            _contactVM = new ContactViewModel(service);
            AlphaBetVM = new AlphabetViewModel();

            _service = service;
            //ContactVM.LoadContacts((await _service.GetContacts()));

            LoadContactsCommand = new RelayCommand(LoadDataContact);
            LoadBirthDayCommand = new RelayCommand(LoadBirthDayContact);
        }
Esempio n. 13
0
        public ContactsViewModel(IContactDataService dataService, IDialogService dialogService) // Connect to database
        {
            _dataService   = dataService;
            _dialogService = dialogService;

            EditCommand        = new RelayCommand(Edit, CanEdit);       // Add edit
            SaveCommand        = new RelayCommand(Save, IsEdit);        // Add save command
            UpdateCommand      = new RelayCommand(Update);              // Add update command
            BrowseImageCommand = new RelayCommand(BrowseImage, IsEdit); // Add browser command ,you can choose any picture from your computer
            AddCommand         = new RelayCommand(Add);                 // Add add command
            DeleteCommand      = new RelayCommand(Delete, CanDelete);   // Delete command, you can delete your contacts
        }
        public ContactsViewModel(IContactDataService dataService, IDialogService dialogService)
        {
            _dataService   = dataService;
            _dialogService = dialogService;

            BrowseImageCommand = new RelayCommand(BrowseImage, IsEdit);
            SaveCommand        = new RelayCommand(Save, IsEdit);
            AddCommand         = new RelayCommand(Add);
            EditCommand        = new RelayCommand(Edit, CanEdit);
            DeleteCommand      = new RelayCommand(Delete, CanDelete);
            FavoriteCommand    = new RelayCommand(Favorite);
        }
Esempio n. 15
0
        public JsonResult SaveContacter(SampleRequestParam param)
        {
            Common.Data.JsonData json      = new Common.Data.JsonData();
            ContactData          contacter = new ContactData()
            {
                ContactName   = param.Name,
                ContactTypeId = string.IsNullOrEmpty(param.Code)?-1: int.Parse(param.Code),
                Value         = param.Value,
                Desc          = param.Desc
            };
            IContactDataService contactService = IocMvcFactoryHelper.GetInterface <IContactDataService>();

            json = contactService.Add(contacter);
            return(Json(json));
        }
        public ContactViewModel(
            IConnectionService connectionService,
            IDialogService dialogService,
            IContactDataService contactDataService,
            IPhoneContactService phoneContactService)
        {
            _connectionService   = connectionService;
            _dialogService       = dialogService;
            _contactDataService  = contactDataService;
            _phoneContactService = phoneContactService;

            _message = new ValidatableObject <string>();
            _email   = new ValidatableObject <string>();

            AddValidations();
        }
Esempio n. 17
0
 /// <summary>
 /// Initialize Contact Business Rules
 /// </summary>
 /// <param name="objContact"></param>
 /// <param name="dataService"></param>
 public void InitializeContactBusinessRules(contact objContact, IContactDataService dataService)
 {
     contactDataService = dataService;
     InitializeValidationRules(objContact);
 }
Esempio n. 18
0
 public WidgetsContactDataViewComponent(IContactDataService contactDataService)
 {
     this._contactDataService = contactDataService;
 }
Esempio n. 19
0
 public ListViewModel(Services.IContactDataService service, ContactsViewModel vm)
 {
     ContactsVM = vm;
     _service   = service;
 }
 public FetchContactQueryHandler(IContactDataService contactDataService) : base(contactDataService)
 {
 }
Esempio n. 21
0
 public DataImportService(ICompanyDataService companyDataService, IContactDataService contactDataService)
 {
     _contactDataService = contactDataService;
     _companyDataService = companyDataService;
 }
Esempio n. 22
0
 public ContactsDataServiceController(IContactDataService contactDataService)
 {
     this._contactDataService = contactDataService;
 }
Esempio n. 23
0
        static void OrmIocFactory()
        {
            if (propertyVal.Count > 0)
            {//存储字典非空出来
            }
            string             connString = InitAppSetting.LogicDBConnString;
            InterfaceIocHelper ioc        = new InterfaceIocHelper();
            string             dir        = NowAppDirHelper.GetNowAppDir(AppCategory.WebApp);
            // 获取到的目录 E:\Code\DayDayStudy\PickUpData\HRApp\HRApp.Web\
            string dllDir = dir + "bin\\";

            #region dll路径配置
            Dictionary <MvcLevel, AssemblyData> mvc = new Dictionary <MvcLevel, AssemblyData>();
            mvc.Add(MvcLevel.DAL, new AssemblyData()
            {
                AssemblyName = "HRApp.Infrastructure.dll", Namespace = "HRApp.Infrastructure"
            });
            mvc.Add(MvcLevel.Bll, new AssemblyData()
            {
                AssemblyName = "HRApp.ApplicationService.dll", Namespace = "HRApp.ApplicationService"
            });
            #endregion
            propertyVal.Add("SqlConnString", connString);
            propertyVal.Add(typeof(IEnumDataRepository).Name + ".SqlConnString", InitAppSetting.AccountDBConnString);   //账号库
            propertyVal.Add(typeof(IEnumDataService).Name + ".SqlConnString", InitAppSetting.AccountDBConnString);      //账号库
            propertyVal.Add(typeof(IAppAccountRepository).Name + ".SqlConnString", InitAppSetting.AccountDBConnString); //账号库
            propertyVal.Add(typeof(IAppAccountService).Name + ".SqlConnString", InitAppSetting.AccountDBConnString);    //账号库
            propertyVal.Add(typeof(IMenuRepository).Name + ".SqlConnString", InitAppSetting.AccountDBConnString);       //账号库
            propertyVal.Add(typeof(IDataFromOtherRepository).Name + ".SqlConnString", InitAppSetting.QueryUinDB);       //这个是用于系统中查询其他库的数据切换操作
            #region dal层属性
            #region Account DB
            IEnumDataRepository enumDal = ioc.IocConvert <IEnumDataRepository>(dllDir, mvc[MvcLevel.DAL].AssemblyName, mvc[MvcLevel.DAL].Namespace, typeof(EnumDataRepository).Name);
            ioc.IocFillProperty(enumDal, propertyVal);
            IAppAccountRepository accountDal = ioc.IocConvert <IAppAccountRepository>(dllDir, mvc[MvcLevel.DAL].AssemblyName, mvc[MvcLevel.DAL].Namespace, typeof(AppAccountRepository).Name);
            ioc.IocFillProperty(accountDal, propertyVal);
            IMenuRepository menuDal = ioc.IocConvert <IMenuRepository>(dllDir, mvc[MvcLevel.DAL].AssemblyName, mvc[MvcLevel.DAL].Namespace, typeof(MenuRepository).Name);
            ioc.IocFillProperty(menuDal, propertyVal);
            #endregion
            #region log --all
            ILogDataRepository logDal = ioc.IocConvert <ILogDataRepository>(dllDir, mvc[MvcLevel.DAL].AssemblyName, mvc[MvcLevel.DAL].Namespace, typeof(LogDataRepository).Name);
            ioc.IocFillProperty(logDal, propertyVal);
            #endregion
            IAppRepository appDal = ioc.IocConvert <IHRApp.Infrastructure.IAppRepository>(dllDir, mvc[MvcLevel.DAL].AssemblyName, mvc[MvcLevel.DAL].Namespace, typeof(AppRepository).Name);
            ioc.IocFillProperty <IAppRepository, IAppRepository>(appDal, propertyVal);
            IAppSettingRepository appSettingDal = ioc.IocConvert <IAppSettingRepository>(dllDir, mvc[MvcLevel.DAL].AssemblyName, mvc[MvcLevel.DAL].Namespace, typeof(AppSettingRepository).Name);
            ioc.IocFillProperty(appSettingDal, propertyVal);

            IOrganizationRepository organzeDal = ioc.IocConvert <IOrganizationRepository>(dllDir, mvc[MvcLevel.DAL].AssemblyName, mvc[MvcLevel.DAL].Namespace, typeof(OrganizationRepository).Name);
            ioc.IocFillProperty(organzeDal, propertyVal);
            IContactDataRepository contacterDal = ioc.IocConvert <IContactDataRepository>(dllDir, mvc[MvcLevel.DAL].AssemblyName, mvc[MvcLevel.DAL].Namespace, typeof(ContactDataRepository).Name);
            ioc.IocFillProperty(contacterDal, propertyVal);
            IMaybeSpecialRepository maybeSpecialDal = ioc.IocConvert <IMaybeSpecialRepository>(dllDir, mvc[MvcLevel.DAL].AssemblyName, mvc[MvcLevel.DAL].Namespace, typeof(MaybeSpecialRepository).Name);
            ioc.IocFillProperty <IMaybeSpecialRepository>(maybeSpecialDal, propertyVal);
            ISpecialSpellNameRepository speicalSpellDal = ioc.IocConvert <ISpecialSpellNameRepository>(dllDir, mvc[MvcLevel.DAL].AssemblyName, mvc[MvcLevel.DAL].Namespace, typeof(SpecialSpellNameRepository).Name);
            ioc.IocFillProperty <ISpecialSpellNameRepository>(speicalSpellDal, propertyVal);
            IDataFromOtherRepository dataFormOtherDal = ioc.IocConvert <IDataFromOtherRepository>(dllDir, mvc[MvcLevel.DAL].AssemblyName, mvc[MvcLevel.DAL].Namespace, typeof(DataFromOtherRepository).Name);
            ioc.IocFillProperty <IDataFromOtherRepository>(dataFormOtherDal, propertyVal);
            IReportEnumDataRepository reportDal = ioc.IocConvert <IReportEnumDataRepository>(dllDir, mvc[MvcLevel.DAL].AssemblyName, mvc[MvcLevel.DAL].Namespace, typeof(ReportEnumDataRepository).Name);
            ioc.IocFillProperty <IReportEnumDataRepository>(reportDal, propertyVal);
            IRelyTableRepository relyDal = ioc.IocConvert <IRelyTableRepository>(dllDir, mvc[MvcLevel.DAL].AssemblyName, mvc[MvcLevel.DAL].Namespace, typeof(RelyTableRepository).Name);
            ioc.IocFillProperty <IRelyTableRepository>(relyDal, propertyVal);
            IEmailDataRepository emailDal = ioc.IocConvert <IEmailDataRepository>(dllDir, mvc[MvcLevel.DAL].AssemblyName, mvc[MvcLevel.DAL].Namespace, typeof(EmailDataRepository).Name);
            ioc.IocFillProperty <IEmailDataRepository>(emailDal, propertyVal);
            #endregion
            #region orm中dal层实例化存储到字典中
            propertyVal.Add(typeof(ILogDataRepository).Name, logDal);
            propertyVal.Add(typeof(IEnumDataRepository).Name, enumDal);
            propertyVal.Add(typeof(IAppAccountRepository).Name, accountDal);
            propertyVal.Add(typeof(IAppRepository).Name, appDal);
            propertyVal.Add(typeof(IAppSettingRepository).Name, appSettingDal);
            propertyVal.Add(typeof(IMenuRepository).Name, menuDal);
            propertyVal.Add(typeof(IOrganizationRepository).Name, organzeDal);
            propertyVal.Add(typeof(IContactDataRepository).Name, contacterDal);
            propertyVal.Add(typeof(IMaybeSpecialRepository).Name, maybeSpecialDal);
            propertyVal.Add(typeof(ISpecialSpellNameRepository).Name, speicalSpellDal);
            propertyVal.Add(typeof(IDataFromOtherRepository).Name, dataFormOtherDal);
            propertyVal.Add(typeof(IReportEnumDataRepository).Name, reportDal);
            propertyVal.Add(typeof(IRelyTableRepository).Name, relyDal);
            propertyVal.Add(typeof(IEmailDataRepository).Name, emailDal);
            #endregion
            #region 业务层
            IEnumDataService enumBll = ioc.IocConvert <IEnumDataService>(dllDir, mvc[MvcLevel.Bll].AssemblyName, mvc[MvcLevel.Bll].Namespace, typeof(EnumDataService).Name);
            ioc.IocFillProperty <IEnumDataService, EnumDataService>(enumBll, propertyVal);
            propertyVal.Add(typeof(IEnumDataService).Name, enumBll);
            IAppAccountService accountBll = ioc.IocConvert <IAppAccountService>(dllDir, mvc[MvcLevel.Bll].AssemblyName, mvc[MvcLevel.Bll].Namespace, typeof(AppAccountService).Name);
            ioc.IocFillProperty <IAppAccountService, AppAccountService>(accountBll, propertyVal);
            propertyVal.Add(typeof(IAppAccountService).Name, accountBll);
            //构造函数的参数注入  判断构造函数的参数是否需要进行注入
            IAppDataService appService = ioc.IocConvert <IAppDataService>(dllDir, mvc[MvcLevel.Bll].AssemblyName, mvc[MvcLevel.Bll].Namespace, typeof(AppDataService).Name);
            ioc.IocFillProperty <IAppDataService, AppDataService>(appService, propertyVal);
            propertyVal.Add(typeof(IAppDataService).Name, appService);
            IAppSettingService appSetService = ioc.IocConvert <IAppSettingService>(dllDir, mvc[MvcLevel.Bll].AssemblyName, mvc[MvcLevel.Bll].Namespace, typeof(AppSettingService).Name);
            ioc.IocFillProperty <IAppSettingService, AppSettingService>(appSetService, propertyVal); //属性和字段注入
            propertyVal.Add(typeof(IAppSettingService).Name, appSetService);
            IMenuService menuService = ioc.IocConvert <IMenuService>(dllDir, mvc[MvcLevel.Bll].AssemblyName, mvc[MvcLevel.Bll].Namespace, typeof(MenuService).Name);
            ioc.IocFillProperty <IMenuService, MenuService>(menuService, propertyVal);
            propertyVal.Add(typeof(IMenuService).Name, menuService);
            IOrganizationService organzeService = ioc.IocConvert <IOrganizationService>(dllDir, mvc[MvcLevel.Bll].AssemblyName, mvc[MvcLevel.Bll].Namespace, typeof(OrganizationService).Name);
            ioc.IocFillProperty <IOrganizationService, OrganizationService>(organzeService, propertyVal);
            propertyVal.Add(typeof(IOrganizationService).Name, organzeService);
            IContactDataService contactService = ioc.IocConvert <IContactDataService>(dllDir, mvc[MvcLevel.Bll].AssemblyName, mvc[MvcLevel.Bll].Namespace, typeof(ContactDataService).Name);
            ioc.IocFillProperty <IContactDataService, ContactDataService>(contactService, propertyVal);
            propertyVal.Add(typeof(IContactDataService).Name, contactService);
            IMaybeSpecialService maybeSpeiclaService = ioc.IocConvert <IMaybeSpecialService>(dllDir, mvc[MvcLevel.Bll].AssemblyName, mvc[MvcLevel.Bll].Namespace, typeof(MaybeSpecialService).Name);
            ioc.IocFillProperty <IMaybeSpecialService, MaybeSpecialService>(maybeSpeiclaService, propertyVal);
            propertyVal.Add(typeof(IMaybeSpecialService).Name, maybeSpeiclaService);
            ISpecialSpellNameService specialSpellService = ioc.IocConvert <ISpecialSpellNameService>(dllDir, mvc[MvcLevel.Bll].AssemblyName, mvc[MvcLevel.Bll].Namespace, typeof(SpecialSpellNameService).Name);
            ioc.IocFillProperty <ISpecialSpellNameService, SpecialSpellNameService>(specialSpellService, propertyVal);
            propertyVal.Add(typeof(ISpecialSpellNameService).Name, specialSpellService);
            IDataFromOtherService dataFormService = ioc.IocConvert <IDataFromOtherService>(dllDir, mvc[MvcLevel.Bll].AssemblyName, mvc[MvcLevel.Bll].Namespace, typeof(DataFromOtherService).Name);
            ioc.IocFillProperty <IDataFromOtherService, DataFromOtherService>(dataFormService, propertyVal);
            propertyVal.Add(typeof(IDataFromOtherService).Name, dataFormService);
            IReportEnumDataService reportBll = ioc.IocConvert <IReportEnumDataService>(dllDir, mvc[MvcLevel.Bll].AssemblyName, mvc[MvcLevel.Bll].Namespace, typeof(ReportEnumDataService).Name);
            ioc.IocFillProperty <IReportEnumDataService, ReportEnumDataService>(reportBll, propertyVal);
            propertyVal.Add(typeof(IReportEnumDataService).Name, reportBll);
            IRelyTableService relyBll = ioc.IocConvert <IRelyTableService>(dllDir, mvc[MvcLevel.Bll].AssemblyName, mvc[MvcLevel.Bll].Namespace, typeof(RelyTableService).Name);
            ioc.IocFillProperty <IRelyTableService>(relyBll, propertyVal);
            propertyVal.Add(typeof(IRelyTableService).Name, relyBll);
            IEmailDataService emailBll = ioc.IocConvert <IEmailDataService>(dllDir, mvc[MvcLevel.Bll].AssemblyName, mvc[MvcLevel.Bll].Namespace, typeof(EmailDataService).Name);
            ioc.IocFillProperty <IEmailDataService>(emailBll, propertyVal);
            propertyVal.Add(typeof(IEmailDataService).Name, emailBll);
            ILogDataService logBll = ioc.IocConvert <ILogDataService>(dllDir, mvc[MvcLevel.Bll].AssemblyName, mvc[MvcLevel.Bll].Namespace, typeof(LogDataService).Name);
            ioc.IocFillProperty <ILogDataService>(logBll, propertyVal);
            propertyVal.Add(typeof(ILogDataService).Name, logBll);
            #endregion
        }
Esempio n. 24
0
 public ContactsViewModel(IContactDataService dataService)
 {
     _dataService = dataService;
 }
 public ContactsViewModel(Services.IContactDataService dataService)
 {
     _dataService = dataService;
     Contacts     = dataService.Contacts;
 }
Esempio n. 26
0
 public ContactsApiController(IContactDataService contactDataService, IMapper mapper)
 {
     _contactDataService = contactDataService;
     _mapper             = mapper;
 }
 public DashboardController(IContactDataService contactServices)
 {
     this.contactServices = contactServices;
 }
 public BaseContactHandler(IContactDataService contactDataService)
 {
     _contactDataService = contactDataService;
 }
Esempio n. 29
0
 public ContactController(ILogger <ContactController> logger, IContactDataService dataService)
 {
     _logger          = logger;
     this.dataService = dataService;
 }
Esempio n. 30
0
 public ContactViewModel( INavigation navigation)
 {
     _navigation = navigation;
     _contactData = new ContactDataService();
     AddContactCommand = new Command(NewContact);
 }
Esempio n. 31
0
 public ContactsAPIController()
 {
     contactDataService = new ContactDataService();
 }
Esempio n. 32
0
 /// <summary>
 /// Constructor
 /// </summary>
 public ContactBusinessService(IContactDataService dataService)
 {
     _ContactDataService = dataService;
 }
Esempio n. 33
0
 public MainViewModel(IContactDataService contactDataService)
 {
     this.Contacts       = new ObservableCollection <Contact>();
     _contactDataService = contactDataService;
 }