// // GET: /Event/Create public PartialViewResult CreateForm() { var categories = _categoryDataAccess.GetCategories(); ViewBag.Categories = categories; return(PartialView("_CreateForm")); }
public void frmCategory_Load(object sender, EventArgs e) { DataTable dt = CategoryDataAccess.GetCategories(); if (dt != null) { this.cateroryGridView.DataSource = dt; FormatGrid(ref this.cateroryGridView); } }
public async Task <IActionResult> Get() { try { var parameters = HttpUtility.ParseQueryString(Request.QueryString.Value); var paramIsActive = parameters["IsActive"]; CategoryDataAccess _categoryAccess = new CategoryDataAccess(_iconfiguration); DatabaseResponse response = await _categoryAccess.GetCategories(paramIsActive); if (response.ResponseCode == (int)DbReturnValue.RecordExists) { return(Ok(new OperationResponse { HasSucceeded = true, IsDomainValidationErrors = false, Message = EnumExtensions.GetDescription(DbReturnValue.RecordExists), ReturnedObject = response.Results })); } else { Log.Error(EnumExtensions.GetDescription(DbReturnValue.NoRecords)); return(Ok(new OperationResponse { HasSucceeded = false, IsDomainValidationErrors = false, Message = EnumExtensions.GetDescription(DbReturnValue.NoRecords) })); } } catch (Exception ex) { Log.Error(new ExceptionHelper().GetLogString(ex, ErrorLevel.Critical)); return(Ok(new OperationResponse { HasSucceeded = false, Message = StatusMessages.ServerError, StatusCode = ((int)ResponseStatus.ServerError).ToString(), IsDomainValidationErrors = false })); } }
public IQueryable <Category> GetAll() { return(dataAccess.GetCategories().AsQueryable()); }
public ActionResult Index() { var categories = _categoryDataAccess.GetCategories(); return(View(categories)); }