예제 #1
0
        public void MusteriGuncelDoldur()
        {
            ArabaContext cc     = new ArabaContext();
            var          result = cc.Musteriler.Where(x => x.Username == label21.Text);

            dataGridmusteriprofil.DataSource = result.ToList();
        }
        public bool Guncelle(Adminmodel p, int AdmId)
        {
            try
            {
                ArabaContext ctx = new ArabaContext();
                Adminmodel   adm = ctx.admins.Find(AdmId);
                if (adm != null)
                {
                    int sonuc = ctx.SaveChanges();
                    if (sonuc > 0)
                    {
                        return(true);
                    }
                    else
                    {
                        return(false);
                    }
                }

                else
                {
                    return(false);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
예제 #3
0
 public virtual int Update()
 {
     try
     {
         dbContext = dbContext ?? new ArabaContext();
         return(dbContext.SaveChanges());
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #4
0
 public virtual int Delete(T entity)
 {
     try
     {
         dbContext = dbContext ?? new ArabaContext();
         dbContext.Set <T>().Remove(entity);
         return(dbContext.SaveChanges());
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 public bool Sil(Adminmodel adm)
 {
     try
     {
         ArabaContext ctx = new ArabaContext();
         ctx.admins.Remove(adm);
         return(ctx.SaveChanges() > 0);
     }
     catch (Exception)
     {
         throw;
     }
 }
 public bool AdminEkle(Adminmodel prs)
 {
     try
     {
         ArabaContext ctx = new ArabaContext();
         ctx.admins.Add(prs);
         return(ctx.SaveChanges() > 0);
     }
     catch (Exception)
     {
         throw;
     }
 }
        public List <Adminmodel> Listele()
        {
            try
            {
                ArabaContext      ctx = new ArabaContext();
                List <Adminmodel> lst = ctx.admins.ToList();

                if (lst != null)
                {
                    return(lst);
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
예제 #8
0
 public T GetByID(ID id)
 {
     dbContext = new ArabaContext();
     return(dbContext.Set <T>().Find(id));
 }
예제 #9
0
 public List <T> GetAll()
 {
     dbContext = new ArabaContext();
     return(dbContext.Set <T>().ToList());
 }
 public AdminRepository()
 {
     _ac = new ArabaContext();
 }
예제 #11
0
 public MarkaRepository()
 {
     _ac = new ArabaContext();
 }
 public MusteriRepository()
 {
     _ac = new ArabaContext();
 }
 public ModelRepository()
 {
     _ac = new ArabaContext();
 }