Пример #1
0
 public ActionResult Edit([Bind(Include = "Portfolio_Type_Id,Portfolio_Type_Name")] PortfolioTypeTO portfolio_Type)
 {
     if (portfolio_Type.Portfolio_Type_Name != "" || portfolio_Type.Portfolio_Type_Name != null)
     {
         ptfTypeRepo.updatePortfolioType(portfolio_Type);
         return(RedirectToAction("Index"));
     }
     return(View(portfolio_Type));
 }
Пример #2
0
        public void updatePortfolioType(PortfolioTypeTO portfoliotype)
        {
            Portfolio_Type dataToUpdate = db.Portfolio_Type.Where(x => x.Portfolio_Type_Id == portfoliotype.Portfolio_Type_Id).FirstOrDefault();

            dataToUpdate.Portfolio_Type_Name = portfoliotype.Portfolio_Type_Name;
            dataToUpdate.IsActive            = portfoliotype.IsActive;



            db.SaveChanges();
        }
Пример #3
0
        public void savePortfolioType(PortfolioTypeTO portfoliotype)
        {
            Portfolio_Type dataToSave = new Portfolio_Type()
            {
                Portfolio_Type_Id   = portfoliotype.Portfolio_Type_Id,
                Portfolio_Type_Name = portfoliotype.Portfolio_Type_Name,
                IsActive            = true
            };

            db.Portfolio_Type.Add(dataToSave);
            db.SaveChanges();
        }
Пример #4
0
        // GET: PortfolioType/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            PortfolioTypeTO portfolio_Type = ptfTypeRepo.getPortfolioTypebyId(id);

            if (portfolio_Type == null)
            {
                return(HttpNotFound());
            }
            return(View(portfolio_Type));
        }