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


C# Util.LogError方法代码示例

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


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

示例1: GetCustomerInfo

    public XmlDocument GetCustomerInfo()
    {
        XmlUtil x_util = new XmlUtil();
        Util util = new Util();
        Hashtable State = (Hashtable)HttpRuntime.Cache[Session.SessionID];
        XmlNode status = null;
        XmlDocument Response = new XmlDocument();
        XmlNode root = Response.CreateElement("response");
        Response.AppendChild(root);
        try
        {
            DB db = new DB();
            String sql = "SELECT COUNT(*) FROM customers WHERE status!='inactive'";
            String count = db.ViziAppsExecuteScalar(State, sql);
            x_util.CreateNode(Response, root, "customer_count", count);
            db.CloseViziAppsDatabase(State);
            x_util.CreateNode(Response, root, "status", "success");
        }
        catch (System.Exception SE)
        {
            util.LogError(State, SE);

            if (status == null)
            {
                Response = new XmlDocument();
                XmlNode root2 = Response.CreateElement("response");
                Response.AppendChild(root2);
                status = x_util.CreateNode(Response, root2, "status");

            }
            status.InnerText = SE.Message;
            util.LogError(State, SE);
        }
        return Response;
    }
开发者ID:dcolonvizi,项目名称:ViziAppsPortal,代码行数:35,代码来源:PhoneWebService.cs

示例2: AppPagesChanged

    public void AppPagesChanged(string page_name)
    {
        try
        {
            ClearMessages();
            if (SavedCanvasHtml.Text.Length > 0)
            {
                if (!SavePage())
                    return;
            }
            Hashtable State = (Hashtable)HttpRuntime.Cache[Session.SessionID];
            State["SelectedAppPage"] = page_name;
            PageName.Text = State["SelectedAppPage"].ToString();

            AppPages.SelectedValue = page_name;
            ShowPage(page_name);
        }
        catch (Exception ex)
        {
            Util util = new Util();
            Hashtable State = (Hashtable)HttpRuntime.Cache[Session.SessionID];
            util.LogError(State, ex);
            Message.Text = "Internal Error: " + ex.Message + ": " + ex.StackTrace;
        }
    }
开发者ID:dcolonvizi,项目名称:ViziAppsPortal,代码行数:25,代码来源:TabDesignWeb.aspx.cs

示例3: DesignedForDevice_SelectedIndexChanged

    protected void DesignedForDevice_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e)
    {
        Util util = new Util();
        Hashtable State = (Hashtable)HttpRuntime.Cache[Session.SessionID];
        if (util.CheckSessionTimeout(State, Response, "Default.aspx")) return;

        try
        {
            ClearMessages();

            DesignedForDevice.Text = e.Text;
            string device_design = e.Value;
            DeviceType.Text = e.Text;
            XmlUtil x_util = new XmlUtil();
            string previous_device_design = x_util.GetAppDeviceType(State);

            //State["SelectedDeviceView"] = device_design;
            State["SelectedDeviceType"] = device_design;
            if (State["SelectedApp"] == null || State["SelectedApp"].ToString().Contains("->"))
            {
                util.SetDefaultBackgroundForView(State,device_design);
            }

            x_util.SetAppDeviceType(State, previous_device_design, device_design);

            Message.Text = "Main device for App has been set.";
        }
        catch (Exception ex)
        {
            util.LogError(State, ex);
            Message.Text = "Internal Error: " + ex.Message + ": " + ex.StackTrace;
        }
    }
开发者ID:dcolonvizi,项目名称:ViziAppsPortal,代码行数:33,代码来源:AppDevice.aspx.cs

