public void Clear() { Profits.Clear(); BuyQuantities.Clear(); TradeLog.Clear(); _tradingResultsRepository.Clear(); }
public ConsignmentShop(IDataSource pDataSource, Profits pProfit, NewStoreItems pNewItems) { InitializeComponent(); dataSource = pDataSource; profit = pProfit; newItems = pNewItems; }
public ActionResult DeleteConfirmed(int id) { Profits profits = db.Profits.Find(id); db.Profits.Remove(profits); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ID,NameUser,MovieID,MovieName,DateTimeDownload,PriceMovie")] Profits profits) { if (ModelState.IsValid) { db.Entry(profits).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(profits)); }
public ActionResult Create([Bind(Include = "ID,NameUser,MovieID,MovieName,DateTimeDownload,PriceMovie")] Profits profits) { if (ModelState.IsValid) { db.Profits.Add(profits); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(profits)); }
public override string ToString() { StringBuilder builder = new StringBuilder(); GetNumbers().ForEach(n => builder.AppendLine(n.ToString())); builder.AppendLine("\n\n"); builder.AppendLine(Costs.ToString()); builder.AppendLine(Profits.ToString()); builder.AppendLine(Balance.ToString()); return(builder.ToString()); }
public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Profits profits = db.Profits.Find(id); if (profits == null) { return(HttpNotFound()); } return(View(profits)); }
private void ExecuteSell(ForexTreeData record) { if (BuyQuantities.Count < 1) { throw new BllException("You have no open positions to close for sell."); } var tradeUnits = BidSize / MarginRatio; var unitsSold = BuyQuantities[0]; var profit = MathHelpers.GreedyCurrencyPrecision(unitsSold / record.Ask - tradeUnits); Profits.Add(profit); BuyQuantities.RemoveAt(0); SaveLogRecord(0.0, unitsSold, profit, MarketAction.Sell, record.Action); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); // composition root //IDataSource dataSource = new DummyData(); IDataSource dataSource = new XmlData(); Profits profit = new Profits(); NewStoreItems newItems = new NewStoreItems(); var form = new ConsignmentShop(dataSource, profit, newItems); // run your logic Application.Run(form); }
public void EvaluateCostsAndProfits() { if (!Totals.Any()) // Totals need to be evaluated beforehand { EvaluateTotals(); } Costs.Clear(); Profits.Clear(); for (var index = 0; index <= _diffMonths; index++) { var period = _from.AddMonths(index); var ordersInMonth = _orders.Where(IsInMonth(period.Month)); Costs.Add(ordersInMonth.Sum(order => order.OrderTotalCost)); Profits.Add(Totals[index] - Costs[index]); } }
public FileResult Download(string MovieName, int MovieId) { Movie MovieDownload_id = db.Movies.Where(m => m.ID == MovieId).ToList().First(); try { Profits profits = new Profits(); profits.MovieID = MovieDownload_id.ID; profits.MovieName = MovieDownload_id.Name; profits.NameUser = User.Identity.Name; profits.PriceMovie = MovieDownload_id.Price; profits.DateTimeDownload = DateTime.Now; db.Profits.Add(profits); db.SaveChanges(); } catch (Exception) { throw; } return(File("~/Movie/" + MovieName, System.Net.Mime.MediaTypeNames.Application.Octet, MovieName)); }
public void ClearedShoppingCartTest() { // Arrange Profits profits = new Profits(); Store store = new Store(); store.Vendors.Add(new Vendor { FirstName = "Bill", LastName = "Smith" }); store.Items.Add(new Item { Title = "Moby Dick", Description = "A book about a whale", Price = 4.50M, Owner = store.Vendors[0] }); profits.shoppingCartData.Add(new Item { Title = "Moby Dick", Description = "A book about a whale", Price = 4.50M, Owner = store.Vendors[0] }); //Act var cartItems = profits.CalculateShareOfVendorStore(); // Assert Assert.IsEmpty(cartItems); }
private void btnShowReport_Click(object sender, EventArgs e) { Profits.Profit(dtpStart.Value.Ticks, dtpEnd.Value.Ticks); }
/// <summary> /// 更改 /// </summary> /// <param name="t"></param> /// <returns></returns> public int Update(Profits t) { var result = iProfits_DAL.Update(t); return(result); }
/// <summary> /// 新增稿费记录 /// </summary> /// <param name="t"></param> /// <returns></returns> public int Add(Profits t) { var result = iProfits_DAL.Add(t); return(result); }