public bool AddEntry(string Entryname, string Label) { Balans balans = new Balans(); switch (Label) { case "Vaste activa": balans.vasteActiva.AddEntry(Entryname); return(true); case "Vlottende activa": balans.vlottendeActiva.AddEntry(Entryname); return(true); case "Eigenvermogen": balans.eigenVermogen.AddEntry(Entryname); return(true); case "Langvreendvermogen": balans.langVreemdVermogen.AddEntry(Entryname); return(true); case "Kortvreemdvermogen": balans.kortVreemdVermogen.AddEntry(Entryname); return(true); default: // did not select an item return(false); } }
private void formBalance_Load(object sender, EventArgs e) { Balans balans = new Balans(); Dictionary <string, int> Activa = balans.GetActiva(); Dictionary <string, int> Passiva = balans.GetPassiva(); DataGridViewCellStyle bold = new DataGridViewCellStyle(); bold.Font = new Font(gridviewBalans.Font, FontStyle.Bold); int BalansLength = Activa.Count(); if (Passiva.Count() > BalansLength) { BalansLength = Passiva.Count(); } for (int i = 0; i < BalansLength; i++) { int Rownumber = gridviewBalans.Rows.Add(); if (i < Activa.Count()) { gridviewBalans.Rows[Rownumber].Cells[colActiva.Index].Value = Activa.Keys.ElementAt(i); gridviewBalans.Rows[Rownumber].Cells[colActivaN.Index].Value = "€" + Activa.Values.ElementAt(i); if (Activa.Values.ElementAt(i) < 0) { gridviewBalans.Rows[Rownumber].Cells[colActiva.Index].Style = bold; gridviewBalans.Rows[Rownumber].Cells[colActivaN.Index].Value = ""; } } if (i < Passiva.Count()) { gridviewBalans.Rows[Rownumber].Cells[colPassiva.Index].Value = Passiva.Keys.ElementAt(i); gridviewBalans.Rows[Rownumber].Cells[colPassivaN.Index].Value = "€" + Passiva.Values.ElementAt(i); if (Passiva.Values.ElementAt(i) < 0) { gridviewBalans.Rows[Rownumber].Cells[colPassiva.Index].Style = bold; gridviewBalans.Rows[Rownumber].Cells[colPassivaN.Index].Value = ""; } } } }
public ActionResult Balans() { Balans balans = new Balans(); currentCard = (Card)Session["currentCard"]; operationCode = database.OperationCode.Where(c => c.Name == "Balans").First(); operationWithCard.Id = Guid.NewGuid(); operationWithCard.OperationCodeId = operationCode.Id; operationWithCard.Date = DateTime.UtcNow; database.OperationsWithCard.Add(operationWithCard); database.SaveChanges(); balans.CardNumber = currentCard.CardNumber; balans.AvailableMoney = currentCard.AvailableMoney; balans.Date = DateTime.UtcNow; return(View(balans)); }