示例4: DeleteImageFile

    public string DeleteImageFile(Hashtable State, string url)
    {
        string AWSAccessKey = ConfigurationManager.AppSettings["AWSAccessKey"];
        string AWSSecretKey = ConfigurationManager.AppSettings["AWSSecretKey"];
        string Bucket = ConfigurationManager.AppSettings["ImageBucket"];
        TransferUtility transferUtility = new TransferUtility(AWSAccessKey, AWSSecretKey);
        try
        {
            DeleteObjectRequest request = new DeleteObjectRequest();
            string file_name = url.Substring(url.LastIndexOf("/") + 1);
            string key = State["Username"].ToString() + "/" + file_name;
            request.WithBucketName(Bucket)
                .WithKey(key);
            using (DeleteObjectResponse response = transferUtility.S3Client.DeleteObject(request))
            {
                WebHeaderCollection headers = response.Headers;
             }
        }
        catch (AmazonS3Exception ex)
        {
            Util util = new Util();
            util.LogError(State, ex);
            return ex.Message + ": " + ex.StackTrace;
        }

        return "OK";
    }
开发者ID:dcolonvizi,项目名称:ViziAppsPortal,代码行数:27,代码来源:AmazonS3.cs

示例5: CloseViziAppsDatabase

 public void CloseViziAppsDatabase(Hashtable State)
 {
     try
     {
         MySqlConnection ViziAppsDB = (MySqlConnection)State["ViziAppsDB"];
         if (ViziAppsDB == null)
             return;
         ViziAppsDB.Close();
     }
     catch (MySqlException ex)
     {
         Util util = new Util();
         util.LogError(State, ex);
         throw new Exception("Error in CloseViziAppsDatabase");
     }
 }
开发者ID:dcolonvizi,项目名称:ViziAppsPortal,代码行数:16,代码来源:DB.cs

示例6: AppPagesChanged

 public void AppPagesChanged(string page_name)
 {
     try
     {
         ClearMessages();
         Hashtable State = (Hashtable)HttpRuntime.Cache[Session.SessionID];
          State["SelectedAppPage"] = page_name;
         AppPages.SelectedValue = page_name;
         ShowPage(page_name);
     }
     catch (Exception ex)
     {
         Util util = new Util();
         Hashtable State = (Hashtable)HttpRuntime.Cache[Session.SessionID];
         util.LogError(State, ex);
         Message.Text = "Internal Error: " + ex.Message + ": " + ex.StackTrace;
     }
 }
开发者ID:dcolonvizi,项目名称:ViziAppsPortal,代码行数:18,代码来源:TabDesignNative.aspx.cs

示例7: InitCurrentApp

    public void InitCurrentApp(string app)
    {
        try
        {
            Hashtable State = (Hashtable)HttpRuntime.Cache[Session.SessionID];
            RadComboAppSelector.SelectedValue = app;
            Util util = new Util();
            if (app.Contains("->"))
            {
                State["SelectedDeviceType"] = Constants.IPHONE;
                State["SelectedDeviceView"] = Constants.IPHONE;
                return;
            }
            State["SelectedApp"] = app;
            State["SelectedAppType"] = util.GetAppType(State);

            if (State["SelectedAppType"].ToString().Contains("web"))
            {
                WEB.Visible = true;
                NATIVE.Visible = false;
            }
            else
            {
                NATIVE.Visible = true;
                WEB.Visible = false;
            }

            if (State["SelectedDeviceType"] == null)
            {
                State["SelectedDeviceView"] = State["SelectedDeviceType"] = Constants.IPHONE;

            }

        }
        catch (Exception ex)
        {
            Util util = new Util();
            Hashtable State = (Hashtable)HttpRuntime.Cache[Session.SessionID];
            util.LogError(State, ex);
        }
    }
开发者ID:dcolonvizi,项目名称:ViziAppsPortal,代码行数:41,代码来源:PublishingForm.aspx.cs

