Exemplo n.º 1
0
        private void p_BtnUrgentClicked(object sender, EventArgs e)
        {
            LogPanel logPanel = sender as LogPanel;
            var      log      = db.DepartmentLog.FirstOrDefault(x => x.id == logPanel.id);

            if (MConvert <bool> .ToTypeOrDefault(log.done, false))
            {
                if (BathClass.printAskMsg("事件已完成,加急将会把事件改成未完成状态,确定继续?") != DialogResult.Yes)
                {
                    return;
                }

                log.done = false;
                logPanel.set_btnDone_text("已完成");
            }

            if (!MConvert <bool> .ToTypeOrDefault(log.urgent, false))
            {
                log.urgent     = true;
                log.urgentDate = DateTime.Now;
            }
            else
            {
                log.urgent = false;
            }
            db.SubmitChanges();

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

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

            logPanel.set_panel_status(done, urgent, log.doneDate, log.urgentDate, log.dueTime);
        }
Exemplo n.º 2
0
        private void p_BtnDoneClicked(object sender, EventArgs e)
        {
            LogPanel logPanel = sender as LogPanel;
            var      log      = db.DepartmentLog.FirstOrDefault(x => x.id == logPanel.id);

            if (MConvert <bool> .ToTypeOrDefault(log.done, false))
            {
                log.done = false;
            }
            else
            {
                log.done     = true;
                log.urgent   = false;
                log.doneDate = DateTime.Now;
                logPanel.set_btnUrgent_text("加急");
            }
            db.SubmitChanges();

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

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

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