Example #1
0
    protected void EmpGroupSal_CheckedChanged(object sender, EventArgs e)
    {
        ViewState["SalaryReportSelected"] = 0;
        if (rbtnGroupSal.Checked)
        {
            pnlEmp.Visible      = false;
            pnlGroupSal.Visible = true;

            DataTable dtGroup = objEmpGroup.GetEmployeeGroup_Master(Session["CompId"].ToString());
            dtGroup = new DataView(dtGroup, "Brand_Id='" + Session["BrandId"].ToString() + "'  and Location_Id='" + Session["LocId"].ToString() + "'", "", DataViewRowState.CurrentRows).ToTable();
            if (dtGroup.Rows.Count > 0)
            {
                lbxGroupSal.DataSource     = dtGroup;
                lbxGroupSal.DataTextField  = "Group_Name";
                lbxGroupSal.DataValueField = "Group_Id";

                lbxGroupSal.DataBind();
            }
            gvEmployeeSal.DataSource = null;
            gvEmployeeSal.DataBind();


            lbxGroupSal_SelectedIndexChanged(null, null);
        }
        else if (rbtnEmpSal.Checked)
        {
            pnlEmp.Visible      = true;
            pnlGroupSal.Visible = false;

            lblEmp.Text          = "";
            lblSelectRecord.Text = "";
            string    GroupIds = string.Empty;
            string    EmpIds   = string.Empty;
            DataTable dtEmp    = objEmp.GetEmployeeMaster(Session["CompId"].ToString());

            dtEmp = new DataView(dtEmp, "Brand_Id='" + Session["BrandId"].ToString() + "'  and Location_Id='" + Session["LocId"].ToString() + "'", "", DataViewRowState.CurrentRows).ToTable();

            if (Session["SessionDepId"] != null)
            {
                dtEmp = new DataView(dtEmp, "Department_Id in(" + Session["SessionDepId"].ToString().Substring(0, Session["SessionDepId"].ToString().Length - 1) + ")", "", DataViewRowState.CurrentRows).ToTable();
            }


            if (dtEmp.Rows.Count > 0)
            {
                Session["dtEmp4"] = dtEmp;

                gvEmployee.DataSource = dtEmp;
                gvEmployee.DataBind();
            }
            else
            {
                gvEmployee.DataSource = null;
                gvEmployee.DataBind();
            }
        }
    }
Example #2
0
    private void FillGrid()
    {
        DataTable dtBrand = objEmpGroup.GetEmployeeGroup_Master(Session["CompId"].ToString().ToString());

        dtBrand = new DataView(dtBrand, "Brand_Id='" + Session["BrandId"].ToString() + "'  and Location_Id='" + Session["LocId"].ToString() + "'", "", DataViewRowState.CurrentRows).ToTable();


        lblTotalRecords.Text = Resources.Attendance.Total_Records + ": " + dtBrand.Rows.Count + "";
        Session["dtGroup"]   = dtBrand;
        Session["dtFilter"]  = dtBrand;
        if (dtBrand != null && dtBrand.Rows.Count > 0)
        {
            GvGroup.DataSource = dtBrand;
            GvGroup.DataBind();
            AllPageCode();
        }
        else
        {
            GvGroup.DataSource = null;
            GvGroup.DataBind();
        }
    }
Example #3
0
    public static string[] GetCompletionListGroupG(string prefixText, int count, string contextKey)
    {
        Set_EmployeeGroup_Master objGroup = new Set_EmployeeGroup_Master();
        DataTable dt = new DataView(objGroup.GetEmployeeGroup_Master(HttpContext.Current.Session["CompId"].ToString()), "Group_Name like '" + prefixText.ToString() + "%'", "", DataViewRowState.CurrentRows).ToTable();

        string[] txt = new string[dt.Rows.Count];

        for (int i = 0; i < dt.Rows.Count; i++)
        {
            txt[i] = dt.Rows[i]["Group_Name"].ToString();
        }
        return(txt);
    }
