public JournalPresenter(JournalList model, JournalFormView view)
        {
            this.model = model;
            this.view  = view;

            view.Presenter = this;
        }
        private void ListJournalsBt_Click(object sender, EventArgs e)
        {
            JournalList      model     = new JournalList();
            JournalFormView  view      = new JournalFormView();
            JournalPresenter presenter = new JournalPresenter(model, view);

            view.Show();
        }
        public void LoadJournalExampleData()
        {
            //LedgerAccountList.AddBuchungssatz(new AccountingRecord {Account = account, Text = "Test1Haben", Value = 11},
            //    new AccountingRecord {Account = account, Text = "Test1Soll", Value = 101});
            //LedgerAccountList.AddBuchungssatz(new AccountingRecord {Account = account, Text = "Test2Haben", Value = 22},
            //    new AccountingRecord {Account = account, Text = "Test2Soll", Value = 202});
            //LedgerAccountList.AddBuchungssatz(new AccountingRecord {Account = account, Text = "Test3Haben", Value = 33},
            //    new AccountingRecord {Account = account, Text = "Test3Soll", Value = 303});

            JournalList.Add(new Journal {
                Text = "Verkauf einer alten Maschine gegen Barzahlung für 1'500Fr."
            });
            JournalList.Add(new Journal {
                Text = "Immobilienkauf durch eine Hypothek von 1'000'000Fr."
            });
        }
        private void DeleteLast_Click(object sender, RoutedEventArgs e)
        {
            if (JournalList.Any())
            {
                var existingCreditAccount = LedgerAccountList.FirstOrDefault(x => x.CreditAccountingRecords != null && x.CreditAccountingRecords.Any(y => JournalList.LastOrDefault().ID == y.ID));
                if (existingCreditAccount != null)
                {
                    existingCreditAccount.CreditAccountingRecords.Remove(existingCreditAccount.CreditAccountingRecords.First(y => JournalList.Last().ID == y.ID));
                }

                var existingDebitAccount = LedgerAccountList.FirstOrDefault(x => x.DebitAccountingRecords != null && x.DebitAccountingRecords.Any(y => JournalList.LastOrDefault().ID == y.ID));
                if (existingDebitAccount != null)
                {
                    existingDebitAccount.CreditAccountingRecords.Remove(existingDebitAccount.DebitAccountingRecords.First(y => JournalList.Last().ID == y.ID));
                }
                JournalList.Remove(JournalList.Last());
            }
        }
Esempio n. 5
0
        private void Add_Click(object sender, RoutedEventArgs e)
        {
            JournalList newentry = new JournalList();

            newentry.LogID = UserInfo.UserId;
            newentry.Title = Titlebox.Text.Trim();
            newentry.Entry = Entrybox.Text.Trim();

            JournalList newentry2 = Entry.entry(newentry);

            if (newentry2 == null)
            {
                NoEntry.Foreground.Opacity = 100;
            }
            else
            {
                NavigationService main = NavigationService.GetNavigationService(this);
                main.Navigate(new Uri("MainPage.xaml", UriKind.Relative));
            }
        }
Esempio n. 6
0
 public void LoadJournalExampleData()
 {
     foreach (Account account in accounts.ItemsSource)
     {
         JournalList.Add(new Journal()
         {
             Account = account,
             HABENAccountingRecords = new ObservableCollection <AccountingRecord> {
                 new AccountingRecord()
                 {
                     Account = account, Text = "Test1Haben", Value = 11
                 },
                 new AccountingRecord()
                 {
                     Account = account, Text = "Test2Haben", Value = 22
                 },
                 new AccountingRecord()
                 {
                     Account = account, Text = "Test2Haben", Value = 33
                 },
             },
             SOLLAccountingRecords = new ObservableCollection <AccountingRecord>
             {
                 new AccountingRecord()
                 {
                     Account = account, Text = "Test1Soll", Value = 101
                 },
                 new AccountingRecord()
                 {
                     Account = account, Text = "Test2Soll", Value = 202
                 },
                 new AccountingRecord()
                 {
                     Account = account, Text = "Test2Soll", Value = 303
                 },
             }
         });
     }
 }
        internal static JournalList getJournalList(HttpResponseMessage responce)
        {
            var journalList = new JournalList();
            var jsonObj     = JsonConvert.DeserializeObject <Dictionary <string, object> >(responce.Content.ReadAsStringAsync().Result);

            if (jsonObj.ContainsKey("journals"))
            {
                var journalsArray = JsonConvert.DeserializeObject <List <object> >(jsonObj["journals"].ToString());
                foreach (var journalObj in journalsArray)
                {
                    var journal = new Journal();
                    journal = JsonConvert.DeserializeObject <Journal>(journalObj.ToString());
                    journalList.Add(journal);
                }
            }
            if (jsonObj.ContainsKey("page_context"))
            {
                var pageContext = new PageContext();
                pageContext = JsonConvert.DeserializeObject <PageContext>(jsonObj["page_context"].ToString());
                journalList.page_context = pageContext;
            }
            return(journalList);
        }
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     JournalList.Add(new Journal());
 }
Esempio n. 9
0
        private void JournalList_BuildEnemyList(On.JournalList.orig_BuildEnemyList orig, JournalList self)
        {
            #region modifyFSM
            ListInstance = self;
            var fsm  = self.gameObject.LocateMyFSM("Item List Control");
            var skip = false;
            foreach (var state in fsm.FsmStates)
            {
                if (state.Name == "Custom Check" || state.Name == "Custom")
                {
                    skip = true;
                }
            }
            if (!skip)
            {
                var custom = fsm.CopyState("Normal", "Custom");
                var state  = fsm.CreateState("Custom Check");
                void Check()
                {
                    var list        = ReflectionHelper.GetField <JournalList, GameObject[]>(self, "currentList");
                    var currentitem = list[fsm.FsmVariables.GetFsmInt("Current Item").Value];

                    if (currentitem.GetComponent <JournalEntryStats>().grimmEntry&& currentitem.GetComponent <JournalEntryStats>().warriorGhost)
                    {
                        if (currentitem.GetComponent <JournalTracker>() != null)
                        {
                            if (currentitem.GetComponent <JournalTracker>().CustomEntrySprite != null)
                            {
                                custom.GetAction <SetSpriteRendererSprite>(0).sprite = currentitem.GetComponent <JournalTracker>().CustomEntrySprite;
                                fsm.SetState("Custom");
                                return;
                            }
                        }
                    }
                    else
                    {
                        fsm.SetState("Normal");
                    }
                    fsm.SetState("Type");
                }

                state.AddAction(new CustomCallMethod(Check));
                fsm.ChangeTransition("Display Kills", "FINISHED", "Custom Check");
                fsm.ChangeTransition("Get Notes", "FINISHED", "Custom Check");
            }
            #endregion
            GameObject tmpGo = null;
            try
            {
                tmpGo = self.list.First(x => x.GetComponent <JournalEntryStats>().convoName == GetEntryName());
            }
            catch { }
            if (tmpGo == null)
            {
                //entrynumber = self.list.Length + 1;
                var go       = GameObject.Instantiate(self.list[0]);
                var listitem = go.GetComponent <JournalEntryStats>();
                listitem.convoName = GetEntryName();
                listitem.sprite    = picturesprite;
                go.transform.Find("Portrait").GetComponent <SpriteRenderer>().sprite       = portraitsprite;
                go.transform.Find("Name").GetComponent <SetTextMeshProGameText>().convName = GetEntryName();
                listitem.playerDataName = GetEntryName();
                switch (EType)
                {
                case EntryType.Normal:
                    listitem.warriorGhost = false;
                    listitem.grimmEntry   = false;
                    break;

                case EntryType.Dream:
                    listitem.warriorGhost = true;
                    listitem.grimmEntry   = false;
                    break;

                case EntryType.Grimm:
                    listitem.warriorGhost = false;
                    listitem.grimmEntry   = true;
                    break;

                case EntryType.Custom:
                    listitem.warriorGhost = true;
                    listitem.grimmEntry   = true;
                    break;
                }
                if (addingtracker)
                {
                    tracker = go.AddComponent <JournalTracker>();
                    trackers.Add(tracker);
                    go.GetComponent <JournalTracker>().entrynumber = entrynumber;
                    if (CustomSprite != null && EType == EntryType.Custom)
                    {
                        go.GetComponent <JournalTracker>().CustomEntrySprite = CustomSprite;
                    }
                }
                if (string.IsNullOrEmpty(InsertAfter))
                {
                    Ext.Extensions.Log("Journal Helper", "NO Insert After present(not a error), defaulting to the end of the list on custom entry " + entrynumber);
                    self.list = self.list.Append(go).ToArray();
                }
                else
                {
                    bool containsbool = false;
                    tmpGo = null;
                    try
                    {
                        tmpGo        = self.list.First(x => x.GetComponent <JournalEntryStats>().playerDataName == InsertAfter);
                        containsbool = tmpGo != null;
                    }
                    catch { }
                    int index = containsbool ? Array.IndexOf(self.list, tmpGo) : 0;
                    if (containsbool)
                    {
                        Ext.Extensions.Log("Journal Helper", "Insert After found, adding custom entry " + entrynumber);
                        //var tmpList = self.list.Insert(index + 1, go).ToList();
                        //if ((tmpList[tmpList.Count - 1] = go) && (tmpList.IndexOf(go) != tmpList.Count - 1))
                        //tmpList.RemoveAt(tmpList.Count - 1); //for when vasi was broken
                        //self.list = tmpList.ToArray();
                        self.list = self.list.Insert(index + 1, go).ToArray();
                    }
                    else
                    {
                        Ext.Extensions.Log("Journal Helper", "Insert After present, but NOT found, defaulting to the end of the list on custom entry " + entrynumber);
                        self.list = self.list.Append(go).ToArray();
                    }
                }
            }
            orig(self);
        }
Esempio n. 10
0
 private static void JournalList_BuildEnemyList_Static(On.JournalList.orig_BuildEnemyList orig, JournalList self)
 {
     orig(self);
     try
     {
         var current = ReflectionHelper.GetField <JournalList, GameObject[]>(self, "currentList");
         if (current == null)
         {
             self.UpdateEnemyList();
             current = ReflectionHelper.GetField <JournalList, GameObject[]>(self, "currentList");
         }
         PlayerData.instance.lastJournalItem = Mathf.Clamp(PlayerData.instance.lastJournalItem, 0, current.Length - 1);
     }
     catch (Exception e)
     {
         Ext.Extensions.Log("Journal Helper", e);
     }
     PlayerData.instance.CountJournalEntries();
 }