Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Response.Cookies["loginreferrer"].Value   = "/admin/asset/asset_models_other.aspx";
            Response.Cookies["loginreferrer"].Expires = DateTime.Now.AddDays(30);
            if (Request.Cookies["adminid"] != null && Request.Cookies["adminid"].Value != "")
            {
                intProfile = Int32.Parse(Request.Cookies["adminid"].Value);
            }
            else
            {
                Response.Redirect("/admin/login.aspx");
            }
            oPlatform         = new Platforms(intProfile, dsn);
            oType             = new Types(intProfile, dsn);
            oModel            = new Models(intProfile, dsn);
            oModelsProperties = new ModelsProperties(intProfile, dsn);
            oAssetCategory    = new AssetCategory(intProfile, dsn);
            oDell             = new Dells(intProfile, dsn);

            if (!IsPostBack)
            {
                LoadList();
                LoadPlatforms();
                btnParent.Attributes.Add("onclick", "return OpenWindow('MODELBROWSER','" + hdnParent.ClientID + "','&control=" + hdnParent.ClientID + "&controltext=" + lblParent.ClientID + "',false,400,600);");
                btnDelete.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this item?');");
                btnCancel.Attributes.Add("onclick", "return Cancel();");
            }
        }
Exemplo n.º 2
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (DialogResult.OK == MessageBox.Show("Хотите удалить этот вопрос?", "Удаление вопроса",
                                            MessageBoxButtons.OKCancel, MessageBoxIcon.Question))
     {
         Dells?.Invoke(this, EventArgs.Empty);
     }
 }
Exemplo n.º 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Response.Cookies["loginreferrer"].Value   = "/admin/dell_configs.aspx";
     Response.Cookies["loginreferrer"].Expires = DateTime.Now.AddDays(30);
     if (Request.Cookies["adminid"] != null && Request.Cookies["adminid"].Value != "")
     {
         intProfile = Int32.Parse(Request.Cookies["adminid"].Value);
     }
     else
     {
         Response.Redirect("/admin/login.aspx");
     }
     oDell = new Dells(intProfile, dsn);
     if (Request.QueryString["id"] == null)
     {
         if (Request.QueryString["add"] == null)
         {
             LoopRepeater();
         }
         else
         {
             panAdd.Visible = true;
         }
     }
     else
     {
         panAdd.Visible = true;
         intID          = Int32.Parse(Request.QueryString["id"]);
         if (intID > 0)
         {
             if (!IsPostBack)
             {
                 DataSet ds = oDell.Get(intID);
                 txtName.Text       = ds.Tables[0].Rows[0]["name"].ToString();
                 txtSplit.Text      = ds.Tables[0].Rows[0]["xml_split"].ToString();
                 txtOperator.Text   = ds.Tables[0].Rows[0]["xml_operator"].ToString();
                 txtStart.Text      = ds.Tables[0].Rows[0]["xml_start"].ToString();
                 txtQueryPower.Text = ds.Tables[0].Rows[0]["query_power"].ToString();
                 txtQueryMAC1.Text  = ds.Tables[0].Rows[0]["query_mac1"].ToString();
                 txtQueryMAC2.Text  = ds.Tables[0].Rows[0]["query_mac2"].ToString();
                 txtPowerOn.Text    = ds.Tables[0].Rows[0]["success_power_on"].ToString();
                 txtPowerOff.Text   = ds.Tables[0].Rows[0]["success_power_off"].ToString();
                 txtUsername.Text   = ds.Tables[0].Rows[0]["username"].ToString();
                 txtPassword.Text   = ds.Tables[0].Rows[0]["password"].ToString();
                 chkEnabled.Checked = (ds.Tables[0].Rows[0]["enabled"].ToString() == "1");
                 btnAdd.Text        = "Update";
             }
         }
         else
         {
             btnDelete.Enabled = false;
         }
     }
     btnDelete.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this item?');");
 }
Exemplo n.º 4
0
        protected void Page_Load()
        {
            Int32.TryParse(Request.QueryString["id"], out intAsset);
            if (intAsset > 0)
            {
                int   intModelProperty = 0;
                Asset oAsset           = new Asset(0, dsnAsset, dsn);
                if (Int32.TryParse(oAsset.Get(intAsset, "modelid"), out intModelProperty) == true)
                {
                    ModelsProperties oModelsProperties = new ModelsProperties(0, dsn);
                    if (oModelsProperties.IsDell(intModelProperty) == true)
                    {
                        int intDellConfig = 0;
                        Int32.TryParse(oModelsProperties.Get(intModelProperty, "dellconfigid"), out intDellConfig);
                        Dells   oDell  = new Dells(0, dsn);
                        DataSet dsDell = oDell.Get(intDellConfig);
                        if (dsDell.Tables[0].Rows.Count == 1)
                        {
                            DataRow drDell = dsDell.Tables[0].Rows[0];
                            strUser = drDell["username"].ToString();
                            strPass = drDell["password"].ToString();
                            strILO  = oAsset.GetServerOrBlade(intAsset, "ilo");

                            Functions oFunction = new Functions(0, dsn, intEnvironment);
                            Variables oVariable = new Variables(intEnvironment);

                            if (Request.QueryString["showimage"] != null)
                            {
                                Response.Redirect("/ondemand/ondemand_dell_image.aspx?showimage=https://" + strILO + Request.QueryString["showimage"]);
                            }
                            else if (Request.QueryString["bypass"] != null)
                            {
                                if (strUser == "" || strPass == "")
                                {
                                    strUser = oVariable.ADUser() + "@" + oVariable.FullyQualified();
                                    strPass = oFunction.AddPassword(50);
                                }
                            }
                        }
                    }
                }
            }
        }