Пример #1
0
        public List <OrderType> GetOrderType(string lang)
        {
            OrderQuery orderQuery = new OrderQuery(language);


            System.Data.DataTable dataTable = conn_db.ReadTable(orderQuery.GetOrderTypeWithControls());

            if (dataTable.Rows.Count == 0)
            {
                throw new EmptyViewException(language);
            }

            OrderType        orderType;
            control          control;
            List <OrderType> orderTypes = new List <OrderType>();

            foreach (System.Data.DataRow row in dataTable.Rows)
            {
                orderType               = new OrderType();
                control                 = new control();
                orderType.id            = Convert.ToInt32(row["id"].ToString());
                orderType.OrderTypeName = row["ordertype_Name"].ToString();
                orderType.OrderTypeIcon = row["ORDERTYPE_ICON"].ToString();

                control.PHOTO      = Convert.ToBoolean(row["PHOTO"]);
                control.LOCATION   = Convert.ToBoolean(row["LOCATION"]);
                control.CITY       = Convert.ToBoolean(row["CITY"]);
                control.CAR        = Convert.ToBoolean(row["CAR"]);
                control.INFOWINDOW = Convert.ToBoolean(row["INFOWINDOW"]);


                orderType.controls = control;
                orderTypes.Add(orderType);
            }
            return(orderTypes);
        }