Esempio n. 1
0
    private void GetEmployeeDepartment()
    {
        //Declaring COllection class object
        BusinessEntities.RaveHRCollection raveHRCollection = new BusinessEntities.RaveHRCollection();

        //Declaring Master Class Object
        Rave.HR.BusinessLayer.Common.Master master = new Rave.HR.BusinessLayer.Common.Master();

        try
        {
            //Calling Fill dropdown Business layer method to fill
            //the dropdown from Master class.
            raveHRCollection = master.FillDepartmentDropDownBL();

            ddlDepartment.Items.Clear();
            ddlDepartment.DataSource     = raveHRCollection;
            ddlDepartment.DataTextField  = Common.CommonConstants.DDL_DataTextField;
            ddlDepartment.DataValueField = Common.CommonConstants.DDL_DataValueField;
            ddlDepartment.DataBind();
            ddlDepartment.Items.Insert(CommonConstants.ZERO, CommonConstants.SELECT);

            //remove the Dept Name called RaveDevelopment from Dropdown -Vandna
            ddlDepartment.Items.Remove(ddlDepartment.Items.FindByValue(CommonConstants.DeptId_RaveDevelopment.ToString()));

            // 36837-Ambar-Start-28082012
            ddlDepartment.Items.Remove(ddlDepartment.Items.FindByValue(CommonConstants.DeptId_PRESALES_INDIA.ToString()));
            ddlDepartment.Items.Remove(ddlDepartment.Items.FindByValue(CommonConstants.DeptId_PRESALES_UK.ToString()));
            ddlDepartment.Items.Remove(ddlDepartment.Items.FindByValue(CommonConstants.DeptId_PRESALES_USA.ToString()));
            ddlDepartment.Items.Remove(ddlDepartment.Items.FindByValue(CommonConstants.DeptId_RaveForecastedProject.ToString()));
            // 36837-Ambar-End
        }
        catch (RaveHRException ex)
        {
            LogErrorMessage(ex);
        }
        catch (Exception ex)
        {
            RaveHRException objEx = new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, "GetEmployeeDepartment", EventIDConstants.RAVE_HR_EMPLOYEE_PRESENTATION_LAYER);
            LogErrorMessage(objEx);
        }
    }
    /// <summary>
    /// Function will Fill Dropdowns of all the Master Data
    /// </summary>
    private void FillDropDowns()
    {
        try
        {
            //Declaring Master Class Object
            Rave.HR.BusinessLayer.Common.Master master = new Rave.HR.BusinessLayer.Common.Master();

            //Calling Fill dropdown Business layer method to fill the dropdown
            raveHRCollection = master.FillDepartmentDropDownBL();

            //Check Collection object is null or not
            if (raveHRCollection != null)
            {
                //Assign DataSource to dropdown
                ddlDepartment.DataSource = raveHRCollection;

                //Assign DataText Field to dropdown
                ddlDepartment.DataTextField = CommonConstants.DDL_DataTextField;

                //Assign Data Value field to dropdown
                ddlDepartment.DataValueField = CommonConstants.DDL_DataValueField;

                //Bind Dropdown
                ddlDepartment.DataBind();

                //Insert Select as a Item for Dropdown
                ddlDepartment.Items.Insert(CommonConstants.ZERO, CommonConstants.SELECT);

                raveHRCollection.Clear();
            }
        }
        catch (RaveHRException ex)
        {
            throw ex;
        }
        catch (Exception ex)
        {
            throw new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, "FillDropDowns", EventIDConstants.RAVE_HR_MRF_PRESENTATION_LAYER);
        }
    }
Esempio n. 3
0
    //Rakesh : 18/05/2016 Begin
    void BindDepartmentDropdown()
    {
        Rave.HR.BusinessLayer.Common.Master master = new Rave.HR.BusinessLayer.Common.Master();
        try
        {  // Initialise Collection class object
            BusinessEntities.RaveHRCollection raveHRCollection = new BusinessEntities.RaveHRCollection();

            // Initialise Business layer object


            // Call the Business layer method
            raveHRCollection = master.FillDepartmentDropDownBL();

            if (raveHRCollection != null)
            {
                // Assign the data source to dropdown
                ddlDepartment.DataSource = raveHRCollection;

                ddlDepartment.DataTextField  = CommonConstants.DDL_DataTextField;
                ddlDepartment.DataValueField = CommonConstants.DDL_DataValueField;

                // Bind the data to dropdown
                ddlDepartment.DataBind();

                // Default value of dropdown is "Select"
                ddlDepartment.Items.Insert(CommonConstants.ZERO, CommonConstants.SELECT);
            }
        }
        catch (RaveHRException ex)
        {
            throw ex;
        }
        catch (Exception ex)
        {
            throw new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME_MRFRAISEHEADCOUNT, "FillDropDown", EventIDConstants.RAVE_HR_MRF_PRESENTATION_LAYER);
        }
    }
Esempio n. 4
0
    private void GetEmployeeDepartment()
    {
        //Declaring COllection class object
        BusinessEntities.RaveHRCollection raveHRCollection = new BusinessEntities.RaveHRCollection();

        //Declaring Master Class Object
        Rave.HR.BusinessLayer.Common.Master master = new Rave.HR.BusinessLayer.Common.Master();

        try
        {
            //Calling Fill dropdown Business layer method to fill
            //the dropdown from Master class.
            raveHRCollection = master.FillDepartmentDropDownBL();

            DataSet dsDepartment = null;
            Rave.HR.BusinessLayer.FourC.FourC fourCBAL = new Rave.HR.BusinessLayer.FourC.FourC();
            dsDepartment = fourCBAL.GetDepartmentForCreatorApprover();

            ddlDepartment.Items.Clear();
            //ddlDepartment.DataSource = raveHRCollection;
            //ddlDepartment.DataTextField = Common.CommonConstants.DDL_DataTextField;
            //ddlDepartment.DataValueField = Common.CommonConstants.DDL_DataValueField;
            ddlDepartment.DataSource     = dsDepartment;
            ddlDepartment.DataTextField  = dsDepartment.Tables[0].Columns[1].ToString();
            ddlDepartment.DataValueField = dsDepartment.Tables[0].Columns[0].ToString();
            ddlDepartment.DataBind();
            ddlDepartment.Items.Insert(CommonConstants.ZERO, CommonConstants.SELECT);

            //remove the Dept Name
            ddlDepartment.Items.Remove(ddlDepartment.Items.FindByValue(CommonConstants.DeptId_RaveDevelopment.ToString()));
            ddlDepartment.Items.Remove(ddlDepartment.Items.FindByText(CommonConstants.PRESALES_USA.ToString()));
            ddlDepartment.Items.Remove(ddlDepartment.Items.FindByText(CommonConstants.PRESALES_UK.ToString()));
            ddlDepartment.Items.Remove(ddlDepartment.Items.FindByText(CommonConstants.PRESALES_INDIA.ToString()));
            ddlDepartment.Items.Remove(ddlDepartment.Items.FindByText(CommonConstants.RAVECONSULTANT_USA.ToString()));
            ddlDepartment.Items.Remove(ddlDepartment.Items.FindByText(CommonConstants.RAVECONSULTANT_UK.ToString()));
            ddlDepartment.Items.Remove(ddlDepartment.Items.FindByText(CommonConstants.RAVEFORCASTEDPROJECT.ToString()));
            ddlDepartment.Items.Remove(ddlDepartment.Items.FindByText(CommonConstants.SALES_DEPARTMENT.ToString()));
            ddlDepartment.Items.Remove(ddlDepartment.Items.FindByText(CommonConstants.Senior_Mgt_DEPARTMENT.ToString()));
            ddlDepartment.Items.Remove(ddlDepartment.Items.FindByText(CommonConstants.Project_Mentee2010_DEPARTMENT.ToString()));

            ddlDepartmentFilter.DataSource     = raveHRCollection;
            ddlDepartmentFilter.DataTextField  = Common.CommonConstants.DDL_DataTextField;
            ddlDepartmentFilter.DataValueField = Common.CommonConstants.DDL_DataValueField;
            ddlDepartmentFilter.DataBind();
            ddlDepartmentFilter.Items.Insert(CommonConstants.ZERO, CommonConstants.SELECT);

            //remove the Dept Name
            ddlDepartmentFilter.Items.Remove(ddlDepartmentFilter.Items.FindByValue(CommonConstants.DeptId_RaveDevelopment.ToString()));
            ddlDepartmentFilter.Items.Remove(ddlDepartmentFilter.Items.FindByText(CommonConstants.PRESALES_USA.ToString()));
            ddlDepartmentFilter.Items.Remove(ddlDepartmentFilter.Items.FindByText(CommonConstants.PRESALES_UK.ToString()));
            ddlDepartmentFilter.Items.Remove(ddlDepartmentFilter.Items.FindByText(CommonConstants.PRESALES_INDIA.ToString()));
            ddlDepartmentFilter.Items.Remove(ddlDepartmentFilter.Items.FindByText(CommonConstants.RAVECONSULTANT_USA.ToString()));
            ddlDepartmentFilter.Items.Remove(ddlDepartmentFilter.Items.FindByText(CommonConstants.RAVECONSULTANT_UK.ToString()));
            ddlDepartmentFilter.Items.Remove(ddlDepartmentFilter.Items.FindByText(CommonConstants.RAVEFORCASTEDPROJECT.ToString()));
            ddlDepartmentFilter.Items.Remove(ddlDepartmentFilter.Items.FindByText(CommonConstants.SALES_DEPARTMENT.ToString()));
            ddlDepartmentFilter.Items.Remove(ddlDepartmentFilter.Items.FindByText(CommonConstants.Senior_Mgt_DEPARTMENT.ToString()));
            ddlDepartmentFilter.Items.Remove(ddlDepartmentFilter.Items.FindByText(CommonConstants.Project_Mentee2010_DEPARTMENT.ToString()));

            ddlDepartment.Enabled = true;
        }
        catch (RaveHRException ex)
        {
            LogErrorMessage(ex);
        }
        catch (Exception ex)
        {
            RaveHRException objEx = new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, "GetEmployeeDepartment", EventIDConstants.RAVE_HR_EMPLOYEE_PRESENTATION_LAYER);
            LogErrorMessage(objEx);
        }
    }
