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 Email    = ((TextBox)(GridView1.Rows[e.RowIndex].Cells[2].Controls[0])).Text.Trim();
            string FullName = ((TextBox)(GridView1.Rows[e.RowIndex].Cells[3].Controls[0])).Text.Trim();

            DataLayer.SQLDataProvider data = new DataLayer.SQLDataProvider();
            data.UpdataUserInformation(Email, FullName, GridView1.DataKeys[e.RowIndex].Values[0].ToString());

            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.");
        }
    }