示例#1
0
        private void typeDoubleInput_Leave(object sender, EventArgs e)
        {
            BookTypeModel type = BookTypeController.GetBookType(
                ((int)typeDoubleInput.Value) / 100 * 100);

            typeLabel.BackColor = type.Colour;
        }
示例#2
0
        private void okButton_Click(object sender, EventArgs e)
        {
            TypeName = nameTextBox.Text;
            BookTypeModel bookType = new BookTypeModel()
            {
                Name   = TypeName,
                Colour = Colour
            };

            BookTypeController.EditBookType(TypeNo, bookType);
        }
示例#3
0
        private void loadTable()
        {
            DataTable table = BookTypeController.GetBookType();

            if (table == null)
            {
                return;
            }

            foreach (DataRow row in table.Rows)
            {
                int?colour = row[2] as int?;

                dataGridView.Rows.Add(row[0], row[1], "");

                //Set colour
                int count = dataGridView.Rows.Count;
                if (colour != null)
                {
                    dataGridView.Rows[count - 1].Cells[2].Style.BackColor = Color.FromArgb((int)colour);
                }
                dataGridView.Refresh();
            }
        }