Esempio n. 1
0
        private static Supplier Read(SqlDataReader supReader)
        {
            Supplier newOne = new Supplier();

            newOne.idsupplier = supReader.GetInt32(0);
            newOne.title      = supReader.GetString(1);
            newOne.product    = supReader.GetString(2);
            try
            {
                newOne.FrequencyOfDeliveries = supReader.GetInt32(3);
            }
            catch (System.Data.SqlTypes.SqlNullValueException)
            {
                newOne.FrequencyOfDeliveries = null;
            }
            try
            {
                newOne.VolumeOfDeliveries = supReader.GetInt32(4);
            }
            catch (System.Data.SqlTypes.SqlNullValueException)
            {
                newOne.VolumeOfDeliveries = null;
            }
            newOne.cafe = Cafe.Get(supReader.GetInt32(5));
            //newOne.cafe_idcafe = supReader.GetInt32(5);

            return(newOne);
        }
Esempio n. 2
0
        private static Dish Read(SqlDataReader dishReader)
        {
            Dish newOne = new Dish();

            newOne.iddish   = dishReader.GetInt32(0);
            newOne.title    = dishReader.GetString(1);
            newOne.quantily = dishReader.GetInt32(2);
            newOne.cafe     = Cafe.Get(dishReader.GetInt32(3));
            return(newOne);
        }
Esempio n. 3
0
        private static Serve Read(SqlDataReader serReader)
        {
            Serve newOne = new Serve();

            newOne.idserve  = serReader.GetInt32(0);
            newOne.name     = serReader.GetString(1);
            newOne.passport = serReader.GetInt32(2);
            try
            {
                newOne.education = serReader.GetString(3);
            }
            catch (System.Data.SqlTypes.SqlNullValueException)
            {
                newOne.education = null;
            }
            newOne.experience = serReader.GetInt32(4);
            newOne.cafe       = Cafe.Get(serReader.GetInt32(5));
            //newOne.cafe_idcafe = serReader.GetInt32(5);

            return(newOne);
        }