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


C# Util.GetProductionAppInfo方法代码示例

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


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

示例1: Login

    public XmlDocument Login()
    {
        Init init = new Init();
        Hashtable State = (Hashtable)HttpRuntime.Cache[Session.SessionID];
        init.InitSkuConfigurations(State);
         HttpRuntime.Cache["TempFilesPath"] = Server.MapPath(".") + @"\temp_files\";
        Util util = new Util();
        XmlUtil x_util = new XmlUtil();
        XmlNode status = null;
        XmlDocument Design = null;

        try
        {
            DB db = new DB();

            HttpRequest request = Context.Request;

            string viziapps_version = request.QueryString.Get("viziapps_version");
            if (viziapps_version == null)
                viziapps_version = request.QueryString.Get("mobiflex_version");

            string device_id = request.QueryString.Get("deviceid");
            string device_model = request.QueryString.Get("device_model");
            string customer_username = request.QueryString.Get("customer");
            string app_status = (customer_username != null && customer_username.Length > 0) ? "production" : "staging";
            string application_name = request.QueryString.Get("app");
            string application_id = request.QueryString.Get("app_id");
            string unlimited = request.QueryString.Get("unlimited");
            string device_version = request.QueryString.Get("device_version");
            if (application_id == null)
                application_id = "";

            string sql = null;
            DataRow[] rows = null;
            string customer_id = null;
            string user_id = null;
            string user = request.QueryString.Get("user");
            string password = request.QueryString.Get("pwd");

            string display_width = request.QueryString.Get("display_width");
            if (display_width == null)
                display_width = "320";

            string display_height = request.QueryString.Get("display_height");
            if (display_height == null)
                display_height = "480";

            if (device_model == null)
                State["SelectedDeviceType"] = Constants.IPHONE;
            else if (device_model.ToLower().Contains("iphone") || device_model.ToLower().Contains("ipod"))
                State["SelectedDeviceType"] = Constants.IPHONE;
            else if (device_model.ToLower().Contains("ipad"))
                State["SelectedDeviceType"] = Constants.IPAD;
            else if (Convert.ToInt32(display_width) > 600)
                State["SelectedDeviceType"] = Constants.ANDROID_TABLET;
            else
                State["SelectedDeviceType"] = Constants.ANDROID_PHONE;

            if (unlimited == null || unlimited != "true")
            {
                if (user == null || password == null)
                {
                    Design = new XmlDocument();
                    XmlNode root2 = Design.CreateElement("login_response");
                    Design.AppendChild(root2);
                    status = x_util.CreateNode(Design, root2, "status", "Either the username or the password: " + password + " is incorrect.");
                    SaveReport(State, application_id, app_status, customer_id, user_id, device_id, device_model, device_version, viziapps_version, null, null, "app login: bad credentials");
                    return Design;
                }
            }

            if (app_status == "production")
            {
                util.GetProductionAccountInfo(State, customer_username);
                if (customer_id == null)
                    customer_id = State["CustomerID"].ToString();
                //State["Username"] = customer_username;
                //customer_id = util.GetCustomerIDFromUsername(State, customer_username);
                //State["CustomerID"] = customer_id;
                //string account_status = util.GetCustomerStatus(State);
                // if (account_status == "inactive")
                if (State["AccountStatus"].ToString() == "inactive")
                {
                    SaveReport(State, application_id, app_status, customer_id, user_id, device_id, device_model, device_version, viziapps_version, null, null, "app login: account inactive");
                    throw new System.InvalidOperationException("Your customer account is inactive.");
                }
                util.GetProductionAppInfo(State, application_name);
                application_id = State["AppID"].ToString();

                if (State["IsProductionAppPaid"] != null && State["IsProductionAppPaid"].ToString() != "true")
                {
                    //if (!util.IsFreeProductionValid(State, application_id))
                    if (State["IsFreeProductionValid"] != null && State["IsFreeProductionValid"].ToString() != "true")
                    {
                        SaveReport(State, application_id, app_status, customer_id, user_id, device_id, device_model, device_version, viziapps_version, null, null, "app login: publishing service expired");
                        throw new System.InvalidOperationException("The publishing service for your app has expired.");
                    }
                }

                if (unlimited == null || unlimited != "true")
//.........这里部分代码省略.........
开发者ID:dcolonvizi,项目名称:ViziAppsPortal,代码行数:101,代码来源:PhoneWebService.cs

示例2: Report

    public XmlDocument Report()
    {
        Init init = new Init();
        Hashtable State = (Hashtable)HttpRuntime.Cache[Session.SessionID];
        init.InitSkuConfigurations(State);
         HttpRuntime.Cache["TempFilesPath"] = Server.MapPath(".") + @"\temp_files\";
        Util util = new Util();
        XmlUtil x_util = new XmlUtil();
        XmlNode status_node = null;
        XmlDocument Report = new XmlDocument();
        XmlNode root = Report.CreateElement("report_response");
        Report.AppendChild(root);
        try
        {
            DB db = new DB();

            HttpRequest request = Context.Request;
            string application_id = request.QueryString.Get("appid");
            string application_name = request.QueryString.Get("app");
            string isproduction = request.QueryString.Get("isproduction");
            string username = request.QueryString.Get("customer");
            string user_id = request.QueryString.Get("userid");
            string device_id = request.QueryString.Get("deviceid");
            string device_version = request.QueryString.Get("device_version");
            string device_model = request.QueryString.Get("device_model");

            string viziapps_version = request.QueryString.Get("viziapps_version");
            if (viziapps_version == null)
                viziapps_version = request.QueryString.Get("mobiflex_version");

            string latitude = request.QueryString.Get("latitude");
            string longitude = request.QueryString.Get("longitude");

            string app_status = "staging";
            if (isproduction == "yes")
            {
                app_status = "production";
            }

            string customer_id = request.QueryString.Get("custid");
            if (app_status == "production")
            {
                util.GetProductionAccountInfo(State, username);
                util.GetProductionAppInfo(State, application_name);
                application_id = State["AppID"].ToString();

                if (State["IsProductionAppPaid"] != null && State["IsProductionAppPaid"].ToString() != "true")
                {
                    //if (!util.IsFreeProductionValid(State, application_id))
                    if (State["IsFreeProductionValid"] != null && State["IsFreeProductionValid"].ToString() != "true")
                    {
                        x_util.CreateNode(Report, root, "status", "kill");
                        x_util.CreateNode(Report, root, "status_message", "The account for this app is inactive. Contact ViziApps to re-activate your account.");
                        SaveReport(State, application_id, app_status, customer_id, user_id, device_id, device_model, device_version, viziapps_version, latitude, longitude, "app killed due to inactive account");
                        throw new System.InvalidOperationException("The publishing service for your app has expired.");
                    }
                }
                if (State["AccountStatus"].ToString() == "inactive")
                {
                    x_util.CreateNode(Report, root, "status", "kill");
                    x_util.CreateNode(Report, root, "status_message", "The account for this app is inactive. Contact ViziApps to re-activate your account.");
                    SaveReport(State, application_id, app_status, customer_id, user_id, device_id, device_model, device_version, viziapps_version, latitude, longitude, "app killed due to inactive account");
                    return Report;
                }
            }
            //else app is staging
            else if (customer_id != null && customer_id.Length > 0)
            {
                State["CustomerID"] = customer_id;
                string active_sql = "SELECT COUNT(*) FROM customers where customer_id='" + customer_id + "' AND status!='inactive'";
                string active_count = db.ViziAppsExecuteScalar(State, active_sql);
                if (active_count == "0")
                {
                    x_util.CreateNode(Report, root, "status", "kill");
                    x_util.CreateNode(Report, root, "status_message", "The account for this app is inactive. Contact ViziApps to re-activate your account.");
                    SaveReport(State, application_id, app_status, customer_id, user_id, device_id, device_model, device_version, viziapps_version, latitude, longitude, "app killed due to inactive account");
                    return Report;
                }
            }

            string display_width = request.QueryString.Get("display_width");
            if (display_width == null)
                display_width = "320";

            string display_height = request.QueryString.Get("display_height");
            if (display_height == null)
                display_height = "480";

            if (device_model == null)
                State["SelectedDeviceType"] = Constants.IPHONE;
            else if (device_model.ToLower().Contains("iphone") || device_model.ToLower().Contains("ipod"))
                State["SelectedDeviceType"] = Constants.IPHONE;
            else if (device_model.ToLower().Contains("ipad"))
                State["SelectedDeviceType"] = Constants.IPAD;
            else if (Convert.ToInt32(display_width) > 600)
                State["SelectedDeviceType"] = Constants.ANDROID_TABLET;
            else
                State["SelectedDeviceType"] = Constants.ANDROID_PHONE;

            if (application_id != null && application_id.Length > 0)
//.........这里部分代码省略.........
开发者ID:dcolonvizi,项目名称:ViziAppsPortal,代码行数:101,代码来源:PhoneWebService.cs


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