当前位置: 首页>>代码示例>>C#>>正文


C# acUI.acUI.GetSessionUserFullName方法代码示例

本文整理汇总了C#中acUI.acUI.GetSessionUserFullName方法的典型用法代码示例。如果您正苦于以下问题:C# acUI.acUI.GetSessionUserFullName方法的具体用法?C# acUI.acUI.GetSessionUserFullName怎么用?C# acUI.acUI.GetSessionUserFullName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在acUI.acUI的用法示例。


在下文中一共展示了acUI.acUI.GetSessionUserFullName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SaveNotifications

        public static string SaveNotifications(object[] oAsset)
        {
            dataAccess dc = new dataAccess();
            acUI.acUI ui = new acUI.acUI();
            acUI.AppGlobals ag = new acUI.AppGlobals();

            string sErr = "";
            string sMessengerOnOff = oAsset[0].ToString();
            string sPollLoop = oAsset[1].ToString();
            string sRetryDelay = oAsset[2].ToString();
            string sRetryMaxAttempts = oAsset[3].ToString();
            string sSMTPServerAddress = oAsset[4].ToString().Replace("'", "''");
            string sSMTPUserAccount = oAsset[5].ToString().Replace("'", "''");
            string sSMTPUserPassword = oAsset[6].ToString();
            string sSMTPServerPort = oAsset[7].ToString();
            string sFromEmail = oAsset[8].ToString().Replace("'", "''");
            string sFromName = oAsset[9].ToString().Replace("'", "''");
            string sAdminEmail = oAsset[10].ToString().Replace("'", "''");

            // get the current settings for the logging
            string sOrigMessengerOnOff = "";
            string sOrigPollLoop = "";
            string sOrigRetryDelay = "";
            string sOrigRetryMaxAttempts = "";
            string sOrigSMTPServerAddress = "";
            string sOrigSMTPUserAccount = "";
            string sOrigSMTPServerPort = "";
            string sOrigFromEmail = "";
            string sOrigFromName = "";
            string sOrigAdminEmail = "";

            string sSQL = "select mode_off_on, loop_delay_sec, retry_delay_min, retry_max_attempts," +
                    " smtp_server_addr, smtp_server_user, smtp_server_password, smtp_server_port, from_email, from_name, admin_email" +
                    " from messenger_settings" +
                    " where id = 1";

            DataTable dt = new DataTable();
            if (!dc.sqlGetDataTable(ref dt, sSQL, ref sErr))
            {
                return "Unable to continue. " + sErr;
            }
            if (dt.Rows.Count > 0)
            {
                DataRow dr = dt.Rows[0];
                sOrigMessengerOnOff = dr["mode_off_on"].ToString();
                sOrigPollLoop = dr["loop_delay_sec"].ToString();
                sOrigRetryDelay = dr["retry_delay_min"].ToString();
                sOrigRetryMaxAttempts = dr["retry_max_attempts"].ToString();
                sOrigSMTPServerAddress = dr["smtp_server_addr"].ToString();
                sOrigSMTPUserAccount = dr["smtp_server_user"].ToString();
                sOrigSMTPServerPort = dr["smtp_server_port"].ToString();
                sOrigFromEmail = dr["from_email"].ToString();
                sOrigFromName = dr["from_name"].ToString();
                sOrigAdminEmail = dr["admin_email"].ToString();
            }

            sSQL = "update messenger_settings set mode_off_on='{0}', loop_delay_sec={1}, retry_delay_min={2}, retry_max_attempts={3}, smtp_server_addr='{4}', smtp_server_user='{5}', smtp_server_port={6}, from_email='{7}', from_name='{8}', admin_email='{9}'";
            //only update password if it has been changed.
            string sPasswordFiller = "($%#[email protected]!&";
            if (sSMTPUserPassword != sPasswordFiller)
            {
                sSQL += ",smtp_server_password='{10}'";
            }
            sSQL = string.Format(sSQL, sMessengerOnOff, sPollLoop, sRetryDelay, sRetryMaxAttempts, sSMTPServerAddress, sSMTPUserAccount, sSMTPServerPort, sFromEmail, sFromName, sAdminEmail, dc.EnCrypt(sSMTPUserPassword));

            if (!dc.sqlExecuteUpdate(sSQL, ref sErr))
            {
                return "Update failed: " + sErr;
            }
            else
            {
                //logging
                var sLogObject = "Manage Notifications";
                ui.WriteObjectChangeLog(acObjectTypes.None, sLogObject, "Messenger On / Off", sOrigMessengerOnOff, sMessengerOnOff);
                ui.WriteObjectChangeLog(acObjectTypes.None, sLogObject, "Poll Loop", sOrigPollLoop, sPollLoop);
                ui.WriteObjectChangeLog(acObjectTypes.None, sLogObject, "Retry Delay", sOrigRetryDelay, sRetryDelay);
                ui.WriteObjectChangeLog(acObjectTypes.None, sLogObject, "Retry Max Attempts", sOrigRetryMaxAttempts, sRetryMaxAttempts);
                ui.WriteObjectChangeLog(acObjectTypes.None, sLogObject, "SMTP Server Address", sOrigSMTPServerAddress, sSMTPServerAddress);
                ui.WriteObjectChangeLog(acObjectTypes.None, sLogObject, "SMTP User Account", sOrigSMTPUserAccount, sSMTPUserAccount);
                ui.WriteObjectChangeLog(acObjectTypes.None, sLogObject, "SMTP Server Port", sOrigSMTPServerPort, sSMTPServerPort);
                ui.WriteObjectChangeLog(acObjectTypes.None, sLogObject, "From Email", sOrigFromEmail, sFromEmail);
                ui.WriteObjectChangeLog(acObjectTypes.None, sLogObject, "From Name", sOrigFromName, sFromName);
                ui.WriteObjectChangeLog(acObjectTypes.None, sLogObject, "From Name", sOrigAdminEmail, sAdminEmail);

                // send a notification to the user that made the change
                if (sMessengerOnOff == "on")
                {
                    // get the users email, if they do not have an email tell them no message was created.
                    string sUsersEmail = null;
                    string sUserID = ui.GetSessionUserID();
                    sSQL = "select email from users where user_id = '" + sUserID + "'";

                    if (!dc.sqlGetSingleString(ref sUsersEmail, sSQL, ref sErr))
                    {
                        return "Unable to create test email: " + sErr;
                    }
                    string sUserName = "";
                    sUserName = ui.GetSessionUserFullName();

                    if (string.IsNullOrEmpty(sUsersEmail) || sUsersEmail.Length < 5)
//.........这里部分代码省略.........
开发者ID:remotesyssupport,项目名称:cato,代码行数:101,代码来源:notificationEdit.aspx.cs


注:本文中的acUI.acUI.GetSessionUserFullName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。