Exemplo n.º 1
0
        private void Btn_kaydet_Click(object sender, EventArgs e)
        {
            try
            {
                var hataKontrol = new HataKontrol();
                hataKontrol.TextBosKontrol(txtBransKod, "BransKod");
                if (hataKontrol.HataVarmi())
                {
                    return;
                }

                if (duzenlenenBrans == null)
                {
                    duzenlenenBrans = new Brans();
                }

                duzenlenenBrans.Kod         = txtBransKod.Text.Trim();
                duzenlenenBrans.Ad          = txtBransAd.Text.Trim();
                duzenlenenBrans.HizmetDurum = Convert.ToBoolean(cbHizmetDurum.Checked);
                duzenlenenBrans.Save();
                DialogResult = DialogResult.OK;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
Exemplo n.º 2
0
        private void BtnBransDuzenle_Click(object sender, EventArgs e)
        {
            duzenlenenBrans = (Brans)dgv_Kayit_Listele.CurrentRow.DataBoundItem;
            var duzenlemeFormu = new BransDuzenle(duzenlenenBrans);

            if (duzenlemeFormu.ShowDialog() == DialogResult.OK)
            {
                Brans.Reload();
            }
            return;
        }
Exemplo n.º 3
0
        public BransDuzenle(Brans brans)
        {
            InitializeComponent();
            duzenlenenBrans = brans;

            if (brans == null)
            {
                btn_sil.Visible = false;
            }
            else
            {
                brans.Reload();
                txtBransKod.Text      = duzenlenenBrans.Kod;
                txtBransAd.Text       = duzenlenenBrans.Ad;
                cbHizmetDurum.Checked = duzenlenenBrans.HizmetDurum;
            }
        }