Exemple #1
0
            static void Insert()
            {
                string name = Tool.Read("Target Client >");
                int    pos  = GetPos(name);

                if (pos == -1)
                {
                    Console.WriteLine("ERROR : Target does not exist"); return;
                }
                Console.WriteLine("Options : \n1\t+Fund\n2\t-Fund\n3\t+Income\n4\t-Income");
                int opt = Convert.ToInt32(Tool.Read("Option >"));

                if (!(opt <= 1 && opt <= 4))
                {
                    Console.WriteLine("ERROR : Unkonwn Option"); return;
                }
                Templates.Collections.Date date = Templates.Collections.Make_Date(Tool.Read("Date >"));
                int val = Convert.ToInt32(Tool.Read("Value >"));

                investor[pos].rec.Add(Objs.Trace.Make_Rec(date, Objs.Trace.Make_DoSums(opt), val));

                switch (opt)
                {
                case 1: AvaFund += val; TotFund += val; investor[pos].fund += val; break;

                case 2: AvaFund -= val; TotFund -= val; investor[pos].fund -= val; break;

                case 3: TotIncome += val; investor[pos].income += val; break;

                case 4: TotIncome -= val; investor[pos].income -= val; break;

                default: break;
                }
                Console.WriteLine("Finished!");
            }
Exemple #2
0
            public static Rec Make_Rec(Templates.Collections.Date date, DoSums type, int val)
            {
                Rec ret = new Rec {
                };

                ret.date = date; ret.type = type; ret.val = val;
                return(ret);
            }