示例#1
0
        private void OgrenciListesi_Load(object sender, EventArgs e)
        {
            DURUM.SelectedIndex = 0;
            imageTypeList.Add("JPG");
            imageTypeList.Add("JPEG");
            imageTypeList.Add("PNG");

            SQLQry qryUni = new SQLQry();

            qryUni.SQLText = "SELECT UNIVERSITE_ID, UNIVERSITE_ADI FROM TBLUNIVERSITE WHERE ISNULL(DURUM, 0) = 1";
            qryUni.Open();
            uniList.Clear();
            UNIVERSITE.Items.Clear();
            if (qryUni.Found())
            {
                for (int i = 0; i < qryUni.DataCount(); i++)
                {
                    Universite uni = new Universite();
                    uni.universiteID  = qryUni.GetInt("UNIVERSITE_ID");
                    uni.universiteAdi = qryUni.GetString("UNIVERSITE_ADI");
                    uniList.Add(uni);
                    qryUni.Next();
                }
            }

            foreach (Universite uni in uniList)
            {
                UNIVERSITE.Items.Add(uni.universiteAdi);
            }

            RefreshGrid();
        }
示例#2
0
        public async Task <IActionResult> Edit(int id, [Bind("UniversiteId,UniversiteAdi")] Universite universite)
        {
            if (id != universite.UniversiteId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(universite);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!UniversiteExists(universite.UniversiteId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(universite));
        }
示例#3
0
        public ActionResult UniversiteDeleteConfirmed(int id)
        {
            Universite universite = db.Universite.Find(id);

            db.Universite.Remove(universite);
            db.SaveChanges();
            return(RedirectToAction("UniversiteIndex"));
        }
示例#4
0
 public ActionResult UniversiteEdit([Bind(Include = "UniversiteID,Ad,Sehirler,Bolum")] Universite universite)
 {
     if (ModelState.IsValid)
     {
         db.Entry(universite).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("UniversiteIndex"));
     }
     return(View(universite));
 }
示例#5
0
        public ActionResult UniversiteCreate([Bind(Include = "UniversiteID,Ad,Sehirler,Bolum")] Universite universite)
        {
            if (ModelState.IsValid)
            {
                db.Universite.Add(universite);
                db.SaveChanges();
                return(RedirectToAction("UniversiteIndex"));
            }

            return(View(universite));
        }
示例#6
0
        public async Task <IActionResult> Create([Bind("UniversiteId,UniversiteAdi")] Universite universite)
        {
            if (ModelState.IsValid)
            {
                _context.Add(universite);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(universite));
        }
        public async Task <ActionResult <IEnumerable <Fakulte> > > GetFakulteler(int uniId)
        {
            Universite uni = await _context.Universiteler.Include(x => x.Fakulteler).FirstOrDefaultAsync(x => x.Id == uniId);

            if (uni == null)
            {
                return(NotFound());
            }

            return(uni.Fakulteler);
        }
示例#8
0
        public async Task <ActionResult <Universite> > Get(int id)
        {
            Universite uni = await _context.Universiteler.Include(x => x.Fakulteler)
                             .FirstOrDefaultAsync(x => x.Id == id);

            if (uni == null)
            {
                return(NotFound());
            }

            return(uni);
        }
示例#9
0
        // GET: Universite/Delete/5
        public ActionResult UniversiteDelete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Universite universite = db.Universite.Find(id);

            if (universite == null)
            {
                return(HttpNotFound());
            }
            return(View(universite));
        }
示例#10
0
        private List <Universite> okuUniversiteListe()
        {
            string            connetionString = null;
            SqlConnection     cnn             = null;
            SqlCommand        cmd             = null;
            List <Universite> universiteListe = new List <Universite>();
            int        id         = int.MinValue;
            string     adi        = null;
            Universite universite = null;

            connetionString = "Data Source=DESKTOP-JP3T3G6;Initial Catalog=DKMPKisi;Integrated Security=True;Encrypt=False;TrustServerCertificate=True;ApplicationIntent=ReadWrite;MultiSubnetFailover=False";
            cnn             = new SqlConnection(connetionString);

            cmd             = new SqlCommand();
            cmd.CommandText = "SELECT * FROM Customers";
            cmd.CommandType = CommandType.Text;
            cmd.Connection  = cnn;

            try
            {
                cnn.Open();
                using (SqlDataReader reader = cmd.ExecuteReader())
                {
                    // Check is the reader has any rows at all before starting to read.
                    if (reader.HasRows)
                    {
                        // Read advances to the next row.
                        while (reader.Read())
                        {
                            // To avoid unexpected bugs access columns by name.
                            id  = reader.GetInt32(reader.GetOrdinal("id"));
                            adi = reader.GetString(reader.GetOrdinal("name"));

                            universite = new Universite(id, adi);
                            universiteListe.Add(universite);
                        }
                    }
                }


                cnn.Close();

                return(universiteListe);
            }
            catch (Exception)
            {
            }

            return(new List <Universite>());
        }
