Пример #1
0
        public control GetOrderListTitles(int orderType_id)
        {
            OrderQuery OrderQuery = new OrderQuery(language);


            System.Data.DataTable dataTable = conn_db.ReadTable(OrderQuery.GetOrderListTitle(orderType_id));
            control control = new control();


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

            foreach (System.Data.DataRow row in dataTable.Rows)
            {
                control            = new control();
                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"]);
            }
            return(control);
        }
Пример #2
0
        public List <InfoWindow> GetOrderListDetails(int orderType_id)
        {
            OrderQuery OrderQuery = new OrderQuery(language);


            System.Data.DataTable  dataTable       = conn_db.ReadTable(OrderQuery.GetOrderListDetailsByType(orderType_id));
            System.Data.DataTable  OrderList       = conn_db.ReadTable(OrderQuery.GetOrderListTitle(orderType_id));
            orderListDetail        orderListDetail = new  orderListDetail();
            List <orderListDetail> orderListDetails;


            InfoWindow        info;
            List <InfoWindow> infoWindows = new List <InfoWindow>();


            if (dataTable.Rows.Count == 0)
            {
                throw new EmptyViewException(language);
            }
            foreach (System.Data.DataRow rowList in OrderList.Rows)
            {
                orderListDetails = new List <orderListDetail>();
                info             = new InfoWindow();
                info.List_id     = Convert.ToInt32(rowList["ID"]);
                if (language == Messages.language.ar.ToString())
                {
                    info.Listname = rowList["LISTNAME_AR"].ToString();
                }
                else
                {
                    info.Listname = rowList["LISTNAME_EN"].ToString();
                }


                foreach (System.Data.DataRow row in dataTable.Rows)
                {
                    orderListDetail = new orderListDetail();
                    if (info.List_id == Convert.ToInt32(row["ORDERLIST_ID"]))
                    {
                        if (language == Messages.language.ar.ToString())
                        {
                            orderListDetail = new orderListDetail {
                                id = Convert.ToInt32(row["ID"]), contentName = row["CONTENTNAME_AR"].ToString()
                            }
                        }
                        ;
                        else
                        {
                            orderListDetail = new orderListDetail {
                                id = Convert.ToInt32(row["ID"]), contentName = row["CONTENTNAME_EN"].ToString()
                            }
                        };


                        orderListDetails.Add(orderListDetail);
                    }
                }


                info.contents = orderListDetails;

                infoWindows.Add(info);
            }
            return(infoWindows);
        }