Esempio n. 5
0
    protected void grdvCreatorApprover_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        lblMessage.Visible = false;



        if (e.CommandName == "Edt")
        {
            GridViewRow row            = (GridViewRow)((Control)e.CommandSource).NamingContainer;
            HiddenField HfProjectId    = (HiddenField)row.FindControl("hfProjectId");
            HiddenField HfDepartmentId = (HiddenField)row.FindControl("HfDepartmentId");
            HiddenField HfCreatorGrd   = (HiddenField)row.FindControl("HfCreatorGrd");
            HiddenField HfReviewerGrd  = (HiddenField)row.FindControl("HfReviewerGrd");

            btnAdd.Enabled    = false;
            btnUpdate.Enabled = true;

            HfCreator.Value  = HfCreatorGrd.Value;
            HfReviewer.Value = HfReviewerGrd.Value;

            txtCreator.Text  = row.Cells[2].Text;
            txtReviewer.Text = row.Cells[3].Text;

            //Declaring COllection class object
            BusinessEntities.RaveHRCollection   raveHRCollection = new BusinessEntities.RaveHRCollection();
            Rave.HR.BusinessLayer.Common.Master master           = new Rave.HR.BusinessLayer.Common.Master();
            raveHRCollection = master.FillDepartmentDropDownBL();

            ddlDepartment.Items.Clear();
            ddlDepartment.DataSource     = raveHRCollection;
            ddlDepartment.DataTextField  = Common.CommonConstants.DDL_DataTextField;
            ddlDepartment.DataValueField = Common.CommonConstants.DDL_DataValueField;
            ddlDepartment.DataBind();
            ddlDepartment.Items.Insert(CommonConstants.ZERO, CommonConstants.SELECT);


            ddlDepartment.SelectedValue = HfDepartmentId.Value;

            if (HfDepartmentId.Value == "1")
            {
                ddlProject.Enabled = true;

                Rave.HR.BusinessLayer.MRF.MRFDetail mrfProjectName = new Rave.HR.BusinessLayer.MRF.MRFDetail();
                raveHRCollection = mrfProjectName.GetProjectName();

                ddlProject.Items.Clear();
                ddlProject.DataSource     = raveHRCollection;
                ddlProject.DataTextField  = CommonConstants.DDL_DataTextField;
                ddlProject.DataValueField = CommonConstants.DDL_DataValueField;

                // Bind the data to dropdown
                ddlProject.DataBind();
                // Default value of dropdown is "Select"
                ddlProject.Items.Insert(CommonConstants.ZERO, CommonConstants.SELECT);


                if (!string.IsNullOrEmpty(HfProjectId.Value))
                {
                    ddlProject.SelectedValue = HfProjectId.Value;
                }
            }
            else
            {
                ddlProject.SelectedItem.Text = "SELECT";
            }

            ddlDepartment.Enabled = false;
            ddlProject.Enabled    = false;
        }
        else if (e.CommandName == "Del")
        {
            try
            {
                if (rblAdminSelectionOption.SelectedIndex == 0)
                {
                    GridViewRow row            = (GridViewRow)((Control)e.CommandSource).NamingContainer;
                    HiddenField HfProjectId    = (HiddenField)row.FindControl("hfProjectId");
                    HiddenField HfDepartmentId = (HiddenField)row.FindControl("HfDepartmentId");
                    HiddenField HfCreatorGrd   = (HiddenField)row.FindControl("HfCreatorGrd");
                    HiddenField HfReviewerGrd  = (HiddenField)row.FindControl("HfReviewerGrd");


                    Rave.HR.BusinessLayer.FourC.FourC fourCBAL = new Rave.HR.BusinessLayer.FourC.FourC();
                    int depId  = int.Parse(HfDepartmentId.Value);
                    int projId = 0;

                    if (depId == 1)
                    {
                        projId = int.Parse(HfProjectId.Value);
                    }


                    fourCBAL.AddUpdateDeleteCreatorReviewer(depId, projId, HfCreator.Value, HfReviewer.Value, UserMailId, "Delete");
                    FillCreatorApproverData();

                    ClearControl();

                    lblMessage.Visible        = true;
                    lblMessage.Text           = "Data Deleted Successfully!!!.";
                    lblMessage.Style["color"] = "blue";
                }
                else
                {
                    GridViewRow   row          = (GridViewRow)((Control)e.CommandSource).NamingContainer;
                    HiddenField   HfCreatorGrd = (HiddenField)row.FindControl("HfCreatorGrd");
                    List <string> ls           = new List <string> {
                    };
                    ls.Add(HfCreatorGrd.Value);

                    if (ls.Count > 0 && !string.IsNullOrEmpty(HfCreatorGrd.Value))
                    {
                        Rave.HR.BusinessLayer.FourC.FourC fourCBAL = new Rave.HR.BusinessLayer.FourC.FourC();
                        fourCBAL.AddDeleteViewAccessRights(ls, UserMailId, "Delete");

                        getEmployeeData();

                        lblMessage.Visible        = true;
                        lblMessage.Text           = "Data Added Successfully!!!.";
                        lblMessage.Style["color"] = "blue";
                    }
                }
            }
            catch (RaveHRException ex)
            {
                LogErrorMessage(ex);
            }
            catch (Exception ex)
            {
                RaveHRException objEx = new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, "grdvCreatorApprover_RowCommand", EventIDConstants.RAVE_HR_PROJECTS_PRESENTATION_LAYER);
                LogErrorMessage(objEx);
            }
        }
    }