示例#1
0
        public frmInfoNote(string LiteratureTitle)
        {
            RefreshInMain = false;
            InitializeComponent();
            note       = new CNote();
            noteLogs   = new List <RNoteLog>();
            noteColors = new List <RNoteColor>();
            topicGUID  = Guid.NewGuid().ToString();
            List <RLiteratureOutSource> litOutSources = G.glb.lstLiteratureOutSource.FindAll(o => o.Title == LiteratureTitle).ToList();

            for (int i = 0; i < litOutSources.Count; i++)
            {
                RNoteOutsource noteOutsource = new RNoteOutsource();
                noteOutsource.TagTime       = DateTime.Today.Date;
                noteOutsource.Topic         = litOutSources[i].Title;
                noteOutsource.Outsourcepath = litOutSources[i].OutsourcePath;
                noteOutsources.Add(noteOutsource);
            }
            LoadNoteColor();
            LoadNoteLog();
            LoadNoteOutsource();
            txtTopic.Text   = LiteratureTitle;
            dtpDate.Value   = DateTime.Today.Date;
            btnSave.Enabled = true;
        }
示例#2
0
 public frmInfoNote(DateTime selectedDate)
 {
     InitializeComponent();
     note           = new CNote();
     noteLogs       = new List <RNoteLog>();
     noteOutsources = new List <RNoteOutsource>();
     noteColors     = new List <RNoteColor>();
     topicGUID      = Guid.NewGuid().ToString();
     LoadNoteColor();
     LoadNoteLog();
     LoadNoteOutsource();
     dtpDate.Value   = selectedDate;
     btnSave.Enabled = true;
 }
示例#3
0
 public frmInfoNote(CNote info)
 {
     note           = info;
     noteLogs       = G.glb.lstNoteLog.FindAll(o => o.TagTime == info.TagTime && o.Topic == info.Topic);
     noteOutsources = G.glb.lstNoteOutsource.FindAll(o => o.TagTime == info.TagTime && o.Topic == info.Topic);
     noteColors     = G.glb.lstNoteColor.FindAll(o => o.TagTime == info.TagTime && o.Topic == info.Topic);
     topicGUID      = info.GUID;
     InitializeComponent();
     LoadNoteColor();
     LoadNoteLog();
     LoadNoteOutsource();
     dtpDate.Value    = note.TagTime;
     txtTopic.Enabled = false;
     btnSave.Enabled  = false;
 }
示例#4
0
 private void tsmOpen_Click(object sender, EventArgs e)
 {
     if (lsbTaskNote.SelectedItem != null)
     {
         string   selectedItemText = lsbTaskNote.SelectedItem.ToString();
         string[] split            = selectedItemText.Split('-');
         string[] datelist         = split[0].Split('.');
         int      Year             = Convert.ToInt16(datelist[0]);
         int      Month            = Convert.ToInt16(datelist[1]);
         int      Day  = Convert.ToInt16(datelist[2].Substring(0, datelist[2].Length - 1));
         DateTime date = new DateTime(Year, Month, Day, 0, 0, 0);
         split[1] = split[1].Substring(1, split[1].Length - 1);
         string NoteTopic = "";
         for (int i = 1; i < split.Length; i++)
         {
             NoteTopic += split[i];
             NoteTopic += "-";
         }
         NoteTopic = NoteTopic.Substring(0, NoteTopic.Length - 1);
         CNote note = G.glb.lstNote.Find(o => o.TagTime == date && o.Topic == NoteTopic);
         plot  D    = new plot();
         D.CallInfoNote(note);
     }
 }
示例#5
0
        public void CallInfoNote(CNote info)
        {
            frmInfoNote frmInfoNote = new frmInfoNote(info);

            frmInfoNote.Show();
        }
