;; +=ex.Message; (msg);
}
{. Close ();
}
}
# endregionButton1_Click (object sender, EventArgs e)
{(TextBox1.Text, TextBox2.Text, TextBox3.Text, TextBox4.Text, .Text, TextBox6.Text, TextBox7.Text, Convert.ToString (DropDownList3.SelectedValue), Convert.ToString ( DropDownList4.SelectedValue), false);
//Re Bind GridView to reflect changes made ( raquo ;, raquo ;, Convert.ToString (DropDownList1.SelectedValue), Convert.ToString (DropDownList2.SelectedValue)) ;. Text= raquo ;;. Text= raquo ;;. Text= raquo ;;. Text= raquo ;;. Text= raquo ;;. Text= raquo ;;. Text= raquo ;;
} GridView1_RowEditing (object sender, GridViewEditEventArgs e)
{. EditIndex=e.NewEditIndex;// Turn to edit mode ( raquo ;, raquo ;, raquo ;, );
} GridView1_RowCancelingEdit (object sender, GridViewCancelEditEventArgs e)
{. EditIndex=- 1;// swicth back to default mode ( raquo ;, raquo ;, raquo ;, );
} GridView1_RowUpdating (object sender, GridViewUpdateEventArgs e)
{
//Accessing Edited values ??from the GridViewID=GridView1.Rows [e.RowIndex] .Cells [0] .Text; par1=((TextBox) GridView1.Rows [e.RowIndex] .Cells [ 1] .Controls [0]). Text; par2=((TextBox) GridView1.Rows [e.RowIndex] .Cells [2] .Controls [0]). Text; par3=((TextBox) GridView1.Rows [e.RowIndex] .Cells [3] .Controls [0]). Text; par4=((TextBox) GridView1.Rows [e.RowIndex] .Cells [4] .Controls [0]). Text; par5=((TextBox ) GridView1.Rows [e.RowIndex] .Cells [5] .Controls [0]). Text; par6=((TextBox) GridView1.Rows [e.RowIndex] .Cells [6] .Controls [0]). Text ; par7=((TextBox) GridView1.Rows [e.RowIndex] .Cells [7] .Controls [0]). Text; par8=((TextBox) GridView1.Rows [e.RowIndex] .Cells [7] .Controls [0]). Text; (ID, par1, par2, par3, par4, par5, par6, par7, par8, true);// Call update method.EditIndex=- 1; ( raquo ;, raquo ;, par1, par2);
} GridView1_RowDeleting (object sender, GridViewDeleteEventArgs e)
{id=GridView1.Rows [e.RowIndex] .Cells [0] .Text;// get the id of the selected row (id);//call delete method ( raquo ;, raquo ;, raquo ;, );
} GridView1_Sorting (object sender, GridViewSortEventArgs e)
{(e.SortExpression, ConvertSortDirectionToSql (e.SortDirection), raquo ;, );
} (SortDirectionsortDirection)
{= String.Empty; (sortDirection)
{. Ascending:= ASC raquo ;;;. Descending:= DESC raquo ;;;
};
}
}
}System;.Collections.Generic;.Linq;.Web;.Web.UI;.Web.UI.WebControls;.Data;.Data.SqlClient;Monitoring
{_ master: System.Web.UI.Page
{_ Load (object sender, EventArgs e)
{(! IsPostBack)
{( raquo ;, raquo ;, raquo ;, );
}
} Button2_Click (object sender, EventArgs e)
{( raquo ;, raquo ;, Convert.ToString (DropDownList1.SelectedValue), Convert.ToString (DropDownList2.SelectedValue));
} ()
{System.Configuration.ConfigurationManager.ConnectionStrings[laquo;MonitoringConnectionStringraquo;].ConnectionString;
}
# region Bind GridView (stringsortExp, stringsortDir, string par1, string par2)
{= newDataTable (); connection=newSqlConnection (GetConnectionString ());
{. Open ();=string.Empty; (par1!=string.Empty amp; amp; par2!=string.Empty)
{= SELECT * FROM Норми Where КодДеталі=@ par1 and КодМатеріала=@ par2 raquo ;;
}= SELECT * FROM Норми raquo ;;=newSqlCommand (sqlStatement, connection);=newSqlDataAdapter (cmd);
. Parameters.AddWithValue ( @ par1 raquo ;, par1) ;. Parameters.AddWithValue ( @ par2 raquo ;, par2) ;. CommandType=CommandType.Text; .ExecuteNonQuery () ;. Fill (dt); (dt.Rows.Count gt; 0)
{= newDataView ();=dt.DefaultView; (sortExp!=string.Empty)
{
//myDataView.Sort=string.Format ( {0} {1} raquo ;, sortExp, sortDir);
}. DataSource=myDataView; .DataBind ();
}
} (SqlException ex)
{= Fetch Error: raquo ;; +=ex.Message; (msg);
}
{. Close ();
}