Ejemplo n.º 1
0
        public ActionResult EditSubcategory([Bind(Include = "dossierId,assetSubcategoryId,assetCategoryId,description,isAsset")]                                                   POCO.assetSubcategory assetSubcategory)
        {
            ListAssetsModel ass = new ListAssetsModel(assetSubcategory.dossierId, assetSubcategory.isAsset);

            assetSubcategory.ListCategories = ass.Categories.Where(c => c.isAsset == assetSubcategory.isAsset).ToList();

            ViewBag.Action = "EditSubcategory";
            return(View("DetailsSubcategory", assetSubcategory));
        }
Ejemplo n.º 2
0
 public ActionResult EditSubcategoryConfirmed([Bind(Include = "assetCategoryId,assetSubcategoryId,dossierId,isAsset,description")] POCO.assetSubcategory assetSubcategory)
 {
     if (ModelState.IsValid)
     {
         POCO.assetSubcategory.UpdateSubcategory(assetSubcategory);
         return(RedirectToAction("Index", "AssetCategory", new { dossierId = assetSubcategory.dossierId }));
     }
     return(View(assetSubcategory));
 }
Ejemplo n.º 3
0
        // GET: AssetCategory/Create
        public ActionResult CreateSubcategory(int dossierId, bool isAsset)
        {
            POCO.assetSubcategory model = new POCO.assetSubcategory {
                dossierId = dossierId
            };
            ListAssetsModel ass = new ListAssetsModel(dossierId, true);

            model.ListCategories = ass.Categories.Where(c => c.isAsset == isAsset).ToList();

            ViewBag.Action = "CreateSubcategory";
            return(View("DetailsSubcategory", model));
            //return View();
        }
        public static void AddSubCategory(assetSubcategory subcat)
        {
            PersonalFinancesDBEntities db = new PersonalFinancesDBEntities();

            var catEntity = new PersonalFinances.DATA.DataModel.assetSubcategory
            {
                assetCategoryId = subcat.assetCategoryId,
                description     = subcat.description
            };

            db.assetSubcategories.Add(catEntity);
            db.SaveChanges();
        }
Ejemplo n.º 5
0
        public ActionResult CreateSubcategory([Bind(Include = "dossierId,assetSubcategoryId,assetCategoryId,description,isAsset")] POCO.assetSubcategory assetSubcategory)
        {
            if (ModelState.IsValid)
            {
                //  POCO.assetSubcategory.AddCategory(assetCategory);

                POCO.assetSubcategory.AddSubCategory(assetSubcategory);

                return(RedirectToAction("Index", "AssetCategory", new { dossierId = assetSubcategory.dossierId }));
                //return RedirectToAction("Index");
            }

            return(View(assetSubcategory));
        }