public void SetControlContent()
 {
     try
     {
         string status = isolatedLocalStorage.Read(IsolatedFiles.isFacilityDetailsCompleted);
         status = status.Replace(@"\r\n", "");
         if (status == "true")
         {
             btnFacilitySaveUpdate.Content = "Update";
         }
         string strFacility = isolatedLocalStorage.Read(IsolatedFiles.facilityDetails);
         var    facility    = JsonConvert.DeserializeObject <Facility>(strFacility);
         txtName.Text    = facility.name;
         txtEmail.Text   = facility.email;
         txtAddress.Text = facility.street;
         txtCity.Text    = facility.city;
         txtContact.Text = facility.contact;
         txtState.Text   = facility.state;
         txtPoBox.Text   = facility.poBox;
     }
     catch (Exception ex)
     {
         string el = ex.Message;
     }
 }
        public async void FindWorkers()
        {
            try
            {
                string strfacilityDetails   = isolatedLocalStorage.Read(IsolatedFiles.facilityDetails);
                var    deserializedFacility = JsonConvert.DeserializeObject <Facility>(strfacilityDetails);

                string strAuth          = isolatedLocalStorage.Read(IsolatedFiles.authFile);
                var    deserializedAuth = JsonConvert.DeserializeObject <Auth>(strAuth);

                string url             = EndPoints.fiiterWorker + "?facilityId=" + deserializedFacility.Id + "&name=" + txtSearchWorkers.Text;
                string strFilterWorker = await httpClientServices.GetAsync(url, deserializedAuth.AccessToken);

                if (strFilterWorker != "")
                {
                    var deserializedFilterWorker = JsonConvert.DeserializeObject <PersonStructure>(strFilterWorker);
                    if (deserializedFilterWorker.Data.Count() != 1 && selectedPerson.Id != deserializedFilterWorker.Data[0].Id)
                    {
                        lvFilteredWorkers.Visibility  = Visibility.Visible;
                        lvFilteredWorkers.ItemsSource = deserializedFilterWorker.Data;
                    }
                    else if (selectedPerson == null)
                    {
                        lvFilteredWorkers.Visibility  = Visibility.Visible;
                        lvFilteredWorkers.ItemsSource = deserializedFilterWorker.Data;
                    }
                }
                else
                {
                    Login login = new Login();
                    login.Show();
                }
            }
            catch (Exception ex)
            {
            }
        }
示例#3
0
        private async void GetListOfWorkers()
        {
            grdProgressBar.Visibility = Visibility.Visible;
            string strfacilityDetails   = isolatedLocalStorage.Read(IsolatedFiles.facilityDetails);
            var    deserializedFacility = JsonConvert.DeserializeObject <Facility>(strfacilityDetails);

            string strAuth          = isolatedLocalStorage.Read(IsolatedFiles.authFile);
            var    deserializedAuth = JsonConvert.DeserializeObject <Auth>(strAuth);

            string url        = EndPoints.persons + "?facilityId=" + deserializedFacility.Id;
            string strPersons = await httpClientServices.GetAsync(url, deserializedAuth.AccessToken);

            if (strPersons != "")
            {
                var deserializedPerson = JsonConvert.DeserializeObject <PersonStructure>(strPersons);
                dataGrid.ItemsSource      = deserializedPerson.Data;
                grdProgressBar.Visibility = Visibility.Collapsed;
            }
            else
            {
                Login login = new Login();
                login.Show();
            }
        }
示例#4
0
        private void initializeRegMenuItem()
        {
            IsolatedLocalStorage isolatedLocalStorage = new IsolatedLocalStorage();
            string status = isolatedLocalStorage.Read(IsolatedFiles.isFacilityDetailsCompleted);

            status = status.Replace(System.Environment.NewLine, "");
            if (status != "true")
            {
                indicatorStep1.Visibility = Visibility.Visible;
                gridregistrationMainLayout.Children.Clear();
                gridregistrationMainLayout.Children.Add(new UserControlRegistrationStep1());
                menuIndex = 2;
            }
            else
            {
                this.Hide();
                MasterLandingWindow masterLandingWindow = new MasterLandingWindow();
                masterLandingWindow.Show();
            }
        }
示例#5
0
        public void InitializeContentFlow()
        {
            IsolatedLocalStorage isolatedLocalStorage = new IsolatedLocalStorage();
            string status = isolatedLocalStorage.Read(IsolatedFiles.isFacilityDetailsCompleted);

            status = status.Replace(System.Environment.NewLine, "");
            if (status != "true")
            {
                gridContentLayout.Children.Clear();
                gridContentLayout.Children.Add(new UserControlFacility());
                txtWindowHeader.Text = "Organisation Details";
            }
            else
            {
                gridContentLayout.Children.Clear();
                gridContentLayout.Children.Add(new UserControlClockInOut());
                txtWindowHeader.Text       = "Clock In/Out";
                listViewMenu.SelectedIndex = 0;
            }
        }
        public async void savePost()
        {
            try
            {
                btnSaveNewPost.IsEnabled = false;
                string    strfacilityDetails   = isolatedLocalStorage.Read(IsolatedFiles.facilityDetails);
                var       deserializedFacility = JsonConvert.DeserializeObject <Facility>(strfacilityDetails);
                string    strAuth          = isolatedLocalStorage.Read(IsolatedFiles.authFile);
                var       deserializedAuth = JsonConvert.DeserializeObject <Auth>(strAuth);
                ItemClass workerPostItem   = new ItemClass();
                workerPostItem.name       = txtName.Text.ToUpper();
                workerPostItem.facilityId = deserializedFacility.Id;
                string strPersons = await httpClientServices.CreateAsync(EndPoints.workerPosts, workerPostItem, deserializedAuth.AccessToken);

                var deserializedworkerPostItem = JsonConvert.DeserializeObject <ItemClass>(strPersons);
                GetWorkerPosts();
            }
            catch (Exception ex)
            {
            }
        }