private void bUjfogl_Click(object sender, EventArgs e)
        {
            FoglUj cn = new FoglUj(sconn);
            cn.ShowDialog();

            try
            {
                if (int.Parse(cn.FoglId) != 0)      // ha a másik formon sikeres a mentés, átveszem az adatokat.
                {
                    txAdoszam.Text = cn.adoszam;
                    txMegnev.Text = cn.nev;
                    txAdoazon.Text = cn.Adoazon;
                    txIrszam.Text = cn.Irszam;
                    txHelyseg.Text = cn.Helyseg;
                    txCim.Text = cn.Cim;
                    txMegjegyzes.Text = cn.Megjegyzes;
                    txPnrid.Text = cn.FoglId;

                    txMegnev.ReadOnly = true;
                    txAdoszam.ReadOnly = true;
                    txCim.ReadOnly = true;
                    txHelyseg.ReadOnly = true;
                    txIrszam.ReadOnly = true;
                    txAdoazon.ReadOnly = true;
                }
            }
            catch
            {
                // nem történt módosítás
            }
        }
Ejemplo n.º 2
0
        public override void createNew()
        {
            FoglUj cn = new FoglUj(sconn);

            cn.ShowDialog();

            if (int.Parse(cn.FoglId) != 0)
            {
                txAdoszam.Text    = cn.adoszam;
                txMegnevezes.Text = cn.nev;
                cbFoglTipusa.Text = cn.FoglTipusa;
                txEgyeniVall.Text = cn.EgyeniVall;
                txAdoazon.Text    = cn.Adoazon;
                txOrszKod.Text    = cn.OrszKod;
                txIrszam.Text     = cn.Irszam;
                txHelyseg.Text    = cn.Helyseg;
                txCim.Text        = cn.Cim;
                txErtOrszKod.Text = cn.ErtOrszKod;
                txErtIrszam.Text  = cn.ErtIrszam;
                txErtHelyseg.Text = cn.ErtHelyseg;
                txErtCim.Text     = cn.ErtCim;
                txKSH.Text        = cn.KSH;
                txTelszam.Text    = cn.Telszam;
                txEmail.Text      = cn.Email;
                txFax.Text        = cn.Fax;
                txTitulus.Text    = cn.Titulus;
                txMegjegyzes.Text = cn.Megjegyzes;
                txFoglId.Text     = cn.FoglId;

                txMegnevezes.ReadOnly = true;
                txAdoszam.ReadOnly    = true;
                txCim.ReadOnly        = true;
                txHelyseg.ReadOnly    = true;
                txIrszam.ReadOnly     = true;
                txKSH.ReadOnly        = true;
                txFoglId.ReadOnly     = true;
                txTelszam.ReadOnly    = true;
                cbFoglTipusa.Enabled  = true;
                txTitulus.ReadOnly    = true;
                txErtOrszKod.ReadOnly = true;
                txErtIrszam.ReadOnly  = true;
                txErtHelyseg.ReadOnly = true;
                txErtCim.ReadOnly     = true;
                txOrszKod.ReadOnly    = true;
                txEmail.ReadOnly      = true;
                txEgyeniVall.ReadOnly = true;
                txMegjegyzes.ReadOnly = true;
                txFax.ReadOnly        = true;
                txAdoazon.ReadOnly    = true;

                //txMegnevezes.BackColor = System.Drawing.SystemColors.Control;
                //txAdoszam.BackColor = System.Drawing.SystemColors.Control;
                //txCim.BackColor = System.Drawing.SystemColors.Control;
                //txHelyseg.BackColor = System.Drawing.SystemColors.Control;
                //txIrszam.BackColor = System.Drawing.SystemColors.Control;
                //txKSH.BackColor = System.Drawing.SystemColors.Control;
                //txFoglId.BackColor = System.Drawing.SystemColors.Control;
                //txTelszam.BackColor = System.Drawing.SystemColors.Control;
                //txTitulus.BackColor = System.Drawing.SystemColors.Control;
                //cbFoglTipusa.BackColor = System.Drawing.SystemColors.Control;
                //txErtOrszKod.BackColor = System.Drawing.SystemColors.Control;
                //txErtIrszam.BackColor = System.Drawing.SystemColors.Control;
                //txErtHelyseg.BackColor = System.Drawing.SystemColors.Control;
                //txErtCim.BackColor = System.Drawing.SystemColors.Control;
                //txOrszKod.BackColor = System.Drawing.SystemColors.Control;
                //txEmail.BackColor = System.Drawing.SystemColors.Control;
                //txEgyeniVall.BackColor = System.Drawing.SystemColors.Control;
                //txMegjegyzes.BackColor = System.Drawing.SystemColors.Control;
                //txFax.BackColor = System.Drawing.SystemColors.Control;
                //txAdoazon.BackColor = System.Drawing.SystemColors.Control;
            }
        }
        public override void createNew()
        {
            FoglUj cn = new FoglUj(sconn);

            cn.ShowDialog();

            try
            {
                if (int.Parse(cn.FoglId) != 0)      // ha a másik formon sikeres a mentés, átveszem az adatokat.
                {
                    txAdoszam.Text    = cn.adoszam;
                    txMegnevezes.Text = cn.nev;
                    cbFoglTipusa.Text = cn.FoglTipusa;
                    txEgyeniVall.Text = cn.EgyeniVall;
                    txAdoazon.Text    = cn.Adoazon;
                    txOrszKod.Text    = cn.OrszKod;
                    txIrszam.Text     = cn.Irszam;
                    txHelyseg.Text    = cn.Helyseg;
                    txCim.Text        = cn.Cim;
                    txErtOrszKod.Text = cn.ErtOrszKod;
                    txErtIrszam.Text  = cn.ErtIrszam;
                    txErtHelyseg.Text = cn.ErtHelyseg;
                    txErtCim.Text     = cn.ErtCim;
                    txKSH.Text        = cn.KSH;
                    txTitulus.Text    = cn.Titulus;
                    txPnrid.Text      = cn.FoglId;

                    txMegnevezes.ReadOnly = true;
                    txAdoszam.ReadOnly    = true;
                    txCim.ReadOnly        = true;
                    txHelyseg.ReadOnly    = true;
                    txIrszam.ReadOnly     = true;
                    txKSH.ReadOnly        = true;
                    txPnrid.ReadOnly      = true;
                    txPnrid.Enabled       = false;
                    cbFoglTipusa.Enabled  = true;
                    txTitulus.ReadOnly    = true;
                    txErtOrszKod.ReadOnly = true;
                    txErtIrszam.ReadOnly  = true;
                    txErtHelyseg.ReadOnly = true;
                    txErtCim.ReadOnly     = true;
                    txOrszKod.ReadOnly    = true;
                    txEgyeniVall.ReadOnly = true;
                    txAdoazon.ReadOnly    = true;

                    //betöltés
                    this.dgwFogl.DataSource = null;
                    querystring             = "SELECT pnr.adoszam,coalesce(pnr.nev,pnr.megnevezes) as nev,pnr.pnr_tipus,pnr.egyeni_vall,pnr.adoazonosito_jel,pnr.orszagkod," +
                                              "pnr.ir_szam,pnr.helyseg,pnr.cim,pnr.ert_orszagkod,pnr.ert_irszam,pnr.ert_helyseg,pnr.ert_cim,pnr.ksh_torzsszam,pnr.telefon,pnr.email,pnr.faxszam," +
                                              "pnr.titulus,pnr.megjegyzes,pnr.pnr_id FROM partnerek pnr WHERE pnr_id=" + txPnrid.Text;

                    scommand     = new SqlCommand(querystring, sconn);
                    lastScommand = scommand;
                    try
                    {
                        da.Dispose();
                    }
                    catch
                    {
                        // első keresés
                    }
                    da = new SqlDataAdapter(scommand);
                    dt = new DataTable();

                    Frissit();
                    this.dgwFogl.DataSource = dt;
                    bBankszla.Enabled       = true;

                    tsDelete.Enabled = false;
                    tsFind.Enabled   = false;
                    tsNew.Enabled    = true;
                    tsSave.Enabled   = false;
                    tsSearch.Enabled = true;
                    tsUpdate.Enabled = false;
                }
            }
            catch
            {
                // nem történt módosítás
            }
        }