Example #1
0
 /// <summary>
 /// Deprecated Method for adding a new object to the AvtorskiClenovi EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToAvtorskiClenovi(AvtorskiClenovi avtorskiClenovi)
 {
     base.AddObject("AvtorskiClenovi", avtorskiClenovi);
 }
Example #2
0
 /// <summary>
 /// Create a new AvtorskiClenovi object.
 /// </summary>
 /// <param name="idAvtorskiClen">Initial value of the IdAvtorskiClen property.</param>
 public static AvtorskiClenovi CreateAvtorskiClenovi(global::System.Int32 idAvtorskiClen)
 {
     AvtorskiClenovi avtorskiClenovi = new AvtorskiClenovi();
     avtorskiClenovi.IdAvtorskiClen = idAvtorskiClen;
     return avtorskiClenovi;
 }
Example #3
0
        private void buttonAvtorskiClenCLENOVI_A_Click(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;
            int i = 0;
            foreach (var ca in _mladinskaEntities.CLENOVI_A)
            {
                CLENOVI_A ca1 = ca;
                if (_avtorskaEntities.AvtorskiClenovi.Count(c => c.ClenskiBroj == ca1.BROJ) != 0) continue;
                var ac = new AvtorskiClenovi
                             {
                                 Adresa = ca.ADRESA,
                                 ClenskiBroj = ca.BROJ,
                                 MaticenBroj = ca.MB,
                                 LicnaKarta = ca.LICNAKARTA,
                                 Telefon = ca.TELEFONI
                             };

                if (!String.IsNullOrWhiteSpace(ca.POL))
                {
                    if (ca.POL.Contains("m"))
                        ac.Pol = _avtorskaEntities.Pol.FirstOrDefault(p => p.NazivPol.Contains("м"));
                    else if (ca.POL.Contains("z"))
                        ac.Pol = _avtorskaEntities.Pol.FirstOrDefault(p => p.NazivPol.Contains("ж"));
                }

                DateTime dateTime;
                if (DateTime.TryParse(ca.DATUM_CLEN, out dateTime))
                    if (dateTime >= Convert.ToDateTime("1753/1/1") && dateTime <= DateTime.MaxValue)
                        ac.DatumNaZaclenuvanje = dateTime;

                _avtorskaEntities.AddToAvtorskiClenovi(ac);
                i++;
            }
            _avtorskaEntities.SaveChanges();
            Cursor.Current = Cursors.Default;
            MessageBox.Show("CLENOVI_A => AvtorskiClenovi : "+i);
        }