Ejemplo n.º 1
0
        public bool writeStringSettingsToLocalStorage(Windows.Storage.ApplicationDataCompositeValue composite, string key, string value)
        {
            if (!composite.ContainsKey(key))
            {
                composite.Add(key, value);
            }
            else
            {
                composite[key] = value;
            }

            return(true);
        }
Ejemplo n.º 2
0
        public bool writeSettingsToLocalStorage(Windows.Storage.ApplicationDataCompositeValue composite, int Idx)
        {
            String key = getCompositePropertyIDName("m_DataCompositeIDName", Idx);

            if (!composite.ContainsKey(key))
            {
                composite.Add(key, m_DataCompositeIDName);
            }
            else
            {
                composite[key] = m_DataCompositeIDName;
            }

            return(true);
        }
Ejemplo n.º 3
0
        private void GetSaves()
        {
            Windows.Storage.ApplicationDataContainer localSettings =
                Windows.Storage.ApplicationData.Current.LocalSettings;


            if (localSettings.Values.ContainsKey("TypeOfSUP"))
            {
                Windows.Storage.ApplicationDataCompositeValue TypeSUP =
                    (Windows.Storage.ApplicationDataCompositeValue)localSettings.Values["TypeOfSUP"];

                if (TypeSUP.ContainsKey("nb"))
                {
                    int nb = (int)TypeSUP["nb"];

                    for (int i = 0; i < nb; i++)
                    {// retrieve all
                        string I    = i.ToString();
                        string name = I + "NAME";
                        string id   = I + "ID";
                        string demi = I + "DEMI";
                        string hour = I + "HOUR";
                        string supp = I + "SUPP";

                        string Name = (string)TypeSUP[name];
                        int    ID   = Int32.Parse((string)TypeSUP[id]);
                        int    Demi = Int32.Parse((string)TypeSUP[demi]);
                        int    Hour = Int32.Parse((string)TypeSUP[hour]);
                        int    Supp = Int32.Parse((string)TypeSUP[supp]);

                        SUPData nData = new SUPData(Name, ID, Demi, Hour, Supp);
                        SUPCategory.Add(nData);
                    }
                }
            }
            if (localSettings.Values.ContainsKey("StockSUP"))
            {
                Windows.Storage.ApplicationDataCompositeValue SUPStock =
                    (Windows.Storage.ApplicationDataCompositeValue)localSettings.Values["StockSUP"];
                if (SUPStock.ContainsKey("nb"))
                {
                    int nb = (int)SUPStock["nb"];

                    for (int i = 0; i < nb; i++)
                    {// retrieve all
                        string I    = i.ToString();
                        string type = I + "TYPE";
                        string id   = I + "ID";

                        string Type = (string)SUPStock[type];
                        Int64  ID   = (Int64)SUPStock[id];

                        foreach (var tp in SUPCategory)
                        {
                            if (tp.Name == Type)
                            {
                                SUP nSUP = new SUP(ID, tp);
                                StockSUP.Add(nSUP);
                                break;
                            }
                        }
                    }
                }
            }
            if (localSettings.Values.ContainsKey("AwaySUP"))
            {
                Windows.Storage.ApplicationDataCompositeValue SUPAway =
                    (Windows.Storage.ApplicationDataCompositeValue)localSettings.Values["AwaySUP"];
                if (SUPAway.ContainsKey("nb"))
                {
                    int nb = (int)SUPAway["nb"];

                    for (int i = 0; i < nb; i++)
                    {// retrieve all
                        string I    = i.ToString();
                        string type = I + "TYPE";
                        string id   = I + "ID";
                        string time = I + "TIME";


                        string         Type = (string)SUPAway[type];
                        Int64          ID   = (Int64)SUPAway[id];
                        DateTimeOffset left = (DateTimeOffset)SUPAway[time];
                        foreach (var tp in SUPCategory)
                        {
                            if (tp.Name == Type)
                            {
                                SUP nSUP = new SUP(ID, tp, left);
                                AwaySUP.Add(nSUP);
                                break;
                            }
                        }
                    }
                }
            }
        }