コード例 #1
0
        /// <summary>
        /// Function <code>ssCheckRegisteredRole</code> that represents the Service Studio function
        ///  <code>CheckRegisteredRole</code> <p> Description: </p>
        /// </summary>

        public static bool ssCheckRegisteredRole(HeContext heContext, int inParamUserId)
        {
            bool outParamHasRole;

            ExtendedActions.CheckRegisteredRole(heContext, inParamUserId, out outParamHasRole);
            return(outParamHasRole);
        }
コード例 #2
0
        /// <summary>
        /// Function <code>rssespaceservicecenter_Deprecated_NotifyGetMessage</code> that represents the
        ///  Service Studio function <code>Deprecated_NotifyGetMessage</code> <p> Description: DEPRECATED: Thi
        /// s action is deprecated because Events are now available for Web Blocks. Use Input Parameters in
        ///  block Events to send information to the parent block when the Event is triggered.  Returns th
        /// e notification message sent by the Notify action.</p>
        /// </summary>

        public static string rssespaceservicecenter_Deprecated_NotifyGetMessage(HeContext heContext)
        {
            string outParamMessage;

            ExtendedActions.Deprecated_NotifyGetMessage(heContext, out outParamMessage);
            return(outParamMessage);
        }
コード例 #3
0
        /// <summary>
        /// Function <code>ssGetUser</code> that represents the Service Studio function <code>GetUser</code>
        ///  <p> Description: </p>
        /// </summary>

        public static RCUserRecord ssGetUser(HeContext heContext, int inParamId)
        {
            RCUserRecord.EnsureInitialized();
            RCUserRecord outParamRecord;

            ExtendedActions.GetUser(heContext, inParamId, out outParamRecord);
            return(outParamRecord);
        }
コード例 #4
0
        /// <summary>
        /// Action <code>ActionBootstrapContacts</code> that represents the Service Studio user action
        ///  <code>BootstrapContacts</code> <p> Description: Populates the database with the contacts from th
        /// e excel file if the corresponding database table is still empty</p>
        /// </summary>
        public static void ActionBootstrapContacts(HeContext heContext)
        {
            lcvBootstrapContacts localVars = new lcvBootstrapContacts();

            if (heContext != null && heContext.RequestTracer != null)
            {
                heContext.RequestTracer.RegisterInternalCall("K1bGnfsi2kam_D7_C_yQqA", "BootstrapContacts", "X0RMeX3yYU+0eg2nFEDfaA", "ContactManager");
            }
            // Query datasetGetContacts
            int datasetGetContacts_maxRecords = 0;

            localVars.queryResGetContacts_outParamList = FuncActionBootstrapContacts.datasetGetContacts(heContext, datasetGetContacts_maxRecords, IterationMultiplicity.Never, out localVars.queryResGetContacts_outParamCount);

            if ((localVars.queryResGetContacts_outParamList.Empty))
            {
                // ExcelToRecordList ExcelToRLBootstrapContactsConvertFromExcel
                FuncActionBootstrapContacts.ExcelToRLBootstrapContactsConvertFromExcel(heContext, RuntimePlatformUtils.GetResourceBinary("bin2\\hidden_resources\\ContactManager\\Contacts.xlsx", "bin2\\hidden_resources\\ContactManager\\Contacts.xlsx"), "Contacts", out localVars.resConvertFromExcel_outParamOut);
                // Foreach ConvertFromExcel
                localVars.resConvertFromExcel_outParamOut.StartIteration();
                try {
                    while (!((localVars.resConvertFromExcel_outParamOut.Eof)))
                    {
                        // Assign ContactRecord
                        // ContactRecord.Contact.Name = ConvertFromExcel.Current.Excel_Contacts.Name
                        localVars.varLcContactRecord.ssENContact.ssName = localVars.resConvertFromExcel_outParamOut.CurrentRec.ssSTExcel_Contacts.ssName;
                        // ContactRecord.Contact.JobTitle = ConvertFromExcel.Current.Excel_Contacts.JobTitle
                        localVars.varLcContactRecord.ssENContact.ssJobTitle = localVars.resConvertFromExcel_outParamOut.CurrentRec.ssSTExcel_Contacts.ssJobTitle;
                        // ContactRecord.Contact.Phone = ConvertFromExcel.Current.Excel_Contacts.Phone
                        localVars.varLcContactRecord.ssENContact.ssPhone = localVars.resConvertFromExcel_outParamOut.CurrentRec.ssSTExcel_Contacts.ssPhone;
                        // ContactRecord.Contact.Email = ConvertFromExcel.Current.Excel_Contacts.Email
                        localVars.varLcContactRecord.ssENContact.ssEmail = localVars.resConvertFromExcel_outParamOut.CurrentRec.ssSTExcel_Contacts.ssEmail;
                        // CreateContact
                        ExtendedActions.CreateContact(heContext, localVars.varLcContactRecord, out localVars.resCreateContact_outParamId);

                        localVars.resConvertFromExcel_outParamOut.Advance();
                    }
                } finally {
                    localVars.resConvertFromExcel_outParamOut.EndIteration();
                }
            }
        }
コード例 #5
0
        /// <summary>
        /// Action <code>ActionPrivate_List_Navigation_GetPageNumbers</code> that represents the Service Studio
        ///  user action <code>Private_List_Navigation_GetPageNumbers</code> <p> Description: </p>
        /// </summary>
        public static void ActionPrivate_List_Navigation_GetPageNumbers(HeContext heContext, int inParamStartIndex, int inParamLineCount, int inParamTotalRowCount, int inParamMaxPageNumbers, out RLListNavigation_PageNumberRecordList outParamPageNumbers)
        {
            lcoPrivate_List_Navigation_GetPageNumbers result    = new lcoPrivate_List_Navigation_GetPageNumbers();
            lcvPrivate_List_Navigation_GetPageNumbers localVars = new lcvPrivate_List_Navigation_GetPageNumbers(inParamStartIndex, inParamLineCount, inParamTotalRowCount, inParamMaxPageNumbers);

            if (heContext != null && heContext.RequestTracer != null)
            {
                heContext.RequestTracer.RegisterInternalCall("NU0efdNzk06AYlO38KWVbg", "Private_List_Navigation_GetPageNumbers", "X0RMeX3yYU+0eg2nFEDfaA", "ContactManager");
            }
            try {
                if ((((localVars.inParamMaxPageNumbers > 0) && (localVars.inParamLineCount > 0))))
                {
                    // Init
                    // CurrentPageNumberMinus1 = Trunc
                    localVars.varLcCurrentPageNumberMinus1 = (((int)BuiltInFunction.Trunc(((decimal)(((decimal)localVars.inParamStartIndex)) /
                                                                                           (decimal)(((decimal)localVars.inParamLineCount))))));
                    // LastPageNumber = Trunc + TextToInteger
                    localVars.varLcLastPageNumber = (((int)(BuiltInFunction.Trunc(((decimal)(((decimal)localVars.inParamTotalRowCount)) /
                                                                                   (decimal)(((decimal)localVars.inParamLineCount)))) + (((decimal)BuiltInFunction.TextToInteger(Convert.ToString(((((((decimal)0)) == BuiltInFunction.Mod((((decimal)localVars.inParamTotalRowCount)), (((decimal)localVars.inParamLineCount))))) ?(0):(1)))))))));
                    // MorePageNumber.ListNavigation_PageNumber.Number = "..."
                    localVars.varLcMorePageNumber.ssSTListNavigation_PageNumber.ssNumber = "...";
                    // Not enough page numbers?
                    if (((localVars.inParamMaxPageNumbers < localVars.varLcLastPageNumber)))
                    {
                        // Start at Current - MaxPageNumbers/2
                        // CurrentPageNumberMinus1 = Max
                        localVars.varLcCurrentPageNumberMinus1 = (((int)BuiltInFunction.Max((((decimal)0)), ((((decimal)localVars.varLcCurrentPageNumberMinus1)) - BuiltInFunction.Trunc(((decimal)(((decimal)localVars.inParamMaxPageNumbers)) /
                                                                                                                                                                                          (decimal)(((decimal)2))))))));
                        // AppendMoreAtBeginning?
                        if (((localVars.varLcCurrentPageNumberMinus1 != 0)))
                        {
                            // AppendMoreAtBeginning
                            ExtendedActions.ListAppend(heContext, result.outParamPageNumbers, localVars.varLcMorePageNumber);
                        }
                    }
                    else
                    {
                        // Start at beginning
                        // CurrentPageNumberMinus1 = 0
                        localVars.varLcCurrentPageNumberMinus1 = 0;
                    }

                    // CurrentPageFirstShownRowIndex = CurrentPageNumberMinus1 * LineCount
                    localVars.varLcCurrentPageFirstShownRowIndex = (localVars.varLcCurrentPageNumberMinus1 * localVars.inParamLineCount);
                    // LastShownPageNumber = Min
                    localVars.varLcLastShownPageNumber = (((int)BuiltInFunction.Min((((decimal)(localVars.varLcCurrentPageNumberMinus1 + localVars.inParamMaxPageNumbers))), (((decimal)localVars.varLcLastPageNumber)))));
                    // All numbers done?
                    while ((!(((localVars.varLcCurrentPageNumberMinus1 + 1) > localVars.varLcLastShownPageNumber))))
                    {
                        // PageNumber
                        // PageNumber.ListNavigation_PageNumber.Number = CurrentPageNumberMinus1 + 1
                        localVars.varLcPageNumber.ssSTListNavigation_PageNumber.ssNumber = Convert.ToString((localVars.varLcCurrentPageNumberMinus1 + 1));
                        // PageNumber.ListNavigation_PageNumber.Index = CurrentPageFirstShownRowIndex
                        localVars.varLcPageNumber.ssSTListNavigation_PageNumber.ssIndex = localVars.varLcCurrentPageFirstShownRowIndex;
                        // PageNumber.ListNavigation_PageNumber.IsCurrent = StartIndex = CurrentPageFirstShownRowIndex
                        localVars.varLcPageNumber.ssSTListNavigation_PageNumber.ssIsCurrent = (localVars.inParamStartIndex == localVars.varLcCurrentPageFirstShownRowIndex);
                        // CurrentPageFirstShownRowIndex = CurrentPageFirstShownRowIndex + LineCount
                        localVars.varLcCurrentPageFirstShownRowIndex = (localVars.varLcCurrentPageFirstShownRowIndex + localVars.inParamLineCount);
                        // CurrentPageNumberMinus1 = CurrentPageNumberMinus1 + 1
                        localVars.varLcCurrentPageNumberMinus1 = (localVars.varLcCurrentPageNumberMinus1 + 1);
                        // AppendPage
                        ExtendedActions.ListAppend(heContext, result.outParamPageNumbers, localVars.varLcPageNumber);
                    }

                    // AppendMoreAtEnd?
                    if (((localVars.varLcCurrentPageNumberMinus1 < localVars.varLcLastPageNumber)))
                    {
                        // AppendMoreAtEnd
                        ExtendedActions.ListAppend(heContext, result.outParamPageNumbers, localVars.varLcMorePageNumber);
                    }
                }
            }             // try

            finally {
                outParamPageNumbers = result.outParamPageNumbers;
            }
        }
