Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $.ajax({
- url: "test.aspx/Start",
- datatype: "json",
- cache: false,
- async: true,
- contentType: "application/json; charset=utf-8",
- method: "POST",
- data: JSON.stringify({ "HTMLString": str }),
- success: function (data) {
- if (data.d.length > 0) {
- ShowMessage(data.d, "error");
- }
- }
- }); return false;
- [System.Web.Services.WebMethod]
- [System.Web.Script.Services.ScriptMethod(ResponseFormat = System.Web.Script.Services.ResponseFormat.Json)]
- public static string Start(string HTMLString)
- {
- bool IsInstalled = Handlers.CheckDirectumIsInstalled();
- string result = "";
- if (IsInstalled)
- {
- string filePath = Path.GetTempPath() + "\" + fileName;
- // Создадим документ в темп пользователя
- Handlers.ConvertToPDF(html, filePath, true);
- // Подключаемся к СЭД
- string AppProgId = "SBLogon.LoginPoint";
- Type LoginPointType = Type.GetTypeFromProgID(AppProgId);
- dynamic LoginPoint = Activator.CreateInstance(LoginPointType);
- dynamic App = LoginPoint.GetApplication("ServerName=STEST;
- DBName=DBTEST;
- UserName=;Password=");
- dynamic Src = App.ScriptFactory.GetObjectByName("test");
- Src.Params.SetVar("document", filePath);
- Src.Execute();
- }
- else
- {
- result = "не установлено ПО...";
- }
- return result;
- }
- ExceptionType: "System.Runtime.InteropServices.COMException"
- Message: "Вход в систему не произведен"
- StackTrace:" at System.Dynamic.ComRuntimeHelpers.CheckThrowException(Int32
- hresult, ExcepInfo& excepInfo, UInt32 argErr, String message)
- ↵ at CallSite.Target(Closure , CallSite , ComObject , String )
- ↵ at CallSite.Target(Closure , CallSite , Object , String )
- ↵ at SpecodInfo.Test.Start(String HTMLString)
- dynamic App = LoginPoint.GetApplication("ServerName=STEST;
- DBName=DBTEST;
- UserName=;Password=");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement