Beispiel #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="T:ReactiveUIAroundMe.Portable.ViewModels.ViewModelBase"/> class.
        /// </summary>
        /// <param name="signalRClient">Signal RC lient.</param>
        public ViewModelBase(ISQLiteStorage storage, IScheduler scheduler, Logging.ILogger log,
                             ApplicationStateHandler applicationStateHandler, WebServiceController webServiceController,
                             GoogleMapsWebServiceController googleMapsWebServiceController, IPathLocator pathLocator, IScreen hostScreen,
                             ILocationManager locationManager)
        {
            HostScreen = hostScreen;

            Locations       = new ObservableCollection <Location>();
            CurrentLocation = new Location();

            LocationManager = locationManager;

            ConnectedStatusMessage = Labels.ConnectedTitle.ToUpper();

            Storage = storage;
            scheduler.Schedule((arg1) => Storage.CreateSQLiteConnection());

            WebServiceController           = webServiceController;
            GoogleMapsWebServiceController = googleMapsWebServiceController;
            PathLocator = pathLocator;

            Subscriptions = new CompositeDisposable();

            Scheduler = scheduler;
            ApplicationStateHandler = applicationStateHandler;

            Log = log;
            Tag = $"{GetType()} ";
        }
Beispiel #2
0
        private void SelectEQPModel_Load(object sender, EventArgs e)
        {
            DynamicConditionFactory dcf = new DynamicConditionFactory();

            _dynamicEQP = dcf.GetDCOfPageByKey("BISTel.eSPC.Page.ATT.Modeling.SPCATTModelingUC");
            Control ctrlEQP = ((DCBar)_dynamicEQP).GetControlByContextID("ESPC_ATT_COMBO_TREE");

            this._btreeComboEQP = (BTreeCombo)ctrlEQP;
            this._btreeComboEQP.SelectionCommitted += new EventHandler(_btreeComboEQP_SelectionCommitted);
            this.bplEQPModel.Controls.Add(ctrlEQP);
            ctrlEQP.Dock = DockStyle.Fill;

            BISTel.eSPC.Page.eSPCWebService.eSPCWebService spcWebService = new WebServiceController <eSPCWebService.eSPCWebService>().Create();

            //SPC MODEL LEVEL을 가져옴
            LinkedList llstCondtion = new LinkedList();

            llstCondtion.Add(BISTel.eSPC.Common.Definition.CONDITION_KEY_CATEGORY, "SPC_ATT_MODEL_LEVEL");
            llstCondtion.Add(BISTel.eSPC.Common.Definition.CONDITION_KEY_USE_YN, "Y");
            //llstCondtion.Add(BISTel.eSPC.Common.Definition.CONDITION_KEY_DEFAULT_COL, "Y");

            DataSet dsModelLevel = spcWebService.GetATTCodeData(llstCondtion.GetSerialData());

            if (DSUtil.CheckRowCount(dsModelLevel))
            {
                _sSPCModelLevel = dsModelLevel.Tables[0].Rows[0][BISTel.eSPC.Common.COLUMN.CODE].ToString();
                if (!_sSPCModelLevel.Equals(BISTel.eSPC.Common.Definition.CONDITION_KEY_EQP_MODEL))
                {
                    this.btnIgnore.Text = "Use Current Area";
                }
            }
        }
Beispiel #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="T:ReactiveUIAroundMe.Portable.ViewModels.LoginPageViewModel"/> class.
        /// </summary>
        /// <param name="signalRClient">Signal RC lient.</param>
        /// <param name="scheduler">Scheduler.</param>
        /// <param name="applicationStateHandler">Application state handler.</param>
        /// <param name="storage">Storage.</param>
        /// <param name="webServiceController">Web service controller.</param>
        /// <param name="log">Log.</param>
        /// <param name="device">Device.</param>
        public LoginPageViewModel(IScheduler scheduler, ApplicationStateHandler applicationStateHandler,
                                  ISQLiteStorage storage, WebServiceController webServiceController, GoogleMapsWebServiceController googleMapsWebServiceController,
                                  IPathLocator pathLocator, ILogger log, IDevice device, IScreen hostScreen, ILocationManager locationManager)
            : base(storage, scheduler, log, applicationStateHandler, webServiceController, googleMapsWebServiceController, pathLocator, hostScreen, locationManager)
        {
            Title = "Welcome";

            _webServiceController = webServiceController;
            _device = device;

            scheduler.ScheduleAsync((arg1, arg2) => SetupSQLite());
            scheduler.ScheduleAsync((arg1, arg2) => Load());

            var canLogin = this.WhenAnyValue(
                vm => vm.Username,
                vm => vm.Password,
                vm => vm.IsLoading,
                (username, password, loading) =>
                !string.IsNullOrEmpty(Username) &&
                !string.IsNullOrEmpty(Password) &&
                !IsLoading);

            LoginCommand = ReactiveCommand.CreateFromObservable(LoginAsync,
                                                                canLogin,
                                                                Scheduler);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="T:ReactiveUIAroundMe.ViewModels.TileViewModel"/> class.
 /// </summary>
 /// <param name="signalRClient">Signal RC lient.</param>
 public TileViewModel(ISQLiteStorage storage, IScheduler scheduler, ILogger log,
                      ApplicationStateHandler applicationStateHandler, WebServiceController webServiceController, GoogleMapsWebServiceController googleMapsWebServiceController,
                      IPathLocator pathLocator, IScreen hostScreen, ILocationManager locationManager)
     : base(storage, scheduler, log, applicationStateHandler,
            webServiceController, googleMapsWebServiceController, pathLocator, hostScreen, locationManager)
 {
     Height = 200;
 }
        private void SPCModelGroupPopup_Load(object sender, EventArgs e)
        {
            if (_isMET)
            {
                DynamicConditionFactory dcf = new DynamicConditionFactory();
                _dynamicEQP = dcf.GetDCOfPageByKey("BISTel.eSPC.Page.Modeling.MET.Modeling.SPCModelingUC");
                Control ctrlEQP = ((DCBar)_dynamicEQP).GetControlByContextID("ESPC_COMBO_TREE");
                this._btreeComboEQP = (BTreeCombo)ctrlEQP;
                this._btreeComboEQP.SelectionCommitted += new EventHandler(bComboLevel_SelectionCommitted);
                this.bplEQPModel.Controls.Add(ctrlEQP);
                ctrlEQP.Dock = DockStyle.Fill;

                //SPC MODEL LEVEL을 가져옴
                LinkedList llstCondtion = new LinkedList();
                llstCondtion.Add(BISTel.eSPC.Common.Definition.CONDITION_KEY_CATEGORY, "SPC_MET_MODEL_LEVEL");
                llstCondtion.Add(BISTel.eSPC.Common.Definition.CONDITION_KEY_USE_YN, "Y");
                //llstCondtion.Add(BISTel.eSPC.Common.Definition.CONDITION_KEY_DEFAULT_COL, "Y");

                DataSet dsModelLevel = _wsSPC.GetCodeData(llstCondtion.GetSerialData());
                if (DSUtil.CheckRowCount(dsModelLevel))
                {
                    _sSPCModelLevel = dsModelLevel.Tables[0].Rows[0][BISTel.eSPC.Common.COLUMN.CODE].ToString();
                }
            }
            else
            {
                DynamicConditionFactory dcf = new DynamicConditionFactory();
                _dynamicEQP = dcf.GetDCOfPageByKey("BISTel.eSPC.Page.Modeling.SPCModelingUC");
                Control ctrlEQP = ((DCBar)_dynamicEQP).GetControlByContextID("ESPC_COMBO_TREE");
                this._btreeComboEQP = (BTreeCombo)ctrlEQP;
                this._btreeComboEQP.SelectionCommitted += new EventHandler(bComboLevel_SelectionCommitted);
                this.bplEQPModel.Controls.Add(ctrlEQP);
                ctrlEQP.Dock = DockStyle.Fill;

                BISTel.eSPC.Page.eSPCWebService.eSPCWebService spcWebService = new WebServiceController <eSPCWebService.eSPCWebService>().Create();

                //SPC MODEL LEVEL을 가져옴
                LinkedList llstCondtion = new LinkedList();
                llstCondtion.Add(BISTel.eSPC.Common.Definition.CONDITION_KEY_CATEGORY, "SPC_MODEL_LEVEL");
                llstCondtion.Add(BISTel.eSPC.Common.Definition.CONDITION_KEY_USE_YN, "Y");
                //llstCondtion.Add(BISTel.eSPC.Common.Definition.CONDITION_KEY_DEFAULT_COL, "Y");

                DataSet dsModelLevel = spcWebService.GetCodeData(llstCondtion.GetSerialData());
                if (DSUtil.CheckRowCount(dsModelLevel))
                {
                    _sSPCModelLevel = dsModelLevel.Tables[0].Rows[0][BISTel.eSPC.Common.COLUMN.CODE].ToString();
                }
            }

            EESProgressBar.ShowProgress(this, this._mlthandler.GetMessage(Definition.LOADING_DATA), true);

            this._dsGroupList = _wsSPC.GetSPCModelGroupList(this._isMET);

            EESProgressBar.CloseProgress(this);

            this.bComboLevel_SelectionCommitted(_btreeComboEQP, new EventArgs());
        }
Beispiel #6
0
        public DummyPUC()
        {
            InitializeComponent();

            eSPCWebService.eSPCWebService eSPCWS     = new WebServiceController <eSPCWebService.eSPCWebService>().Create();
            eSPCWebService.eSPCWebService eSPCPageWS = new WebServiceController <eSPCWebService.eSPCWebService>().Create();

            LinkedList llstCondition = new LinkedList();

            eSPCWS.GetLine(llstCondition.GetSerialData());
            eSPCPageWS.GetLine(llstCondition.GetSerialData());
        }
Beispiel #7
0
 void Awake()
 {
     if (instance != null && instance != this)
     {
         Destroy(this.gameObject);
         return;
     }
     else
     {
         instance = this;
     }
     DontDestroyOnLoad(this.gameObject);
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="T:ReactiveUIAroundMe.Portable.ViewModels.HomePageViewModel"/> class.
        /// </summary>
        /// <param name="signalRClient">Signal RC lient.</param>
        /// <param name="scheduler">Scheduler.</param>
        /// <param name="applicationStateHandler">Application state handler.</param>
        /// <param name="storage">Storage.</param>
        /// <param name="webServiceController">Web service controller.</param>
        /// <param name="log">Log.</param>
        /// <param name="device">Device.</param>
        public SearchResultsPageViewModel(IScheduler scheduler, ApplicationStateHandler applicationStateHandler,
                                          ISQLiteStorage storage, WebServiceController webServiceController, GoogleMapsWebServiceController googleMapsWebServiceController,
                                          IPathLocator pathLocator, ILogger log, IDevice device, IScreen hostScreen, ILocationManager locationManager)
            : base(storage, scheduler, log, applicationStateHandler, webServiceController,
                   googleMapsWebServiceController, pathLocator, hostScreen, locationManager)
        {
            Title = "Results";

            Results = new ReactiveList <EReactiveUIAroundMeListItemViewModel>();

            _webServiceController = webServiceController;
            _device = device;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="T:ReactiveUIAroundMe.Portable.ViewModels.HomePageViewModel"/> class.
        /// </summary>
        /// <param name="signalRClient">Signal RC lient.</param>
        /// <param name="scheduler">Scheduler.</param>
        /// <param name="applicationStateHandler">Application state handler.</param>
        /// <param name="storage">Storage.</param>
        /// <param name="webServiceController">Web service controller.</param>
        /// <param name="log">Log.</param>
        /// <param name="device">Device.</param>
        public MapPageViewModel(IScheduler scheduler, ApplicationStateHandler applicationStateHandler,
                                ISQLiteStorage storage, WebServiceController webServiceController, GoogleMapsWebServiceController googleMapsWebServiceController,
                                IPathLocator pathLocator, ILogger log, IDevice device, IScreen hostScreen, ILocationManager locationManager)
            : base(storage, scheduler, log, applicationStateHandler, webServiceController, googleMapsWebServiceController, pathLocator, hostScreen, locationManager)
        {
            Title = "Results";

            Feedbacks = new ReactiveList <FeedbackListItemViewModel>();
            Infos     = new ReactiveList <TetrixViewModelBase>();
            Infos.Add(new HeaderListItemViewModel(storage, scheduler, log, applicationStateHandler,
                                                  webServiceController, googleMapsWebServiceController,
                                                  pathLocator, hostScreen, locationManager)
            {
                Title = "Contacts"
            });

            foreach (var icon in icons)
            {
                Infos.Add(new ContactListItemViewModel(storage, scheduler,
                                                       log, applicationStateHandler,
                                                       webServiceController,
                                                       googleMapsWebServiceController,
                                                       pathLocator, hostScreen, locationManager)
                {
                    Icon = string.Format("{0}.png", icon)
                });
            }

            var canSelectFeedback = this.WhenAnyValue(
                vm => vm.Feedbacks,
                vm => vm.IsLoading,
                (feedbacks, isLoading) => !feedbacks.IsEmpty && !isLoading);

            FeedbackSelectCommand = ReactiveCommand.CreateFromObservable(SelectFeedbackAsync,
                                                                         canSelectFeedback, Scheduler);

            var canSelectTravelMode = this.WhenAnyValue(vm => vm.IsLoading,
                                                        (isLoading) => !isLoading);

            TransitCommand = ReactiveCommand.CreateFromObservable(() => CreatePathAsync(GoogleMapsTravelModes.Transit),
                                                                  canSelectTravelMode, Scheduler);

            DrivingCommand = ReactiveCommand.CreateFromObservable(() => CreatePathAsync(GoogleMapsTravelModes.Driving),
                                                                  canSelectTravelMode, Scheduler);

            WalkingCommand = ReactiveCommand.CreateFromObservable(() => CreatePathAsync(GoogleMapsTravelModes.Walking),
                                                                  canSelectTravelMode, Scheduler);
        }
    private void Awake()
    {
        #region [Deleting PlayerData]
        if (DeletePlayerData)
        {
            PlayerPrefs.DeleteAll();
            print("Played Data Deleted");
        }
        #endregion

        Screen.sleepTimeout = SleepTimeout.NeverSleep;
        foldercheck();
        if (webServiceController_Instance == null)
        {
            webServiceController_Instance = this;
            DontDestroyOnLoad(gameObject);
        }
        GetAccessToken();
    }
Beispiel #11
0
        /// <summary>
        /// Initializes a new instance of the <see cref="T:ReactiveUIAroundMe.Portable.ViewModels.HomePageViewModel"/> class.
        /// </summary>
        /// <param name="signalRClient">Signal RC lient.</param>
        /// <param name="scheduler">Scheduler.</param>
        /// <param name="applicationStateHandler">Application state handler.</param>
        /// <param name="storage">Storage.</param>
        /// <param name="webServiceController">Web service controller.</param>
        /// <param name="log">Log.</param>
        /// <param name="device">Device.</param>
        public FlyoutMenuPageViewModel(IScheduler scheduler, ApplicationStateHandler applicationStateHandler,
                                       ISQLiteStorage storage, WebServiceController webServiceController, GoogleMapsWebServiceController googleMapsWebServiceController,
                                       IPathLocator pathLocator, ILogger log, IDevice device, IScreen hostScreen, ILocationManager locationManager)
            : base(storage, scheduler, log, applicationStateHandler, webServiceController,
                   googleMapsWebServiceController, pathLocator, hostScreen, locationManager)
        {
            Title = "Results";

            Results = new ReactiveList <EReactiveUIAroundMeListItemViewModel>();

            _webServiceController = webServiceController;
            _device = device;

            var canSelect = this.WhenAnyValue(vm => vm.Results,
                                              (results) => !results.IsEmpty && !IsLoading);

            ResultSelectCommand = ReactiveCommand.CreateFromObservable(SelectAsync,
                                                                       canSelect, Scheduler);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="T:ReactiveUIAroundMe.Portable.ViewModels.HomePageViewModel"/> class.
        /// </summary>
        /// <param name="signalRClient">Signal RC lient.</param>
        /// <param name="scheduler">Scheduler.</param>
        /// <param name="applicationStateHandler">Application state handler.</param>
        /// <param name="storage">Storage.</param>
        /// <param name="webServiceController">Web service controller.</param>
        /// <param name="log">Log.</param>
        /// <param name="device">Device.</param>
        public HomePageViewModel(IScheduler scheduler, ApplicationStateHandler applicationStateHandler,
                                 ISQLiteStorage storage, WebServiceController webServiceController, GoogleMapsWebServiceController googleMapsWebServiceController,
                                 IPathLocator pathLocator, ILogger log, IDevice device, IScreen hostScreen, ILocationManager locationManager)
            : base(storage, scheduler, log, applicationStateHandler, webServiceController, googleMapsWebServiceController, pathLocator, hostScreen,
                   locationManager)
        {
            Title = "Welcome";

            _webServiceController = webServiceController;
            _device = device;

            scheduler.ScheduleAsync((arg1, arg2) => SetupSQLite());
            scheduler.ScheduleAsync((arg1, arg2) => Load());

            var canSearch = this.WhenAnyValue(
                vm => vm.CurrentLocation,
                (location) => location.Timestamp != default(DateTimeOffset));

            SearchCommand = ReactiveCommand.CreateFromObservable(SearchAsync, canSearch, scheduler);
        }
        public void GetNotes()
        {
            // Arrange
            TestCase.PopulateTestData();
            WebServiceController controller = new WebServiceController();

            // Act
            JsonResult <List <NoteViewModel> > result = controller.Notes(TestCustomer.cid) as JsonResult <List <NoteViewModel> >;

            // Assert
            NoteViewModel note = result.Content.Find(n => n.Id == TestNote.id);

            Assert.AreEqual(TestNote.id, note.Id);
            Assert.AreEqual(TestNote.cid, note.Cid);
            Assert.AreEqual(TestNote.createdBy, note.CreatedBy);
            Assert.AreEqual(TestNote.entryDate, note.EntryDate);
            Assert.AreEqual(TestNote.memo, note.Memo);
            Assert.AreEqual(TestNote.category, note.Category);
            Assert.AreEqual(TestNote.attachment, note.Attachment);

            TestCase.CleanUp();
        }
        public void GetCustomers()
        {
            // Arrange
            TestCase.PopulateTestData();
            WebServiceController controller = new WebServiceController();

            // Act
            JsonResult <List <CustomerViewModel> > result = controller.Customers() as JsonResult <List <CustomerViewModel> >;

            // Assert
            CustomerViewModel c = result.Content.Find(e => e.Cid == TestCustomer.cid);

            Assert.AreEqual(TestCustomer.cid, c.Cid);
            Assert.AreEqual(TestCustomer.company, c.Company);
            Assert.AreEqual(TestCustomer.address, c.Address);
            Assert.AreEqual(TestCustomer.zip, c.Zip);
            Assert.AreEqual(TestCustomer.city, c.City);
            Assert.AreEqual(TestCustomer.country, c.Country);
            Assert.AreEqual(TestCustomer.contractId, c.ContractId);
            Assert.AreEqual(TestCustomer.contractDate, c.ContractDate);

            TestCase.CleanUp();
        }
        public void GetContactPersons()
        {
            // Arrange
            TestCase.PopulateTestData();
            WebServiceController controller = new WebServiceController();

            // Act
            JsonResult <List <ContactPersonViewModel> > result = controller.ContactPersons(TestCustomer.cid) as JsonResult <List <ContactPersonViewModel> >;

            // Assert
            ContactPersonViewModel cp = result.Content.Find(c => c.Id == TestContactPerson.id);

            Assert.AreEqual(TestContactPerson.id, cp.Id);
            Assert.AreEqual(TestContactPerson.cid, cp.Cid);
            Assert.AreEqual(TestContactPerson.forename, cp.Forename);
            Assert.AreEqual(TestContactPerson.surname, cp.Surname);
            Assert.AreEqual(TestContactPerson.gender, cp.Gender);
            Assert.AreEqual(TestContactPerson.email, cp.Email);
            Assert.AreEqual(TestContactPerson.phone, cp.Phone);
            Assert.AreEqual(TestContactPerson.mainContact, cp.MainContact);

            TestCase.CleanUp();
        }
Beispiel #16
0
        public XSummaryParamTree(BTreeView btv)
        {
            this.XTreeView = btv;

            _wsSPC = new WebServiceController <eSPCWebService.eSPCWebService>().Create();
        }
Beispiel #17
0
        /// <summary>
        /// Initializes a new instance of the <see cref="T:ReactiveUIAroundMe.Droid.AppBootstrapper"/> class.
        /// </summary>
        public AppBootstrapper()
        {
            Router = new RoutingState();
            Locator.CurrentMutable.RegisterConstant(this, typeof(IScreen));

            HttpClientHandler clientHandler = new HttpClientHandler();             //_isWindows ? new HttpClientHandler() : new NativeMessageHandler();

            clientHandler.UseCookies             = false;
            clientHandler.AutomaticDecompression = DecompressionMethods.Deflate | DecompressionMethods.GZip;

            // TODO: singletons, we want to pull resolved items from container, rather than outside declarations
            var sqliteplatform = new SQLitePlatformAndroid();
            var logger         = new LoggerAndroid();
            var settings       = new Settings();
            var userDefaults   = new UserDefaults(settings);

            // temp until settings page added
            userDefaults.Host = Config.BaseUrl;

            var device                         = new Device.Device();
            var sqliteSetup                    = new SQLiteSetup(sqliteplatform);
            var sqliteStorage                  = new SQLiteStorage(sqliteSetup, logger);
            var scheduler                      = new ReactiveUIAroundMe.Droid.Threading.HandlerScheduler();
            var webServiceController           = new WebServiceController(sqliteStorage, logger, clientHandler, scheduler, userDefaults);
            var googleMapsWebServiceController = new GoogleMapsWebServiceController(sqliteStorage, logger, clientHandler, scheduler, userDefaults);
            var applicationStateHandler        = new ApplicationStateHandler(sqliteStorage);
            //var orientationHandler = new OrientationHandlerAndroid();
            var pathLocator     = new PathLocator();
            var locationManager = new LocationManager();

            // pages
            // todo: we could use reflection here
            //Locator.CurrentMutable.Register(() => new LoginPage(), typeof(IViewFor<LoginPageViewModel>));
            Locator.CurrentMutable.Register(() => new HomeActivity(), typeof(IViewFor <HomePageViewModel>));
            //Locator.CurrentMutable.Register(() => new SuperAdminPage(), typeof(IViewFor<SuperAdminPageViewModel>));
            //Locator.CurrentMutable.Register(() => new SearchResultsPage(), typeof(IViewFor<SearchResultsPageViewModel>));
            //Locator.CurrentMutable.Register(() => new MapPage(), typeof(IViewFor<MapPageViewModel>));
            Locator.CurrentMutable.Register(() => new FlyoutMenuActivity(), typeof(IViewFor <FlyoutMenuPageViewModel>));

            // singletons
            Locator.CurrentMutable.RegisterLazySingleton(() => applicationStateHandler, typeof(ApplicationStateHandler));
            Locator.CurrentMutable.RegisterLazySingleton(() => webServiceController, typeof(WebServiceController));
            Locator.CurrentMutable.RegisterLazySingleton(() => googleMapsWebServiceController, typeof(GoogleMapsWebServiceController));

            Locator.CurrentMutable.Register <ISettings>(() => settings);
            Locator.CurrentMutable.Register <IUserDefaults>(() => userDefaults);
            Locator.CurrentMutable.Register <ISQLitePlatform>(() => sqliteplatform);
            Locator.CurrentMutable.Register <ISQLiteSetup>(() => sqliteSetup);
            Locator.CurrentMutable.Register <ISQLiteStorage>(() => sqliteStorage);
            Locator.CurrentMutable.Register <Portable.Logging.ILogger>(() => logger);
            Locator.CurrentMutable.Register <IDevice>(() => device);
            //Locator.CurrentMutable.Register<IOrientationHandler>(() => orientationHandler);
            Locator.CurrentMutable.Register <IPathLocator>(() => pathLocator);
            Locator.CurrentMutable.Register <IScheduler>(() => scheduler);
            Locator.CurrentMutable.Register <ILocationManager>(() => locationManager);
            Locator.CurrentMutable.Register <HttpClientHandler>(() => clientHandler);

            // converters
            Locator.CurrentMutable.RegisterConstant(new NotConverter(), typeof(IBindingTypeConverter));

            //Locator.CurrentMutable.RegisterViewsForViewModels(this.GetType().GetTypeInfo().Assembly);

            _flyoutMenuViewModel = new FlyoutMenuPageViewModel(scheduler, applicationStateHandler, sqliteStorage,
                                                               webServiceController, googleMapsWebServiceController, pathLocator, logger, device, this, locationManager);

            //// Navigate to the opening page of the application
            Router.Navigate.Execute(new HomePageViewModel(scheduler, applicationStateHandler, sqliteStorage,
                                                          webServiceController, googleMapsWebServiceController, pathLocator, logger, device, this, locationManager));
        }
Beispiel #18
0
        public List <Sample> GetSamples()
        {
            WebServiceController con = new WebServiceController(ConfigurationManager.ConnectionStrings["DBInformation"].ToString());

            return(con.GetSamples());
        }
Beispiel #19
0
        public static DataTable Parsing(DataSet _ds, LinkedList _llstWhere, bool bDataParsing, bool bMoCVD, bool includingToggleData)
        {
            ParseBLOB parseBlob    = null;
            ParseCLOB parseClob    = null;
            DataSet   _dsSelect    = null;
            DataTable dtResult     = new DataTable();
            bool      bResultTable = false;

            try
            {
                parseBlob = new ParseBLOB();
                parseClob = new ParseCLOB();
                _dsSelect = new DataSet();
                eSPCWebService.eSPCWebService _wsSPC = new WebServiceController <eSPCWebService.eSPCWebService>().Create();
                LinkedList _llstData     = new LinkedList();
                DataSet    dsContextType = _wsSPC.GetContextType(_llstData.GetSerialData());

                LinkedList mllstContextType = SetContextType(dsContextType);

                for (int i = 0; i < _ds.Tables.Count; i++)
                {
                    string sTableName = _ds.Tables[i].TableName.ToString();
                    if (sTableName == Definition.TableName.USERNAME_DATA)
                    {
                        bResultTable = true;
                        _dsSelect    = parseBlob.DecompressDATA_TRX_DATA(_ds.Tables[i], _llstWhere, mllstContextType, bDataParsing, includingToggleData);
                        if (_dsSelect.Tables.Count > 0)
                        {
                            dtResult = _dsSelect.Tables[0].Copy();
                        }

                        _dsSelect.Dispose();
                        if (dtResult.Columns.Contains(BISTel.eSPC.Common.COLUMN.FILE_DATA))
                        {
                            dtResult.Columns.Remove(BISTel.eSPC.Common.COLUMN.FILE_DATA);
                        }
                    }
                    else if (sTableName == Definition.TableName.USERNAME_TEMPDATA)
                    {
                        _dsSelect = parseClob.DecompressData(_ds.Tables[i], _llstWhere, mllstContextType, bDataParsing, includingToggleData);
                        if (!DataUtil.IsNullOrEmptyDataSet(_dsSelect))
                        {
                            DataTable dt = _dsSelect.Tables[0];
                            if (bResultTable)
                            {
                                foreach (DataColumn dc in dt.Columns)
                                {
                                    if (dc.ColumnName.Contains(BISTel.eSPC.Common.COLUMN.DATA_LIST) || dc.ColumnName.Contains(BISTel.eSPC.Common.COLUMN.CONTEXT_LIST) || dc.ColumnName.Contains("NORMAL") || dc.ColumnName.Contains("ORIGINAL_PARAM"))
                                    {
                                        continue;
                                    }
                                    if (!dtResult.Columns.Contains(dc.ColumnName.ToString()))
                                    {
                                        dtResult.Columns.Add(dc.ColumnName.ToString(), dc.DataType);
                                    }
                                }

                                foreach (DataRow dr in dt.Rows)
                                {
                                    dtResult.ImportRow(dr);
                                }
                            }
                            else
                            {
                                dtResult.Merge(dt);
                                if (dtResult.Columns.Contains(BISTel.eSPC.Common.COLUMN.DATA_LIST))
                                {
                                    dtResult.Columns.Remove(BISTel.eSPC.Common.COLUMN.DATA_LIST);
                                }
                                if (dtResult.Columns.Contains(BISTel.eSPC.Common.COLUMN.CONTEXT_LIST))
                                {
                                    dtResult.Columns.Remove(BISTel.eSPC.Common.COLUMN.CONTEXT_LIST);
                                }
                            }
                        }
                    }
                }

                dtResult.Columns.Add(Definition.CHART_COLUMN.DTSOURCEID);
                for (int i = 0; i < dtResult.Rows.Count; i++)
                {
                    dtResult.Rows[i][Definition.CHART_COLUMN.DTSOURCEID] = i;
                }
            }
            catch (Exception ex)
            {
            }
            finally
            {
                if (_ds != null)
                {
                    _ds.Dispose();
                }
                if (parseBlob != null)
                {
                    parseBlob = null;
                }
                if (parseClob != null)
                {
                    parseClob = null;
                }
                if (_dsSelect != null)
                {
                    _dsSelect.Dispose();
                }
            }

            return(dtResult);
        }
Beispiel #20
0
 public void MakeSession()
 {
     eSPCWebService.eSPCWebService ws = new WebServiceController <eSPCWebService.eSPCWebService>().Create();
     ws.GetPreConnection();
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="T:ReactiveUIAroundMe.Portable.ViewModels.TetrixPageViewModelBase"/> class.
        /// </summary>
        /// <param name="storage">Storage.</param>
        /// <param name="scheduler">Scheduler.</param>
        /// <param name="signalRClient">Signal RC lient.</param>
        /// <param name="log">Log.</param>
        /// <param name="applicationStateHandler">Application state handler.</param>
        protected TetrixPageViewModelBase(ISQLiteStorage storage, IScheduler scheduler, ILogger log,
                                          ApplicationStateHandler applicationStateHandler, WebServiceController webServiceController, GoogleMapsWebServiceController googleMapsWebServiceController,
                                          IPathLocator pathLocator, IScreen hostScreen, ILocationManager locationManager)
            : base(storage, scheduler, log, applicationStateHandler, webServiceController, googleMapsWebServiceController,
                   pathLocator, hostScreen, locationManager)
        {
            Cells = new ObservableRangeCollection <TetrixViewModelBase>();

            DataChanges = new Subject <DataChange>();
        }
Beispiel #22
0
        /// <summary>
        /// Initializes a new instance of the <see cref="T:ReactiveUIAroundMe.Portable.ViewModels.SuperAdminPageViewModel"/> class.
        /// </summary>
        /// <param name="storage">Storage.</param>
        /// <param name="scheduler">Scheduler.</param>
        /// <param name="signalRClient">Signal RC lient.</param>
        /// <param name="log">Log.</param>
        /// <param name="applicationStateHandler">Application state handler.</param>
        /// <param name="webServiceController">Web service controller.</param>
        public SuperAdminPageViewModel(ISQLiteStorage storage, IScheduler scheduler, ILogger log,
                                       ApplicationStateHandler applicationStateHandler, WebServiceController webServiceController, GoogleMapsWebServiceController googleMapsWebServiceController,
                                       IPathLocator pathLocator, IScreen hostScreen, ILocationManager locationManager)
            : base(storage, scheduler, log, applicationStateHandler, webServiceController, googleMapsWebServiceController, pathLocator,
                   hostScreen, locationManager)
        {
            _pathLocator = pathLocator;

            Title = "Super Admin";

            selection = (obj) =>
            {
                var parameters = (obj as TetrixViewModelBase)?.SelectParameters;

                object selectKey;
                parameters.TryGetValue("ViewModel", out selectKey);
                if (selectKey != null)
                {
                    HostScreen.Router.Navigate.Execute(new SuperAdminPageViewModel(Storage, Scheduler,
                                                                                   Log, ApplicationStateHandler, WebServiceController,
                                                                                   GoogleMapsWebServiceController, PathLocator, HostScreen, LocationManager));

                    var viewModelType = Type.GetType(string.Format("ReactiveUIAroundMe.Portable.ViewModels.{0}", selectKey));
                    var instance      = (ViewModelBase)Activator.CreateInstance(viewModelType,
                                                                                new object[] { Storage, Scheduler,
                                                                                               Log, ApplicationStateHandler, WebServiceController,
                                                                                               PathLocator, HostScreen });

                    HostScreen.Router.Navigate.Execute(instance);
                }
                ;

                return(Unit.Default);
            };

            InitSelectCommand((obj) => selection(obj));

            var tiles = _tileTiles.Select((title, index) =>
            {
                var tileModel = new TileViewModel(Storage, Scheduler, Log,
                                                  ApplicationStateHandler, WebServiceController, GoogleMapsWebServiceController, PathLocator, HostScreen, LocationManager);
                tileModel.Title       = _tileTiles[index];
                tileModel.BannerImage = _pathLocator.GetPath(_bannerImages[index], "jpg");
                tileModel.TileImage   = _pathLocator.GetPath("profile_image", "jpeg");

                // hack: for mac until wet selectable cells working for collection views
                tileModel.InitSelectionCommand((obj) => selection(obj));
                tileModel.SelectParameters = new Dictionary <string, object>()
                {
                    { "ViewModel", _tileNavigationViewModels[index] },
                };

                tileModel.UseXSpacing = true;
                tileModel.UseYSpacing = true;
                tileModel.Layout      = LayoutType.Fifth;
                tileModel.Position    = index;

                return(tileModel);
            });

            Cells.AddRange(tiles);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="T:ReactiveUIAroundMe.ViewModels.TetrixViewModelBase"/> class.
 /// </summary>
 protected TetrixViewModelBase(ISQLiteStorage storage, IScheduler scheduler, ILogger log,
                               ApplicationStateHandler applicationStateHandler, WebServiceController webServiceController, GoogleMapsWebServiceController googleMapsWebServiceController,
                               IPathLocator pathLocator, IScreen hostScreen, ILocationManager locationManager)
     : base(storage, scheduler, log, applicationStateHandler, webServiceController, googleMapsWebServiceController, pathLocator, hostScreen, locationManager)
 {
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="T:ReactiveUIAroundMe.ViewModels.TetrixViewModelBase"/> class.
        /// </summary>
        protected SelectableViewModelBase(ISQLiteStorage storage, IScheduler scheduler, ILogger log,
                                          ApplicationStateHandler applicationStateHandler, WebServiceController webServiceController, GoogleMapsWebServiceController googleMapsWebServiceController,
                                          IPathLocator pathLocator, IScreen hostScreen, ILocationManager locationManager)
            : base(storage, scheduler, log, applicationStateHandler, webServiceController, googleMapsWebServiceController, pathLocator, hostScreen, locationManager)
        {
            // todo:  working on this logic
            _selectAsync = Observable.Create((IObserver <bool> observer) =>
            {
                IsSelected = !IsSelected;
                return(Disposable.Empty);
            }).Select(x => Unit.Default);

            var canExecute = this.WhenAnyValue(x => x.IsSelectable,
                                               (selectable) => !selectable);

            _selectCommand = ReactiveCommand.CreateFromObservable(() => _selectAsync, canExecute);
        }
Beispiel #25
0
        public override void PageSearch(LinkedList llCondition)
        {
            if (!llCondition.Contains(Definition.DynamicCondition_Search_key.SPCMODEL))
            {
                MSGHandler.DisplayMessage(MSGType.Information, "SPC_INFO_SELECT_MODEL", null, null);
                return;
            }

            if (!this.ApplyAuthory(llCondition))
            {
                MSGHandler.DisplayMessage(MSGType.Warning, MSGHandler.GetMessage("GENERAL_NOT_ENOUGHT_SUFFICIENT"), null, null, true);
                return;
            }

            if (llCondition[Definition.DynamicCondition_Search_key.SITE] != null &&
                ((DataTable)llCondition[Definition.DynamicCondition_Search_key.SITE]).Rows.Count > 0)
            {
                sSite =
                    ((DataTable)llCondition[Definition.DynamicCondition_Search_key.SITE]).Rows[0][Definition.CONDITION_SEARCH_KEY_VALUEDATA].ToString();
            }
            if (llCondition[Definition.DynamicCondition_Search_key.FAB] != null &&
                ((DataTable)llCondition[Definition.DynamicCondition_Search_key.FAB]).Rows.Count > 0)
            {
                sFab =
                    ((DataTable)llCondition[Definition.DynamicCondition_Search_key.FAB]).Rows[0][Definition.CONDITION_SEARCH_KEY_VALUEDATA].ToString();
            }
            if (llCondition[Definition.DynamicCondition_Search_key.LINE] != null &&
                ((DataTable)llCondition[Definition.DynamicCondition_Search_key.LINE]).Rows.Count > 0)
            {
                _line =
                    ((DataTable)llCondition[Definition.DynamicCondition_Search_key.LINE]).Rows[0][Definition.CONDITION_SEARCH_KEY_VALUEDATA].ToString();
                //sLine = ((DataTable)llCondition[Definition.DynamicCondition_Search_key.LINE]).Rows[0][Definition.CONDITION_SEARCH_KEY_DISPLAYDATA].ToString();
            }

            if (llCondition[Definition.DynamicCondition_Search_key.AREA] != null &&
                ((DataTable)llCondition[Definition.DynamicCondition_Search_key.AREA]).Rows.Count > 0)
            {
                _area =
                    ((DataTable)llCondition[Definition.DynamicCondition_Search_key.AREA]).Rows[0][Definition.CONDITION_SEARCH_KEY_VALUEDATA].ToString();
                //sArea = ((DataTable)llCondition[Definition.DynamicCondition_Search_key.AREA]).Rows[0][Definition.CONDITION_SEARCH_KEY_VALUEDATA].ToString();
            }
            if (llCondition[Definition.DynamicCondition_Search_key.EQPMODEL] != null &&
                ((DataTable)llCondition[Definition.DynamicCondition_Search_key.EQPMODEL]).Rows.Count > 0)
            {
                _eqpModel =
                    ((DataTable)llCondition[Definition.DynamicCondition_Search_key.EQPMODEL]).Rows[0][Definition.CONDITION_SEARCH_KEY_VALUEDATA].ToString();
            }
            if (llCondition[Definition.CONDITION_KEY_GROUP_NAME] != null &&
                ((DataTable)llCondition[Definition.CONDITION_KEY_GROUP_NAME]).Rows.Count > 0)
            {
                _groupName =
                    ((DataTable)llCondition[Definition.CONDITION_KEY_GROUP_NAME]).Rows[0][Definition.CONDITION_SEARCH_KEY_VALUEDATA].ToString();
            }

            this.bTabControl1.SelectedIndex = this.tabSPCModelList.TabIndex;

            //this.MsgShow(COMMON_MSG.Query_Data);

            string modelRawid = ((DataTable)llCondition[Definition.DynamicCondition_Search_key.SPCMODEL]).Rows[0]["VALUEDATA"].ToString();

            eSPCWebService.eSPCWebService ws = new WebServiceController <eSPCWebService.eSPCWebService>().Create();

            LinkedList condition = new LinkedList(Definition.DynamicCondition_Condition_key.MODEL_RAWID, modelRawid);
            DataSet    ds        = ws.GetParamName(condition.GetSerialData());

            if (ds != null && ds.Tables[0].Rows.Count > 0)
            {
                this.btxtParamName.Text = ds.Tables[0].Rows[0][COLUMN.PARAM_ALIAS].ToString();
            }

            InitializePage();

            this.spcModelUCForHistory31.PageSearch(llCondition);

            this.MsgClose();
        }