Ejemplo n.º 1
0
 public void Add(OdaDAL oda)
 {
     try
     {
         ParseOda();
         OdaList = new List <OdaDAL>();
         OdaList.Add(oda);
         using (StreamWriter sw = File.CreateText(@"C:\Users\METEHAN\Desktop\proje2-yetisyagauss-master\proje2-yetisyagauss-master\proje2-yetisyagauss\DeuCSC.Proje2.DAL\Data\Musteriler.txt"))
         {
             JsonSerializer serializer = new JsonSerializer();
             serializer.Serialize(sw, OdaList);
         }
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
     }
 }
Ejemplo n.º 2
0
        public void Update(OdaDAL updatedOda)
        {
            try
            {
                ParseOda();
                var result = OdaList.Where(x => x.Id == updatedOda.Id).FirstOrDefault();
                result = updatedOda;

                using (StreamWriter sw = File.CreateText(@"C:\Users\METEHAN\Desktop\proje2-yetisyagauss-master\proje2-yetisyagauss-master\proje2-yetisyagauss\DeuCSC.Proje2.DAL\Data\Musteriler.txt"))
                {
                    JsonSerializer serializer = new JsonSerializer();
                    serializer.Serialize(sw, OdaList);
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Ejemplo n.º 3
0
 public void Update(OdaDAL oda)
 {
     try
     {
         ParseOdaFile();
         var result = OdaList.Where(x => x.Id == oda.Id).FirstOrDefault();
         OdaList.Remove(result);
         OdaList.Add(oda);
         using (StreamWriter sw = File.CreateText(@"C:\Users\Yasin\Documents\GitHub\proje2-yetisyagauss\proje2-yetisyagauss\DeuCSC.Proje2.DAL\Data\Odalar.txt"))
         {
             sw.Flush();
             JsonSerializer serializer = new JsonSerializer();
             serializer.Serialize(sw, OdaList);
         }
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
     }
 }
Ejemplo n.º 4
0
        public void Add(OdaDAL oda)
        {
            try
            {
                ParseOdaFile();
                if (OdaList == null)
                {
                    OdaList = new List <OdaDAL>();
                }

                OdaList.Add(oda);
                using (StreamWriter sw = File.CreateText(@"C:\Users\Yasin\Documents\GitHub\proje2-yetisyagauss\proje2-yetisyagauss\DeuCSC.Proje2.DAL\Data\Odalar.txt"))
                {
                    sw.Flush();
                    JsonSerializer serializer = new JsonSerializer();
                    serializer.Serialize(sw, OdaList);
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Ejemplo n.º 5
0
 public void Add(OdaDAL oda)
 {
 }