public ActionResult DeleteLocalHelp(int id) { LocalHelp localhelp = db.LocalHelps.Find(id); localhelp.Description = Server.HtmlDecode(localhelp.Description); return(View(localhelp)); }
public ActionResult CreateLocalHelp(int?orgId) { var vol = GetCurrentVolunteer(); if (vol == null) { return(RedirectToAction("UnauthorizedError", "Home", null)); } if (!User.IsInRole(LWSFRoles.admin) && !User.IsInRole(LWSFRoles.localhelpAdmin)) { if (vol.OrganizationId != orgId) { return(RedirectToAction("UnauthorizedError", "Home", null)); } } var localhelp = new LocalHelp { OrganizationId = orgId, Restriction = LocalHelpRestriction.INSIDE_ORG_ONLY, }; return(View(localhelp)); }
// // GET: /LocalHelp/Details/5 public ViewResult LocalhelpDetails(int id) { LocalHelp localhelp = db.LocalHelps.Find(id); localhelp.Description = Server.HtmlDecode(localhelp.Description); return(View(localhelp)); }
void getHelp(object sender, EventArgs e) { try { LocalHelp.OpenHelpFile(_localHelpUri); } catch (Exception ex) { MessageBox.Show("Could not open help file at " + _localHelpUri + "\n" + ex.Message, "Could not open help", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
/// <summary> /// Demonstrate using the MessageSendingService to send a GovTalkMessage to the Government Gateway and receive a reply. /// </summary> /// <param name="loggingService"></param> /// <param name="sendMessage"></param> static XmlDocument DemonstrateSendMessage(ILoggingService loggingService, XmlDocument sendMessage, GovernmentGatewayEnvironment gatewayEnv) { string uri = LocalHelp.GetSendURI("Send", gatewayEnv, configurationRepository); // Create a client to send the file to the target gateway CharitiesOnline.MessageService.Client client = new MessageService.Client(loggingService); // Create an XmlDocument of the reply from the endpoint XmlDocument reply = client.SendRequest(sendMessage, uri); return(reply); }
public ActionResult DeleteLocalHelpConfirmed(int id) { LocalHelp localhelp = db.LocalHelps.Find(id); foreach (var r in localhelp.RegisterEntries.ToList()) { r.NewStudents.Clear(); foreach (var g in r.GuestParticipants.ToList()) { db.GuestParticipants.Remove(g); } db.RegisterEntries.Remove(r); } db.LocalHelps.Remove(localhelp); db.SaveChanges(); return(RedirectToAction("Manage", new { orgId = localhelp.OrganizationId })); }
public ActionResult CreateLocalHelp(LocalHelp localhelp) { if (ModelState.IsValid) { if (String.IsNullOrEmpty(localhelp.Title)) { ModelState.AddModelError("", "活动名称不能为空!"); return(View(localhelp)); } localhelp.Description = Server.HtmlEncode(localhelp.Description); db.LocalHelps.Add(localhelp); db.SaveChanges(); return(RedirectToAction("CreateRegisterEntry", new { localhelpId = localhelp.Id })); } return(View(localhelp)); }
void onlineHelpButton_Click(object sender, EventArgs e) { try { if (WebUtilities.IsInternetAvailable() == false) { LocalHelp.OpenHelpFile(_localHelpUri); } else { OpenUri(_remoteHelpUri); } } catch (Exception ex) { MessageBox.Show("Could not open help file at " + _localHelpUri + "\n" + ex.Message, "Could not open help", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
void quickStartButton_Click(object sender, EventArgs e) { try { if (WebUtilities.IsInternetAvailable() == false) { string quickStartGuideFile = Properties.Settings.Default.QuickStartGuideName; LocalHelp.OpenHelpFile(quickStartGuideFile); } else { OpenUri(_quickStartUri); } } catch (Exception ex) { MessageBox.Show("Could not open help file at " + _localHelpUri + "\n" + ex.Message, "Could not open help", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public ActionResult EditLocalHelp(LocalHelp localhelp, string returnUrl) { if (ModelState.IsValid) { localhelp.Description = Server.HtmlEncode(localhelp.Description); db.Entry(localhelp).State = EntityState.Modified; db.SaveChanges(); if (Url.IsLocalUrl(returnUrl) && returnUrl.Length > 1 && returnUrl.StartsWith("/") && !returnUrl.StartsWith("//") && !returnUrl.StartsWith("/\\")) { return(Redirect(returnUrl)); } else { return(RedirectToAction("Index", "LocalHelp", null)); } } return(View(localhelp)); }
private bool IsAuthorizedLocalHelpAdmin(LocalHelp localhelp) { if (localhelp == null) { return(false); } if (!Request.IsAuthenticated) { return(false); } if (User.IsInRole(LWSFRoles.admin) || User.IsInRole(LWSFRoles.localhelpAdmin)) { return(true); } if (User.IsInRole(LWSFRoles.organizationLeader)) { var vol = GetCurrentVolunteer(); if (vol.OrganizationId == localhelp.OrganizationId) { return(true); } } return(false); }
/// <summary> /// Opens a help topic for the item in context when the user presses F1. /// </summary> private void ThemeExportDialog_HelpRequested(object sender, HelpEventArgs hlpevent) { LocalHelp.OpenHelpFile(_localHelpUri); hlpevent.Handled = true; // Signal that we've handled the help request. }
/// <summary> /// Opens a help topic for the item in context when the Help button is clicked. /// </summary> private void ThemeExportDialog_HelpButtonClicked(object sender, CancelEventArgs e) { LocalHelp.OpenHelpFile(_localHelpUri); e.Cancel = true; // Prevents mouse cursor from changing to question mark. }
private void linkLabelHelp_click(object sender, LinkLabelLinkClickedEventArgs e) { LocalHelp.OpenHelpFile("welcome.html"); }
void getHelp(object sender, EventArgs e) { LocalHelp.OpenHelpFile(_localHelpUri); }
/// <summary> /// Demonstrate using the message reader strategies to get results from a message reply /// </summary> /// <param name="loggingService"></param> /// <param name="messageToRead"></param> static void DemonstrateReadMessage(ILoggingService loggingService, XmlDocument messageToRead) { // Set up a message reading strategy IMessageReader messageReader = new DefaultMessageReader(loggingService, configurationRepository, messageToRead.ToXDocument()); messageReader.ReadMessage(); // We don't know what we've got back from the Gateway, but all replies are GovTalkMessages if (messageReader.HasErrors()) { //There are errors in the results file so we can deal with them // Get a DataTable of the results and have a look at that DataTable errorTable = messageReader.GetMessageResults <DataTable>(); // Or set up an error return strategy and do something with that IErrorReturnCalculator errorCalculator = new DefaultErrorReturnCalculator(); GovTalkMessageGovTalkDetailsError error = messageReader.GetMessageResults <GovTalkMessageGovTalkDetailsError>(); Console.WriteLine(errorCalculator.CalculateErrorReturn(error)); if (error.Number == "3001") { ErrorResponse errResponse = messageReader.GetMessageResults <ErrorResponse>(); } } else { // It's either an acknowledgement so we need to get the poll interval and URL, or a response. string[] results = messageReader.GetMessageResults <string[]>(); foreach (var result in results) { Console.WriteLine(result); } if (messageReader.GetQualifier() == "response") { string body = messageReader.GetBodyType(); if (body != null) { DataTable responseTable = messageReader.GetMessageResults <DataTable>(); LocalHelp.ConsolePrintDataTable(responseTable); } else { Console.WriteLine("No body content"); } } } GovTalkMessageFileName ReplyNamer = new GovTalkMessageFileName.FileNameBuilder() .AddLogger(loggingService) .AddConfigurationRepository(configurationRepository) .AddMessageIntention("ReplyMessage") .AddCorrelationId(messageReader.GetCorrelationId()) .AddFilePath(@"C:\Temp\") .BuildFileName(); string replyFileName = ReplyNamer.ToString(); messageToRead.Save(replyFileName); }
private void linkLabelQuickStart_click(object sender, LinkLabelLinkClickedEventArgs e) { LocalHelp.OpenHelpFile(QuickStartGuideFile); }