예제 #1
0
    protected void GvQualificationBin_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        GvQualificationBin.PageIndex = e.NewPageIndex;

        DataTable dt = (DataTable)Session["dtBinFilter"];

        GvQualificationBin.DataSource = dt;
        GvQualificationBin.DataBind();
        AllPageCode();
        string temp = string.Empty;


        for (int i = 0; i < GvQualificationBin.Rows.Count; i++)
        {
            Label    lblconid = (Label)GvQualificationBin.Rows[i].FindControl("lblQualiId");
            string[] split    = lblSelectedRecord.Text.Split(',');

            for (int j = 0; j < lblSelectedRecord.Text.Split(',').Length; j++)
            {
                if (lblSelectedRecord.Text.Split(',')[j] != "")
                {
                    if (lblconid.Text.Trim().ToString() == lblSelectedRecord.Text.Split(',')[j].Trim().ToString())
                    {
                        ((CheckBox)GvQualificationBin.Rows[i].FindControl("chkgvSelect")).Checked = true;
                    }
                }
            }
        }
    }
예제 #2
0
    protected void GvQualificationBin_OnSorting(object sender, GridViewSortEventArgs e)
    {
        HDFSortbin.Value = HDFSortbin.Value == "ASC" ? "DESC" : "ASC";
        DataTable dt = new DataTable();

        dt = objDesg.GetQualificationMasterInactive(Session["CompId"].ToString().ToString());
        DataView dv    = new DataView(dt);
        string   Query = "" + e.SortExpression + " " + HDFSortbin.Value + "";

        dv.Sort = Query;
        dt      = dv.ToTable();
        Session["dtBinFilter"]        = dt;
        GvQualificationBin.DataSource = dt;
        GvQualificationBin.DataBind();
        lblSelectedRecord.Text = "";
        AllPageCode();
    }
예제 #3
0
    protected void ImgbtnSelectAll_Click(object sender, ImageClickEventArgs e)
    {
        DataTable dtQualification = (DataTable)Session["dtbinFilter"];

        if (ViewState["Select"] == null)
        {
            ViewState["Select"] = 1;
            foreach (DataRow dr in dtQualification.Rows)
            {
                if (!lblSelectedRecord.Text.Split(',').Contains(dr["Qualification_ID"]))
                {
                    lblSelectedRecord.Text += dr["Qualification_ID"] + ",";
                }
            }
            for (int i = 0; i < GvQualificationBin.Rows.Count; i++)
            {
                string[] split    = lblSelectedRecord.Text.Split(',');
                Label    lblconid = (Label)GvQualificationBin.Rows[i].FindControl("lblQualiId");
                for (int j = 0; j < lblSelectedRecord.Text.Split(',').Length; j++)
                {
                    if (lblSelectedRecord.Text.Split(',')[j] != "")
                    {
                        if (lblconid.Text.Trim().ToString() == lblSelectedRecord.Text.Split(',')[j].Trim().ToString())
                        {
                            ((CheckBox)GvQualificationBin.Rows[i].FindControl("chkgvSelect")).Checked = true;
                        }
                    }
                }
            }
        }
        else
        {
            lblSelectedRecord.Text = "";
            DataTable dtQualification1 = (DataTable)Session["dtBinFilter"];
            GvQualificationBin.DataSource = dtQualification1;
            GvQualificationBin.DataBind();
            ViewState["Select"] = null;
        }
    }
예제 #4
0
    protected void btnbindBin_Click(object sender, EventArgs e)
    {
        string condition = string.Empty;

        if (ddlOptionBin.SelectedIndex != 0)
        {
            if (ddlOptionBin.SelectedIndex == 1)
            {
                condition = "convert(" + ddlFieldNameBin.SelectedValue + ",System.String)='" + txtValueBin.Text + "'";
            }
            else if (ddlOptionBin.SelectedIndex == 2)
            {
                condition = "convert(" + ddlFieldNameBin.SelectedValue + ",System.String) like '%" + txtValueBin.Text + "%'";
            }
            else
            {
                condition = "convert(" + ddlFieldNameBin.SelectedValue + ",System.String) Like '" + txtValueBin.Text + "%'";
            }

            DataTable dtCust = (DataTable)Session["dtBinQualification"];
            DataView  view   = new DataView(dtCust, condition, "", DataViewRowState.CurrentRows);
            Session["dtBinFilter"]        = view.ToTable();
            lblTotalRecordsBin.Text       = Resources.Attendance.Total_Records + " : " + view.ToTable().Rows.Count.ToString() + "";
            GvQualificationBin.DataSource = view.ToTable();
            GvQualificationBin.DataBind();

            lblSelectedRecord.Text = "";
            if (view.ToTable().Rows.Count == 0)
            {
                imgBtnRestore.Visible   = false;
                ImgbtnSelectAll.Visible = false;
            }
            else
            {
                AllPageCode();
            }
            System.Web.UI.ScriptManager.GetCurrent(this).SetFocus(txtValueBin);
        }
    }
예제 #5
0
    public void FillGridBin()
    {
        DataTable dt = new DataTable();

        dt = objDesg.GetQualificationMasterInactive(Session["CompId"].ToString().ToString());
        GvQualificationBin.DataSource = dt;
        GvQualificationBin.DataBind();
        Session["dtBinQualification"] = dt;
        Session["dtBinFilter"]        = dt;
        lblTotalRecordsBin.Text       = Resources.Attendance.Total_Records + ": " + dt.Rows.Count.ToString() + "";

        lblSelectedRecord.Text = "";
        if (dt.Rows.Count == 0)
        {
            imgBtnRestore.Visible   = false;
            ImgbtnSelectAll.Visible = false;
        }
        else
        {
            AllPageCode();
        }
    }