Ejemplo n.º 1
0
        //fungsi: Handle Ketika data pada database telah ditambahkan
        protected void dsAkumulasiEdit_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(), "2431", e.Command.Parameters["@NIP"].Value.ToString() + "," + e.Command.Parameters["@TGL_AWAL"].Value.ToString(), Application["strCn"].ToString());
                ExceptionDetails.Text = "Data telah di simpan";

                GvAkumulasi.DataBind();
                setInitialComponent();
            }

            //if (!isEntrySambung())
            //{
            showGridView(true);
            //}
        }
Ejemplo n.º 2
0
 //fungsi: Refresh GridView
 protected void btnRefresh_Click(object sender, EventArgs e)
 {
     if (Page.IsValid)
     {
         //update ke grid
         GvAkumulasi.DataBind();
     }
 }
Ejemplo n.º 3
0
 //fungsi: Handle Ketika data pada database telah didelete
 protected void dsAkumulasi_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(), "2433", e.Command.Parameters["@NIP"].Value.ToString() + "," + e.Command.Parameters["@TGL_AWAL"].Value.ToString(), Application["strCn"].ToString());
     }
     GvAkumulasi.DataBind();
 }
Ejemplo n.º 4
0
        protected void txtHalaman_TextChanged(object sender, EventArgs e)
        {
            GridViewRow rowPager   = GvAkumulasi.BottomPagerRow;
            TextBox     txtHalaman = (TextBox)(rowPager.Cells[0].FindControl("txtHalaman"));

            try
            {
                if (int.Parse(txtHalaman.Text) <= GvAkumulasi.PageCount + 1 && int.Parse(txtHalaman.Text) > 0)
                {
                    GvAkumulasi.PageIndex = (int.Parse(txtHalaman.Text)) - 1;
                    GvAkumulasi.DataBind();
                }
            }
            catch (Exception)
            {
                txtHalaman.Text = (GvAkumulasi.PageIndex + 1).ToString();
            }
        }