public ActionResult Create([Bind(Include = "GoodID,FundID,FundAreaCode,FundTypeCode,FundCurrencyCode,FundCpyCode,ChargeFeeCode,Description,ClickRate")] FundGoods fundGoods)
        {
            if (ModelState.IsValid)
            {
                /////////////////////////////////////////////////////////////////////////////////////////////////////////
                db.FundGoods.Add(fundGoods);

                var a = (from m in db.FundMaster
                         where m.FundID == fundGoods.FundID
                         select m).FirstOrDefault();

                a.FundStatus = "Y";

                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.ChargeFeeCode    = new SelectList(db.ChargeFee, "ChargeFeeCode", "ChargeFeeCode", fundGoods.ChargeFeeCode);
            ViewBag.FundAreaCode     = new SelectList(db.FundArea, "FundAreaCode", "FundAreaName", fundGoods.FundAreaCode);
            ViewBag.FundCpyCode      = new SelectList(db.FundCompany, "FundCpyCode", "FundCpyName", fundGoods.FundCpyCode);
            ViewBag.FundCurrencyCode = new SelectList(db.FundCurrency, "FundCurrencyCode", "FundCurrencyName", fundGoods.FundCurrencyCode);
            ViewBag.FundID           = new SelectList(db.FundMaster, "FundID", "FundName", fundGoods.FundID);
            ViewBag.FundTypeCode     = new SelectList(db.FundType, "FundTypeCode", "FundTypeName", fundGoods.FundTypeCode);
            return(View(fundGoods));
        }
        // GET: Fund/BackStage/Details/5
        public ActionResult Details(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            FundGoods fundGoods = db.FundGoods.Find(id);

            if (fundGoods == null)
            {
                return(HttpNotFound());
            }
            return(View(fundGoods));
        }
        public ActionResult DeleteConfirmed(string id)
        {
            FundGoods fundGoods = db.FundGoods.Find(id);

            db.FundGoods.Remove(fundGoods);

            var a = (from m in db.FundMaster
                     where m.FundID == fundGoods.FundID
                     select m).FirstOrDefault();

            a.FundStatus = "N";

            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "GoodID,FundID,FundAreaCode,FundTypeCode,FundCurrencyCode,FundCpyCode,ChargeFeeCode,Description,ClickRate")] FundGoods fundGoods)
 {
     if (ModelState.IsValid)
     {
         db.Entry(fundGoods).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ChargeFeeCode    = new SelectList(db.ChargeFee, "ChargeFeeCode", "ChargeFeeCode", fundGoods.ChargeFeeCode);
     ViewBag.FundAreaCode     = new SelectList(db.FundArea, "FundAreaCode", "FundAreaName", fundGoods.FundAreaCode);
     ViewBag.FundCpyCode      = new SelectList(db.FundCompany, "FundCpyCode", "FundCpyName", fundGoods.FundCpyCode);
     ViewBag.FundCurrencyCode = new SelectList(db.FundCurrency, "FundCurrencyCode", "FundCurrencyName", fundGoods.FundCurrencyCode);
     ViewBag.FundID           = new SelectList(db.FundMaster, "FundID", "FundName", fundGoods.FundID);
     ViewBag.FundTypeCode     = new SelectList(db.FundType, "FundTypeCode", "FundTypeName", fundGoods.FundTypeCode);
     return(View(fundGoods));
 }
        // GET: Fund/BackStage/Edit/5
        public ActionResult Edit(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            FundGoods fundGoods = db.FundGoods.Find(id);

            if (fundGoods == null)
            {
                return(HttpNotFound());
            }
            ViewBag.ChargeFeeCode    = new SelectList(db.ChargeFee, "ChargeFeeCode", "ChargeFeePercentage", fundGoods.ChargeFeeCode);
            ViewBag.FundAreaCode     = new SelectList(db.FundArea, "FundAreaCode", "FundAreaName", fundGoods.FundAreaCode);
            ViewBag.FundCpyCode      = new SelectList(db.FundCompany, "FundCpyCode", "FundCpyName", fundGoods.FundCpyCode);
            ViewBag.FundCurrencyCode = new SelectList(db.FundCurrency, "FundCurrencyCode", "FundCurrencyName", fundGoods.FundCurrencyCode);
            ViewBag.FundID           = new SelectList(db.FundMaster, "FundID", "FundName", fundGoods.FundID);
            ViewBag.FundTypeCode     = new SelectList(db.FundType, "FundTypeCode", "FundTypeName", fundGoods.FundTypeCode);
            return(View(fundGoods));
        }