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


C# Util.IsAppStoreSubmissionPaid方法代码示例

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


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

示例1: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        Util util = new Util();
        Hashtable State = (Hashtable)HttpRuntime.Cache[Session.SessionID];
        if (State == null || State.Count <= 2) { Page.ClientScript.RegisterStartupScript(this.GetType(), Guid.NewGuid().ToString(), "timeOut('../../Default.aspx');", true); return; }

        try
        {
            ClearMessages();

           State["ApplicationID"] = util.GetAppID(State);

            App.Text = "Test Native App Name: " + State["SelectedApp"].ToString();

            if (util.IsAppStoreSubmissionPaid(State, State["SelectedApp"].ToString()))
            {
                SubmitForProvisioning.Visible = true;
                SubmissionNotes.Visible = true;
                SubmissionNotesLabel.Visible = true;
                PurchaseButton.Visible = false;
             }
            else
            {
                SubmitForProvisioning.Visible = false;
                SubmissionNotes.Visible = false;
                SubmissionNotesLabel.Visible = false;
                PurchaseButton.Visible = true;
                ProvisioningMessage.Text = "You can fill this form any time, but to submit your app for production, you need to first purchase one of the ViziApps services to submit the app to an app store.";
                PurchaseButton.Attributes.Add("onclick", PopupHelper.GeneratePopupScript(
        "http://stores.homestead.com/MobiFlexStore/StoreFront.bok", 700, 900, false, false, false, true));

            }

            if (!IsPostBack)
            {
                DB db = new DB();
                StringBuilder b_sql = new StringBuilder("SELECT * FROM applications ");
                b_sql.Append("WHERE application_name='" + State["SelectedApp"].ToString() + "'");
                b_sql.Append(" AND customer_id='" + State["CustomerID"].ToString() + "'");
                DataRow[] rows = db.ViziAppsExecuteSql(State, b_sql.ToString());
                DataRow row = rows[0];
                 if (row["production_app_name"] != null)
                    ProductionAppName.Text = row["production_app_name"].ToString();

                if (row["production_app_xml"] != DBNull.Value)
                    ProductionDesignExists.Visible = true;
                else
                    ProductionDesignExists.Visible = false;

                 bool use_1_user_credential = false;
                if (row["use_1_user_credential"] != DBNull.Value)
                {
                    string use_1_cred =  row["use_1_user_credential"].ToString();
                    use_1_user_credential = (use_1_cred.ToLower() == "true") ? true : false;
                }
                bool has_unlimited_users = false;
                if (row["has_unlimited_users"] != DBNull.Value)
                {
                    string has_unlimited = row["has_unlimited_users"].ToString();
                    has_unlimited_users = (has_unlimited.ToLower() == "true") ? true : false;
                }

                if (use_1_user_credential)
                {
                    NumberOfUsers.Style.Value = "";
                    NumberOfUsersLabel.Style.Value = "";

                    NumberOfUsers.SelectedIndex = 1;
                    ArrayList credential = util.GetEndUserCredentials(State);
                    if (credential != null && credential.Count > 0)
                    {
                        string[] output = (string[])credential[0];
                        SingleUsername.Text = output[0];
                        SinglePassword.Text = output[1];
                    }
                    LimitedUsersPanel.Style.Value = "";
                }
                else if (has_unlimited_users)
                {
                    NumberOfUsers.Style.Value = "display:none";
                    NumberOfUsersLabel.Style.Value = "display:none";
                    LimitedUsersPanel.Style.Value = "display:none";
                }
                else
                {
                    long max_users = util.GetMaxUsers(State);
                    if (max_users > 1000)
                    {
                        NumberOfUsers.Style.Value = "display:none";
                        NumberOfUsersLabel.Style.Value = "display:none";
                        LimitedUsersPanel.Style.Value = "display:none";
                        util.SetUnlimitedUsers(State);
                    }
                    else
                    {
                        UploadPublishedUserCredentials.Style.Value = "";
                        ViewPublishedUserCredentials.Style.Value = "";
                        UploadPublishedUserCredentials.Attributes.Add("onclick", PopupHelper.GeneratePopupScript(
                 "../../Dialogs/Publish/UploadUserCredentials.aspx", 350, 800, false, false, false, true));
                        ViewPublishedUserCredentials.Attributes.Add("onclick", PopupHelper.GeneratePopupScript(
//.........这里部分代码省略.........
开发者ID:dcolonvizi,项目名称:ViziAppsPortal,代码行数:101,代码来源:PublishingForm.aspx.cs

示例2: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        Util util = new Util();
        Hashtable State = (Hashtable)HttpRuntime.Cache[Session.SessionID];
        if (State == null || State.Count <= 2) { Page.ClientScript.RegisterStartupScript(this.GetType(), Guid.NewGuid().ToString(), "timeOut('../../Default.aspx');", true); return; }

        try
        {
            ClearMessages();

            State["ApplicationID"] = util.GetAppID(State);

            App.Text = "Test Web App Name: " +  State["SelectedApp"].ToString();

            if (util.IsAppStoreSubmissionPaid(State,  State["SelectedApp"].ToString()))
            {
                //SubmitForProvisioning.Visible = true;
                PurchaseButton.Visible = false;
             }
            else
            {
                //SubmitForProvisioning.Visible = false;
                PurchaseButton.Visible = true;
                //ProvisioningMessage.Text = "You can fill this form any time, but to submit your app for production, you need to first purchase one of the ViziApps services to submit the app to an app store.";
                PurchaseButton.Attributes.Add("onclick", PopupHelper.GeneratePopupScript(
        "http://stores.homestead.com/MobiFlexStore/StoreFront.bok", 700, 900, false, false, false, true));
            }

            if (!IsPostBack)
            {
                XmlUtil x_util = new XmlUtil();
                //State["SelectedDeviceView"] =
                State["SelectedDeviceType"] = x_util.GetAppDeviceType(State);
                if (State["SelectedDeviceType"] == null)
                {
                   // State["SelectedDeviceView"] =
                    State["SelectedDeviceType"] = Constants.IPHONE;
                }

                //check on device type
                switch(State["SelectedDeviceType"].ToString())
                {
                     case Constants.IPAD:
                        SplashUploadLabel.Text = "Splash Image ( 768 X 1004 pixels from .jpg file )";
                        ScreenSplashButton.Attributes.Add("onclick", PopupHelper.GeneratePopupScript(
                                "ScreenShot.aspx", 1004, 768, false, false, false, true));
                        break;
                     case Constants.ANDROID_TABLET:
                        SplashUploadLabel.Text = "Splash Image ( 800 X 1233 pixels from .jpg file )";
                        ScreenSplashButton.Attributes.Add("onclick", PopupHelper.GeneratePopupScript(
                                "ScreenShot.aspx", 1233, 800, false, false, false, true));
                        break;
                     case Constants.IPHONE:
                        SplashUploadLabel.Text = "Splash Image ( 320 X 460 pixels from .jpg file )";
                        ScreenSplashButton.Attributes.Add("onclick", PopupHelper.GeneratePopupScript(
                                "ScreenShot.aspx", 460, 320, false, false, false, true));
                       break;
                     case Constants.ANDROID_PHONE:
                        SplashUploadLabel.Text = "Splash Image ( 320 X 508 pixels from .jpg file )";
                         ScreenSplashButton.Attributes.Add("onclick", PopupHelper.GeneratePopupScript(
                                "ScreenShot.aspx", 508, 320, false, false, false, true));
                      break;
                }
                SelectedDeviceType.Text = State["SelectedDeviceType"].ToString();

                DB db = new DB();
                StringBuilder b_sql = new StringBuilder("SELECT * FROM applications ");
                b_sql.Append("WHERE application_name='" +  State["SelectedApp"].ToString() + "'");
                b_sql.Append(" AND customer_id='" +  State["CustomerID"].ToString() + "'");
                DataRow[] rows = db.ViziAppsExecuteSql(State, b_sql.ToString());
                DataRow row = rows[0];
                if (row["production_app_name"] != null)
                    ProductionAppName.Text = row["production_app_name"].ToString();

                if (row["production_app_xml"] != DBNull.Value)
                    ProductionDesignExists.Visible = true;
                else
                    ProductionDesignExists.Visible = false;

                 bool use_1_user_credential = false;
                if (row["use_1_user_credential"] != DBNull.Value)
                {
                    string use_1_cred =  row["use_1_user_credential"].ToString();
                    use_1_user_credential = (use_1_cred.ToLower() == "true") ? true : false;
                }
                bool has_unlimited_users = false;
                if (row["has_unlimited_users"] != DBNull.Value)
                {
                    string has_unlimited = row["has_unlimited_users"].ToString();
                    has_unlimited_users = (has_unlimited.ToLower() == "true") ? true : false;
                }

                b_sql = new StringBuilder("SELECT * FROM branding_images ");
                b_sql.Append("WHERE application_id='" +  State["ApplicationID"].ToString() + "'");
                rows = db.ViziAppsExecuteSql(State, b_sql.ToString());
                foreach (DataRow image_row in rows)
                {
                    if (image_row["type"].ToString() == "icon" && image_row["width"].ToString() == "512")
                    {
                        LargeIconButton.Visible = true;
//.........这里部分代码省略.........
开发者ID:dcolonvizi,项目名称:ViziAppsPortal,代码行数:101,代码来源:PublishingFormWebApps.aspx.cs

示例3: SubmitForProvisioning_Click

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

        if (!util.IsAppStoreSubmissionPaid(State, State["SelectedApp"].ToString()))
        {
            ProvisioningMessage.Text = "You need to first purchase one of the ViziApps services to submit the app to an app store.";
            return;
        }

        //check if entries were set
        DB db = new DB();
        StringBuilder b_sql = new StringBuilder("SELECT * FROM applications ");
        b_sql.Append("WHERE application_name='" + State["SelectedApp"].ToString() + "'");
        b_sql.Append(" AND customer_id='" + State["CustomerID"].ToString() + "'");
        DataRow[] rows = db.ViziAppsExecuteSql(State, b_sql.ToString());
        DataRow row = rows[0];
         if (row["production_app_name"] == DBNull.Value || row["production_app_name"].ToString().Length == 0)
         {
             ProvisioningMessage.Text = "The Published App Name needs to be set and saved";
            return;
         }
         if (row["production_app_xml"] == DBNull.Value)
         {
             ProvisioningMessage.Text = "The Publish Design has not been saved";
            return;
         }

         string url = util.GetApplicationLargeIcon(State, State["ApplicationID"].ToString());
        if (url == null || url.Length == 0)
        {
            ProvisioningMessage.Text = "The Icon image has not been uploaded";
            return;
        }
        url = util.GetApplicationSplashImage(State, State["ApplicationID"].ToString());
        if (url == null || url.Length == 0)
        {
            ProvisioningMessage.Text = "The splash image has not been uploaded";
            return;
        }

        util.SetFreeProductionExpiration(State, DateTime.Now.ToUniversalTime().AddDays(10.0D));

        StringBuilder body = new StringBuilder("Customer Username: " + State["Username"].ToString() + "\n");
        body.Append("App Name: " + State["SelectedApp"].ToString() + "\n");
        if(SubmissionNotes.Text.Length > 0)
            body.Append("Customer Notes: " + SubmissionNotes.Text + "\n");
        body.Append("\n-- ViziApps Support");

        Email email = new Email();

        string status = email.SendEmail(State,  HttpRuntime.Cache["TechSupportEmail"].ToString(),  HttpRuntime.Cache["TechSupportEmail"].ToString(),
            "", "", "Customer Request to Submit or Update App to Store", body.ToString(), "",false);
        if (status.IndexOf("OK") >= 0)
        {
            ProvisioningMessage.Text = "Your application has been submitted for production. When it is ready, you will get an email.";
        }
        else
        {
            ProvisioningMessage.Text = "There has been a problem sending your request. Please contact [email protected]";
        }
    }
开发者ID:dcolonvizi,项目名称:ViziAppsPortal,代码行数:64,代码来源:PublishingForm.aspx.cs


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