private static void CalcProfitValue(TranTotals total, TranProfit profit) { if (total.FinType == "FeesInDischargePortNet") { profit.TotalPaid += total.FinTotal; } else if (total.FinType == "FeesInDischargePortSelling") { profit.TotalEarned += total.FinTotal; } else if (total.FinType == "FeesInOriginNet") { profit.TotalPaid += total.FinTotal; } else if (total.FinType == "FeesInOriginSelling") { profit.TotalEarned += total.FinTotal; } else if (total.FinType == "TranChargesNet") { profit.TotalPaid += total.FinTotal; } else if (total.FinType == "TranChargesSelling") { profit.TotalEarned += total.FinTotal; } else if (total.FinType == "LineShippingNet") { profit.TotalPaid += total.FinTotal; } else if (total.FinType == "LineShippingSelling") { profit.TotalEarned += total.FinTotal; } }
public ActionResult DeleteConfirmed(int id) { TranTotals trantotals = db.TranTotals.Find(id); db.TranTotals.Remove(trantotals); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "TranID,FinType,CurrencyID,FinTotal")] TranTotals trantotals) { if (ModelState.IsValid) { db.Entry(trantotals).State = EntityState.Modified; db.SaveChanges(); //return RedirectToAction("Index"); return(RedirectToAction("Details", "Tran", new { id = trantotals.TranID })); } ViewBag.CurrencyID = new SelectList(db.Currency, "CurrencyID", "CurrencyCode", trantotals.CurrencyID); ViewBag.TranID = new SelectList(db.Tran, "TranID", "Updator", trantotals.TranID); return(View(trantotals)); }
public ActionResult Create([Bind(Include = "TranID,FinType,CurrencyID,FinTotal")] TranTotals trantotals) { if (ModelState.IsValid) { db.TranTotals.Add(trantotals); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CurrencyID = new SelectList(db.Currency, "CurrencyID", "CurrencyCode", trantotals.CurrencyID); ViewBag.TranID = new SelectList(db.Tran, "TranID", "Updator", trantotals.TranID); return(View(trantotals)); }
// GET: /TranTotals/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TranTotals trantotals = db.TranTotals.Find(id); if (trantotals == null) { return(HttpNotFound()); } return(View(trantotals)); }
// GET: /TranTotals/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TranTotals trantotals = db.TranTotals.Find(id); if (trantotals == null) { return(HttpNotFound()); } ViewBag.CurrencyID = new SelectList(db.Currency, "CurrencyID", "CurrencyCode", trantotals.CurrencyID); ViewBag.TranID = new SelectList(db.Tran, "TranID", "Updator", trantotals.TranID); return(View(trantotals)); }