123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Drawing;
- using System.Data;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- using PMSUI.Model;
- namespace PMSUI
- {
- public partial class StationUserControl : UserControl
- {
- public StationUserControl()
- {
- InitializeComponent();
- }
- private int _id;
- private string name = "";
- private string type = "";
- private int status = 0;
- private int area = 0;
- public int ID
- {
- get { return _id; }
- set
- {
- _id = value;
- }
- }
- public string JobName
- {
- get { return name; }
- set
- {
- name = value;
- this.Invoke(new Action(() =>
- {
- this.lbname.Text = name;
- }));
- }
- }
- public string Materials
- {
- get { return type; }
- set
- {
- type = value;
- //if (type == 0 || this.area != VariableClass.DischargeArea)
- //{ lbtype.Visible = false; }
- //else
- //{
- // lbtype.Visible = true;
- //}
- this.Invoke(new Action(() =>
- {
- this.lbtype.Text = type.ToString();
- }));
- }
- }
- public int Status
- {
- get { return status; }
- set
- {
- status = value;
- if (!this.IsHandleCreated)
- { base.CreateHandle(); }
- this.Invoke(new Action(() =>
- {
- lbstatus.Text = status == VariableClass.StationEmpty ? VariableClass.Empty : (status == VariableClass.StationFill ? VariableClass.Fill : VariableClass.Tasking);
- switch (status)
- {
- case 1:
- this.BackColor = Color.AntiqueWhite;
- break;
- case 2:
- this.BackColor = Color.Green;
- break;
- case 3:
- this.BackColor = Color.Yellow;
- break;
- default:
- this.BackColor = Color.Yellow;
- break;
- }
- }));
- }
- }
- }
- }
|