Example #1
0
        protected void btnAdd_Click(Object Sender, EventArgs e)
        {
            string strName = txtName.Text.Trim();

            if (intID == 0)
            {
                intID = oSolaris.AddSVECluster(strName, (chkDatabase.Checked ? 1 : 0), Int32.Parse(ddlClass.SelectedItem.Value), Int32.Parse(ddlResiliency.SelectedItem.Value), (chkNetworks.Checked ? 1 : 0), (chkAvailable.Checked ? 1 : 0), txtComments.Text, (chkStorage.Checked ? 1 : 0), (chkTrunking.Checked ? 1 : 0), (chkEnabled.Checked ? 1 : 0));
            }
            else
            {
                // Details
                oSolaris.UpdateSVECluster(intID, strName, (chkDatabase.Checked ? 1 : 0), Int32.Parse(ddlClass.SelectedItem.Value), Int32.Parse(ddlResiliency.SelectedItem.Value), (chkNetworks.Checked ? 1 : 0), (chkAvailable.Checked ? 1 : 0), txtComments.Text, (chkStorage.Checked ? 1 : 0), (chkTrunking.Checked ? 1 : 0), (chkEnabled.Checked ? 1 : 0));
                // Networks
                oSolaris.DeleteSVENetwork(intID);
                foreach (TreeNode oNodeC in oTreeNetworks.Nodes)
                {
                    foreach (TreeNode oNodeE in oNodeC.ChildNodes)
                    {
                        foreach (TreeNode oNodeA in oNodeE.ChildNodes)
                        {
                            foreach (TreeNode oNodeV in oNodeA.ChildNodes)
                            {
                                SaveNetwork(oNodeV);
                            }
                        }
                    }
                }
            }
            Response.Redirect(Request.Path + "?id=" + intID.ToString() + "&save=true");
        }