コード例 #1
0
ファイル: frmInfoNote.cs プロジェクト: isaac0821/LifeGame
        private void addNoteColor(string Keyword, string NoteColor)
        {
            if (!noteColors.Exists(o => o.Keyword == Keyword))
            {
                RNoteColor newNoteColor = new RNoteColor();
                newNoteColor.Topic   = txtTopic.Text;
                newNoteColor.TagTime = dtpDate.Value.Date;
                newNoteColor.Keyword = Keyword;
                newNoteColor.Color   = NoteColor;
                noteColors.Add(newNoteColor);

                ListViewItem item = new ListViewItem();
                item.Text = Keyword;
                plot C = new plot();
                item.BackColor = C.GetColor(NoteColor);
                if (NoteColor == "Red" || NoteColor == "Green" || NoteColor == "Blue" || NoteColor == "Purple" || NoteColor == "Brown")
                {
                    item.ForeColor = Color.White;
                }
                else
                {
                    item.ForeColor = Color.Black;
                }
                item.Checked = true;
                lsvColor.Items.Add(item);
                SaveNoteLog();
                LoadNoteLog();
            }
        }
コード例 #2
0
        private void tsmNewNote_Click(object sender, EventArgs e)
        {
            modifiedFlag = true;
            plot D = new plot();

            D.CallInfoNoteAddNew(txtTitle.Text);
        }
コード例 #3
0
ファイル: frmTask.cs プロジェクト: isaac0821/LifeGame
 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);
     }
 }
コード例 #4
0
        private void RefreshPtgSubAccount(string accountname)
        {
            plot plot = new plot();

            // Get list of subaccounts
            if (trvAccount.SelectedNode.Text == "(Root)")
            {
                picDebit.BackColor = Color.White;
                picDebit.Controls.Clear();
                picCredit.BackColor = Color.White;
                picCredit.Controls.Clear();
            }
            else
            {
                List <RSubAccount> sub = G.glb.lstSubAccount.FindAll(o => o.Account == accountname);
                if (sub.Count > 0)
                {
                    List <double> lstCreditAmounts = new List <double>();
                    List <string> lstCreditDesc    = new List <string>();
                    List <double> lstDebitAmounts  = new List <double>();
                    List <string> lstDebitDesc     = new List <string>();
                    foreach (RSubAccount item in sub)
                    {
                        CAccountBalanceDetail subBalance = new CAccountBalanceDetail();
                        string accountCurrency           = G.glb.lstAccount.Find(o => o.AccountName == accountname).Currency;
                        string subAccountCurrency        = G.glb.lstAccount.Find(o => o.AccountName == item.SubAccount).Currency;
                        subBalance = LoadAccount(item.SubAccount);
                        if (subBalance.lblCreditAmount > 0)
                        {
                            if (accountCurrency == subAccountCurrency)
                            {
                                lstCreditAmounts.Add(subBalance.lblCreditAmount);
                            }
                            else
                            {
                                double currencyRate = 0;
                                if (G.glb.lstCurrencyRate.Exists(o => o.CurrencyA == accountCurrency && o.CurrencyB == subAccountCurrency))
                                {
                                    currencyRate = G.glb.lstCurrencyRate.Find(o => o.CurrencyA == accountCurrency && o.CurrencyB == subAccountCurrency).Rate;
                                    lstCreditAmounts.Add(subBalance.lblCreditAmount / currencyRate);
                                }
                                else
                                {
                                    currencyRate = G.glb.lstCurrencyRate.Find(o => o.CurrencyB == accountCurrency && o.CurrencyA == subAccountCurrency).Rate;
                                    lstCreditAmounts.Add(subBalance.lblCreditAmount * currencyRate);
                                }
                            }
                            lstCreditDesc.Add(item.SubAccount);
                        }
                        if (subBalance.lblDebitAmount > 0)
                        {
                            if (accountCurrency == subAccountCurrency)
                            {
                                lstDebitAmounts.Add(subBalance.lblDebitAmount);
                            }
                            else
                            {
                                double currencyRate = 0;
                                if (G.glb.lstCurrencyRate.Exists(o => o.CurrencyA == accountCurrency && o.CurrencyB == subAccountCurrency))
                                {
                                    currencyRate = G.glb.lstCurrencyRate.Find(o => o.CurrencyA == accountCurrency && o.CurrencyB == subAccountCurrency).Rate;
                                    lstDebitAmounts.Add(subBalance.lblDebitAmount / currencyRate);
                                }
                                else
                                {
                                    currencyRate = G.glb.lstCurrencyRate.Find(o => o.CurrencyB == accountCurrency && o.CurrencyA == subAccountCurrency).Rate;
                                    lstDebitAmounts.Add(subBalance.lblDebitAmount * currencyRate);
                                }
                            }
                            lstDebitDesc.Add(item.SubAccount);
                        }
                    }
                    if (lstCreditAmounts.Count > 0)
                    {
                        plot.DrawPercentageBlocks(picCredit, "g", lstCreditAmounts, lstCreditDesc);
                    }
                    else
                    {
                        picCredit.BackColor = Color.White;
                        picCredit.Controls.Clear();
                    }
                    if (lstDebitAmounts.Count > 0)
                    {
                        plot.DrawPercentageBlocks(picDebit, "r", lstDebitAmounts, lstDebitDesc);
                    }
                    else
                    {
                        picDebit.BackColor = Color.White;
                        picDebit.Controls.Clear();
                    }
                }
                else
                {
                    CAccountBalanceDetail balance = LoadAccount(accountname);
                    picDebit.BackColor = Color.White;
                    picDebit.Controls.Clear();
                    picCredit.BackColor = Color.White;
                    picCredit.Controls.Clear();
                    if (balance.lblCreditAmount > 0)
                    {
                        plot.DrawPercentageBlocks(picCredit, "g", new List <double> {
                            balance.lblCreditAmount
                        }, new List <string> {
                            accountname
                        });
                    }
                    if (balance.lblDebitAmount > 0)
                    {
                        plot.DrawPercentageBlocks(picDebit, "r", new List <double> {
                            balance.lblDebitAmount
                        }, new List <string> {
                            accountname
                        });
                    }
                }
            }
        }