示例#1
0
        public List <DoktorEntities> TumDoktorlariGetir()
        {
            List <DoktorEntities> DoktorList = new List <DoktorEntities>();

            cmd = new SqlCommand("Select * From Doktorlar", conn);
            DoktorEntities currentUser = null;

            conn.Open();
            SqlDataReader reader = cmd.ExecuteReader(CommandBehavior.CloseConnection);

            while (reader.Read())
            {
                currentUser = new DoktorEntities()
                {
                    DoktorID     = reader.GetInt32(0),
                    Adi          = reader.GetString(1),
                    Soyadi       = reader.GetString(2),
                    Cinsiyet     = reader.GetBoolean(3),
                    HastaneID    = reader.GetInt32(4),
                    DepartmanID  = reader.GetInt32(5),
                    KullaniciAdi = reader.GetString(6),
                    Sifre        = reader.GetString(7)
                };
                DoktorList.Add(currentUser);
            }
            reader.Close();
            return(DoktorList);
        }
示例#2
0
 void AddParametersToCommand(DoktorEntities doktor)
 {
     //cmd.Parameters.AddWithValue("@DoktorID", doktor.DoktorID);
     cmd.Parameters.AddWithValue("@Adi", doktor.Adi);
     cmd.Parameters.AddWithValue("@Soyadi", doktor.Soyadi);
     cmd.Parameters.AddWithValue("@Cinsiyet", doktor.Cinsiyet);
     cmd.Parameters.AddWithValue("@HastaneID", doktor.HastaneID);
     cmd.Parameters.AddWithValue("@DepartmanID", doktor.DepartmanID);
     cmd.Parameters.AddWithValue("@Kullaniciadi", doktor.KullaniciAdi);
     cmd.Parameters.AddWithValue("@Sifre", doktor.Sifre);
 }
示例#3
0
        public int EkleDoktor(DoktorEntities doktor)
        {
            cmd = new SqlCommand("INSERT INTO Doktorlar VALUES(@Adi, @Soyadi, @Cinsiyet,@HastaneID,@DepartmanID,@Kullaniciadi,@Sifre)", conn);
            AddParametersToCommand(doktor);

            conn.Open();
            int result = cmd.ExecuteNonQuery();

            conn.Close();
            return(result);
        }
示例#4
0
        public int Guncelle(DoktorEntities doktor)
        {
            cmd = new SqlCommand("Update Doktorlar set adi=@adi,soyadi=@soyadi where DoktorID=@did)", conn);
            AddParametersToCommand(doktor);
            cmd.Parameters.AddWithValue("@did", doktor.DoktorID);

            conn.Open();
            int result = cmd.ExecuteNonQuery();

            conn.Close();
            return(result);
        }
示例#5
0
        public DoktorEntities DoktorIDyeGore(int doktorID)
        {
            DoktorEntities currentUser = new DoktorEntities();

            cmd = new SqlCommand("Select * From Doktorlar Where DoktorID = @id", conn);
            cmd.Parameters.AddWithValue("@id", doktorID);
            conn.Open();
            SqlDataReader reader = cmd.ExecuteReader(CommandBehavior.CloseConnection);

            reader.Read();
            currentUser.DoktorID     = reader.GetInt32(0);
            currentUser.Adi          = reader.GetString(1);
            currentUser.Soyadi       = reader.GetString(2);
            currentUser.Cinsiyet     = reader.GetBoolean(3);
            currentUser.HastaneID    = reader.GetInt32(4);
            currentUser.DepartmanID  = reader.GetInt32(5);
            currentUser.KullaniciAdi = reader.GetString(6);
            currentUser.Sifre        = reader.GetString(7);

            reader.Close();
            return(currentUser);
        }
示例#6
0
        public DoktorFrm(int doktorID)
        {
            InitializeComponent();
            doktorController    = new DoktorController();
            randevuController   = new RandevuController();
            hastaController     = new HastaController();
            muayeneController   = new MuayeneController();
            departmanController = new DepartmanController();
            departman           = new DepartmanEntities();
            doktor           = new DoktorEntities();
            randevu          = new RandevuEntities();
            hasta            = new HastaEntities();
            randevus         = new List <RandevuHastaDTO>();
            muaneler         = new List <HastaMuaneleriDTO>();
            doktor           = doktorController.GetDoktor(doktorID);
            departman        = departmanController.IDyeGoreDepartmanGetir(doktor.DepartmanID);
            labelDoktor.Text = departman.DepartmanAdi + " Uzmanı Dr. " + doktor.Adi + " " + doktor.Soyadi;

            gBoxMuaneSorgula.Hide();
            gBoxHesapBilgileri.Hide();
            gBoxCalismaGunu.Hide();
        }