示例#6
0
        public void DrawEventController(
            PictureBox picMap,
            DateTime date,
            List <CEvent> events,
            List <CWorkOut> workOuts,
            List <CMedicine> medicines,
            List <CTransaction> transactions,
            List <CTransaction> budgets,
            List <CNote> notes)
        {
            int left = picMap.Width - 27 > 0 ? picMap.Width - 27 : 0;
            List <PictureBox>   lstPicEvent    = new List <PictureBox>();
            List <CEvent>       lstEvent       = events.FindAll(o => o.TagTime.Date == date).ToList();
            List <CWorkOut>     lstWorkOut     = workOuts.FindAll(o => o.TagTime.Date == date).ToList();
            List <CMedicine>    lstMedicine    = medicines.FindAll(o => o.TagTime.Date == date).ToList();
            List <CTransaction> lstTransaction = transactions.FindAll(o => o.TagTime.Date == date).ToList();
            List <CTransaction> lstBudget      = budgets.FindAll(o => o.TagTime.Date == date).ToList();
            List <CNote>        lstNote        = notes.FindAll(o => o.TagTime.Date == date).ToList();
            int acc = 0;

            for (int i = 0; i < lstEvent.Count; i++)
            {
                lstPicEvent.Add(new PictureBox());
                CEvent eve = lstEvent[i];
                if (lstEvent[i].EventState == EEventState.LogEvent)
                {
                    lstPicEvent[i].Image = icon.iconEvent;
                }
                else if (lstEvent[i].EventState == EEventState.Succeed)
                {
                    lstPicEvent[i].Image = icon.iconSucceedEvent;
                }
                else
                {
                    lstPicEvent[i].Image = icon.iconFailedEvent;
                }
                lstPicEvent[i].Top    = i * 30 + 3;
                lstPicEvent[i].Left   = left;
                lstPicEvent[i].Width  = 24;
                lstPicEvent[i].Height = 24;
                lstPicEvent[i].Click += (e, a) => CallInfoEvent(eve);
                picMap.Controls.Add(lstPicEvent[i]);
            }
            acc = acc + lstEvent.Count;
            for (int i = 0; i < lstWorkOut.Count; i++)
            {
                lstPicEvent.Add(new PictureBox());
                CWorkOut workOut = lstWorkOut[i];
                lstPicEvent[i + acc].Image  = icon.iconFitness;
                lstPicEvent[i + acc].Top    = (i + acc) * 30 + 3;
                lstPicEvent[i + acc].Left   = left;
                lstPicEvent[i + acc].Width  = 24;
                lstPicEvent[i + acc].Height = 24;
                lstPicEvent[i + acc].Click += (e, a) => CallInfoWorkOut(workOut);
                picMap.Controls.Add(lstPicEvent[i + acc]);
            }
            acc = acc + lstWorkOut.Count;
            for (int i = 0; i < lstMedicine.Count; i++)
            {
                lstPicEvent.Add(new PictureBox());
                CMedicine medicine = lstMedicine[i];
                lstPicEvent[i + acc].Image  = icon.iconHealth;
                lstPicEvent[i + acc].Top    = (i + acc) * 30 + 3;
                lstPicEvent[i + acc].Left   = left;
                lstPicEvent[i + acc].Width  = 24;
                lstPicEvent[i + acc].Height = 24;
                lstPicEvent[i + acc].Click += (e, a) => CallInfoMedicine(medicine);
                picMap.Controls.Add(lstPicEvent[i + acc]);
            }
            acc = acc + lstMedicine.Count;
            for (int i = 0; i < lstTransaction.Count; i++)
            {
                lstPicEvent.Add(new PictureBox());
                CTransaction    transaction    = lstTransaction[i];
                EMoneyFlowState MoneyFlowState = lstTransaction[i].IconType;
                switch (MoneyFlowState)
                {
                case EMoneyFlowState.WithinSystem:
                    lstPicEvent[i + acc].Image = icon.iconMoneyWithin;
                    break;

                case EMoneyFlowState.FlowIn:
                    lstPicEvent[i + acc].Image = icon.iconMoneyIn;
                    break;

                case EMoneyFlowState.FlowOut:
                    lstPicEvent[i + acc].Image = icon.iconMoneyOut;
                    break;

                default:
                    break;
                }
                lstPicEvent[i + acc].Top    = (i + acc) * 30 + 3;
                lstPicEvent[i + acc].Left   = left;
                lstPicEvent[i + acc].Width  = 24;
                lstPicEvent[i + acc].Height = 24;
                lstPicEvent[i + acc].Click += (e, a) => CallInfoTransaction(transaction);
                picMap.Controls.Add(lstPicEvent[i + acc]);
            }
            acc = acc + lstTransaction.Count;
            for (int i = 0; i < lstBudget.Count; i++)
            {
                lstPicEvent.Add(new PictureBox());
                CTransaction    transactionDue = lstBudget[i];
                EMoneyFlowState MoneyFlowState = lstBudget[i].IconType;
                switch (MoneyFlowState)
                {
                case EMoneyFlowState.WithinSystem:
                    lstPicEvent[i + acc].Image = icon.iconTransactionDueWithin;
                    break;

                case EMoneyFlowState.FlowIn:
                    lstPicEvent[i + acc].Image = icon.iconTransactionDueIn;
                    break;

                case EMoneyFlowState.FlowOut:
                    lstPicEvent[i + acc].Image = icon.iconTransactionDueOut;
                    break;

                default:
                    break;
                }
                lstPicEvent[i + acc].Top    = (i + acc) * 30 + 3;
                lstPicEvent[i + acc].Left   = left;
                lstPicEvent[i + acc].Width  = 24;
                lstPicEvent[i + acc].Height = 24;
                lstPicEvent[i + acc].Click += (e, a) => CallInfoBudget(transactionDue);
                picMap.Controls.Add(lstPicEvent[i + acc]);
            }
            acc = acc + lstBudget.Count;
            for (int i = 0; i < lstNote.Count; i++)
            {
                lstPicEvent.Add(new PictureBox());
                CNote note = lstNote[i];
                if (lstNote[i].FinishedNote)
                {
                    if (lstNote[i].LiteratureTitle != "")
                    {
                        lstPicEvent[i + acc].Image = icon.iconLiterature;
                    }
                    else
                    {
                        lstPicEvent[i + acc].Image = icon.iconNote;
                    }
                }
                else
                {
                    lstPicEvent[i + acc].Image = icon.iconWorkingNote;
                }
                lstPicEvent[i + acc].Top    = (i + acc) * 30 + 3;
                lstPicEvent[i + acc].Left   = left;
                lstPicEvent[i + acc].Width  = 24;
                lstPicEvent[i + acc].Height = 24;
                lstPicEvent[i + acc].Click += (e, a) => CallInfoNote(note);
                picMap.Controls.Add(lstPicEvent[i + acc]);
            }
            acc = acc + lstNote.Count;
        }