/// <summary>
 /// Deprecated Method for adding a new object to the GorevPersonel EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToGorevPersonel(GorevPersonel gorevPersonel)
 {
     base.AddObject("GorevPersonel", gorevPersonel);
 }
Пример #2
0
    protected void InsertItemButton_Click(object sender, EventArgs e)
    {
        if (clnGorevSuresiBaslangic.SelectedDate == null || clnGorevSuresiBitis.SelectedDate == null)
        {
            lblUyari.ForeColor = System.Drawing.Color.Red;
            lblUyari.Text = "Lütfen geçerli görev başlangıç ve bitiş tarihlerini belirleyiniz";
        }
        else
        {

            if (Session["OturumIcinGorevID"] == null)
            {
                lblUyari.Text = "Öncelikle sol taraftaki ögeleri kullanarak görev kapsamına bir firma ekleyip bir GorevId almalısınız. GorevId bulunamadı!";
            }
            else
            {
                using (sfKalDataEntities ent = new sfKalDataEntities())
                {
                    try
                    {
                        GorevPersonel oGorevPersonel = new GorevPersonel();
                        oGorevPersonel.GorevID = int.Parse(GorevID.Text.Trim());
                        oGorevPersonel.Personel = Personel.Text.Trim();
                        oGorevPersonel.GorevSuresi = clnGorevSuresiBaslangic.SelectedDate.Value;
                        oGorevPersonel.GorevSuresiBitis = clnGorevSuresiBitis.SelectedDate.Value;
                        oGorevPersonel.Unvan = Unvan.Text.Trim();
                        oGorevPersonel.Avans = decimal.Parse(Avans.Text.Trim());
                        oGorevPersonel.GorevKonusu = int.Parse(ddlGorevKonusu.SelectedValue);
                        ent.AddToGorevPersonel(oGorevPersonel);
                        ent.SaveChanges();
                        lblUyari.ForeColor = System.Drawing.Color.Green;
                        lblUyari.Text = "Görev-Personel ekleme başarılı.";
                        GorevPersonelGridiniBagla(int.Parse(GorevID.Text.Trim()));
                    }
                    catch (Exception exc)
                    {
                        lblUyari.ForeColor = System.Drawing.Color.Red;
                        lblUyari.Text = "Görev-Personel ekleme başarısız.Hata:" + exc.Message;
                    }
                }
            }
        }
    }
 /// <summary>
 /// Create a new GorevPersonel object.
 /// </summary>
 /// <param name="id">Initial value of the ID property.</param>
 /// <param name="gorevID">Initial value of the GorevID property.</param>
 /// <param name="personel">Initial value of the Personel property.</param>
 /// <param name="gorevSuresi">Initial value of the GorevSuresi property.</param>
 /// <param name="gorevSuresiBitis">Initial value of the GorevSuresiBitis property.</param>
 /// <param name="unvan">Initial value of the Unvan property.</param>
 /// <param name="avans">Initial value of the Avans property.</param>
 public static GorevPersonel CreateGorevPersonel(global::System.Int32 id, global::System.Int32 gorevID, global::System.String personel, global::System.DateTime gorevSuresi, global::System.DateTime gorevSuresiBitis, global::System.String unvan, global::System.Decimal avans)
 {
     GorevPersonel gorevPersonel = new GorevPersonel();
     gorevPersonel.ID = id;
     gorevPersonel.GorevID = gorevID;
     gorevPersonel.Personel = personel;
     gorevPersonel.GorevSuresi = gorevSuresi;
     gorevPersonel.GorevSuresiBitis = gorevSuresiBitis;
     gorevPersonel.Unvan = unvan;
     gorevPersonel.Avans = avans;
     return gorevPersonel;
 }