Esempio n. 1
0
        public bool Guncelle(Adminmodel p, int AdmId)
        {
            try
            {
                MotorContext ctx = new MotorContext();
                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;
            }
        }
Esempio n. 2
0
 public bool Sil(Adminmodel adm)
 {
     try
     {
         MotorContext ctx = new MotorContext();
         ctx.Admins.Remove(adm);
         return(ctx.SaveChanges() > 0);
     }
     catch (Exception)
     {
         throw;
     }
 }
Esempio n. 3
0
 public bool AdminEkle(Adminmodel prs)
 {
     try
     {
         MotorContext ctx = new MotorContext();
         ctx.Admins.Add(prs);
         return(ctx.SaveChanges() > 0);
     }
     catch (Exception)
     {
         throw;
     }
 }
Esempio n. 4
0
        public List <Adminmodel> Listele()
        {
            try
            {
                MotorContext      ctx = new MotorContext();
                List <Adminmodel> lst = ctx.Admins.ToList();

                if (lst != null)
                {
                    return(lst);
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }