Exemple #1
0
        public static MagCompan GetMagCompan()
        {
            MagCompan magCompan = null;

            try
            {
                if (File.Exists(MagCompanFilePath))
                {
                    string json = File.ReadAllText(MagCompanFilePath);
                    magCompan = JsonConvert.DeserializeObject <MagCompan>(json);
                }
            }
            catch (Exception ex)
            {
            }

            return(magCompan);
        }
Exemple #2
0
        public static _result SaveMagCompan(MagCompan magCompan)
        {
            _result rslt = new _result();

            try
            {
                string json = JsonConvert.SerializeObject(magCompan);
                File.WriteAllText(MagCompanFilePath, json);
                rslt.Succes = true;
            }
            catch (Exception ex)
            {
                rslt.Succes  = false;
                rslt.Message = ex.Message;
            }

            return(rslt);
        }