예제 #1
0
파일: MainForm.cs 프로젝트: Hennz/TMS
        /// <summary>
        /// Initializes all components
        /// </summary>
        public void Init()
        {
            _trackingController  = new TrackingController(this, picMinePlan);
            _messagingController = new MessagingController(this);
            _reportsController   = new ReportsController();

            // Set labels
            llblSiteInfo.Text = MineSite.GetInstance().siteName;

            llblUsername.Text = User.GetInstance().username;
            lblUserType.Text  = User.GetInstance().isAdmin ? "Administrator" : "Regular User";

            // Load routers into treeview
            LoadRoutersToTree();

            picMinePlan.Controls.Clear();
            _trackingController.AddAllRoutersToMap();

            LoadAllActiveMembers();

            // Set mapscale number incrementer
            nudMapScale.Value    = (decimal)(MineSite.GetInstance().mapScale);
            nudMapScale.Font     = new Font(nudMapScale.Font, FontStyle.Regular);
            btnSaveScale.Enabled = false;

            // Subscribe mainform to let it deal with member changes
            foreach (Member member in MineSite.GetInstance().siteMembers.Values)
            {
                member.OnInfoUpdated += LoadAllActiveMembers;
                member.OnPathUpdated += LoadRoutersToTree;
            }
        }
예제 #2
0
        public MessagesViewForm(MessagingController c)
        {
            InitializeComponent();

            _controller = c;

            LoadMessages();
        }
예제 #3
0
        public MessagesSendForm(MessagingController c, bool isDefaultBroadcast)
        {
            InitializeComponent();

            _controller = c;

            lblUsername.Text = User.GetInstance().username;
            lblDate.Text     = DateTime.Now.ToString("yyyy-MM-dd");

            foreach (Member member in MineSite.GetInstance().siteMembers.Values)
            {
                lstMembers.Items.Add(member);
            }

            rbBroadcast.Checked = isDefaultBroadcast;
        }