Exemple #1
0
 public static bool Save()
 {
     try
     {
         Dictionary <string, object> data = GetCustomList();
         if (data != null)
         {
             System.Web.Script.Serialization.JavaScriptSerializer javaScriptSerializer = new System.Web.Script.Serialization.JavaScriptSerializer();
             string jsondata = javaScriptSerializer.Serialize(data);
             if (!string.IsNullOrEmpty(jsondata))
             {
                 using (System.IO.StreamWriter sw = new System.IO.StreamWriter(FilePath))
                 {
                     sw.Write(jsondata);
                     sw.Close();
                 }
                 System.Web.HttpContext.Current.Application["kategoriler"] = KategoriMethods.Read();
                 return(true);
             }
         }
         return(false);
     }
     catch (Exception)
     {
         return(false);
     }
 }
Exemple #2
0
 protected void Application_Start()
 {
     try
     {
         Application["kategoriler"] = KategoriMethods.Read();
     }
     catch (Exception)
     {
     }
 }