Exemplo n.º 1
0
 protected void btnRefresh_Click(object sender, EventArgs e)
 {
     if (Page.IsValid)
     {
         //update ke grid
         GvLembur.DataBind();
     }
 }
Exemplo n.º 2
0
 protected void dsLembur_Deleted(object sender, 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(), "2313", e.Command.Parameters["@NIP"].Value.ToString() + "," + e.Command.Parameters["@TGL_MASUK"].Value.ToString(), Application["strCn"].ToString());
     }
     GvLembur.DataBind();
 }
Exemplo n.º 3
0
        protected void txtHalaman_TextChanged(object sender, EventArgs e)
        {
            GridViewRow rowPager   = GvLembur.BottomPagerRow;
            TextBox     txtHalaman = (TextBox)(rowPager.Cells[0].FindControl("txtHalaman"));

            try
            {
                if (int.Parse(txtHalaman.Text) <= GvLembur.PageCount + 1 && int.Parse(txtHalaman.Text) > 0)
                {
                    GvLembur.PageIndex = (int.Parse(txtHalaman.Text)) - 1;
                    GvLembur.DataBind();
                }
            }
            catch (Exception)
            {
                txtHalaman.Text = (GvLembur.PageIndex + 1).ToString();
            }
        }
Exemplo n.º 4
0
        protected void dsLembur_Inserted(object sender, 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.ToString() + ")";
                e.ExceptionHandled    = true;
            }
            else
            {
                //Catat ke Log
                rtwin.azlib.AddUserAct(Session["UserID"].ToString(), "2431", e.Command.Parameters["@NIP"].Value.ToString() + "," + e.Command.Parameters["@TGL_MASUK"].Value.ToString(), Application["strCn"].ToString());
                ExceptionDetails.Text = "Data telah di simpan";

                GvLembur.DataBind();
            }

            showGridView(true);
        }