Ejemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            SecondPrice stockPrice = db.StockPrices.Find(id);

            db.StockPrices.Remove(stockPrice);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "Id,Code,Name,Open,Last,Current,Max,Min,Buy,Sell,Turnover,Amount,Buy1,BuyPrice1,Buy2,BuyPrice2,Buy3,BuyPrice3,Buy4,BuyPrice4,Buy5,BuyPrice5,Sell1,SellPrice1,Sell2,SellPrice2,Sell3,SellPrice3,Sell4,SellPrice4,Sell5,SellPrice5,Date,Time,MillSecond,Remark,CreatedOn,UpdatedOn")] SecondPrice stockPrice)
 {
     if (ModelState.IsValid)
     {
         db.Entry(stockPrice).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(stockPrice));
 }
Ejemplo n.º 3
0
        // GET: StockPrices/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            SecondPrice stockPrice = db.StockPrices.Find(id);

            if (stockPrice == null)
            {
                return(HttpNotFound());
            }
            return(View(stockPrice));
        }
Ejemplo n.º 4
0
 private void button2_Click(object sender, EventArgs e)
 {
     try
     {
         var url = this.textBox1.Text.Trim();
         List <SecondPrice> list = new List <SecondPrice>();
         foreach (var line in client.DownloadString(url).Split('\r', '\n'))
         {
             if (line.Length < 100)
             {
                 continue;
             }
             list.Add(SecondPrice.NewStockPrice(line));
         }
         this.dataGridView1.DataSource = list;
         this.dataGridView1.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.DisplayedCells);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }