private void btngeri_Click(object sender, EventArgs e)
        {
            Faturalar fat = new Faturalar();

            fat.yonetici = yonetici;
            fat.seller   = seller;
            this.Hide();
            fat.Show();
        }
        private void picSave_Click(object sender, EventArgs e)
        {
            Random  rastgele = new Random();
            Invoice inv      = new Invoice();

            inv.CompanyName   = (int)comboacenta.SelectedValue;
            inv.Address       = textaddress.Text;
            inv.City          = textsehir.Text;
            inv.PostalCode    = Convert.ToInt32(textposta.Text);
            inv.Seller        = (int)combosatıcı.SelectedValue;
            inv.Date          = DateTime.Today;
            inv.InvoiceNumber = rastgele.Next(1905, 5000);

            ctx.Invoices.InsertOnSubmit(inv);
            ctx.SubmitChanges();

            Faturalar fat = new Faturalar();

            fat.yonetici = yonetici;
            fat.seller   = seller;
            this.Hide();
            fat.Show();
        }
        private void btndel_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Bu kaydı silmek istediğinizden emin misiniz ?", "Dikkat", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                if (dataGridViewfatura.CurrentRow == null)
                {
                    return;
                }

                int id = (int)dataGridViewfatura.CurrentRow.Cells["RecId"].Value;

                Invoice inv = ctx.Invoices.SingleOrDefault(i => i.RecId == id);

                ctx.Invoices.DeleteOnSubmit(inv);
                ctx.SubmitChanges();

                Faturalar fat = new Faturalar();
                fat.yonetici = yonetici;
                fat.seller   = seller;
                this.Hide();
                fat.Show();
            }
        }