public ContactViewModel(INavigation navigation, Contact contact) { _navigation = navigation; _contactData = new ContactDataService(); FillingCurrentContact(contact); AddContactCommand = new Command(() => NewContact(contact)); }
public void ValidateContact(contact objContact, IContactDataService dataService) { contactDataService = dataService; InitializeValidationRules(objContact); ValidateEmailAddress("Email", "Email Address"); }
public BookViewModel(IContactDataService service) { _service = service; ContactsVM = new ContactsViewModel(); LoadContactsCommand = new RelayCommand(LoadContacts); LoadFavoritesCommand = new RelayCommand(LoadFavorites); }
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); }
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); }
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); }
public AppViewModel() { var dataService = new JsonContactDataService(); _dataService = dataService; NewContactVM = new NewContactViewModel(dataService); ContactsVM = new ContactsViewModel(dataService); ListVM = new ListViewModel(dataService, ContactsVM); }
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; }
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); }
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); }
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(); }
/// <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); }
public WidgetsContactDataViewComponent(IContactDataService contactDataService) { this._contactDataService = contactDataService; }
public ListViewModel(Services.IContactDataService service, ContactsViewModel vm) { ContactsVM = vm; _service = service; }
public FetchContactQueryHandler(IContactDataService contactDataService) : base(contactDataService) { }
public DataImportService(ICompanyDataService companyDataService, IContactDataService contactDataService) { _contactDataService = contactDataService; _companyDataService = companyDataService; }
public ContactsDataServiceController(IContactDataService contactDataService) { this._contactDataService = contactDataService; }
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 }
public ContactsViewModel(IContactDataService dataService) { _dataService = dataService; }
public ContactsViewModel(Services.IContactDataService dataService) { _dataService = dataService; Contacts = dataService.Contacts; }
public ContactsApiController(IContactDataService contactDataService, IMapper mapper) { _contactDataService = contactDataService; _mapper = mapper; }
public DashboardController(IContactDataService contactServices) { this.contactServices = contactServices; }
public BaseContactHandler(IContactDataService contactDataService) { _contactDataService = contactDataService; }
public ContactController(ILogger <ContactController> logger, IContactDataService dataService) { _logger = logger; this.dataService = dataService; }
public ContactViewModel( INavigation navigation) { _navigation = navigation; _contactData = new ContactDataService(); AddContactCommand = new Command(NewContact); }
public ContactsAPIController() { contactDataService = new ContactDataService(); }
/// <summary> /// Constructor /// </summary> public ContactBusinessService(IContactDataService dataService) { _ContactDataService = dataService; }
public MainViewModel(IContactDataService contactDataService) { this.Contacts = new ObservableCollection <Contact>(); _contactDataService = contactDataService; }