Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Text;
- using Laserfiche.WebAccess.Common.Util;
- using LFSO91Lib;
- using System.Data;
- using System.IO;
- namespace WebAccessCustomActions
- {
- public class CustomActions
- {
- public static IDictionary<string, object> PerformAction(string actionID,
- IDictionary<string, object> args)
- {
- // Branches to your custom action function using the actionID
- switch (actionID)
- {
- case "GenerateLaserInvestigatorsURL":
- return GenerateLaserInvestigatorsURL(args);
- default:
- // If unknown actionID was specified just return an empty value
- return new Dictionary<string, object>();
- }
- }
- private static IDictionary<string, object>
- GenerateLaserInvestigatorsURL(IDictionary<string, object> args)
- {
- Dictionary<string, object> retVal = new Dictionary<string, object>();
- retVal["url"] = "";
- // Retrieve the active LFSO database object from the current Web Access Session
- WebAccessSession WASession = WebAccessSession.GetSessionObject();
- ILFDatabase db = WASession.ConnectionManager.GetLoggedInRepository();
- //if (args.ContainsKey("DocumentID"))
- //{
- // int docID = (int)args["DocumentID"];
- // LFDocument doc = (LFDocument)db.GetEntryByID(docID);
- // if (doc != null)
- // {
- // LFFieldData fieldData = doc.FieldData;
- // // Check to see Case Files template is applied to the document
- // if (fieldData.Template.Name == "Case Files")
- // {
- // String formatter =
- // "http://conferencevm/InvestigationManagement/CaseNotes.cshtml/{0}";
- // String caseID = fieldData.get_FieldAsString("Case ID");
- // retVal["url"] = String.Format(formatter, caseID);
- // }
- // doc.Dispose();
- // }
- //}
- retVal["url"] = "http://www.google.com";
- return retVal;
- }
- }
- }
Add Comment
Please, Sign In to add comment