Exemplo n.º 1
0
        /// <summary>
        /// Data mapped by the user
        /// </summary>
        private void ConvertMappedData()
        {
            if (PickerData.Count < 1)
            {
                return;
            }

            List <LunPerVdiImportPickerItem> mappedData = PickerData.ConvertAll(i => i as LunPerVdiImportPickerItem);

            foreach (KeyValuePair <string, VmMapping> pair in mappingsToMap)
            {
                string sysId = pair.Key;
                foreach (IStorageResource resourceData in ResourceData(sysId))
                {
                    List <LunPerVdiImportPickerItem> items = (from i in mappedData
                                                              where i.VmKey == sysId
                                                              select i).ToList();

                    foreach (LunPerVdiImportPickerItem item in items)
                    {
                        if (item.IsValidForMapping &&
                            !pair.Value.StorageToAttach.ContainsKey(item.SrKey) &&
                            pair.Value.Storage.ContainsKey(item.SrKey))
                        {
                            pair.Value.StorageToAttach.Add(item.SrKey, item.SelectedVdi);
                            pair.Value.Storage.Remove(item.SrKey);
                        }
                    }
                }
            }
        }
Exemplo n.º 2
0
        public void SetData(PickerData data)
        {
            _currentLevel = data.PickerLevel;
            _currentCost  = data.PickerCost;
            _pickerButton.SetActive(data.PickerButtonActive);

            UpdatePickerUI();
        }
Exemplo n.º 3
0
        public PickerData GetData(PickerData data)
        {
            data.PickerLevel = _currentLevel;
            data.PickerCost  = _currentCost;

            data.PickerButtonActive = _pickerButton.activeInHierarchy;

            return(data);
        }
Exemplo n.º 4
0
        public void GetCurrentData(GameData data)
        {
            PlasticData plasticData = new PlasticData();

            data.PlasticData = _plastic.GetData(plasticData);

            TransactionData transactionData = new TransactionData();

            data.TransactionData = _transaction.GetData(transactionData);

            List <PickerData> pickerDatas = new List <PickerData>();

            for (int i = 0; i < _pickerList.Count; i++)
            {
                PickerData pickerData = new PickerData();

                pickerDatas.Add(_pickerList[i].GetData(pickerData));

                data.PickerDataList.Add(pickerDatas[i]);
            }
        }
Exemplo n.º 5
0
        public ReadDataViewModel()
        {
            var    assembly = typeof(ReadDataViewModel).GetTypeInfo().Assembly;
            Stream stream   = assembly.GetManifestResourceStream("ReadDataFromJson.getbannerdata.json");


            PickerData obj = new PickerData();

            obj.Name = "Bharath";
            obj.Id   = "702";

            PickerData objTwo = new PickerData();

            objTwo.Name = "subbu";
            objTwo.Id   = "802";

            rootObjectSe.Add(obj);
            rootObjectSe.Add(objTwo);



            using (var reader = new System.IO.StreamReader(stream))
            {
                var           json = reader.ReadToEnd();
                RootObjectNew data = JsonConvert.DeserializeObject <RootObjectNew>(json);

                for (int i = 0; i < data.SearchOrgUsersResult.Count; i++)
                {
                    SearchOrgUsersResult dataObject = data.SearchOrgUsersResult[i];
                    Debug.WriteLine("First Major ID :" + i + "= " + dataObject.FirstName);
                    Debug.WriteLine("First Major Name :" + i + "= " + dataObject.LastName);
                    orgRelatedData.Add(dataObject);
                }
                SroringData = orgRelatedData;
            }
        }