示例8: AppType_SelectedIndexChanged

    protected void AppType_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
    {
        Util util = new Util();
        XmlUtil x_util = new XmlUtil();
        Hashtable State = (Hashtable)HttpRuntime.Cache[Session.SessionID];
        if (util.CheckSessionTimeout(State, Response, "Default.aspx")) return;

        try
        {
            ClearMessages();

            AppType.Text = e.Text;
            util.SetAppType(State, e.Value);
            string prev_app_type = State["SelectedAppType"].ToString();
            State["SelectedAppType"] = e.Value;
            switch (State["SelectedAppType"].ToString())
            {
                case Constants.NATIVE_APP_TYPE:
                    RedirectPage.Text = "TabDesignNative.aspx";
                    break;
                case Constants.WEB_APP_TYPE:
                    if (prev_app_type == Constants.NATIVE_APP_TYPE)
                        x_util.ConvertNativeAppToWebApp(State);
                     RedirectPage.Text = "TabDesignWeb.aspx";
                    break;
                case Constants.HYBRID_APP_TYPE:
                   if (prev_app_type == Constants.NATIVE_APP_TYPE)
                        x_util.ConvertNativeAppToWebApp(State);

                    RedirectPage.Text = "TabDesignHybrid.aspx";
                    break;
            }
             Message.Text = "The App Type has been changed...";
            //ajax return will close this dialog box and change page windows
        }
        catch (Exception ex)
        {
            util.LogError(State, ex);
            Message.Text = "Internal Error: " + ex.Message + ": " + ex.StackTrace;
        }
    }
开发者ID:dcolonvizi,项目名称:ViziAppsPortal,代码行数:41,代码来源:ConvertApp.aspx.cs

示例9: CancelPaidServicesDB

    public void CancelPaidServicesDB(Hashtable State)
    {
        try
            {
                Util util = new Util();

                string NOW = DateTime.Now.ToUniversalTime().ToString("u").Replace("Z", "");
                string application_id = State["application_id"].ToString();

                DB db = new DB();

                StringBuilder b_sql = new StringBuilder("UPDATE paid_services SET ");
                b_sql.Append("cancellation_date_time='" + NOW + "',");
                b_sql.Append("status='cancelled'");
                b_sql.Append("WHERE application_id='" + application_id + "'");

                System.Diagnostics.Debug.WriteLine("b_sql =" + b_sql.ToString());
                string sql_string = b_sql.ToString();

                try
                {
                    db.ViziAppsExecuteNonQuery(State, sql_string);
                }
                catch (Exception ex)
                {
                    util.LogError(State, ex);

                    if (!ex.Message.ToLower().Contains("duplicate"))
                        throw new Exception(ex.Message);
                }

                db.CloseViziAppsDatabase(State);

            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex.Message.ToString() + ex.StackTrace.ToString());

            }
    }
开发者ID:dcolonvizi,项目名称:ViziAppsPortal,代码行数:40,代码来源:BillingUtil.cs

示例10: PageTransitions_SelectedIndexChanged

    protected void PageTransitions_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
    {
        Util util = new Util();
        Hashtable State = (Hashtable)HttpRuntime.Cache[Session.SessionID];
        if (util.CheckSessionTimeout(State, Response, "Default.aspx")) return;

        try
        {
            ClearMessages();

            PageTransitions.Text = e.Text;
            State["PageTransitionType"] = e.Value;
            XmlUtil x_util = new XmlUtil();
            x_util.SetPageTransitionType(State, e.Value);
            Message.Text = "The Page Transition Type has been set.";
        }
        catch (Exception ex)
        {
            util.LogError(State, ex);
            Message.Text = "Internal Error: " + ex.Message + ": " + ex.StackTrace;
        }
    }
开发者ID:dcolonvizi,项目名称:ViziAppsPortal,代码行数:22,代码来源:PageTransitionType.aspx.cs

