Example #1
0
        protected override async void OnStart()
        {
            AppCenter.Start("android=8cdf0827-a552-4ecb-88f7-c35c58a58dc9;", typeof(Analytics), typeof(Crashes));

            // Handle when your app starts
            IEFSERVICE = new EfService();
            var ihelper = DependencyService.Get <IHelper>();
            var config  = new Config();

            APPCONFIG   = config.GetAppConfig();
            APP_VERSION = ihelper.AppVersion;
            bool   hasUpdate = false;
            string urlUpdateApp;
            var    userService = new UserService();

            USER = IEFSERVICE.GetUser();
            if (USER != null)
            {
                USER.RoleMenus = USER.Roles.Split(',').Select(int.Parse).ToList();
                APPCONFIG.Api  = APPCONFIG.GetApiByEnv(USER.Enviroment);
                TOKEN          = userService.GetToken(APPCONFIG.UserApi, APPCONFIG.PassApi);

                MainPage = new MainPage();
            }
            else
            {
                MainPage = new Login();
            }

            if (Device.RuntimePlatform == Device.iOS)
            {
                urlUpdateApp = APPCONFIG.StoreIos;
                hasUpdate    = !APP_VERSION.Equals(APPCONFIG.IosVersion);
            }
            else
            {
                urlUpdateApp = APPCONFIG.StoreAndroid;
                hasUpdate    = !APP_VERSION.Equals(APPCONFIG.AndroidVersion);
            }

            if (hasUpdate)
            {
                var result = await Current.MainPage.DisplayAlert("Cập nhật phiên bản mới", "Đã có phiên bản cập nhật. Bạn có muốn cập nhật không ?", "Ok", "Cancel"); // since we are using async, we should specify the DisplayAlert as awaiting.

                if (result)                                                                                                                                           // if it's equal to Ok
                {
                    Device.OpenUri(new Uri(urlUpdateApp));
                }
            }
        }
Example #2
0
 public EventiController(IEFService <Evento> service, IMapper mapper) : base(service, mapper)
 {
 }
Example #3
0
 public OrderService(IEFService <Order> orders, IEFService <Product> products, IEFService <Client> clients)
 {
     this.orders   = orders;
     this.products = products;
     this.clients  = clients;
 }
 public AgenzieController(IEFService <Agenzia> service, IMapper mapper) : base(service, mapper)
 {
 }
 public CRUDBaseController(IEFService <TEntity> service, IMapper mapper)
 {
     this.service = service;
     this.mapper  = mapper;
 }