Пример #1
0
        //
        // GET: /Event/Create
        public PartialViewResult CreateForm()
        {
            var categories = _categoryDataAccess.GetCategories();

            ViewBag.Categories = categories;
            return(PartialView("_CreateForm"));
        }
Пример #2
0
        public void frmCategory_Load(object sender, EventArgs e)
        {
            DataTable dt = CategoryDataAccess.GetCategories();

            if (dt != null)
            {
                this.cateroryGridView.DataSource = dt;
                FormatGrid(ref this.cateroryGridView);
            }
        }
Пример #3
0
        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
                }));
            }
        }
Пример #4
0
 public IQueryable <Category> GetAll()
 {
     return(dataAccess.GetCategories().AsQueryable());
 }
Пример #5
0
        public ActionResult Index()
        {
            var categories = _categoryDataAccess.GetCategories();

            return(View(categories));
        }