void tutupPeriode() { try { //string query = dsTutupPeriode.UpdateCommand.ToString(); string query = "UPDATE taTutupPeriode SET STATUS_DITUTUP = 1, TGL_PROSES_TERAKHIR = getdate(), TGL_DITUTUP = getdate(), TGL_PROSES_KOREKSI = NULL WHERE JENIS_TRANSAKSI = '" + ddlJenisTransaksi.SelectedValue + "' AND TAHUN = '" + ddlTahun.SelectedValue + "' AND BULAN ='" + DropBulan.SelectedValue + "' AND KODE_CABANG = '" + Session["param_cabang"].ToString() + "'"; // Label3.Text = query; string strCn; strCn = Application["strCn"].ToString(); SqlConnection cn; cn = new SqlConnection(strCn); SqlCommand cmd = new SqlCommand(query, cn); cmd.CommandTimeout = 36000; cn.Open(); cmd.ExecuteNonQuery(); cn.Close(); GvTutupPeriode.DataBind(); //ExceptionDetails.Text = " Berhasil"; } catch (SqlException e) { ExceptionDetails.Text = e.Message.ToString(); } }
protected void txtHalaman_TextChanged(object sender, EventArgs e) { GridViewRow rowPager = GvTutupPeriode.BottomPagerRow; TextBox txtHalaman = (TextBox)(rowPager.Cells[0].FindControl("txtHalaman")); try { if (int.Parse(txtHalaman.Text) <= GvTutupPeriode.PageCount + 1 && int.Parse(txtHalaman.Text) > 0) { GvTutupPeriode.PageIndex = (int.Parse(txtHalaman.Text)) - 1; GvTutupPeriode.DataBind(); } } catch (Exception) { txtHalaman.Text = (GvTutupPeriode.PageIndex + 1).ToString(); } }