示例#11
0
        private void OgrenciDuzenleme_Load(object sender, EventArgs e)
        {
            SQLQry qryIl = new SQLQry();

            qryIl.SQLText = "SELECT IL_ADI FROM TBLIL";
            qryIl.Open();
            if (qryIl.Found())
            {
                for (int i = 0; i < qryIl.DataCount(); i++)
                {
                    OKUDUGU_IL.Items.Add(qryIl.GetString("IL_ADI"));
                    qryIl.Next();
                }
            }

            SQLQry qryUni = new SQLQry();

            qryUni.SQLText = "SELECT UNIVERSITE_ID, UNIVERSITE_ADI FROM TBLUNIVERSITE WHERE ISNULL(DURUM, 0) = 1";
            qryUni.Open();
            uniList.Clear();
            UNIVERSITE.Items.Clear();
            if (qryUni.Found())
            {
                for (int i = 0; i < qryUni.DataCount(); i++)
                {
                    Universite uni = new Universite();
                    uni.universiteID  = qryUni.GetInt("UNIVERSITE_ID");
                    uni.universiteAdi = qryUni.GetString("UNIVERSITE_ADI");
                    uniList.Add(uni);
                    qryUni.Next();
                }
            }

            foreach (Universite uni in uniList)
            {
                UNIVERSITE.Items.Add(uni.universiteAdi);
            }

            SQLQry qryOgrenci = new SQLQry();

            qryOgrenci.SQLText = "SELECT TC_KIMLIK,OGRENCI_ADI,OGRENCI_SOYADI,TEL_NO,DOGUM_YERI,DOGUM_TARIHI,E_POSTA,BABA_ADI,ANNE_ADI,VELI_TELEFON,OKUDUGU_IL,OKUDUGU_UNIVERSITE" +
                                 ",OKUDUGU_BOLUM,SINIF,BANKA_ADI,SUBE_ADI,HESAP_NO,IBAN_NO,FAKULTE, ISNULL(ARFLOAT_1, 0) ARFLOAT_1, ISNULL(ARSTR_1, '') ARSTR_1 FROM TBLOGRENCI WHERE REC_ID = " + recID;
            qryOgrenci.Open();
            if (qryOgrenci.Found())
            {
                Text = qryOgrenci.GetString("OGRENCI_ADI") + " " + qryOgrenci.GetString("OGRENCI_SOYADI");
                ScreenFill(qryOgrenci);
            }
        }
示例#12
0
 public bool Kaydet(Universite o)
 {
     try
     {
         Helper         hlp = new Helper();
         SqlParameter[] p   = { new SqlParameter("@Ad", o.Ad), new SqlParameter("@Soyad", o.Soyad), new SqlParameter("@Numara", o.Numara), new SqlParameter("@SinifId", o.Sinifid) };
         return(hlp.ExecuteNonQuery("Insert into tblOgrenciler values(@Ad,@Soyad,@Numara,@SinifId)", p) > 0);
     }
     catch (SqlException ex)
     {
         throw ex;
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
示例#13
0
        public Universite OgrenciBul(int numara)
        {
            Helper hlp = new Helper();

            SqlParameter[] p  = { new SqlParameter("@Numara", numara) };
            SqlDataReader  dr = hlp.ExecuteReader("Select OgrenciId,Ad,Soyad,Numara,SinifId from tblOgrenciler Where Numara=@Numara", p);
            Universite     o  = null;

            if (dr.Read())
            {
                o           = new Universite();
                o.Ad        = dr["Ad"].ToString();
                o.Soyad     = dr["Soyad"].ToString();
                o.Numara    = Convert.ToInt32(dr["Numara"]);
                o.Ogrenciid = Convert.ToInt32(dr["OgrenciId"]);
                o.Sinifid   = Convert.ToInt32(dr["SinifId"]);
            }
            dr.Close();
            return(o);
        }
示例#14
0
        public async Task <ActionResult <Universite> > AddUniversity(string UniName)
        {
            if (UniName == null)
            {
                return(BadRequest());
            }

            Universite uni = await _context.Universiteler.FirstOrDefaultAsync(x => x.Ad == UniName);

            if (uni != null)
            {
                return(uni);
            }

            Universite newUni = new Universite()
            {
                Ad = UniName
            };

            _context.Universiteler.Add(newUni);
            await _context.SaveChangesAsync();

            return(newUni);
        }