Example #1
0
        protected void CN_btn_CreateNetwork_OnClick(object sender, EventArgs e)
        {
            Stopwatch TimeClock = new Stopwatch();

            TimeClock.Start();

            string cidrrange   = CN_txt_CIDRRange.Text;
            string networkname = CN_txt_CreateNetworkName.Text;
            string region      = CN_ddl_Region.SelectedItem.ToString();

            try
            {
                Networks.CN_m_CreateNetwork(cidrrange, networkname, CN_txt_CreateNetworkName.Text, region);
                bindListNetworksDDL(Networks.CN_m_ListNetworks(region), "Label", "Id");
                CN_lbl_networkinfo.Text = Networks.CN_m_ShowNetworkInfo(CN_ddl_ListNetworks.SelectedValue, region);
                CN_m_MSGCreateNetwork();

                TimeClock.Stop();
                CN_lbl_TimeClock.Text = TimeClock.Elapsed.ToString();
            }
            catch (Exception ex)
            {
                CN_m_MSGCatchException(ex.ToString());
            }
        }
Example #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Stopwatch TimeClock = new Stopwatch();

            TimeClock.Start();

            string region = CN_ddl_Region.SelectedItem.ToString();

            HttpContext.Current.Session["CNListNetworks"]   = HttpUtility.HtmlEncode(CN_ddl_ListNetworks.SelectedItem);
            HttpContext.Current.Session["CNListNetworksID"] = HttpUtility.HtmlEncode(CN_ddl_ListNetworks.SelectedValue);

            Page.GetPostBackEventReference(CN_btn_CreateNetwork);

            try
            {
                if (IsPostBack)
                {
                }
                else
                {
                    if (string.IsNullOrEmpty((string)(Session["CloudIdentityUserName"])) & string.IsNullOrEmpty((string)(Session["CloudIdentityApiKey"])))
                    {
                        CN_lbl_Error.Text = "Before continuing please login and enter Cloud Username and API Key.";
                    }
                    else if (string.IsNullOrEmpty((string)(Session["CloudIdentityUserName"])))
                    {
                        CN_lbl_Error.Text = "Before continuing please login and please enter Cloud Username.";
                    }
                    else if (string.IsNullOrEmpty((string)(Session["CloudIdentityApiKey"])))
                    {
                        CN_lbl_Error.Text = "Before continuing please login and please enter API Key.";
                    }
                    else
                    {
                        bindListNetworksDDL(Networks.CN_m_ListNetworks(region), "Label", "Id");

                        CN_lbl_networkinfo.Text = Networks.CN_m_ShowNetworkInfo(CN_ddl_ListNetworks.SelectedValue, region);

                        TimeClock.Stop();
                        CN_lbl_TimeClock.Text = TimeClock.Elapsed.ToString();
                    }
                }
            }
            catch (Exception ex)
            {
                CN_m_MSGCatchException(ex.ToString());
            }
        }
Example #3
0
        protected void CN_ddl_ListNetworks_SelectChange(object sender, EventArgs e)
        {
            Stopwatch TimeClock = new Stopwatch();

            TimeClock.Start();

            string region = CN_ddl_Region.SelectedItem.ToString();

            try
            {
                CN_lbl_networkinfo.Text = Networks.CN_m_ShowNetworkInfo(CN_ddl_ListNetworks.SelectedValue, region);

                TimeClock.Stop();
                CN_lbl_TimeClock.Text = TimeClock.Elapsed.ToString();
            }
            catch (Exception ex)
            {
                CN_m_MSGCatchException(ex.ToString());
            }
        }