public ActionResult listado() { if (Session["USER_ID"] != null) { try { long communityAct = Convert.ToInt64(Session["CURRENT_COMU"]); long userId = (long)Session["USER_ID"]; user curUser = entities.users.Find(userId); List <ShowMessage> pubMessageList = ep.GetChatMessages(userId); List <emailtheme> emailthemeList = entities.emailthemes.Where(m => m.user_id == userId).ToList(); listadoPlantillasViewModel viewModel = new listadoPlantillasViewModel(); List <PlantillaItemViewModel> list = new List <PlantillaItemViewModel>(); foreach (var item in emailthemeList) { PlantillaItemViewModel plantillaItemViewModel = new PlantillaItemViewModel(); int typeID = item.type_id; emailtype emailtype = entities.emailtypes.Find(typeID); plantillaItemViewModel.TypeID = typeID; plantillaItemViewModel.TypeName = emailtype.represent; plantillaItemViewModel.Content = item.htmcontent; plantillaItemViewModel.ID = item.id; list.Add(plantillaItemViewModel); } communityList = ep.GetCommunityList(userId); viewModel.communityList = communityList; viewModel.side_menu = "plantillas"; viewModel.side_sub_menu = "plantillas_listado"; viewModel.document_category_list = entities.document_type.Where(x => x.community_id == communityAct).ToList(); viewModel.pubTaskList = ep.GetNotifiTaskList(userId); viewModel.curUser = curUser; viewModel.pubMessageList = pubMessageList; viewModel.messageCount = ep.GetUnreadMessageCount(pubMessageList); viewModel.list = list; return(View(viewModel)); } catch (Exception ex) { return(Redirect(Url.Action("Index", "Error"))); } } else { return(Redirect(ep.GetLogoutUrl())); } }
public EmailDocument GetTransformedDocument(EmailPayload payload, List <SyncFeedEntryLink> links) { EmailDocument document = new EmailDocument(); emailtype email = payload.Emailtype; if (String.IsNullOrEmpty(payload.LocalID)) { document.CrmId = payload.SyncUuid.ToString();// document.Id = GetLocalId(payload.SyncUuid); } else { document.Id = payload.LocalID; } document.emailaddress.Value = email.address; document.type.Value = email.type; return(document); }
public EmailPayload GetTransformedPayload(EmailDocument document, out List <SyncFeedEntryLink> links) { emailtype email = new emailtype(); links = new List <SyncFeedEntryLink>(); EmailPayload payload = new EmailPayload(); payload.SyncUuid = GetUuid(document.Id, document.CrmId); payload.LocalID = document.Id; email.uuid = payload.SyncUuid.ToString(); email.applicationID = document.Id; SyncFeedEntryLink selfLink = SyncFeedEntryLink.CreateSelfLink(String.Format("{0}{1}('{2}')", _datasetLink, SupportedResourceKinds.emails, document.Id)); links.Add(selfLink); email.type = (document.type.IsNull) ? null : document.type.Value.ToString();; email.address = (document.emailaddress.IsNull) ? null : document.emailaddress.Value.ToString();; payload.Emailtype = email; return(payload); }
// GET: webmaster/plantillas public ActionResult listado() { if (Session["USER_ID"] != null) { long userId = (long)Session["USER_ID"]; user curUser = entities.users.Find(userId); List <ShowMessage> pubMessageList = ep.GetChatMessages(userId); List <emailtheme> emailthemeList = entities.emailthemes.Where(m => m.user_id == userId).ToList(); listadoPlantillasViewModel viewModel = new listadoPlantillasViewModel(); List <PlantillaItemViewModel> list = new List <PlantillaItemViewModel>(); foreach (var item in emailthemeList) { PlantillaItemViewModel plantillaItemViewModel = new PlantillaItemViewModel(); int typeID = item.type_id; emailtype emailtype = entities.emailtypes.Find(typeID); plantillaItemViewModel.TypeID = typeID; plantillaItemViewModel.TypeName = emailtype.represent; plantillaItemViewModel.Content = item.htmcontent; plantillaItemViewModel.ID = item.id; list.Add(plantillaItemViewModel); } viewModel.side_menu = "plantillas"; viewModel.side_sub_menu = "plantillas_listado"; viewModel.pubTaskList = ep.GetNotifiTaskList(userId); viewModel.curUser = curUser; viewModel.pubMessageList = pubMessageList; viewModel.messageCount = ep.GetUnreadMessageCount(pubMessageList); viewModel.list = list; return(View(viewModel)); } else { return(Redirect(ep.GetLogoutUrl())); } }