Example #1
0
    private void BindProjectData(int deptId, int projectId, int month, int year)
    {
        int empId = int.Parse(ViewState["LoginEmpId"].ToString());

        grdEmpDetails.Visible = true;
        dsEmpDeatils          = new DataSet();
        Rave.HR.BusinessLayer.FourC.FourC fourCBAL = new Rave.HR.BusinessLayer.FourC.FourC();


        dsEmpDeatils             = fourCBAL.Get4CViewFeedbackDeatils(deptId, projectId, month, year, empId, int.Parse(ViewState["LoginEmpId"].ToString()), "");
        grdEmpDetails.DataSource = dsEmpDeatils.Tables[0];
        grdEmpDetails.DataBind();


        if (dsEmpDeatils != null && dsEmpDeatils.Tables[0].Rows.Count > 0)
        {
            int count = dsEmpDeatils.Tables[0].Rows.Count;
            if (count <= 2)
            {
                divGridViewEmpDetails.Style.Add("height", "120px");
            }
            else if (count <= 5)
            {
                divGridViewEmpDetails.Style.Add("height", "220px");
            }
            else if (count <= 7)
            {
                divGridViewEmpDetails.Style.Add("height", "240px");
            }
            else if (count >= 8)
            {
                divGridViewEmpDetails.Style.Add("height", "450px");
            }
        }
    }
    private void BindProjectData(int deptId, int projectId, int month, int year)
    {
        int empId = 0;

        if (ddlEmployee.SelectedIndex > 0)
        {
            empId = int.Parse(ddlEmployee.SelectedItem.Value);
        }
        grdEmpDetails.Visible = true;
        dsEmpDeatils          = new DataSet();
        Rave.HR.BusinessLayer.FourC.FourC fourCBAL = new Rave.HR.BusinessLayer.FourC.FourC();

        //if (ViewState["AllowDirectSubmit"] != null && !string.IsNullOrEmpty(ViewState["AllowDirectSubmit"].ToString()) && projectId == 0)
        //{
        //    dsEmpDeatils = fourCBAL.Get4CCreatorDeatils(month, year, fourCRole, UserMailId);
        //}
        //else
        //{
        //    dsEmpDeatils = fourCBAL.Get4CEmployeeDeatils(projectId, month, year, fourCRole, empId);
        //}

        dsEmpDeatils             = fourCBAL.Get4CViewFeedbackDeatils(deptId, projectId, month, year, empId, int.Parse(ViewState["LoginEmpId"].ToString()), ViewState["FourCRole"].ToString());
        grdEmpDetails.DataSource = dsEmpDeatils.Tables[0];
        grdEmpDetails.DataBind();


        if (dsEmpDeatils != null && dsEmpDeatils.Tables[0].Rows.Count > 0)
        {
            int count = dsEmpDeatils.Tables[0].Rows.Count;
            if (count <= 2)
            {
                divGridViewEmpDetails.Style.Add("height", "120px");
            }
            else if (count <= 5)
            {
                divGridViewEmpDetails.Style.Add("height", "220px");
            }
            else if (count <= 7)
            {
                divGridViewEmpDetails.Style.Add("height", "240px");
            }
            else if (count >= 8)
            {
                divGridViewEmpDetails.Style.Add("height", "280px");
            }
        }


        if (empId == 0)
        {
            ddlEmployee.ClearSelection();
            ddlEmployee.Items.Clear();
            //ddlEmployee.DataSource = dsEmpDeatils.Tables[0];

            //ddlEmployee.DataTextField = dsEmpDeatils.Tables[0].Columns[0].ToString();
            //ddlEmployee.DataValueField = dsEmpDeatils.Tables[0].Columns[2].ToString();
            //ddlEmployee.DataBind();
            int funmanagerLoginId = 0;

            if (ViewState["FourCRole"].ToString().Trim() == MasterEnum.FourCRole.RMS_FUNCTIONALMANAGER.ToString())
            {
                funmanagerLoginId = int.Parse(ViewState["LoginEmpId"].ToString());
            }

            DataSet dsEmp = fourCBAL.Get4CViewEmployeeFromRMS(deptId, projectId, month, year, funmanagerLoginId);
            ddlEmployee.DataSource     = dsEmp;
            ddlEmployee.DataTextField  = dsEmp.Tables[0].Columns[1].ToString();
            ddlEmployee.DataValueField = dsEmp.Tables[0].Columns[0].ToString();
            ddlEmployee.DataBind();

            ddlEmployee.Items.Insert(0, new ListItem(CommonConstants.SELECT, CommonConstants.ZERO.ToString()));
        }
    }