Exemple #1
0
        public ActionResult Edit(CategoryIncome CIVM)
        {
            CategoryIncomeClient client = new CategoryIncomeClient();

            client.Edit(CIVM);
            return(RedirectToAction("Index"));
        }
        public String GetCategoryName(int id)
        {
            CategoryIncomeClient ac       = new CategoryIncomeClient();
            CategoryIncome       category = ac.Find(id);

            return(category.Name);
        }
Exemple #3
0
        public ActionResult Delete(int id)
        {
            CategoryIncomeClient client = new CategoryIncomeClient();

            client.Delete(id);
            return(RedirectToAction("Index"));
        }
Exemple #4
0
        public ActionResult Create(CategoryIncome CategoryIncome)
        {
            CategoryIncomeClient client = new CategoryIncomeClient();

            client.Create(CategoryIncome);
            return(RedirectToAction("Index"));
        }
Exemple #5
0
        public ActionResult Edit(int id)
        {
            CategoryIncomeClient    client = new CategoryIncomeClient();
            CategoryIncomeViewModel CIVM   = new CategoryIncomeViewModel();

            CIVM.CategoryIncome = client.Find(id);
            return(View("Edit", CIVM.CategoryIncome));
        }
Exemple #6
0
        // GET: Category  where user id==current user id
        public ActionResult Index()
        {
            ClaimsPrincipal currentUser = User;

            var userId = currentUser.FindFirst(ClaimTypes.NameIdentifier).Value;

            CategoryIncomeClient client = new CategoryIncomeClient();

            ViewBag.CategoryIncomelist = client.GetCategoryIncomeList(userId);

            return(View());
        }
        public List <SelectListItem> GetCategoryIncomeList(string id)
        {
            CategoryIncomeClient         ac         = new CategoryIncomeClient();
            IEnumerable <CategoryIncome> enumerable = ac.GetCategoryIncomeList(id);
            var types    = new List <SelectListItem>();
            var iterator = 0;

            foreach (var el in enumerable)
            {
                iterator++;
                types.Add(new SelectListItem()
                {
                    Text = el.Name.ToString(), Value = el.Id.ToString()
                });
            }



            return(types);
        }