コード例 #6
0
        protected void Application_AcquireRequestState(Object sender, EventArgs e)
        {
            Context.Items["osCurrentPTAName"]     = RequestPtaName;
            Context.Items["osCurrentPTAUserName"] = RequestPtaUserName;
            Context.Items["osIsLoadingScreen"]    = false;
            RunningInfo.InitializeRunningInfo();
            RunningInfo.ESpaceHash         = ConfigurationManager.AppSettings["OutSystems.HubEdition.EspaceCompilationHash"];
            RunningInfo.ESpaceVersionToken = ConfigurationManager.AppSettings["OutSystems.HubEdition.EspaceVersionToken"];
            RunningInfo.ESpaceVersionId    = int.Parse(ConfigurationManager.AppSettings["OutSystems.HubEdition.EspaceVersionID"]);
            RunningInfo.DebugMode          = false;
            // Skips internal pages
            if (Request.FilePath.ToLowerInvariant().EndsWith("/_ping.aspx") || Request.FilePath.ToLowerInvariant().EndsWith("/_queriescoverage.aspx") || Request.FilePath.ToLower().EndsWith("/_debugger.asmx") || Request.FilePath.ToLower().EndsWith("/_debuggerevents.ashx"))
            {
                return;
            }

            if (App == null)
            {
                // Try again
                Application_Start(sender, e);
                if (Application["ApplicationStartError"] != null)
                {
                    ApplicationStartErrorRedirect();
                }
            }

            // Session Start
            HeContext heContext = Global.App.OsContext;

            heContext.InitSession();

            HttpCookie sessionCookie = null;

            var sessionCookieKey = Response.Cookies.AllKeys.FirstIfSingleOrDefault(c => c == CookieActions.GetSessionCookieName());

            if (sessionCookieKey == null)
            {
                sessionCookieKey = Request.Cookies.AllKeys.FirstIfSingleOrDefault(c => c == CookieActions.GetSessionCookieName());
                if (sessionCookieKey != null)
                {
                    sessionCookie = Request.Cookies.Get(sessionCookieKey);
                }
            }
            else
            {
                sessionCookie = Response.Cookies.Get(sessionCookieKey);
            }
            if (sessionCookie != null)
            {
                sessionCookie.Secure   = RuntimePlatformSettings.Authentication.EnforceSessionCookiesSecure.GetValue();
                sessionCookie.HttpOnly = true;
                Response.Cookies.Set(sessionCookie);
            }

            if (Context.Session == null || heContext.Session.NeedsSessionStart(App.eSpaceName))
            {
                Global.App.OsContext.Session["TerminalType"] = "WEB";
                Global.App.OsContext.Session["MSISDN"]       = "";

                if (Application["ApplicationStartError"] != null)
                {
                    // Try again
                    Application_Start(sender, e);
                }

                if (Application["ApplicationStartError"] != null)
                {
                    ApplicationStartErrorRedirect();
                }
                if (Context.Session != null)
                {
                    ExtendedActions.AutoLogin(App, App.OsContext.Session);
                    RunOnSessionStart();
                }
            }            /*
                          * else {
                          *
                          * } */

            // Process visit cookies
            if (RuntimePlatformUtils.ShouldCreateCookieForRequest())
            {
                if (Request.CurrentExecutionFilePath.ToLowerInvariant().EndsWith(".aspx"))
                {
                    var osVisitorCookie = Request.Cookies["osVisitor"];
                    var osVisitCookie   = Request.Cookies["osVisit"];

                    if (osVisitorCookie == null || !GuidUtils.IsGuid(osVisitorCookie.Value))
                    {
                        osVisitorCookie = new HttpCookie("osVisitor", Guid.NewGuid().ToString());
                    }
                    osVisitorCookie.Expires = DateTime.Now.AddYears(100);                     // forever
                    SecureCookieUtils.setSecureCookie(osVisitorCookie, heContext.Context.Response);

                    if (osVisitCookie == null || !GuidUtils.IsGuid(osVisitCookie.Value))
                    {
                        osVisitCookie = new HttpCookie("osVisit", Guid.NewGuid().ToString());
                        heContext.Session["osIsNewVisit"] = true;
                    }
                    osVisitCookie.Expires = DateTime.Now.AddMinutes(30);
                    SecureCookieUtils.setSecureCookie(osVisitCookie, heContext.Context.Response);

                    Context.Items["osVisitor"] = osVisitorCookie.Value;
                    Context.Items["osVisit"]   = osVisitCookie.Value;
                }
            }

            App.OsContext.Session[GenericExtendedActions.ReqAuditCountSessionName] = 0;

            // Default Multilingual state
            if (!App.MultilingualEnabled)
            {
                GenericExtendedActions.SetCurrentLocale(heContext, "");
            }
            else
            {
                string localeHeader = heContext.OsISAPIFilter.GetLocale(Request);
                if (localeHeader != null)
                {
                    try {
                        GenericExtendedActions.SetCurrentLocale(heContext, localeHeader);
                    } catch {}
                }
            }
        }