Exemplo n.º 1
0
//INSTANT C# WARNING: Strict 'Handles' conversion only applies to 'WithEvents' fields declared in the same class - the event will be wired in 'SubscribeToEvents':
//ORIGINAL LINE: Protected Sub GridView1_RowUpdating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GridView1.RowUpdating
    protected void GridView1_RowUpdating(object sender, System.Web.UI.WebControls.GridViewUpdateEventArgs e)
    {
        if (b.DemoMode == false)
        {
            string IPAddress = ((TextBox)(GridView1.Rows[e.RowIndex].Cells[1].Controls[0])).Text;

            DataLayer.SQLDataProvider data = new DataLayer.SQLDataProvider();
            data.UpdateIPAddress(IPAddress, Convert.ToString(GridView1.DataKeys[e.RowIndex].Value));

            if (data.SQLError == null)
            {
                GridView1.EditIndex = -1;
                LoadData();
            }
            else
            {
                DisplayError(data.SQLError.Message);
            }
        }
        else
        {
            Alert("You are not allowed to make changes in demo mode.");
        }
    }