Example #4
0
    protected void EmpGroup_CheckedChanged(object sender, EventArgs e)
    {
        if (rbtnGroup.Checked)
        {
            Panel4.Visible   = false;
            pnlGroup.Visible = true;

            DataTable dtGroup = objEmpGroup.GetEmployeeGroup_Master(Session["CompId"].ToString());
            dtGroup = new DataView(dtGroup, "Brand_Id='" + Session["BrandId"].ToString() + "'  and Location_Id='" + Session["LocId"].ToString() + "'", "", DataViewRowState.CurrentRows).ToTable();
            if (dtGroup.Rows.Count > 0)
            {
                lbxGroup.DataSource     = dtGroup;
                lbxGroup.DataTextField  = "Group_Name";
                lbxGroup.DataValueField = "Group_Id";

                lbxGroup.DataBind();
            }



            lbxGroup_SelectedIndexChanged(null, null);
        }
        else if (rbtnEmp.Checked)
        {
            Panel4.Visible   = true;
            pnlGroup.Visible = false;

            lblEmp.Text = "";
            string    GroupIds = string.Empty;
            string    EmpIds   = string.Empty;
            DataTable dtEmp    = objEmp.GetEmployeeMaster(Session["CompId"].ToString());

            dtEmp = new DataView(dtEmp, "Brand_Id='" + Session["BrandId"].ToString() + "'  and Location_Id='" + Session["LocId"].ToString() + "'", "", DataViewRowState.CurrentRows).ToTable();



            if (dtEmp.Rows.Count > 0)
            {
                Session["dtEmp"]      = dtEmp;
                gvEmployee.DataSource = dtEmp;
                gvEmployee.DataBind();
            }
        }
    }
    protected void EmpGroup_CheckedChanged(object sender, EventArgs e)
    {
        if (rbtnGroup.Checked)
        {
            pnlEmp.Visible    = false;
            pnlGroup.Visible  = true;
            btnDelete.Visible = true;
            DataTable dtGroup = objEmpGroup.GetEmployeeGroup_Master(Session["CompId"].ToString());
            dtGroup = new DataView(dtGroup, "Brand_Id='" + Session["BrandId"].ToString() + "'  and Location_Id='" + Session["LocId"].ToString() + "'", "", DataViewRowState.CurrentRows).ToTable();
            if (dtGroup.Rows.Count > 0)
            {
                lbxGroup.DataSource     = dtGroup;
                lbxGroup.DataTextField  = "Group_Name";
                lbxGroup.DataValueField = "Group_Id";

                lbxGroup.DataBind();
            }

            DataTable dtHolidayGroup = objHolidayGroup.GetHolidayGroupByHolidayId(Session["CompId"].ToString(), editid.Value);

            if (dtHolidayGroup.Rows.Count > 0)
            {
                for (int i = 0; i < lbxGroup.Items.Count; i++)
                {
                    DataTable dt = new DataView(dtHolidayGroup, "Group_Id='" + lbxGroup.Items[i].Value + "'", "", DataViewRowState.CurrentRows).ToTable();

                    if (dt.Rows.Count > 0)
                    {
                        lbxGroup.Items[i].Selected = true;
                    }
                }
            }

            lbxGroup_SelectedIndexChanged(null, null);
        }
        else if (rbtnEmp.Checked)
        {
            pnlEmp.Visible    = true;
            pnlGroup.Visible  = false;
            btnDelete.Visible = false;
            lblEmp.Text       = "";
            string    GroupIds = string.Empty;
            string    EmpIds   = string.Empty;
            DataTable dtEmp    = objEmp.GetEmployeeMaster(Session["CompId"].ToString());

            dtEmp = new DataView(dtEmp, "Brand_Id='" + Session["BrandId"].ToString() + "'  and Location_Id='" + Session["LocId"].ToString() + "'", "", DataViewRowState.CurrentRows).ToTable();



            //  dtEmpInGroup = new DataView(dtEmpInGroup, "Group_Id in(" + GroupIds.Substring(0, GroupIds.Length - 1) + ")", "", DataViewRowState.CurrentRows).ToTable();

            //for (int i = 0; i < dtEmpInGroup.Rows.Count; i++)
            //{
            //    if (!EmpIds.Split(',').Contains(dtEmpInGroup.Rows[i]["Emp_Id"].ToString()))
            //    {
            //        EmpIds += dtEmpInGroup.Rows[i]["Emp_Id"].ToString() + ",";
            //    }
            //}
            //dtEmp = new DataView(dtEmp, "Emp_Id in(" + EmpIds.Substring(0, EmpIds.Length - 1) + ")", "", DataViewRowState.CurrentRows).ToTable();

            if (dtEmp.Rows.Count > 0)
            {
                Session["dtEmp"]      = dtEmp;
                gvEmployee.DataSource = dtEmp;
                gvEmployee.DataBind();
                lblTotalRecordEmp.Text = Resources.Attendance.Total_Records + " : " + dtEmp.Rows.Count.ToString() + "";



                DataTable dtEmpInGrp = objEmpHoliday.GetEmployeeHolidayMasterById(Session["CompId"].ToString(), editid.Value);



                if (dtEmpInGrp.Rows.Count > 0)
                {
                    for (int i = 0; i < dtEmpInGrp.Rows.Count; i++)
                    {
                        lblEmp.Text += dtEmpInGrp.Rows[i]["Emp_Id"].ToString() + ",";
                    }
                }



                foreach (GridViewRow gvr in gvEmployee.Rows)
                {
                    Label lb = (Label)gvr.FindControl("lblEmpId");
                    if (lblEmp.Text.Split(',').Contains(lb.Text))
                    {
                        if (!lblEmp.Text.Split(',').Contains(lb.Text))
                        {
                            lblEmp.Text += lb.Text + ",";
                        }
                        CheckBox chk = (CheckBox)gvr.FindControl("chkgvSelect");
                        chk.Checked = true;
                    }
                }
            }
        }
    }