예제 #1
0
        private void create_msgPanel(DepartmentLog log, ref int y, int v_space)
        {
            int w = PanelLogs.Width;
            var p = new MsgPanel.LogPanel();

            p.Location = new Point((w - p.Width) / 2, y);
            p.setDate(log.date.Value);
            p.setSender(log.sender);
            p.setToDepart(db.Department.FirstOrDefault(x => x.id == log.departId).name);
            PanelLogs.Controls.Add(p);

            string img1Url = log.imgUrl;
            string img2Url = log.img2Url;
            string img3Url = log.img3Url;

            if (img1Url != null)
            {
                img1Url = "ftp://" + connectionIP + "/" + img1Url;
            }

            if (img2Url != null)
            {
                img2Url = "ftp://" + connectionIP + "/" + img2Url;
            }

            if (img3Url != null)
            {
                img3Url = "ftp://" + connectionIP + "/" + img3Url;
            }
            p.setImg(img1Url, img2Url, img3Url);

            p.id = log.id;
            p.setMsg(log.msg);

            bool done = MConvert <bool> .ToTypeOrDefault(log.done, false);

            bool urgent = MConvert <bool> .ToTypeOrDefault(log.urgent, false);

            p.set_panel_status(done, urgent, log.doneDate, log.urgentDate, log.dueTime);

            p.BtnSetTimeClicked += new LogPanel.BtnSetTimeClickHandle(p_BtnSetTimeClicked);
            p.BtnUrgentClicked  += new LogPanel.BtnUrgentClickHandle(p_BtnUrgentClicked);
            p.BtnDoneClicked    += new LogPanel.BtnDoneClickHandle(p_BtnDoneClicked);
            y += p.Size.Height + v_space;
        }
예제 #2
0
        private void create_msgPanel(DepartmentLog log, ref int y, int v_space)
        {
            int w = PanelLogs.Width;
            var p = new MsgPanel.LogPanel();
            p.Location = new Point((w - p.Width) / 2, y);
            p.setDate(log.date.Value);
            p.setSender(log.sender);
            p.setToDepart(db.Department.FirstOrDefault(x => x.id == log.departId).name);
            PanelLogs.Controls.Add(p);

            string img1Url = log.imgUrl;
            string img2Url = log.img2Url;
            string img3Url = log.img3Url;

            if (img1Url != null)
                img1Url = "ftp://" + connectionIP + "/" + img1Url;

            if (img2Url != null)
                img2Url = "ftp://" + connectionIP + "/" + img2Url;

            if (img3Url != null)
                img3Url = "ftp://" + connectionIP + "/" + img3Url;
            p.setImg(img1Url, img2Url, img3Url);

            p.id = log.id;
            p.setMsg(log.msg);

            bool done = MConvert<bool>.ToTypeOrDefault(log.done, false);
            bool urgent = MConvert<bool>.ToTypeOrDefault(log.urgent, false);
            p.set_panel_status(done, urgent, log.doneDate, log.urgentDate, log.dueTime);

            p.BtnSetTimeClicked +=new LogPanel.BtnSetTimeClickHandle(p_BtnSetTimeClicked);
            p.BtnUrgentClicked += new LogPanel.BtnUrgentClickHandle(p_BtnUrgentClicked);
            p.BtnDoneClicked += new LogPanel.BtnDoneClickHandle(p_BtnDoneClicked);
            y += p.Size.Height + v_space;
        }