protected void Ekle() { EFDal ed = new EFDal(); using (sfKalDataEntities ent = new sfKalDataEntities()) { try { Egitim oEgitim = new Egitim(); oEgitim.FirmaId = int.Parse(_FirmaId.Text.Trim()); oEgitim.Egitimci = _Egitimci.Text.Trim(); oEgitim.EgitimiAlan = _EgitimiAlan.Text.Trim(); oEgitim.EgitimTarihi = clnEgitimTar.SelectedDate.Value; //oEgitim.EgitimTarihi = DateTime.Parse("2010.06.14"); oEgitim.EgitiminKonusu = _EgitiminKonusu.Text.Trim(); oEgitim.SertifikaNo = _SertifikaNo.Text.Trim(); oEgitim.EgitimYeri = _EgitimYeri.Text.Trim(); oEgitim.BolgeKodu = (short)ed.kal_BolgeKoduDon(Context.User.Identity.Name); oEgitim.EgitimBedeli = decimal.Parse(_EgitimBedeli.Text); oEgitim.EgitimGunSayisi = short.Parse(_EgitimGunSayisi.Text); ent.AddToEgitim(oEgitim); ent.SaveChanges(); lblUyari.ForeColor = System.Drawing.Color.Green; lblUyari.Text = "Kayıt ekleme işlemi başarılı!"; } catch (Exception exc) { lblUyari.ForeColor = System.Drawing.Color.Red; lblUyari.Text = "Kayıt ekleme işlemi başarısız!Hata:" + exc.Message; } } }
/// <summary> /// Deprecated Method for adding a new object to the Egitim EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToEgitim(Egitim egitim) { base.AddObject("Egitim", egitim); }
/// <summary> /// Create a new Egitim object. /// </summary> /// <param name="id">Initial value of the Id property.</param> /// <param name="firmaId">Initial value of the FirmaId property.</param> /// <param name="egitimci">Initial value of the Egitimci property.</param> /// <param name="egitimiAlan">Initial value of the EgitimiAlan property.</param> /// <param name="egitimTarihi">Initial value of the EgitimTarihi property.</param> /// <param name="egitiminKonusu">Initial value of the EgitiminKonusu property.</param> /// <param name="sertifikaNo">Initial value of the SertifikaNo property.</param> /// <param name="egitimYeri">Initial value of the EgitimYeri property.</param> /// <param name="bolgeKodu">Initial value of the BolgeKodu property.</param> /// <param name="egitimBedeli">Initial value of the EgitimBedeli property.</param> /// <param name="egitimGunSayisi">Initial value of the EgitimGunSayisi property.</param> public static Egitim CreateEgitim(global::System.Int32 id, global::System.Int32 firmaId, global::System.String egitimci, global::System.String egitimiAlan, global::System.DateTime egitimTarihi, global::System.String egitiminKonusu, global::System.String sertifikaNo, global::System.String egitimYeri, global::System.Int16 bolgeKodu, global::System.Decimal egitimBedeli, global::System.Int16 egitimGunSayisi) { Egitim egitim = new Egitim(); egitim.Id = id; egitim.FirmaId = firmaId; egitim.Egitimci = egitimci; egitim.EgitimiAlan = egitimiAlan; egitim.EgitimTarihi = egitimTarihi; egitim.EgitiminKonusu = egitiminKonusu; egitim.SertifikaNo = sertifikaNo; egitim.EgitimYeri = egitimYeri; egitim.BolgeKodu = bolgeKodu; egitim.EgitimBedeli = egitimBedeli; egitim.EgitimGunSayisi = egitimGunSayisi; return egitim; }