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); }
public ActionResult Delete(int id) { CategoryIncomeClient client = new CategoryIncomeClient(); client.Delete(id); return(RedirectToAction("Index")); }
public ActionResult Create(CategoryIncome CategoryIncome) { CategoryIncomeClient client = new CategoryIncomeClient(); client.Create(CategoryIncome); return(RedirectToAction("Index")); }
public ActionResult Edit(int id) { CategoryIncomeClient client = new CategoryIncomeClient(); CategoryIncomeViewModel CIVM = new CategoryIncomeViewModel(); CIVM.CategoryIncome = client.Find(id); return(View("Edit", CIVM.CategoryIncome)); }
// 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); }