public IActionResult ArrowAceOne(int id)
        {
            var str = db.Evaluation.Where(x => x.Id == id).ToList();

            foreach (var val in str) // iterator the data from the list and insert them into the listSecond
            {
                string     SalesStage = "ClosedLost";
                ClosedLost ls         = new ClosedLost();
                ls.Id                  = val.Id;
                ls.Name                = val.Name;
                ls.Rep                 = val.Rep;
                ls.SalesStage          = SalesStage;
                ls.Priority            = val.Priority;
                ls.ExpectedCloseDate   = val.ExpectedCloseDate;
                ls.ForeCastValue       = val.ForeCastValue;
                ls.Probability         = val.Probability;
                ls.LastContact         = val.LastContact;
                ls.SignedContractValue = val.SignedContractValue;
                ls.Notes               = val.Notes;



                db.ClosedLost.Add(ls);
            }
            db.SaveChanges();
            db.Evaluation.Remove(db.Evaluation.Find(id));

            db.SaveChanges();

            return(RedirectToAction("Index"));
        }
コード例 #2
0
        public IActionResult Add(ClosedLost ClosedLost, Sales Sales)
        {
            db.ClosedLost.Add(ClosedLost);
            db.Sales.Add(Sales);
            db.SaveChanges();

            return(RedirectToAction("Index"));
        }
コード例 #3
0
        public IActionResult Edit(int id, ClosedLost ClosedLost, Sales Sales)
        {
            db.Entry(ClosedLost).State = Microsoft.EntityFrameworkCore.EntityState.Modified;

            db.Entry(Sales).State = Microsoft.EntityFrameworkCore.EntityState.Modified;
            db.SaveChanges();

            return(RedirectToAction("Index"));
        }