Exemplo n.º 1
0
 public override void save()
 {
     // Adatátadás
     if (Szulo.GetType() == typeof(Okiratok))
     {
         this.okir = (Okiratok)Szulo;
         //Okiratok adat = (Okiratok)this.Parent;
         okir.PnrId      = int.Parse(txFoglId.Text);
         okir.megnevezes = txMegnevezes.Text;
         okir.irszam     = txIrszam.Text;
         okir.helyseg    = txHelyseg.Text;
         okir.foglcim    = txCim.Text;
         okir.telszam    = txTelszam.Text;
         okir.adoszam    = txAdoszam.Text;
     }
     else if (Szulo.GetType() == typeof(BevRogzLemezes))
     {
         //BevRogzLemezes adat = (BevRogzLemezes)this.Parent;
         this.BevR       = (BevRogzLemezes)Szulo;
         BevR.PnrId      = int.Parse(txFoglId.Text);
         BevR.megnevezes = txMegnevezes.Text;
         BevR.irszam     = txIrszam.Text;
         BevR.helyseg    = txHelyseg.Text;
         BevR.foglcim    = txCim.Text;
         BevR.telszam    = txTelszam.Text;
         BevR.adoszam    = txAdoszam.Text;
     }
     Close();
 }
Exemplo n.º 2
0
        public Zaradekolas(Okiratok ujOkirat, SqlConnection SqlConn)
        {
            InitializeComponent();

            tag = ujOkirat;

            this.sconn = SqlConn;
            if (sconn.State == ConnectionState.Closed)
            {
                sconn.Open();
            }

            txAdoazon.Text  = tag.adoazon;
            txNev.Text      = tag.nev;
            txPnrid.Text    = tag.pnrid;
            dtAlair.Value   = tag.alair;
            dtErkezes.Value = tag.erkezes;
            int pajszam = tag.paj;

            tszsid = pajszam.ToString();

            // Életciklus jogcímek
            scommand = new SqlCommand("SELECT * FROM jogcimek WHERE tipus='E' AND ervenyes='I'", sconn);
            if (sconn.State == ConnectionState.Closed)
            {
                sconn.Open();
            }
            SqlDataReader sqlReader = scommand.ExecuteReader();

            while (sqlReader.Read())
            {
                cbEletcikl.Items.Add(sqlReader["megnevezes"].ToString());
            }

            sqlReader.Close();

            tsDelete.Enabled = false;
            tsFind.Enabled   = true;
            tsNew.Enabled    = false;
            tsSave.Enabled   = false;
            tsSearch.Enabled = false;
            tsUpdate.Enabled = false;
            bZaradek.Enabled = true;
            txNev.Focus();
        }
Exemplo n.º 3
0
        public NypKivalaszt(SqlConnection SqlConn, Okiratok ok)
        {
            InitializeComponent();

            this.sconn = SqlConn;
            if (sconn.State == ConnectionState.Closed)
            {
                sconn.Open();
            }
            this.ok = ok;

            tsDelete.Enabled = false;
            tsFind.Enabled   = false;
            tsNew.Enabled    = false;
            tsSave.Enabled   = false;
            tsSearch.Enabled = false;
            tsUpdate.Enabled = false;

            dgvNyugdijpenzt.Focus();
        }
Exemplo n.º 4
0
        public Kedvezmenyezettek(SqlConnection SqlConn, int Pnr_id, object Szulo)
        {
            InitializeComponent();

            this.sconn = SqlConn;
            if (sconn.State == ConnectionState.Closed)
            {
                sconn.Open();
            }
            this.tagPnr  = Pnr_id;
            txPnrid.Text = tagPnr.ToString();

            // adattábla
            dt = new DataTable();

            tsUpdate.Enabled = true;
            tsNew.Enabled    = true;
            tsDelete.Enabled = true;
            tsFind.Enabled   = false;
            tsSearch.Enabled = false;
            tsSave.Enabled   = false;

            if (Szulo.GetType() == typeof(Okiratok))
            {
                this.okir = (Okiratok)Szulo;

                scommand = new SqlCommand("select count(*) from kedvezmenyezettek where pnr_id=" + tagPnr.ToString(), sconn);
                int van = (int)scommand.ExecuteScalar();

                if (van > 0)
                {
                    scommand             = new SqlCommand("spKedvezmenyezettek", sconn);
                    scommand.CommandType = CommandType.StoredProcedure;
                    scommand.Parameters.Add(new SqlParameter("@pnr_id", SqlDbType.Int)).Value = tagPnr;
                    lastScommand = scommand;
                    da           = new SqlDataAdapter(scommand);
                    Frissit();

                    this.dgvKedvezmenyezettek.DataSource = dt;
                    rejtId();

                    decimal sum = 0;
                    for (int i = 0; i < dgvKedvezmenyezettek.RowCount; i++)
                    {
                        sum += decimal.Parse(dgvKedvezmenyezettek.Rows[i].Cells[3].Value.ToString());
                    }
                    txKedvOssz.Value = dgvKedvezmenyezettek.RowCount;
                    txReszOssz.Text  = sum.ToString() + " %";
                }

                createNew();
            }
            else if (Szulo.GetType() == typeof(OkiratokModositas))
            {
                this.om = (OkiratokModositas)Szulo;

                scommand = new SqlCommand("select count(*) from kedvezmenyezettek where pnr_id=" + tagPnr.ToString(), sconn);
                int van = (int)scommand.ExecuteScalar();

                if (van > 0)
                {
                    scommand             = new SqlCommand("spKedvezmenyezettek", sconn);
                    scommand.CommandType = CommandType.StoredProcedure;
                    scommand.Parameters.Add(new SqlParameter("@pnr_id", SqlDbType.Int)).Value = tagPnr;
                    lastScommand = scommand;
                    da           = new SqlDataAdapter(scommand);
                    Frissit();

                    this.dgvKedvezmenyezettek.DataSource = dt;
                    rejtId();

                    decimal sum = 0;
                    for (int i = 0; i < dgvKedvezmenyezettek.RowCount; i++)
                    {
                        sum += decimal.Parse(dgvKedvezmenyezettek.Rows[i].Cells[3].Value.ToString());
                    }
                    txKedvOssz.Value = dgvKedvezmenyezettek.RowCount;
                    txReszOssz.Text  = sum.ToString() + " %";

                    txAdoazon.ReadOnly   = true;
                    txAdoszam.ReadOnly   = true;
                    txAnyjaNeve.ReadOnly = true;
                    txBankszla.ReadOnly  = true;
                    txCim.ReadOnly       = true;
                    txHelyseg.ReadOnly   = true;
                    txIrszam.ReadOnly    = true;
                    txNev.ReadOnly       = true;
                    txPnrid.ReadOnly     = true;
                    txSzulHely.ReadOnly  = true;
                    txSzulNev.ReadOnly   = true;
                    txTelefon.ReadOnly   = true;

                    chTerm.Enabled         = false;
                    numReszesedes.ReadOnly = true;
                    dtSzulIdo.Enabled      = false;

                    dgvKedvezmenyezettek.Focus();
                }
            }
        }
Exemplo n.º 5
0
        public override void createNew()
        {
            Okiratok ujokirat = new Okiratok(sconn);

            ujokirat.Show();
        }
Exemplo n.º 6
0
        /// <summary>
        /// Törzsadatok menü
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void tagságiOkiratokRögzítéseToolStripMenuItem2_Click(object sender, EventArgs e)
        {
            Okiratok newContract = new Okiratok(sconn);

            newContract.Show();
        }