protected void dsManualEdit_Inserted(object sender, System.Web.UI.WebControls.SqlDataSourceStatusEventArgs e) { //Seleksi apakah terjadi error atau tidak //jika tidak ada record yang ter insert maka terjadi error if (e.AffectedRows == 0) { ExceptionDetails.Text = lblCannotUpdate.Text; //& " (" & e.Exception.Message & ")" e.ExceptionHandled = true; if (!isEntrySambung()) { setInitialComponent(); } } else { //Catat ke Log rtwin.azlib.AddUserAct(Session["UserID"].ToString(), "2101", e.Command.Parameters["@NIP"].Value.ToString() + "," + e.Command.Parameters["@TGL_MASUK"].Value.ToString(), Application["strCn"].ToString()); ExceptionDetails.Text = "Data telah di simpan"; GvManual.DataBind(); setInitialComponent(); } if (!isEntrySambung()) { showGridView(true); } }
protected void btnRefresh_Click(object sender, EventArgs e) { if (Page.IsValid) { //update ke grid GvManual.DataBind(); } }
protected void dsManual_Deleted(object sender, System.Web.UI.WebControls.SqlDataSourceStatusEventArgs e) { //Seleksi apakah terjadi error atau tidak //jika tidak ada record yang ter delete maka terjadi error if (e.AffectedRows == 0) { ExceptionDetails.Text = lblCannotUpdate.Text; e.ExceptionHandled = true; } else { //Catat ke Log rtwin.azlib.AddUserAct(Session["UserID"].ToString(), "2103", e.Command.Parameters["@NIP"].Value.ToString() + "," + e.Command.Parameters["@TGL_MASUK"].Value.ToString(), Application["strCn"].ToString()); } GvManual.DataBind(); }
protected void txtHalaman_TextChanged(object sender, EventArgs e) { GridViewRow rowPager = GvManual.BottomPagerRow; TextBox txtHalaman = (TextBox)(rowPager.Cells[0].FindControl("txtHalaman")); try { if (int.Parse(txtHalaman.Text) <= GvManual.PageCount + 1 && int.Parse(txtHalaman.Text) > 0) { GvManual.PageIndex = (int.Parse(txtHalaman.Text)) - 1; GvManual.DataBind(); } } catch (Exception) { txtHalaman.Text = (GvManual.PageIndex + 1).ToString(); } }