Exemplo n.º 6
0
        //Picker related data end

        //public void textChangedMethod(string searchBarText)
        //{
        //	//orgRelatedData = orgRelatedData.OrderBy(x => x.FirstName).ToList();
        //	if (searchBarText == null || searchBarText == "")
        //	{
        //		Debug.WriteLine("Cancel Pressed");
        //		orgRelatedData = SroringData;
        //	}

        //	else if (searchBarText.Length > 0)
        //	{
        //		orgRelatedData = SroringData.Where(x => x.FirstName.Contains(searchBarText)).ToList();
        //	}

        //	OnPropertyChanged("OrgRelatedData");
        //}


        public ReadDataViewModel(INavigation navigation)
        {
            IsBusy = true;

            _navigation = navigation;
            var    assembly = typeof(ReadDataViewModel).GetTypeInfo().Assembly;
            Stream stream   = assembly.GetManifestResourceStream("ReadDataFromJson.getbannerdata.json");

            PopOverView = false;

            inputData inputDatobj = new inputData();

            inputDatobj.Org_Id = 11;


            PickerData obj = new PickerData();

            obj.Name = "Bharath";
            obj.Id   = "702";

            PickerData objTwo = new PickerData();

            objTwo.Name = "subbu";
            objTwo.Id   = "802";

            rootObjectSe.Add(obj);
            rootObjectSe.Add(objTwo);



            //         JSSEData jsseOne = new JSSEData();
            //         jsseOne.jsseId = 35;
            //         jsseOne.jsseDate = "08/03/2017";
            //         jsseOne.status = "Submitted";


            //JSSEData jsseTwo = new JSSEData();
            //jsseTwo.jsseId = 52;
            //jsseTwo.jsseDate = "08/09/2017";
            //jsseTwo.status = "Submitted";

            //JSSEData jsseThree = new JSSEData();
            //jsseThree.jsseId = 68;
            //jsseThree.jsseDate = "08/15/2017";
            //jsseThree.status = "Draft";

            //JSSEData jsseFour = new JSSEData();
            //jsseFour.jsseId = 73;
            //jsseFour.jsseDate = "08/23/2017";
            //jsseFour.status = "Draft";

            //orgRelatedData.Add(jsseOne);
            //orgRelatedData.Add(jsseTwo);
            //orgRelatedData.Add(jsseThree);
            //orgRelatedData.Add(jsseThree);


            using (var reader = new System.IO.StreamReader(stream))
            {
                var json = reader.ReadToEnd();
                List <RootObjectJSSE> data = JsonConvert.DeserializeObject <List <RootObjectJSSE> >(json);
                //for (int i = 0; i < data.Count; i++)
                //{
                //	//SearchOrgUsersResult dataObject = data[i];
                //                Debug.WriteLine("First Major ID :" + i + "= " + data[i].JSSE_ID);
                //	//Debug.WriteLine("First Major Name :" + i + "= " + dataObject.LastName);
                //	orgRelatedData.Add(dataObject);
                //}
                SroringData    = data;
                orgRelatedData = data;
            }
            Device.BeginInvokeOnMainThread(() =>
            {
                IsBusy = false;
            });
        }
        //Picker related data end

        //public void textChangedMethod(string searchBarText)
        //{
        //	//orgRelatedData = orgRelatedData.OrderBy(x => x.FirstName).ToList();
        //	if (searchBarText == null || searchBarText == "")
        //	{
        //		Debug.WriteLine("Cancel Pressed");
        //		orgRelatedData = SroringData;
        //	}

        //	else if (searchBarText.Length > 0)
        //	{
        //		orgRelatedData = SroringData.Where(x => x.FirstName.Contains(searchBarText)).ToList();
        //	}

        //	OnPropertyChanged("OrgRelatedData");
        //}


        public ReadDataViewModel()
        {
            var    assembly = typeof(ReadDataViewModel).GetTypeInfo().Assembly;
            Stream stream   = assembly.GetManifestResourceStream("ReadDataFromJson.getbannerdata.json");


            PickerData obj = new PickerData();

            obj.Name = "Bharath";
            obj.Id   = "702";

            PickerData objTwo = new PickerData();

            objTwo.Name = "subbu";
            objTwo.Id   = "802";

            rootObjectSe.Add(obj);
            rootObjectSe.Add(objTwo);



            JSSEData jsseOne = new JSSEData();

            jsseOne.jsseId   = 35;
            jsseOne.jsseDate = "08/03/2017";
            jsseOne.status   = "Submitted";


            JSSEData jsseTwo = new JSSEData();

            jsseTwo.jsseId   = 52;
            jsseTwo.jsseDate = "08/09/2017";
            jsseTwo.status   = "Submitted";

            JSSEData jsseThree = new JSSEData();

            jsseThree.jsseId   = 68;
            jsseThree.jsseDate = "08/15/2017";
            jsseThree.status   = "Draft";

            JSSEData jsseFour = new JSSEData();

            jsseFour.jsseId   = 73;
            jsseFour.jsseDate = "08/23/2017";
            jsseFour.status   = "Draft";

            orgRelatedData.Add(jsseOne);
            orgRelatedData.Add(jsseTwo);
            orgRelatedData.Add(jsseThree);
            orgRelatedData.Add(jsseThree);

            //using (var reader = new System.IO.StreamReader(stream))
            //{

            //	var json = reader.ReadToEnd();
            //	RootObjectNew data = JsonConvert.DeserializeObject<RootObjectNew>(json);

            //	for (int i = 0; i < data.SearchOrgUsersResult.Count; i++)
            //	{
            //		SearchOrgUsersResult dataObject = data.SearchOrgUsersResult[i];
            //		Debug.WriteLine("First Major ID :" + i + "= " + dataObject.FirstName);
            //		Debug.WriteLine("First Major Name :" + i + "= " + dataObject.LastName);
            //		orgRelatedData.Add(dataObject);
            //	}
            //	SroringData = orgRelatedData;
            //}
        }
Exemplo n.º 8
0
        /// <summary>
        /// Replaces the current picker entries with the given ones.
        /// This will reset all rows back to the top.
        /// </summary>
        public void UpdateData(IEnumerable<string[]> newDataSet)
        {
            if (pickerData == null)
            {
                pickerData = new PickerData(newDataSet);
            }
            else
            {
                pickerData.Data = newDataSet.ToArray();
            }

            // reset all rows back to 0
            selectedRows = new int[newDataSet.Count()];

            FormatValue();
        }
Exemplo n.º 9
0
        /// <summary>
        /// Creates a picker with custom options in multiple columns.
        /// </summary>
        public PickerElement(string caption, IEnumerable<string[]> entries, params int[] selected)
            : base(caption)
        {
            pickerType = PickerType.Custom;

            if (pickerView == null)
            {
                pickerView = new UIPickerView(new RectangleF(0, 152, 320, 100));
                pickerView.ShowSelectionIndicator = true;
            }

            if (toolBar == null)
            {
                toolBar = new UIToolbar(new RectangleF(0, 108, 320, 44));
                toolBar.BarStyle = UIBarStyle.Black;
            }

            pickerData = new PickerData(entries);
            pickerData.ValueSelected += () => {
                for (int i = 0; i < selectedRows.Length; i++)
                    selectedRows[i] = pickerView.SelectedRowInComponent(i);

                if (RowsSelected != null)
                    RowsSelected(selectedRows);

                FormatValue();
            };

            int count = entries.Count();
            selectedRows = new int[count];

            string formatter = "";
            for (int i = 0; i < count; i++)
            {
                // the default format string simply separates each string with a space
                formatter += " {" + i + "}";

                if (selected.Length > i)
                    selectedRows[i] = selected[i];
            }

            FormatString = formatter.Trim();
        }