Esempio n. 1
0
        public static Organizator Find(int _id)
        {
            Organizator organizator = new Organizator();

            DataTable dt = Organizator.FindD(_id);

            organizator = MapResultsetToObject(dt.Rows[0]);

            return(organizator);
        }
Esempio n. 2
0
 public Turnaj()
 {
     ID          = null;
     nazev       = null;
     datumOD     = null;
     datumDO     = null;
     prizepool   = null;
     misto       = null;
     zeme        = null;
     organizator = null;
 }
Esempio n. 3
0
 public Turnaj(int _id, string _nazev, DateTime _datumOD, DateTime _datumDO, int _prizepool, string _misto, string _zeme, Organizator _organizator)
 {
     ID          = _id;
     nazev       = _nazev;
     datumOD     = _datumOD;
     datumDO     = _datumDO;
     prizepool   = _prizepool;
     misto       = _misto;
     zeme        = _zeme;
     organizator = _organizator;
 }
Esempio n. 4
0
        public static Organizator MapResultsetToObject(DataRow dr)
        {
            Organizator organizator = new Organizator();

            organizator.ID               = Convert.ToInt32(dr.ItemArray[0].ToString());
            organizator.nazev            = dr.ItemArray[1].ToString();
            organizator.zeme             = dr.ItemArray[2].ToString();
            organizator.pocetZamestnancu = Convert.ToInt32(dr.ItemArray[3].ToString());
            organizator.zalozeno         = Convert.ToDateTime(dr.ItemArray[4].ToString());

            return(organizator);
        }
Esempio n. 5
0
        public static List <Organizator> Find()
        {
            List <Organizator> organizatorList = new List <Organizator>();

            DataTable dt = new Organizator().FindD();

            foreach (DataRow dr in dt.Rows)
            {
                organizatorList.Add(MapResultsetToObject(dr));
            }

            return(organizatorList);
        }
Esempio n. 6
0
        public static Turnaj MapResultsetToObject(DataRow dr)
        {
            Turnaj turnaj = new Turnaj();

            turnaj.ID          = Convert.ToInt32(dr.ItemArray[0].ToString());
            turnaj.nazev       = dr.ItemArray[1].ToString();
            turnaj.datumOD     = Convert.ToDateTime(dr.ItemArray[2].ToString());
            turnaj.datumDO     = Convert.ToDateTime(dr.ItemArray[3].ToString());
            turnaj.prizepool   = Convert.ToInt32(dr.ItemArray[4].ToString());
            turnaj.misto       = dr.ItemArray[5].ToString();
            turnaj.zeme        = dr.ItemArray[6].ToString();
            turnaj.organizator = Organizator.MapResultsetToObject(Organizator.FindD(Convert.ToInt32(dr.ItemArray[7].ToString())).Rows[0]);

            return(turnaj);
        }