Ejemplo n.º 1
0
 protected void btnRefresh_Click(object sender, EventArgs e)
 {
     if (Page.IsValid)
     {
         GvKaryawan.DataBind();
     }
 }
 protected void GvKaryawan_RowEditing(object sender, System.Web.UI.WebControls.GridViewEditEventArgs e)
 {
     if (Page.IsValid)
     {
         GvKaryawan.EditIndex = e.NewEditIndex;
         GvKaryawan.DataBind();
         //this.ScriptManager1.SetFocus(GvBranch.Rows[e.NewEditIndex].Cells[1].FindControl("txtCol1Edit").ClientID);
     }
     else
     {
         e.Cancel = true;
     }
 }
        protected void btnRefresh_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                //    string strFilter = "";
                //   strFilter += "where BULAN=";

                //  strFilter += " WHERE NIP = '" + txtFilterItem0.Text + "'";
                // dsKaryawan.SelectCommand += strFilter;
                GvKaryawan.DataBind();
                GvKaryawan.Visible = true;
                // GvKaryawan.DataBind();
            }
        }
 protected void dsKaryawanManajemen_Updated(object sender, SqlDataSourceStatusEventArgs e)
 {
     //Seleksi apakah terjadi error atau tidak
     //jika tidak ada record yang ter update maka terjadi error
     if (e.AffectedRows == 0)
     {
         ExceptionDetails.Text = e.Exception.Message;
         e.ExceptionHandled    = true;
     }
     else
     {
         //Catat ke Log
         rtwin.azlib.AddUserAct(Session["UserID"].ToString(), "1302", e.Command.Parameters["@NIP"].Value.ToString(), Application["strCn"].ToString());
     }
     GvKaryawan.DataBind();
     showGridView(true);
 }
        protected void txtHalaman_TextChanged(object sender, EventArgs e)
        {
            GridViewRow rowPager   = GvKaryawan.BottomPagerRow;
            TextBox     txtHalaman = (TextBox)(rowPager.Cells[0].FindControl("txtHalaman"));

            try
            {
                if (int.Parse(txtHalaman.Text) <= GvKaryawan.PageCount + 1 && int.Parse(txtHalaman.Text) > 0)
                {
                    GvKaryawan.PageIndex = (int.Parse(txtHalaman.Text)) - 1;
                    GvKaryawan.DataBind();
                }
            }
            catch (Exception ex)
            {
                txtHalaman.Text = (GvKaryawan.PageIndex + 1).ToString();
            }
        }
        protected void btnRefresh_Click(object sender, EventArgs e)
        {
            /* dsKaryawan.SelectCommand = "SELECT NIP, NAMA,NAMA_CABANG,STATUS_PENSIUN from taRapelTK where BULAN = '" + Session["iBulan"].ToString() + "' AND TAHUN= '" + Session["iTahun"].ToString() + "'";
             * if (txtFilterItem0.Text.Trim() != "")
             * {
             *   lblTitle.Text = txtFilterItem0.Text;
             * }*/
            /* if (ddlFilterItem1.SelectedValue != "---")
             * {
             *   dsKaryawan.SelectCommand += "AND KODE_CABANG ='" + ddlFilterItem1.SelectedValue + "'";
             *   GvKaryawan.DataBind();
             * }*/

            /* if (txtFilterItem0.Text.Trim() != "")
             * {
             *   string strFilter = "";
             *   strFilter += " AND (NIP = '" + txtFilterItem0.Text.Replace("'", "''") + "')";
             *   Response.Write(strFilter);
             * }*/
            // showGridView(false);
            //   Label24.Text = txtFilterItem0.Text;
            dsKaryawan.SelectCommand += "AND NIP='" + txtFilterItem0.Text + "'";
            GvKaryawan.DataBind();
        }
 protected void ddlFilterItem1_SelectedIndexChanged(object sender, EventArgs e)
 {
     dsKaryawan.SelectCommand += "AND KODE_CABANG='" + ddlFilterItem1.SelectedValue + "'";
     GvKaryawan.DataBind();
 }