コード例 #1
0
        private void btn_Click(object sender, EventArgs e)
        {
            if (rodzaj == 0)
            {
                if (txt_tekst.Text != "")
                {
                    kategoria nowa = new kategoria();
                    if (id_nadkat == -1)
                    {
                        if (tekst == "wydatek")
                        {
                            nowa.nazwa           = txt_tekst.Text;
                            nowa.id_nadkategoria = null;
                            nowa.typ             = "wydatek";
                        }
                        else
                        {
                            nowa.nazwa           = txt_tekst.Text;
                            nowa.id_nadkategoria = null;
                            nowa.typ             = "przychod";
                        }
                    }
                    else
                    {
                        nowa.nazwa           = txt_tekst.Text;
                        nowa.id_nadkategoria = id_nadkat;
                        nowa.typ             = null;
                    }

                    db.kategoria.InsertOnSubmit(nowa);
                    db.SubmitChanges();
                    txt_tekst.Clear();
                }
            }
            else if (rodzaj == 1)
            {
                var kat = from k in db.kategoria
                          where k.nazwa == tekst
                          select k;

                foreach (var u in kat)
                {
                    MessageBox.Show(u.nazwa);
                    u.nazwa = txt_tekst.Text;
                    MessageBox.Show(u.nazwa);
                }
                db.SubmitChanges();
            }
            other.wczytaj_kategorie();
            other.OtwartyUcDodajKategorie = 0;
            this.Parent.Controls.Remove(this);
        }
コード例 #2
0
 private void detach_kategoria2(kategoria entity)
 {
     this.SendPropertyChanging();
     entity.kategoria1 = null;
 }
コード例 #3
0
 private void attach_kategoria2(kategoria entity)
 {
     this.SendPropertyChanging();
     entity.kategoria1 = this;
 }
コード例 #4
0
 partial void Deletekategoria(kategoria instance);
コード例 #5
0
 partial void Updatekategoria(kategoria instance);
コード例 #6
0
 partial void Insertkategoria(kategoria instance);