private void ShowItemOnRow(DataGridViewRow row, VehicleLedItem item, string park, string entrance, string station) { row.Tag = item; row.Cells["colName"].Value = item.Name; row.Cells["colPark"].Value = park; row.Cells["colPark"].Tag = item.ParkID; row.Cells["colEntrance"].Value = entrance; row.Cells["colEntrance"].Tag = item.EntranceID; row.Cells["colStation"].Value = station; row.Cells["colStation"].Tag = item.StationID; row.Cells["colComPort"].Value = item.ComPort; row.Cells["colShowTitle"].Value = item.ShowTitle; row.Cells["colSubAddress1"].Value = item.SubAddress1; row.Cells["colSubTitle1"].Value = item.SubTitle1; row.Cells["colSubMessage1"].Value = VehicleLEDMessageTypeDescription.GetDescription(item.SubMessage1); row.Cells["colSubMessage1"].Tag = item.SubMessage1; row.Cells["colSubInterval1"].Value = item.SubInterval1; row.Cells["colSubAddress2"].Value = item.SubAddress2; row.Cells["colSubTitle2"].Value = item.SubTitle2; row.Cells["colSubMessage2"].Value = VehicleLEDMessageTypeDescription.GetDescription(item.SubMessage2); row.Cells["colSubMessage2"].Tag = item.SubMessage2; row.Cells["colSubInterval2"].Value = item.SubInterval2; row.Cells["colSubAddress3"].Value = item.SubAddress3; row.Cells["colSubTitle3"].Value = item.SubTitle3; row.Cells["colSubMessage3"].Value = VehicleLEDMessageTypeDescription.GetDescription(item.SubMessage3); row.Cells["colSubMessage3"].Tag = item.SubMessage3; row.Cells["colSubInterval3"].Value = item.SubInterval3; row.Cells["colMemo"].Value = item.Memo; }
public void Init() { var items = new[] { new TextValueItem <VehicleLEDMessageType>(VehicleLEDMessageType.None, VehicleLEDMessageTypeDescription.GetDescription(VehicleLEDMessageType.None)), new TextValueItem <VehicleLEDMessageType>(VehicleLEDMessageType.Department, VehicleLEDMessageTypeDescription.GetDescription(VehicleLEDMessageType.Department)), new TextValueItem <VehicleLEDMessageType>(VehicleLEDMessageType.OwnerName, VehicleLEDMessageTypeDescription.GetDescription(VehicleLEDMessageType.OwnerName)), new TextValueItem <VehicleLEDMessageType>(VehicleLEDMessageType.CardCarPlate, VehicleLEDMessageTypeDescription.GetDescription(VehicleLEDMessageType.CardCarPlate)), new TextValueItem <VehicleLEDMessageType>(VehicleLEDMessageType.RegCarPlate, VehicleLEDMessageTypeDescription.GetDescription(VehicleLEDMessageType.RegCarPlate)), new TextValueItem <VehicleLEDMessageType>(VehicleLEDMessageType.CardCertificate, VehicleLEDMessageTypeDescription.GetDescription(VehicleLEDMessageType.CardCertificate)), new TextValueItem <VehicleLEDMessageType>(VehicleLEDMessageType.LastCarPlate, VehicleLEDMessageTypeDescription.GetDescription(VehicleLEDMessageType.LastCarPlate)), new TextValueItem <VehicleLEDMessageType>(VehicleLEDMessageType.LastDateTime, VehicleLEDMessageTypeDescription.GetDescription(VehicleLEDMessageType.LastDateTime)), new TextValueItem <VehicleLEDMessageType>(VehicleLEDMessageType.LastEntrance, VehicleLEDMessageTypeDescription.GetDescription(VehicleLEDMessageType.LastEntrance)), new TextValueItem <VehicleLEDMessageType>(VehicleLEDMessageType.ValidDate, VehicleLEDMessageTypeDescription.GetDescription(VehicleLEDMessageType.ValidDate)), new TextValueItem <VehicleLEDMessageType>(VehicleLEDMessageType.Balance, VehicleLEDMessageTypeDescription.GetDescription(VehicleLEDMessageType.Balance)), new TextValueItem <VehicleLEDMessageType>(VehicleLEDMessageType.TotalPosition, VehicleLEDMessageTypeDescription.GetDescription(VehicleLEDMessageType.TotalPosition)), new TextValueItem <VehicleLEDMessageType>(VehicleLEDMessageType.Vacant, VehicleLEDMessageTypeDescription.GetDescription(VehicleLEDMessageType.Vacant)), new TextValueItem <VehicleLEDMessageType>(VehicleLEDMessageType.Park, VehicleLEDMessageTypeDescription.GetDescription(VehicleLEDMessageType.Park)), new TextValueItem <VehicleLEDMessageType>(VehicleLEDMessageType.Entrance, VehicleLEDMessageTypeDescription.GetDescription(VehicleLEDMessageType.Entrance)), }; this.DataSource = items; this.DisplayMember = "Text"; this.ValueMember = "Value"; this.DropDownStyle = ComboBoxStyle.DropDownList; }