public async Task <ActionResult> CreateEvent(EventViewModel model) { var helper = new StudentHelper(); var upsert = await helper.UpsertEvent(UpsertMode.Admin, model); if (upsert.i_RecordId() > 0) { if (model.IsEmpty()) { model.EventId = upsert.i_RecordId(); return(View("Event", model)); } else { ShowSuccess(upsert.ErrorMsg); } } else { ShowError(upsert.ErrorMsg); } return(RedirectToAction("Index")); }