Exemplo n.º 1
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;
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 2
0
 public SUP(Int64 _ID, SUPData _Type, DateTimeOffset Left)
 {
     ID       = _ID;
     Type     = _Type;
     LeftTime = Left.UtcDateTime;
 }
Exemplo n.º 3
0
 public bool IsSameType(SUPData typ)
 {
     return(typ.ID == Type.ID);
 }
Exemplo n.º 4
0
 public SUP(Int64 _ID, SUPData _Type)
 {
     ID   = _ID;
     Type = _Type;
 }