示例11: ShowPage

    public void ShowPage(string page_name)
    {
        PageName.Text = page_name;
        try
        {
            XmlUtil x_util = new XmlUtil();

            Hashtable State = (Hashtable)HttpRuntime.Cache[Session.SessionID];
            if (State["SelectedDeviceType"] == null /*|| State["SelectedDeviceView"] == null*/)
            {
                string device_type = x_util.GetAppDeviceType(State);
                 State["SelectedDeviceType"] = device_type;
                // State["SelectedDeviceView"] = device_type;
                DeviceType.Text =  State["SelectedDeviceType"].ToString();
            }

            if (page_name != null)
            {
                string html = x_util.GetAppPage(State, page_name);
                if (html.StartsWith("Error:"))
                {
                    Message.Text = html;
                    return;
                }

                 State["PageHtml"] = html;
                 Util util = new Util();
                 if (State["DoSavePage"] != null)
                 {
                     State["DoSavePage"] = null;
                     util.SavePageImage(State, page_name, html);
                 }
                DefaultButtonImage.Text = util.GetDefaultButton(State);
            }
            else
            {
                 State["PageHtml"] = "";
                DefaultButtonImage.Text = ConfigurationManager.AppSettings["DefaultWebAppButtonImage"];
            }
        }
        catch (Exception ex)
        {
            Util util = new Util();
            Hashtable State = (Hashtable)HttpRuntime.Cache[Session.SessionID];
            util.LogError(State, ex);
            Message.Text = "Internal Error: " + ex.Message + ": " + ex.StackTrace;
        }
    }
开发者ID:dcolonvizi,项目名称:ViziAppsPortal,代码行数:48,代码来源:TabDesignWeb.aspx.cs

示例12: OnCurrentAppChanged

    public void OnCurrentAppChanged(Object sender, EventArgs e)
    {
        Util util = new Util();
        Hashtable State = (Hashtable)HttpRuntime.Cache[Session.SessionID];
        if (util.CheckSessionTimeout(State, Response, "Default.aspx")) return;

        try
        {
            ClearMessages();
            if (SavedCanvasHtml.Text.Length > 0)
            {
                if (!SavePage())
                {
                    //check for no app
                    string selected_app = Request.Form.Get("CurrentApp");
                    if (selected_app.IndexOf("->") >= 0)
                    {
                        Message.Text = "Go back and edit the previous app. " + Message.Text;
                        InitCurrentApp(selected_app);
                        SavedCanvasHtml.Text = "";
                    }
                    else
                        InitCurrentApp(State["SelectedApp"].ToString());
                    return;
                }
            }
            string app = Request.Form.Get("CurrentApp");
            InitCurrentApp(app);
        }
        catch (Exception ex)
        {
            util.LogError(State, ex);
            Message.Text = "Internal Error: " + ex.Message + ": " + ex.StackTrace;
        }
    }
开发者ID:dcolonvizi,项目名称:ViziAppsPortal,代码行数:35,代码来源:TabDesignWeb.aspx.cs

示例13: InitCurrentApp

    public void InitCurrentApp(string app)
    {
        try
        {
            Hashtable State = (Hashtable)HttpRuntime.Cache[Session.SessionID];
            CurrentApp.SelectedValue = app;
            Util util = new Util();
            if (app.Contains("->"))
            {
                ResetAppStateVariables();
                DesignMessage.Text = "Select an App or Click the New App Icon";
                State["SelectedDeviceType"] = Constants.IPHONE;
                //State["SelectedDeviceView"] = Constants.IPHONE;
                SetViewForDevice();
                HideAppControls();
                AppName.Text = "";
                return;
            }
            State["SelectedApp"] = app;
            AppName.Text = app;
            State["SelectedAppType"] = util.GetAppType(State);
            switch (State["SelectedAppType"].ToString())
            {
                case Constants.NATIVE_APP_TYPE:
                    Response.Redirect("TabDesignNative.aspx", false);
                    break;
                case Constants.WEB_APP_TYPE:
                     break;
                case Constants.HYBRID_APP_TYPE:
                    Response.Redirect("TabDesignHybrid.aspx", false);
                    break;
            }
            XmlUtil x_util = new XmlUtil();
            util.GetStagingAppXml(State, app);
           // State["SelectedDeviceView"] =
            State["SelectedDeviceType"] = x_util.GetAppDeviceType(State);
            if (State["SelectedDeviceType"] == null)
            {
               // State["SelectedDeviceView"] =
                State["SelectedDeviceType"] = Constants.IPHONE;
            }
            if (State["SelectedDeviceType"].ToString() == Constants.IPAD ||
                State["SelectedDeviceType"].ToString() == Constants.ANDROID_TABLET)
            {
                State["BackgroundColor"] = x_util.GetBackgroundColor(State);
            }
            DeviceType.Text = State["SelectedDeviceType"].ToString();
            SetViewForDevice();

            InitAppPages();
             DesignMessage.Text = "";

            string html = x_util.GetFirstAppPage(State);
            State["PageHtml"] = html;

            DefaultButtonImage.Text = util.GetDefaultButton(State);

            AppPages.SelectedValue = State["SelectedAppPage"].ToString();

            ShowAppControls();
        }
        catch (Exception ex)
        {
            Util util = new Util();
            Hashtable State = (Hashtable)HttpRuntime.Cache[Session.SessionID];
            util.LogError(State, ex);
            Message.Text = "Internal Error: " + ex.Message + ": " + ex.StackTrace;
        }
    }
