// Data members
    protected void Page_Load(object sender, EventArgs e)
    {
        Init init = new Init();
        Util util = new Util();

        try
        {
            Hashtable State = (Hashtable)HttpRuntime.Cache[Session.SessionID];

            if (util.CheckSessionTimeout(State, Response, "Default.aspx")) return;

            if ( HttpRuntime.Cache["TechSupportEmail"] != null)
            {
                util.AddEmailToButton(SupportButton,  HttpRuntime.Cache["TechSupportEmail"].ToString(), "Email To Tech Support");
            }

            util.UpdateSessionLog(State, "post", "TabPublish");

            if (!IsPostBack)
            {
                CopyRight.InnerText = HttpRuntime.Cache["CopyRight"].ToString();
                UserLabel.Text = State["Username"].ToString();
            }

         //   SeeAllFields.Attributes.Add("onclick", "javascript: PopUp('../Help/Design/ViewAllNativeFields.htm', 'height=800, width=800, left=200, top=200, menubar=no, status=no, location=no, toolbar=no, scrollbars=yes, resizable=yes');return false;");
         //   LayoutVideo.Attributes.Add("onclick", "javascript: PopUp('../Help/Design/LayoutVideo.htm', 'height=325, width=570, left=200, top=200, menubar=no, status=no, location=no, toolbar=no, scrollbars=no, resizable=no');return false;");
         //   BasicFieldsVideo.Attributes.Add("onclick", "javascript: PopUp('../Help/Design/BasicFieldsVideo.htm', 'height=325, width=570, left=200, top=200, menubar=no, status=no, location=no, toolbar=no, scrollbars=no, resizable=no');return false;");

        }
        catch (Exception ex)
        {
            System.Diagnostics.Debug.WriteLine(ex.Message.ToString());
            throw;
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        Util util = new Util();
        Hashtable State = (Hashtable)HttpRuntime.Cache[Session.SessionID];
        if (util.CheckSessionTimeout(State,Response,"Default.aspx")) return;
         try
        {
            if (!IsPostBack)
            {
                CopyRight.InnerText = HttpRuntime.Cache["CopyRight"].ToString();
                UserLabel.Text = State["Username"].ToString();
            }

            if ( HttpRuntime.Cache["TechSupportEmail"] != null)
            {
                util.AddEmailToButton(SupportButton,  HttpRuntime.Cache["TechSupportEmail"].ToString(), "Email To Tech Support");
            }

            util.UpdateSessionLog(State, "post", "TabPublishOld");

            /*PurchaseButton.Attributes.Add("onclick", PopupHelper.GeneratePopupScript(
               "http://stores.homestead.com/MobiFlexStore/StoreFront.bok", 700, 900, false, false, false, true));
           ManageBillingButton.Attributes.Add("onclick", PopupHelper.GeneratePopupScript(
               "http://stores.homestead.com/MobiFlexStore/StoreFront.bok", 700, 900, false, false, false, true));*/

            ShowProductionServices();

            ClearMessages();

            Init init = new Init();
            if (State["ResetProvisionApps"] != null)
            {
                State["SelectedApp"] = null;
                init.InitAppsList(State, ProvisionApps);
                State["ResetProvisionApps"] = null;
            }

            if (ProvisionApps.Items.Count == 0)
            {
                init.InitAppsList(State, ProvisionApps);

            }
            SetProvisionButtons(ProvisionApps.SelectedValue);
            SetProvisionFormPopup();
        }
        catch (Exception ex)
        {
            util.ProcessMainExceptions(State, Response, ex);
        }
    }
Example #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Util util = new Util();
        Hashtable State = (Hashtable)HttpRuntime.Cache[Session.SessionID];
        if (util.CheckSessionTimeout(State,Response,"Default.aspx")) return;
        try
        {
            if (!IsPostBack)
            {
                CopyRight.InnerText = HttpRuntime.Cache["CopyRight"].ToString();
                UserLabel.Text = State["Username"].ToString();
            }

            if ( HttpRuntime.Cache["TechSupportEmail"] != null)
            {
                util.AddEmailToButton(SupportButton,  HttpRuntime.Cache["TechSupportEmail"].ToString(), "Email To Tech Support");
            }
        }
        catch (Exception ex)
        {
            util.ProcessMainExceptions(State, Response, ex);
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        Util util = new Util();
        Hashtable State = (Hashtable)HttpRuntime.Cache[Session.SessionID];
        if (util.CheckSessionTimeout(State, Response, "Default.aspx")) return;

        Init init = new Init();
        try
        {
            if (util.CheckSessionTimeout(State,Response,"Default.aspx")) return;
            if ( HttpRuntime.Cache["TechSupportEmail"] != null)
            {
                util.AddEmailToButton(SupportButton,  HttpRuntime.Cache["TechSupportEmail"].ToString(), "Email To Tech Support");
            }
            util.UpdateSessionLog(State, "post", "TabDesignWeb");

            ClearMessages();

            if (!IsPostBack)
            {
                CopyRight.InnerText = HttpRuntime.Cache["CopyRight"].ToString();
                UserLabel.Text = State["Username"].ToString();

                if (CurrentApp.Items.Count == 0 || CurrentApp.SelectedValue.Contains("->") ||
                              State["SelectedApp"] == null)
                {
                    init.InitAppsList(State, CurrentApp);
                }

                State["SelectedAppType"] = Constants.WEB_APP_TYPE;
                AppType.Text = Constants.WEB_APP_TYPE;
                State["UrlAccountIdentifier"] = util.GetUrlAccountIdentifier(State);
                UrlAccountIdentifier.Text = State["UrlAccountIdentifier"].ToString();

                if (State["SelectedApp"] == null || !util.DoesAppExist(State) || CurrentApp.SelectedIndex == 0)
                {
                    InitCurrentApp("->");
                    State["SelectedDeviceType"] = Constants.IPHONE;
                    DeviceType.Text = State["SelectedDeviceType"].ToString();
                }
                else if (State["SelectedApp"] != null)
                {
                    InitCurrentApp(State["SelectedApp"].ToString());
                }
            }
            DeletePage.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this page?');");

            if (State["ResetConfigApps"] != null)
            {
                State["SelectedApp"] = null;
                init.InitAppsList(State, CurrentApp);
                State["ResetConfigApps"] = null;
            }

            State["WebServiceValidated"] = null;
            if (State["SelectedDeviceType"] == null)
            {
                State["SelectedDeviceType"] = Constants.IPHONE;
                DeviceType.Text = State["SelectedDeviceType"].ToString();
             }
            SetAllAppNames();
        }
        catch (Exception ex)
        {
            util.ProcessMainExceptions(State, Response, ex);
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        Util util = new Util();
        Hashtable State = (Hashtable)HttpRuntime.Cache[Session.SessionID];
        if (util.CheckSessionTimeout(State,Response,"Default.aspx")) return;
        try
        {
            if (!IsPostBack)
            {
                CopyRight.InnerText = HttpRuntime.Cache["CopyRight"].ToString();
                UserLabel.Text = State["Username"].ToString();
            }

            if ( HttpRuntime.Cache["TechSupportEmail"] != null)
            {
                util.AddEmailToButton(SupportButton,  HttpRuntime.Cache["TechSupportEmail"].ToString(), "Email To Tech Support");
            }

            util.UpdateSessionLog(State, "post", "TabMyProfile");

            if (State["ServerAdminCustomerUsername"] != null)
                UsernameLabel.Text = State["ServerAdminCustomerUsername"].ToString();
            else
                UsernameLabel.Text = State["Username"].ToString();

            Message.Text = "";

            string sql = null;
            if (State["Username"].ToString() != "admin")
            {
                sql = "SELECT * FROM customers WHERE customer_id='" + State["CustomerID"].ToString() + "'";
            }
            else
            {
                sql = "SELECT * FROM customers WHERE customer_id='" + State["ServerAdminCustomerID"].ToString() + "'";
            }
            DB db = new DB();
            DataRow[] rows = db.ViziAppsExecuteSql(State, sql);
            DataRow row = rows[0];

            PasswordTextBox.Text = "";
            ConfirmPasswordBox.Text = "";
            CompanyTextBox.Text = util.DecodeMySql(row["company"].ToString());
            RoleTextBox.Text = util.DecodeMySql(row["role"].ToString());
            FirstNameTextBox.Text = util.DecodeMySql(row["first_name"].ToString());
            LastNameTextBox.Text = util.DecodeMySql(row["last_name"].ToString());
            StreetTextBox.Text = util.DecodeMySql(row["street_address"].ToString());
            CityTextBox.Text = util.DecodeMySql(row["city"].ToString());

            if (row["state"] != null && row["state"].ToString().Length > 0)
                StateList.Text = row["state"].ToString();

            PostalCodeTextBox.Text = row["postal_code"].ToString();
            CountryTextBox.Text = util.DecodeMySql(row["country"].ToString());

            PhoneTextbox.Text = row["phone"].ToString();
            EmailTextBox.Text = row["email"].ToString();
            string status = row["status"].ToString();

            //Additions for the CC fields
            if (!IsPostBack)
            {
                CCFirstNameTextbox.Text = util.DecodeMySql(row["first_name"].ToString());
                CCLastNameTextBox.Text = util.DecodeMySql(row["last_name"].ToString());
                CCZipTextBox.Text = row["postal_code"].ToString();
            }

            db.CloseViziAppsDatabase(State);

            TimeZones zone_util = new TimeZones();
            string default_time_zone_delta_hours = row["default_time_zone_delta_hours"].ToString();
            zone_util.InitTimeZones(State, DateTime.Now.ToUniversalTime(), TimeZoneList, default_time_zone_delta_hours);

            string force_1_user_sessions = row["force_1_user_sessions"].ToString();
            Force1UserSessions.Checked = force_1_user_sessions == "1" || force_1_user_sessions.ToLower() == "true";

        }
        catch (Exception ex)
        {
            util.ProcessMainExceptions(State, Response, ex);
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        Util util = new Util();
        Hashtable State = (Hashtable)HttpRuntime.Cache[Session.SessionID];
        if (util.CheckSessionTimeout(State,Response,"Default.aspx")) return;
         try
        {
            if (!IsPostBack)
            {
                CopyRight.InnerText = HttpRuntime.Cache["CopyRight"].ToString();
                UserLabel.Text = State["Username"].ToString();
            }

            if ( HttpRuntime.Cache["TechSupportEmail"] != null)
            {
                util.AddEmailToButton(SupportButton,  HttpRuntime.Cache["TechSupportEmail"].ToString(), "Email To Tech Support");
            }

            util.UpdateSessionLog(State, "post", "ManageData");

            State["DatabaseEvents"] = DatabaseEvents;
            State["SpreadSheetEvents"] = SpreadSheetEvents;
            State["WebServiceEvents"] = WebServiceEvents;
            State["ManageDataApps"] = ManageDataApps;
            ManageDataType.Attributes.Add("onclick", "checkChangingManageDataType(this);");
            string attr = "javascript: NamedPopUp('Dialogs/Design/StoryBoard.aspx', 'StoryBoardPopup','height=900, width=460, left=0, top=400, menubar=no, status=no, location=no, toolbar=no, scrollbars=yes, resizable=yes');return false;";
            ViewStoryBoard.Attributes.Add("onclick", attr);

            ClearMessages();

            if (DataMultiPage.SelectedIndex == 2)
                return;

            WebServiceEventMappingStatus.Attributes.Add("onclick", PopupHelper.GeneratePopupScript(
                "Dialogs/ManageData/EventMappingStatus.aspx", 500, 500, false, false, false, true));

            Init init = new Init();
            if (State["ResetManageDataApps"] != null)
            {
                State["SelectedApp"] = null;
                init.InitManageDataAppsList(State);
                State["ResetManageDataApps"] = null;
            }

            if (ManageDataApps.Items.Count == 0 || ManageDataApps.SelectedValue.Contains("->"))
            {
                init.InitManageDataAppsList(State);
                ManageDataType.Style.Value = "display:none";
                ManageDataTypeLabel.Style.Value = "display:none";
                ViewStoryBoard.Style.Value = "display:none";
                ShouldRefreshStoryBoard.Text = "close";
                ManageTypeMultiPage.SelectedIndex = Constants.BLANK_PAGE;
                State["ManageDataType"] = null;
            }

            if (ManageDataApps.SelectedIndex > 0)
            {
                ViewStoryBoard.Style.Value = "";
                ManageDataType.Style.Value = "";
                ManageDataTypeLabel.Style.Value = "";

                string target = Request.Form.Get("__EVENTTARGET");
                if (target != "SaveDataRequestMap" &&
                    target != "SaveDataResponseMap" &&
                    target != "WebServiceResponseTreeView")
                    PrepareAppDisplay(target);
                if (target == "ViewConnectionString")
                {
                    DatabaseCommandsView.Nodes.Clear();
                    DatabaseEvents.SelectedIndex = 0;
                    SpreadsheetCommandsView.Nodes.Clear();
                    SpreadSheetEvents.SelectedIndex = 0;
                }
            }
        }
        catch (Exception ex)
        {
            util.ProcessMainExceptions(State, Response, ex);
        }
    }
Example #7
0
    protected void CustomersByAccount_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
    {
        ClearMessages();
        HideForCustomers();

        Hashtable State = (Hashtable)HttpRuntime.Cache[Session.SessionID];
        if (e.Text.IndexOf("->") > 0)
        {
            CustomersByEmail.Items[0].Selected = true;
             AdminMessage.Text = "Select a customer and try again.";
            return;
        }

        State["ServerAdminCustomerUsername"] = e.Text;
        string sql = "SELECT * FROM customers WHERE username='******'";
        DB db = new DB();
        DataRow[] rows = db.ViziAppsExecuteSql(State, sql);
        DataRow row = rows[0];
        string customer_id = row["customer_id"].ToString();
        string email = row["email"].ToString();
        CustomersByAccount.FindItemByText(row["username"].ToString()).Selected = true;
        CustomersByEmail.FindItemByText(email).Selected = true;
        State["ServerAdminCustomerID"] = customer_id;
        Util util = new Util();
        RegisteredDateTime.Text = "Signed Up: " + row["registration_date_time"].ToString();
        LastUsedDateTime.Text = "Last used: " + row["last_use_date_time"].ToString();

        Password.Text = util.DecodeMySql(row["password"].ToString());
        AccountTypes.Text = util.DecodeMySql(row["account_type"].ToString().Replace("type=","").Replace(";",""));
        CustomerStatus.Text = row["status"].ToString();
        if (row["email"] != null && row["email"].ToString().Length > 0)
        {
            util.AddEmailToButton(EmailCustomer, row["email"].ToString(), "Customer Email");
        }

        sql = "SELECT application_name FROM applications WHERE customer_id='" + customer_id + "' ORDER BY application_name";
        rows = db.ViziAppsExecuteSql(State, sql);
        Applications.Items.Clear();
        foreach (DataRow row1 in rows)
        {

            Applications.Items.Add(new RadComboBoxItem(row1["application_name"].ToString()));
        }
        Applications.Items.Insert(0, new RadComboBoxItem("Select ViziApps App ->"));

        db.CloseViziAppsDatabase(State);

        ShowForCustomers();
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        Util util = new Util();
        Hashtable State = (Hashtable)HttpRuntime.Cache[Session.SessionID];
        if (util.CheckSessionTimeout(State,Response,"Default.aspx")) return;
        try
        {
            if ( HttpRuntime.Cache["TechSupportEmail"] != null)
            {
                util.AddEmailToButton(SupportButton,  HttpRuntime.Cache["TechSupportEmail"].ToString(), "Email To Tech Support");
            }

            util.UpdateSessionLog(State, "post", "TabMySolutions");

            ClearMessages();

            DemoVideo.Attributes.Add("onclick", PopupHelper.GeneratePopupScript(
                 "Help/MySolutions/DemoVideo.htm", 400, 655, false, false, false, true));
            DemoVideo1.Attributes.Add("onclick", PopupHelper.GeneratePopupScript(
                 "Help/MySolutions/DemoVideo.htm", 400, 655, false, false, false, true));
            QuickStart.Attributes.Add("onclick", PopupHelper.GeneratePopupScript(
                 "Help/MySolutions/QuickStart.aspx", 940, 750, false, false, false, true));
            QuickStart1.Attributes.Add("onclick", PopupHelper.GeneratePopupScript(
                  "Help/MySolutions/QuickStart.aspx", 940, 750, false, false, false, true));
            YourFirstApp.Attributes.Add("onclick", PopupHelper.GeneratePopupScript(
                 "Help/MySolutions/YourFirstApp.htm", 350, 650, false, false, false, true));
            YourFirstApp1.Attributes.Add("onclick", PopupHelper.GeneratePopupScript(
                 "Help/MySolutions/YourFirstApp.htm", 350, 650, false, false, false, true));
            Overview.Attributes.Add("onclick", PopupHelper.GeneratePopupScript(
                 "Help/MySolutions/Overview.aspx", 800, 800, false, false, false, true));
            Overview1.Attributes.Add("onclick", PopupHelper.GeneratePopupScript(
                 "Help/MySolutions/Overview.aspx", 800, 800, false, false, false, true));

            if (IsPostBack)
            {
                if (Request.Form.AllKeys.Length > 0)
                {
                    int last = Request.Form.AllKeys.Length - 1;

                    for (int i = last; i > last - 3; i--)
                    {
                        if (Request.Form.AllKeys[i] != null && Request.Form.AllKeys[i].Contains("$delete."))
                        {
                            int start = Request.Form.AllKeys[i].IndexOf("$delete.") + 8;
                            string[] split = Request.Form.AllKeys[i].Substring(start).Split(".".ToCharArray());
                            int row = Convert.ToInt32(split[0]);
                            string app = MySolutions.Items[row].Cells[2].Text;
                            //delete app
                            State["SelectedApp"] = app;
                            util.DeleteApplication(State);
                            util.ResetAppStateVariables(State);
                            LoadData();
                            return;
                        }
                    }
                }
            }
            else
            {
                CopyRight.InnerText = HttpRuntime.Cache["CopyRight"].ToString();
                UserLabel.Text = State["Username"].ToString();
                LoadData();
            }

        }
        catch (Exception ex)
        {
            util.ProcessMainExceptions(State, Response, ex);
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        Init init = new Init();
        Util util = new Util();

        try
        {
            Hashtable State = (Hashtable)HttpRuntime.Cache[Session.SessionID];
            if (util.CheckSessionTimeout(State,Response,"Default.aspx")) return;

            if ( HttpRuntime.Cache["TechSupportEmail"] != null)
            {
                util.AddEmailToButton(SupportButton,  HttpRuntime.Cache["TechSupportEmail"].ToString(), "Email To Tech Support");
            }

            util.UpdateSessionLog(State, "post", "TabDesign");

            ClearMessages();

            if (!IsPostBack)
            {
                CopyRight.InnerText = HttpRuntime.Cache["CopyRight"].ToString();
                string attr = "javascript: NamedPopUp('ManageData.aspx', 'ManageDataPopup','height=800, width=1000, left=50, top=50, menubar=no, status=no, location=no, toolbar=no, scrollbars=yes, resizable=yes');return false;";
                ManageData.Attributes.Add("onclick", attr);

                UserLabel.Text = State["Username"].ToString();

                if (CurrentApp.Items.Count == 0 || CurrentApp.SelectedValue.Contains("->") ||
                              State["SelectedApp"] == null)
                {
                    init.InitAppsList(State, CurrentApp);
                }

                State["SelectedAppType"] = Constants.NATIVE_APP_TYPE;

                if (State["SelectedApp"] == null || !util.DoesAppExist(State) || CurrentApp.SelectedIndex == 0)
                {
                    InitCurrentApp("->");
                    State["SelectedDeviceType"] = Constants.IPHONE;
                    DeviceType.Text = State["SelectedDeviceType"].ToString();
                }
                else if (State["SelectedApp"] != null)
                {
                    InitCurrentApp(State["SelectedApp"].ToString());
                }
            }

            DeletePage.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this page?');");

            if (State["ResetConfigApps"] != null)
            {
                State["SelectedApp"] = null;
                init.InitAppsList(State, CurrentApp);
                State["ResetConfigApps"] = null;
            }

            State["WebServiceValidated"] = null;
            if (State["SelectedDeviceType"] == null)
            {
                State["SelectedDeviceType"] = Constants.IPHONE;
                DeviceType.Text = State["SelectedDeviceType"].ToString();
            }
            SetAllAppNames();
        }
        catch (Exception ex)
        {
            Hashtable State = (Hashtable)HttpRuntime.Cache[Session.SessionID];
            util.ProcessMainExceptions(State, Response, ex);
        }
    }