コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            PriceLine priceLine = db.PriceLines.Find(id);

            db.PriceLines.Remove(priceLine);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 protected override void OnBarUpdate()
 {
     avg         = DYNAverage[0];
     stdDevValue = SDBB[0];
     PriceLine.Set(DYNPrice[0]);
     SignalLine.Set(DYNSignal[0]);
     Average.Set(avg);
     Upper.Set(avg + stdDevNumber * stdDevValue);
     Lower.Set(avg - stdDevNumber * stdDevValue);
 }
コード例 #3
0
 public ActionResult Edit([Bind(Include = "PriceHeaderId,BodyPartId,Price")] PriceLine priceLine)
 {
     if (ModelState.IsValid)
     {
         db.Entry(priceLine).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.PriceHeaderId = new SelectList(db.PriceHeaders, "PriceHeaderId", "PriceName", priceLine.PriceHeaderId);
     return(View(priceLine));
 }
コード例 #4
0
        protected override void OnBarUpdate()
        {
            double RSI_value = RSI(this.RSIPeriod, 1)[0];

            this._RSI_List.Set(RSI_value);

            double PRICE_value = SMA(this._RSI_List, this.PricePeriod)[0];

            PriceLine.Set(PRICE_value);

            double SIGNAL_value = SMA(this._RSI_List, this.SignalPeriod)[0];

            SignalLine.Set(SIGNAL_value);

            double AVG_value = SMA(this._RSI_List, this.BandPeriod)[0];

            Average.Set(AVG_value);
            MidLine.Set(50);

            double stdDevValue = StdDev(this._RSI_List, this.BandPeriod)[0];

            Upper.Set(AVG_value + this.StdDevNumber * stdDevValue);
            Lower.Set(AVG_value - this.StdDevNumber * stdDevValue);

            PlotColors[0][0] = this.Main;
            PlotColors[1][0] = this.Signal;
            PlotColors[2][0] = this.BBAverage;
            PlotColors[3][0] = this.BBUpper;
            PlotColors[4][0] = this.BBLower;

            if (AVG_value > 50)
            {
                PlotColors[5][0] = this.MidPositive;
            }
            else
            {
                PlotColors[5][0] = this.MidNegative;
            }

            Plots[0].PenStyle  = this.Dash0Style;
            Plots[0].Pen.Width = this.Plot0Width;
            Plots[1].PenStyle  = this.Dash1Style;
            Plots[1].Pen.Width = this.Plot1Width;
            Plots[2].PenStyle  = this.Dash2Style;
            Plots[2].Pen.Width = this.Plot2Width;

            Plots[3].PenStyle  = this.Dash3Style;
            Plots[3].Pen.Width = this.Plot3Width;
            Plots[4].PenStyle  = this.Dash3Style;
            Plots[4].Pen.Width = this.Plot3Width;
            Plots[5].PenStyle  = this.Dash3Style;
            Plots[5].Pen.Width = this.Plot3Width;
        }
コード例 #5
0
        public ActionResult Create([Bind(Include = "PriceHeaderId,BodyPartId,Price")] PriceLine priceLine)
        {
            if (ModelState.IsValid)
            {
                db.PriceLines.Add(priceLine);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.PriceHeaderId = new SelectList(db.PriceHeaders, "PriceHeaderId", "PriceName", priceLine.PriceHeaderId);
            return(View(priceLine));
        }
コード例 #6
0
            /// <summary>
            /// For the given item lines calculate and set their prices based on the set
            ///  of price lines provided (keyed by item line line Id).
            /// </summary>
            /// <param name="salesLines">Item lines to have their prices set.</param>
            /// <param name="priceLines">Set of price lines used to set the item line prices.</param>
            /// <param name="currencyAndRoundingHelper">Currency and rounding helper.</param>
            public static void ResolveAndApplyPriceLines(IEnumerable <SalesLine> salesLines, Dictionary <string, IEnumerable <PriceLine> > priceLines, ICurrencyOperations currencyAndRoundingHelper)
            {
                foreach (var sl in salesLines)
                {
                    IEnumerable <PriceLine> prices;
                    if (!priceLines.TryGetValue(sl.LineId, out prices))
                    {
                        prices = new PriceLine[0];
                    }

                    ResolveAndApplyPriceForSalesLine(sl, prices, currencyAndRoundingHelper);
                }
            }
コード例 #7
0
        // GET: PriceLine/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            PriceLine priceLine = db.PriceLines.Find(id);

            if (priceLine == null)
            {
                return(HttpNotFound());
            }
            return(View(priceLine));
        }
コード例 #8
0
        // GET: PriceLine/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            PriceLine priceLine = db.PriceLines.Find(id);

            if (priceLine == null)
            {
                return(HttpNotFound());
            }
            ViewBag.PriceHeaderId = new SelectList(db.PriceHeaders, "PriceHeaderId", "PriceName", priceLine.PriceHeaderId);
            return(View(priceLine));
        }
コード例 #9
0
ファイル: StrategyDrawer.cs プロジェクト: wanwei/sc2
 public void DrawLine(PriceLine line)
 {
 }