public ActionResult registrado(long?id) { if (Session["USER_ID"] != null) { if (id != null) { long userId = (long)Session["USER_ID"]; user curUser = entities.users.Find(userId); @event event_item = entities.events.Find(id); registradoViewModel viewmodel = new registradoViewModel(); viewmodel.side_menu = "eventos"; viewmodel.side_sub_menu = "eventos"; viewmodel.event_name = event_item.name; viewmodel.event_date = Convert.ToDateTime(event_item.created_at).ToString("dd/MM/yyyy"); viewmodel.event_time = Convert.ToDateTime(event_item.created_at).ToString("hh:mm tt"); viewmodel.place = event_item.place; viewmodel.description = event_item.description; viewmodel.note = event_item.note; viewmodel.curUser = curUser; viewmodel.pubTaskList = ep.GetNotifiTaskList(userId); viewmodel.pubMessageList = ep.GetChatMessages(userId); return(View(viewmodel)); } else { return(Redirect(Url.Action("NotFound", "Error"))); } } else { return(Redirect(ep.GetLogoutUrl())); } }
public ActionResult registrado(long?id) { if (Session["USER_ID"] != null) { if (id != null) { long communityAct = Convert.ToInt64(Session["CURRENT_COMU"]); @event event_item = entities.events.Where(x => x.id == id && x.community_id == communityAct).FirstOrDefault(); if (event_item != null) { try { long userId = (long)Session["USER_ID"]; user curUser = entities.users.Find(userId); List <ShowMessage> pubMessageList = ep.GetChatMessages(userId); registradoViewModel viewModel = new registradoViewModel(); titulosList = ep.GetTitulosByTitular(userId); listComunities = ep.GetCommunityListByTitular(titulosList); viewModel.communityList = listComunities; viewModel.side_menu = "eventos"; viewModel.event_name = event_item.name; viewModel.event_date = Convert.ToDateTime(event_item.created_at).ToString("dd/MM/yyyy"); viewModel.event_time = Convert.ToDateTime(event_item.created_at).ToString("hh:mm tt"); viewModel.place = event_item.place; viewModel.description = event_item.description; viewModel.note = event_item.note; viewModel.document_category_list = entities.document_type.Where(x => x.community_id == communityAct).ToList(); viewModel.curUser = curUser; viewModel.pubTaskList = ep.GetNotifiTaskList(userId); viewModel.pubMessageList = pubMessageList; viewModel.messageCount = ep.GetUnreadMessageCount(pubMessageList); return(View(viewModel)); } catch (Exception ex) { return(Redirect(Url.Action("error", "control", new { Error = "Ver evento: " + ex.Message }))); } } else { return(Redirect(Url.Action("calendario", "eventos", new { Error = "No existe ese elemento: " }))); } } else { return(Redirect(Url.Action("calendario", "eventos"))); } } else { return(Redirect(ep.GetLogoutUrl())); } }
public ActionResult registrado(long?id, string searchStr = "") { if (Session["USER_ID"] != null) { if (Session["CURRENT_COMU"] != null) { if (id != null) { long communityAct = Convert.ToInt64(Session["CURRENT_COMU"]); @event event_item = entities.events.Where(x => x.id == id && x.community_id == communityAct).FirstOrDefault(); if (event_item != null) { try { long userId = (long)Session["USER_ID"]; user curUser = entities.users.Find(userId); List <ShowMessage> pubMessageList = ep.GetChatMessages(userId); registradoViewModel viewmodel = new registradoViewModel(); communityList = ep.GetCommunityList(userId); viewmodel.communityList = communityList; viewmodel.side_menu = "registrado"; viewmodel.event_name = event_item.name; viewmodel.event_date = Convert.ToDateTime(event_item.event_date).ToString("dd/MM/yyyy"); viewmodel.event_time = Convert.ToDateTime(event_item.event_date).ToString("hh:mm tt"); viewmodel.place = event_item.place; viewmodel.description = event_item.description; viewmodel.note = event_item.note; viewmodel.document_category_list = entities.document_type.Where(x => x.community_id == communityAct).ToList(); viewmodel.curUser = curUser; viewmodel.eventID = Convert.ToInt64(id); viewmodel.searchStr = searchStr; viewmodel.pubTaskList = ep.GetNotifiTaskList(userId); viewmodel.pubMessageList = pubMessageList; viewmodel.messageCount = ep.GetUnreadMessageCount(pubMessageList); return(View(viewmodel)); } catch (Exception ex) { return(Redirect(Url.Action("registrados", "eventos", new { area = "coadmin", Error = "Problema interno " + ex.Message }))); } } else { return(Redirect(Url.Action("registrados", "eventos", new { area = "coadmin", Error = "No existe ese elemento" }))); } } else { return(Redirect(Url.Action("registrados", "eventos", new { area = "coadmin" }))); } } else { return(Redirect(Url.Action("registrados", "eventos", new { area = "coadmin", Error = "No permitido. Usted no administra ninguna comunidad. Comuníquese con el Webmaster..." }))); } } else { return(Redirect(ep.GetLogoutUrl())); } }