Ejemplo n.º 1
0
        void tileView_ItemCustomize(object sender, DevExpress.XtraGrid.Views.Tile.TileViewItemCustomizeEventArgs e)
        {
            var task = tileView.GetRow(e.RowHandle) as TaskRecord;

            if (task == null)
            {
                return;
            }
            e.Item["Label"].Appearance.Normal.BackColor = GetLabelColor(task.Label);
            e.Item["Description"].ImageVisible          = !String.IsNullOrEmpty(task.Description);
            if (IsEmptyItem(e.RowHandle))
            {
                e.Item["Caption"].Text = "...";
                e.Item.AppearanceItem.Normal.BackColor = Color.LightGray;
                e.Item.AppearanceItem.Normal.ForeColor = Color.DarkGray;
                return;
            }
            UpdateProgressElement(e.Item, task.Id.ToString());
            var elements = GetMembersElements(task.Id.ToString());

            if (elements.Count == 0)
            {
                return;
            }
            TileViewItemElement prev = null;

            foreach (var element in elements)
            {
                e.Item.Elements.Add(element);
                if (prev != null)
                {
                    element.AnchorElement   = prev;
                    element.AnchorAlignment = AnchorAlignment.Left;
                    element.AnchorIndent    = 4;
                }
                else
                {
                    element.ImageAlignment = TileItemContentAlignment.BottomRight;
                }
                prev = element;
            }
        }
Ejemplo n.º 2
0
        private void tileView1_ItemCustomize(object sender, DevExpress.XtraGrid.Views.Tile.TileViewItemCustomizeEventArgs e)
        {
            s = e;
            var list  = db.DK_Customers;
            var list2 = db.Rooms.ToList();
            var list3 = db.Rooms.Where(m => m.Status == 5).ToList();

            foreach (var item in list2)
            {
                var roomtang = db.RoomTangs.ToList();
                foreach (var room in roomtang)
                {
                    ColorPickEdit c = new ColorPickEdit();
                    if (Convert.ToInt32(e.Item.Elements[0].Text) == room.Manhom && item.Manhom == room.Manhom)
                    {
                        c.EditValue = String.Format("{0:X}", room.Mamau);
                        Color mau = c.Color;
                        e.Item.AppearanceItem.Normal.BackColor = mau;
                    }
                }
            }

            foreach (var item in list3)
            {
                if (Convert.ToInt32(e.Item.Elements[3].Text) == item.Sophong)
                {
                    e.Item.Elements[6].Image = Properties.Resources.help20;
                }
            }
            if (list.Count() != 0)
            {
                foreach (var item in list.ToList())
                {
                    if (item.Sophong == Convert.ToInt32(e.Item.Elements[3].Text) && item.Daidien == true)
                    {
                        e.Item.Elements[4].Text  = item.Hoten;
                        e.Item.Elements[5].Text  = item.DateCheckin.ToShortDateString();
                        e.Item.Elements[1].Image = global::devexpress.Properties.Resources.Office_Customer_Male_Light_icon;
                    }
                }
            }
        }