开发者ID:dcolonvizi,项目名称:ViziAppsPortal,代码行数:69,代码来源:TabDesignWeb.aspx.cs

示例14: DuplicatePage_Click

    protected void DuplicatePage_Click(object sender, EventArgs e)
    {
        Util util = new Util();
        Hashtable State = (Hashtable)HttpRuntime.Cache[Session.SessionID];
        if (util.CheckSessionTimeout(State, Response, "Default.aspx")) return;

        try
        {
            ClearMessages();
            if (SavedCanvasHtml.Text.Length > 0)
            {
                if (!SavePage())
                    return;
            }
            string new_page_name = PageName.Text.Trim().Replace(" ", "_");
            PageName.Text = "";

            if (!CheckPageName(CurrentApp.SelectedValue, new_page_name))
            {
                return;
            }

            XmlUtil x_util = new XmlUtil();
            x_util.CopyAppPage(State, State["SelectedAppPage"].ToString(), new_page_name);

            Message.Text = new_page_name + " page has been created. ";
            State["SelectedAppPage"] = new_page_name;
            PageName.Text = State["SelectedAppPage"].ToString();

            InitAppPages();
            ShowPage(new_page_name);
        }
        catch (Exception ex)
        {
            util.LogError(State, ex);
            Message.Text = "Internal Error: " + ex.Message + ": " + ex.StackTrace;
        }
    }
开发者ID:dcolonvizi,项目名称:ViziAppsPortal,代码行数:38,代码来源:TabDesignWeb.aspx.cs

示例15: DeletePage_Click

    protected void DeletePage_Click(object sender, ImageClickEventArgs e)
    {
        Util util = new Util();
        Hashtable State = (Hashtable)HttpRuntime.Cache[Session.SessionID];
        if (util.CheckSessionTimeout(State, Response, "Default.aspx")) return;

        try
        {
            ClearMessages();
            XmlUtil x_util = new XmlUtil();
            int n_pages = x_util.GetAppPageCount(State);
            if (n_pages == 1)
            {
                Message.Text = "A saved application must have at least 1 page. You can rename this page.";
                return;
            }
            if (x_util.IsCurrentPageNameUsed(State))
            {
                Message.Text = "The page was deleted but note that it was referred to, by an action on another page.";
            }
            x_util.DeleteAppPage(State, State["SelectedAppPage"].ToString());
            AppPages.SelectedIndex = 0;
            InitAppPages();

            State["SelectedAppPage"] = AppPages.SelectedValue;
            PageName.Text = State["SelectedAppPage"].ToString();

            string html = x_util.GetAppPage(State, State["SelectedAppPage"].ToString());
            if (html.StartsWith("Error:"))
            {
                Message.Text += html;
                return;
            }
            State["PageHtml"] = html;
            PageName.Text = "";
        }
        catch (Exception ex)
        {
            util.LogError(State, ex);
            Message.Text = "Internal Error: " + ex.Message + ": " + ex.StackTrace;
        }
    }
开发者ID:dcolonvizi,项目名称:ViziAppsPortal,代码行数:42,代码来源:TabDesignWeb.aspx.cs


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