public IActionResult Create() { EventCategoryModel model = new EventCategoryModel(); return(View(model)); }
public ActionResult Index() { try { var Category = Connection.GDgetAllEventCategory("Y"); List <GDgetAllEventCategory_Result> Categorylist = Category.ToList(); EventCategoryModel tcm = new EventCategoryModel(); List <EventCategoryModel> tcmlist = Categorylist.Select(x => new EventCategoryModel { EventCategoryId = x.EventCategoryId, EventCategoryDesc = x.EventCategoryDesc, CreatedBy = x.CreatedBy, CreatedDate = x.CreatedDate, IsActive = x.IsActive, ModifiedBy = x.ModifiedBy, ModifiedDate = x.ModifiedDate, BroadcastMessage = x.BroadcastMessage, ParentApprovalNeeded = x.ParentApprovalNeeded }).ToList(); return(View(tcmlist)); } catch (Exception ex) { Errorlog.ErrorManager.LogError(ex); return(View()); } }
/// <see cref="IEventService.SaveCategory"/> public EventCategoryModel SaveCategory(EventCategoryModel model) { return(EventModelHelper.GetCategoryModels(_eventRepository.SaveCategory( new EventCategory { Id = model.Id, Name = model.Name, IdParent = model.IdParent, Description = model.Description }))); }
/// <summary> /// https://localhost:44370/api/EventCategory /// </summary> /// <returns></returns> public IHttpActionResult Get() { try { return(Ok(EventCategoryModel.GetAllCategories(db))); } catch (Exception ex) { return(Content(HttpStatusCode.BadRequest, ex)); } }
public IActionResult Create(EventCategoryModel model) { ProductCategory category = new ProductCategory { name = model.Name, description = model.Description, slug = model.Slug }; var wooCategoru = _woocomerceService.CreateCategory(category); return(View()); }
public ActionResult Delete(long CategoryId) { try { EventCategoryModel TModel = new EventCategoryModel(); TModel.EventCategoryId = CategoryId; return(PartialView("DeleteEventCategory", TModel)); } catch (Exception ex) { Errorlog.ErrorManager.LogError(ex); return(View()); } }
public ActionResult Delete(EventCategoryModel Model) { try { UserId = USession.User_Id; Connection.GDdeleteEventCategory("N", Model.EventCategoryId, UserId); Connection.SaveChanges(); return(Json(true, JsonRequestBehavior.AllowGet)); //return RedirectToAction("Index"); } catch (Exception ex) { Errorlog.ErrorManager.LogError(ex); return(View()); } }
public ActionResult Edit(EventCategoryModel Model) { UserId = USession.User_Id; try { tblEventcategory TCtable = Connection.tblEventcategories.SingleOrDefault(x => x.EventCategoryId == Model.EventCategoryId); Connection.GDModifyEventCategory(Model.EventCategoryDesc, Model.EventCategoryId, UserId, Model.BroadcastMessage, Model.ParentApprovalNeeded); Connection.SaveChanges(); return(RedirectToAction("Index")); } catch (Exception ex) { Errorlog.ErrorManager.LogError(ex); return(View()); } }
public ActionResult Edit(long CategoryId) { try { EventCategoryModel TModel = new EventCategoryModel(); tblEventcategory TCtable = Connection.tblEventcategories.SingleOrDefault(x => x.EventCategoryId == CategoryId); TModel.IsActive = TCtable.IsActive; TModel.EventCategoryId = TCtable.EventCategoryId; TModel.EventCategoryDesc = TCtable.EventCategoryDesc; TModel.BroadcastMessage = TCtable.BroadcastMessage; TModel.ParentApprovalNeeded = TCtable.ParentApprovalNeeded; return(PartialView("EditEventCategory", TModel)); } catch (Exception ex) { Errorlog.ErrorManager.LogError(ex); return(View()); } }
public List <EventModel> GetAvailableEventsByTypeAndCategory(EventTypeModel type, EventCategoryModel category) { return(Events.Where(e => e.EventType == type && e.CategoryList.Contains(category)).OrderByDescending(_ => _.EventId).ToList()); }
public IHttpActionResult SaveCategory([FromBody] EventCategoryModel model) { return(Ok(_eventService.SaveCategory(model))); }