Пример #1
0
        // GET: UtilityCosts/Create
        public async Task <ActionResult> CreateUtilityCosts()
        {
            var expenseCategory = await _expenseCategory.GetTableAll();

            ViewBag.Category = new SelectList(expenseCategory.Where(x => (x.idExpenseCategory >= 10) && (x.idExpenseCategory <= 15)), "idExpenseCategory", "name");
            return(View());
        }
Пример #2
0
        // Category
        public async Task <JsonResult> GetCountryList(string searchTerm)
        {
            var CounrtyList = Mapper.Map <IEnumerable <ExpenseCategoryView> >(await _expenseCategory.GetTableAll()).ToList();

            if (searchTerm != null)
            {
                CounrtyList = CounrtyList.Where(x => x.idExpenseCategory == Convert.ToInt32(searchTerm)).ToList();
            }

            var modifiedData = CounrtyList.Select(x => new
            {
                id   = x.idExpenseCategory,
                text = x.name
            });

            return(Json(modifiedData, JsonRequestBehavior.AllowGet));
        }
        // GET: SalaryExpenses/Edit/5
        public async Task <ActionResult> Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            SalaryExpensesView salaryExpensesView = Mapper.Map <SalaryExpensesView>(await _salaryExpenses.SelectId(id));

            if (salaryExpensesView == null)
            {
                return(HttpNotFound());
            }

            ViewBag.Category = new SelectList(await _expenseCategory.GetTableAll(), "idExpenseCategory", "name");
            return(View(salaryExpensesView));
        }
Пример #4
0
 // GET: CostsCarWashAndDeteyling/Create
 public async Task <ActionResult> Create()
 {
     ViewBag.Category = new SelectList(await _expenseCategory.GetTableAll(), "idExpenseCategory", "name");
     return(View());
 }