Exemplo n.º 1
0
    /// <summary>
    /// Get billing value
    /// </summary>
    private int GetBillingValue(int RPDurationId)
    {
        int billing = 0;

        BusinessEntities.ResourcePlan objBERPDurationDetail = new BusinessEntities.ResourcePlan();
        objBERPDurationDetail.ResourcePlanDurationId = RPDurationId;
        objBERPDurationDetail.Mode               = "EDIT";
        objBERPDurationDetail.RPDEdited          = false; //--false -RP details edited which is not commited
        objBERPDurationDetail.RPDDeletedStatusId = Convert.ToInt32(MasterEnum.RPDetailEditionStatus.Deleted);

        Rave.HR.BusinessLayer.Projects.ResourcePlan objBLLRPDurationDetail = new Rave.HR.BusinessLayer.Projects.ResourcePlan();

        RaveHRCollection objListRPDurationDetail = new RaveHRCollection();

        objListRPDurationDetail = objBLLRPDurationDetail.GetRPDurationDetail(objBERPDurationDetail);

        //loops through objListRPDurationDetail collection object to get billing value
        foreach (BusinessEntities.ResourcePlan ObjRP in objListRPDurationDetail)
        {
            if (billing != 0)
            {
                billing = billing + Convert.ToInt32(ObjRP.Billing);
            }
            else
            {
                billing = Convert.ToInt32(ObjRP.Billing);
            }
        }

        return(billing);
    }
Exemplo n.º 2
0
    /// <summary>
    /// Repeater Item Bound
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void rptData_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        try
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                BusinessEntities.ResourcePlan objBERPDurationDetail = new BusinessEntities.ResourcePlan();
                objBERPDurationDetail.ResourcePlanDurationId = Convert.ToInt32(((BusinessEntities.ResourcePlan)e.Item.DataItem).ResourcePlanDurationId);
                objBERPDurationDetail.Mode               = "EDIT";
                objBERPDurationDetail.RPDEdited          = false; //--false -RP details edited which is not commited
                objBERPDurationDetail.RPDDeletedStatusId = Convert.ToInt32(MasterEnum.RPDetailEditionStatus.Deleted);

                Rave.HR.BusinessLayer.Projects.ResourcePlan objBLLRPDurationDetail = new Rave.HR.BusinessLayer.Projects.ResourcePlan();

                RaveHRCollection objListRPDurationDetail = new RaveHRCollection();
                objListRPDurationDetail = objBLLRPDurationDetail.GetRPDurationDetail(objBERPDurationDetail);

                ((HiddenField)e.Item.FindControl("hfRPDetailId")).Value       = ((ResourcePlan)objListRPDurationDetail.Item(0)).RPDId.ToString();
                ((HiddenField)e.Item.FindControl("hfUtilization")).Value      = ((ResourcePlan)objListRPDurationDetail.Item(0)).Utilization.ToString();
                ((HiddenField)e.Item.FindControl("hfBilling")).Value          = ((ResourcePlan)objListRPDurationDetail.Item(0)).Billing.ToString();
                ((HiddenField)e.Item.FindControl("hfResourceLocation")).Value = ((ResourcePlan)objListRPDurationDetail.Item(0)).ResourceLocation.ToString();
                ((HiddenField)e.Item.FindControl("hfProjectLocation")).Value  = ((ResourcePlan)objListRPDurationDetail.Item(0)).ProjectLocation.ToString();
            }
        }
        catch (RaveHRException ex)
        {
            LogErrorMessage(ex);
        }
        catch (Exception ex)
        {
            RaveHRException objEx = new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME_RP, "rptData_ItemDataBound", EventIDConstants.RAVE_HR_MRF_PRESENTATION_LAYER);
            LogErrorMessage(objEx);
        }
    }
Exemplo n.º 3
0
    /// <summary>
    /// Returns MRF Details whose status is pending allocation for GridView
    /// </summary>
    /// <returns>List</returns>
    private RaveHRCollection GetListOfInternalResource()
    {
        RaveHRCollection objListMRFDetails = new RaveHRCollection();

        try
        {
            if (Session[SessionNames.MRFDetail] != null)
            {
                mrfDetail = (MRFDetail)Session[SessionNames.MRFDetail];
            }
            else
            {
                mrfDetail = new MRFDetail();
            }

            objParameterCriteria.PageSize = 10;
            objListMRFDetails             = Rave.HR.BusinessLayer.MRF.MRFDetail.GetMRFInternalResource(mrfDetail, txtResourceName.Text.Trim(), objParameterCriteria, ref pageCount);
            Session[PAGE_COUNT]           = pageCount;
        }
        //catches RaveHRException exception
        catch (RaveHRException ex)
        {
            throw ex;
        }
        catch (Exception ex)
        {
            throw new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, "GetListOfInternalResource", EventIDConstants.RAVE_HR_RP_PRESENTATION_LAYER);
        }
        return(objListMRFDetails);
    }
Exemplo n.º 4
0
    /// <summary>
    /// get allocated resource by projectId
    /// </summary>
    public RaveHRCollection GetAllocatedResourceByProjectId()
    {
        try
        {
            objDAResourcePlan = new DataAccessClass();
            objDAResourcePlan.OpenConnection(ConfigurationManager.ConnectionStrings["RaveHRConnectionString"].ConnectionString);
            objReader = objDAResourcePlan.ExecuteReaderSP("USP_ResourcePlan_GetPracticeTeamAllocationDetails");
            RaveHRCollection objListGetResourcePlan = new RaveHRCollection();

            BusinessEntities.Employee objBEEmployee = null;
            while (objReader.Read())
            {
                objBEEmployee             = new BusinessEntities.Employee();
                objBEEmployee.FullName    = objReader["EmployeeName"].ToString();
                objBEEmployee.Designation = objReader["Designation"].ToString();
                objBEEmployee.Department  = objReader["ResourceBU"].ToString();
                objBEEmployee.ProjectName = objReader["ProjectName"].ToString();
                string str  = objReader["NoOfDaysBilled"].ToString();
                string str1 = objReader["NoOfDaysUtilized"].ToString();
                objBEEmployee.NoOfDaysBilled        = double.Parse(objReader["NoOfDaysBilled"].ToString());
                objBEEmployee.NoOfDaysUtilised      = double.Parse(objReader["NoOfDaysUtilized"].ToString());
                objBEEmployee.TotalNoOfDaysBilled   = double.Parse(objReader["TotalNoOfDaysBilled"].ToString());
                objBEEmployee.TotalNoOfDaysUtilised = double.Parse(objReader["TotalNoOfDaysUtilised"].ToString());

                objListGetResourcePlan.Add(objBEEmployee);
            }

            //--
            return(objListGetResourcePlan);
        }
        //catches genral exception
        catch (Exception ex)
        {
            throw ex;
        }
        //close datareader and connection
        finally
        {
            //checks if datareader is null
            if (objReader != null)
            {
                //close datareader
                objReader.Close();
            }

            //close connection
            objDAResourcePlan.CloseConncetion();
        }
    }
Exemplo n.º 5
0
    /// <summary>
    /// Sort GridView
    /// </summary>
    private void SortGridView(string sortExpression, string direction)
    {
        try
        {
            if (sortExpression == RESOURCE_NAME)
            {
                objParameterCriteria.SortExpressionAndDirection = sortExpression + direction;
            }
            else
            {
                objParameterCriteria.SortExpressionAndDirection = sortExpression + direction;
            }
            objListSort = GetListOfInternalResource();
            if (Session[PAGE_COUNT] != null)
            {
                if ((int.Parse(Session[PAGE_COUNT].ToString()) == 1) && (objListSort.Count == 1))
                {
                    grdvListofInternalResource.AllowSorting = false;
                }
                else
                {
                    grdvListofInternalResource.AllowSorting = true;
                }
            }

            if (objListSort.Count == 0)
            {
                grdvListofInternalResource.DataSource = objListSort;
                grdvListofInternalResource.DataBind();
                ShowHeaderWhenEmptyGrid(objListSort);
            }
            else
            {
                //Bind the Grid View in Sorted order
                grdvListofInternalResource.DataSource = objListSort;
                grdvListofInternalResource.DataBind();
            }
        }
        //catches RaveHRException exception
        catch (RaveHRException ex)
        {
            throw ex;
        }
        catch (Exception ex)
        {
            throw new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, "SortGridView", EventIDConstants.RAVE_HR_RP_PRESENTATION_LAYER);
        }
    }
    /// <summary>
    /// Returns MRF Details whose status is pending allocation for GridView
    /// </summary>
    /// <returns>List</returns>
    private RaveHRCollection GetListOfInternalResource()
    {
        RaveHRCollection objListMRFDetails = new RaveHRCollection();

        try
        {
            if (grdvListofInternalResource.BottomPagerRow != null)
            {
                GridViewRow gvrPager = grdvListofInternalResource.BottomPagerRow;
                TextBox     txtPages = (TextBox)gvrPager.Cells[0].FindControl(TXT_PAGES);
                if (txtPages.Text != "" && int.Parse(txtPages.Text) != 0 && Convert.ToInt32(txtPages.Text) <= Convert.ToInt32(Session[PAGE_COUNT].ToString()))
                {
                    objParameterCriteria.PageNumber = int.Parse(txtPages.Text);
                }
            }
            else
            {
                objParameterCriteria.PageNumber = 1;
            }
            if (Session[SessionNames.MRFDetail] != null)
            {
                mrfDetail = (MRFDetail)Session[SessionNames.MRFDetail];
            }
            else
            {
                mrfDetail = new MRFDetail();
            }
            if (ViewState[DEPARTMENT] != null)
            {
                departmentID = (int)ViewState[DEPARTMENT];
            }
            objParameterCriteria.PageSize = 10;
            objListMRFDetails             = Rave.HR.BusinessLayer.MRF.MRFDetail.GetListOfInternalResource(mrfDetail, departmentID, objParameterCriteria, ref pageCount);
            Session[PAGE_COUNT]           = pageCount;
        }
        //catches RaveHRException exception
        catch (RaveHRException ex)
        {
            throw ex;
        }
        catch (Exception ex)
        {
            throw new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, "GetListOfInternalResource", EventIDConstants.RAVE_HR_RP_PRESENTATION_LAYER);
        }
        return(objListMRFDetails);
    }
Exemplo n.º 7
0
    /// <summary>
    /// Method to get total billing
    /// </summary>
    private void GetTotalBilling(RaveHRCollection objListResourcePlan)
    {
        //loops through gridview to get totalbilling.
        foreach (BusinessEntities.ResourcePlanDuration objlist in objListResourcePlan)
        {
            //assign rp billing to totalBilling variable
            if (totalBilling != 0)
            {
                //assign billing value
                totalBilling = totalBilling + GetBillingValue(Convert.ToInt32(objlist.ResourcePlanDurationId));
            }
            else
            {
                //assign billing value
                totalBilling = GetBillingValue(Convert.ToInt32(objlist.ResourcePlanDurationId));
            }
        }

        //assign billing value in viewstate
        ViewState[RESOURCEBILLING] = totalBilling;
    }
Exemplo n.º 8
0
        /// <summary>
        /// Send mail for save projects.
        /// </summary>
        /// <param name="contractData">contract details</param>
        /// <param name="listProjectDetails">project deatils</param>
        /// <param name="allProjectsName">all associated projects</param>
        private void SendMailForEditContract(BusinessEntities.Contract contractDetails,
                                             List <BusinessEntities.ContractProject> listProjectDetails,
                                             string allProjectsName, RaveHRCollection ContractCRdetails)
        {
            try
            {
                IRMSEmail obj = new RMSEmail(Convert.ToInt16(EnumsConstants.RMSModule.Contract),
                                             Convert.ToInt16(EnumsConstants.EmailFunctionality.EditedContract));

                obj.CC.Add(contractDetails.EmailID);

                obj.Subject = string.Format(obj.Subject, contractDetails.ContractCode,
                                            contractDetails.ContractReferenceID,
                                            contractDetails.ContractClientName,
                                            allProjectsName);
                if (ContractCRdetails.Count == 0)
                {
                    obj.Subject = obj.Subject.Replace(", new Change Request added", string.Empty);
                }

                obj.Body = string.Format(obj.Body, contractDetails.ContractCode,
                                         contractDetails.ContractReferenceID,
                                         contractDetails.ContractClientName,
                                         GetHTMLForCRTableData(ContractCRdetails),
                                         GetHTMLForTableData(listProjectDetails),
                                         GetLinkForEmail(contractDetails.ContractID),
                                         //ambar Issue Id:26114
                                         GetHTMLForContractEditedTableData(contractDetails)
                                         );
                obj.SendEmail(obj);
            }
            catch (RaveHRException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw new RaveHRException(ex.Message, ex, Sources.BusinessLayer, CONTRACT, "SendMailForSaveContract", EventIDConstants.RAVE_HR_CONTRACT_BUSNIESS_LAYER);
            }
        }
Exemplo n.º 9
0
    /// <summary>
    /// Returns Resource Plan data for GridView
    /// </summary>
    /// <returns>List</returns>
    private RaveHRCollection GetResourcePlanList(string direction)
    {
        RaveHRCollection objListGetResourcePlan = null;

        try
        {
            //--Fill entiry
            BusinessEntities.ResourcePlan objBEResourcePlan = new BusinessEntities.ResourcePlan();
            objBEResourcePlan.RPId = Convert.ToInt32(Request.QueryString["rid"].ToString());
            objBEResourcePlan.RPDuDeletedStatusId = Convert.ToInt32(MasterEnum.RPDurationEditionStatus.Deleted);
            objBEResourcePlan.RPDDeletedStatusId  = Convert.ToInt32(MasterEnum.RPDetailEditionStatus.Deleted);
            objBEResourcePlan.PageSize            = PAGE_SIZE;
            objBEResourcePlan.PageNumber          = 1;
            //--Sort Expression
            objBEResourcePlan.SortExpression = sortExpression;
            objBEResourcePlan.SortDirection  = direction;

            //--Get data
            Rave.HR.BusinessLayer.Projects.ResourcePlan objBLLGetResourcePlan = new Rave.HR.BusinessLayer.Projects.ResourcePlan();
            objListGetResourcePlan = new RaveHRCollection();

            objListGetResourcePlan = objBLLGetResourcePlan.GetResourcePlanById(objBEResourcePlan, ref pageCount);

            //--Get pagecount in viewstate
            Session[SessionNames.PageCount] = pageCount;
        }
        //catches RaveHRException exception
        catch (RaveHRException ex)
        {
            throw ex;
        }
        catch (Exception ex)
        {
            throw new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME_RP, "GetResourcePlanList", EventIDConstants.RAVE_HR_RP_PRESENTATION_LAYER);
        }

        //--
        return(objListGetResourcePlan);
    }
Exemplo n.º 10
0
    /// <summary>
    /// Returns MRF Details whose status is pending approval of Head Count
    /// </summary>
    /// <returns>List</returns> GetMRFDetailsForApprovalOfHeadCount()
    private RaveHRCollection GetMRFDetailsForApprovalOfHeadCount()
    {
        RaveHRCollection     objListMRFDetails             = new RaveHRCollection();
        AuthorizationManager objRaveHRAuthorizationManager = new AuthorizationManager();
        string UserRaveDomainId = objRaveHRAuthorizationManager.getLoggedInUser();
        string UserMailId       = UserRaveDomainId.Replace("co.in", "com");

        try
        {
            if (grdvListofPendingApproveRejectHeadCount.BottomPagerRow != null)
            {
                GridViewRow gvrPager = grdvListofPendingApproveRejectHeadCount.BottomPagerRow;
                TextBox     txtPages = (TextBox)gvrPager.Cells[0].FindControl(TXT_PAGES);
                if (txtPages.Text != "" && int.Parse(txtPages.Text) != 0 && Convert.ToInt32(txtPages.Text) <= Convert.ToInt32(Session[PAGE_COUNT].ToString()))
                {
                    objParameterCriteria.PageNumber = int.Parse(txtPages.Text);
                }
            }
            else
            {
                objParameterCriteria.PageNumber = 1;
            }
            objParameterCriteria.PageSize = 10;
            //objListMRFDetails = Rave.HR.BusinessLayer.MRF.MRFDetail.GetMRFDetailsForApprocalOfMRFByHeadCount(MRFRoles.GetRolesApproveRejectHeadCount(),objParameterCriteria, ref pageCount);
            objListMRFDetails   = Rave.HR.BusinessLayer.MRF.MRFDetail.GetMRFDetailsForApprocalOfMRFByHeadCount(UserMailId, objParameterCriteria, ref pageCount);
            Session[PAGE_COUNT] = pageCount;
        }
        //catches RaveHRException exception
        catch (RaveHRException ex)
        {
            throw ex;
        }
        catch (Exception ex)
        {
            throw new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, GET_MRF_DETAILS, EventIDConstants.RAVE_HR_RP_PRESENTATION_LAYER);
        }
        return(objListMRFDetails);
    }
Exemplo n.º 11
0
    /// <summary>
    /// Display Header When GridView Empty with proper message
    /// </summary>
    /// <param name="objListSort">EmptyList</param>
    private void ShowHeaderWhenEmptyGrid(RaveHRCollection objListSort)
    {
        try
        {
            //set header visible
            grdvListofPendingApproveRejectHeadCount.ShowHeader   = true;
            grdvListofPendingApproveRejectHeadCount.AllowSorting = false;

            //Create empty datasource for Grid view and bind
            objListSort.Add(new BusinessEntities.MRFDetail());
            grdvListofPendingApproveRejectHeadCount.DataSource = objListSort;
            grdvListofPendingApproveRejectHeadCount.DataBind();
            grdvListofPendingApproveRejectHeadCount.Columns[0].Visible = false;

            //Calculate number of columns in Grid view used for column Span
            int columnsCount = grdvListofPendingApproveRejectHeadCount.Columns.Count;

            //clear all the cells in the row
            grdvListofPendingApproveRejectHeadCount.Rows[0].Cells.Clear();

            //add a new blank cell
            grdvListofPendingApproveRejectHeadCount.Rows[0].Cells.Add(new TableCell());
            grdvListofPendingApproveRejectHeadCount.Rows[0].Cells[0].Text  = NO_RECORDS_FOUND_MESSAGE;
            grdvListofPendingApproveRejectHeadCount.Rows[0].Cells[0].Wrap  = false;
            grdvListofPendingApproveRejectHeadCount.Rows[0].Cells[0].Width = Unit.Percentage(10);
            grdvListofPendingApproveRejectHeadCount.Rows[0].Attributes.Remove(CommonConstants.EVENT_ONCLICK);
            grdvListofPendingApproveRejectHeadCount.Rows[0].Attributes.Remove(CommonConstants.EVENT_ONMOUSEOVER);
        }
        //catches RaveHRException exception
        catch (RaveHRException ex)
        {
            throw ex;
        }
        catch (Exception ex)
        {
            throw new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, SHOW_HEADER_WHEN_EMPTY_GRID, EventIDConstants.RAVE_HR_RP_PRESENTATION_LAYER);
        }
    }
Exemplo n.º 12
0
    /// <summary>
    /// Display Header When GridView Empty with proper message
    /// </summary>
    /// <param name="objListSort">EmptyList</param>
    private void ShowHeaderWhenEmptyGrid(RaveHRCollection objListSort)
    {
        try
        {
            //set header visible
            grdvListofInternalResource.ShowHeader   = true;
            grdvListofInternalResource.AllowSorting = false;

            //Create empty datasource for Grid view and bind
            objListSort.Add(new BusinessEntities.MRFDetail());
            grdvListofInternalResource.DataSource = objListSort;
            grdvListofInternalResource.DataBind();

            //Calculate number of columns in Grid view used for column Span
            int columnsCount = grdvListofInternalResource.Columns.Count;

            //clear all the cells in the row
            grdvListofInternalResource.Rows[0].Cells.Clear();

            //add a new blank cell
            grdvListofInternalResource.Rows[0].Cells.Add(new TableCell());
            grdvListofInternalResource.Rows[0].Cells[0].Text  = NO_RECORDS_FOUND_MESSAGE;
            grdvListofInternalResource.Rows[0].Cells[0].Wrap  = false;
            grdvListofInternalResource.Rows[0].Cells[0].Width = Unit.Percentage(10);
            grdvListofInternalResource.Rows[0].Attributes.Remove("onclick");
            grdvListofInternalResource.Rows[0].Attributes.Remove("onmouseover");
        }
        //catches RaveHRException exception
        catch (RaveHRException ex)
        {
            throw ex;
        }
        catch (Exception ex)
        {
            throw new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, "ShowHeaderWhenEmptyGrid", EventIDConstants.RAVE_HR_RP_PRESENTATION_LAYER);
        }
    }
Exemplo n.º 13
0
    protected void gvSkillCriteria_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        try
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                DropDownList    ddlSkill             = (DropDownList)e.Row.FindControl("ddlSkill");
                RadioButtonList rblMandatoryOptional = (RadioButtonList)e.Row.FindControl("rblMandatoryOptional");

                HiddenField HFSkill             = (HiddenField)e.Row.FindControl("HFSkill");
                HiddenField HFMandatoryOptional = (HiddenField)e.Row.FindControl("HFMandatoryOptional");

                SkillCollection         = this.GetSkills();
                ddlSkill.DataSource     = SkillCollection;
                ddlSkill.DataTextField  = Common.CommonConstants.DDL_DataTextField;
                ddlSkill.DataValueField = Common.CommonConstants.DDL_DataValueField;
                ddlSkill.DataBind();
                ddlSkill.Items.Insert(CommonConstants.ZERO, CommonConstants.SELECT);

                if (!String.IsNullOrEmpty(HFSkill.Value))
                {
                    ddlSkill.Items.FindByText(HFSkill.Value).Selected = true;
                }

                if (!String.IsNullOrEmpty(HFMandatoryOptional.Value))
                {
                    rblMandatoryOptional.SelectedValue = Convert.ToString(HFMandatoryOptional.Value);
                }
            }
        }
        catch (Exception ex)
        {
            RaveHRException objEx = new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, "gvSkillCriteria_RowDataBound", EventIDConstants.RAVE_EMP_SKILL_SEARCH_PRESENTATION_LAYER);
            LogErrorMessage(objEx);
        }
    }
Exemplo n.º 14
0
        /// <summary>
        /// Gets the HTML for CR table data.
        /// </summary>
        /// <param name="contractCRDetails">The contract CR details.</param>
        /// <returns></returns>
        private string GetHTMLForCRTableData(RaveHRCollection contractCRDetails)
        {
            string bodyTable = string.Empty;

            if (contractCRDetails.Count > 0)
            {
                bodyTable = "<br/>A new Change Request (CR) has been added to contract.<br/><br/>";

                string[] header = new string[4];
                header[0] = "CR Reference No";
                header[1] = "Start Date";
                header[2] = "End Date";
                header[3] = "Remarks";

                string[,] arrayData = new string[(contractCRDetails.Count), 4];

                int rowCounter = 0;
                foreach (BusinessEntities.Contract contractCR in contractCRDetails)
                {
                    arrayData[rowCounter, 0] = contractCR.CRReferenceNo;
                    arrayData[rowCounter, 1] = contractCR.CRStartDate.ToString(CommonConstants.DATE_FORMAT);
                    arrayData[rowCounter, 2] = contractCR.CREndDate.ToString(CommonConstants.DATE_FORMAT);
                    arrayData[rowCounter, 3] = contractCR.CRRemarks;

                    rowCounter++;
                }

                IEmailTableData objEmailTableData = new EmailTableData();
                objEmailTableData.Header    = header;
                objEmailTableData.RowDetail = arrayData;
                objEmailTableData.RowCount  = contractCRDetails.Count;

                bodyTable += objEmailTableData.GetTableData(objEmailTableData);
            }
            return(bodyTable);
        }
Exemplo n.º 15
0
    /// <summary>
    /// Sorts grid view
    /// </summary>
    /// <param name="sortExpression">Sort expression</param>
    /// <param name="direction">Sorts in Ascending or Descending order</param>
    private void SortGridView(string sortExpression, string direction)
    {
        try
        {
            //--Get RP data
            objListResourcePlan = GetResourcePlanList(direction);

            //get totatl biling
            GetTotalBilling(objListResourcePlan);

            //--Bind Grid
            rptData.DataSource = objListResourcePlan;
            rptData.DataBind();
        }
        //catches RaveHRException exception
        catch (RaveHRException ex)
        {
            throw ex;
        }
        catch (Exception ex)
        {
            throw new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME_RP, "SortGridView", EventIDConstants.RAVE_HR_RP_PRESENTATION_LAYER);
        }
    }
    /// <summary>
    /// release the employee from project & then Exit the employee.
    /// If employee is last resource on project then project should get closed.
    /// Mail should be send for all above activities.
    /// </summary>
    /// <param name="employee">Employee Details</param>
    /// <created By>Yagendra Sharnagat </created By>
    private void ExitEmployee(BusinessEntities.Employee employee, bool B_ClientName)
    {
        RaveHRCollection raveHRCollection = new RaveHRCollection();

        Rave.HR.BusinessLayer.Employee.Employee employeeBL = new Rave.HR.BusinessLayer.Employee.Employee();

        //Get the allocated project details of employee
        raveHRCollection = employeeBL.IsAllocatedToProject(employee);

        //Issue Id : 28572 Mahendra START
        //Check if any employee's line manager or functional manager is resigned employee.
        RaveHRCollection raveHRCollectionReportingEmployee = new RaveHRCollection();

        raveHRCollectionReportingEmployee = employeeBL.IsRepotingManager(employee);
        if (raveHRCollectionReportingEmployee.Count != 0)
        {
            lblMessage.Visible = true;
            lblMessage.Text    = "Resigned Employee is a Line Manager or Functional Manager of some of employees. Please change Manager for that employees.";
            return;
        }
        //Issue Id : 28572 Mahendra END


        int     ProjectCount      = 0;
        Boolean IsProjectClosed   = false;
        string  projectAllocation = string.Empty;
        Boolean IsRoleHR          = false;

        // Check whether employee is allocated to project.
        if (raveHRCollection.Count != 0)
        {
            RaveHRCollection newRaveHRCollection = new RaveHRCollection();
            BusinessEntities.ParameterCriteria newObjParameter = new BusinessEntities.ParameterCriteria();

            //As this parameter required for the method.
            newObjParameter.PageNumber = 1;
            newObjParameter.PageSize   = 10;
            newObjParameter.SortExpressionAndDirection = "EMPId ASC";
            IsRoleHR = true;

            employee.StatusId = 142;//active emp

            //Get the employee details of allocated projects.
            newRaveHRCollection = employeeBL.GetEmployeesProjectDetails(newObjParameter, employee, ref ProjectCount);

            //To release Employee project wise.
            foreach (BusinessEntities.Employee empDetails in newRaveHRCollection)
            {
                empDetails.EmpReleasedStatus = 1;

                empDetails.StatusId = Convert.ToInt32(ddlStatus.SelectedItem.Value.ToString());

                //For mail get current date for release
                //30920-Subhra-Start
                //empDetails.ProjectReleaseDate = System.DateTime.Now;
                empDetails.ProjectReleaseDate = ucDatePickerLastWorkDay.Text.Trim() == string.Empty ? DateTime.MinValue : Convert.ToDateTime(ucDatePickerLastWorkDay.Text);
                //30920-Subhra-End

                //Release the employee from project.
                employeeBL.UpdateEmployeeReleaseStatus(empDetails, ref IsProjectClosed);

                //Siddharth 7 April 2015 Start
                //Set isActive =0 for projects of resigned employees
                employeeBL.Employee_UpdateEmpCostCodeProjRelease(empDetails);
                //Siddharth 7 April 2015 End

                if (empDetails.ProjectId != 0)
                {   //Send mail for project release.
                    employeeBL.SendMailToEmployeeReleasedFromProject(empDetails, IsRoleHR);

                    projectAllocation += empDetails.ProjectName + ", ";
                }
                else
                {
                    //Send mail for department release.
                    employeeBL.SendMailToEmployeeReleasedFromDepartment(empDetails, IsRoleHR);
                }

                //If last employee then close the project.
                if (IsProjectClosed)
                {
                    //then send Email for closed project
                    int ProjectId = empDetails.ProjectId;

                    Rave.HR.BusinessLayer.Projects.Projects objProjectsBAL = new Rave.HR.BusinessLayer.Projects.Projects();;
                    BusinessEntities.Projects objRaveHR = new BusinessEntities.Projects();;
                    //Get the prooject details for email functionality.
                    objRaveHR = objProjectsBAL.RetrieveProjectDetails(ProjectId);
                    //--Call the BL method to send Emails.
                    employeeBL.SendMailToEmployeeForClosedProject(objRaveHR);
                }
            }
        }

        //Inactive employee Id.
        employee.StatusId = 143;

        //Resign the employee from company (exit).
        employeeBL.UpdateEmployeeResignationDetails(employee);

        //Remove last appended comma.
        if (projectAllocation.EndsWith(", "))
        {
            projectAllocation = projectAllocation.Substring(0, projectAllocation.Length - 2);
        }

        //Also get project name with department.
        if (projectAllocation.Trim() != string.Empty)
        {
            employee.Department = employee.Department + " (" + projectAllocation.Trim() + ") ";
        }


        //Send mail for exit.
        employeeBL.SendMailEmployeeResignFromCompany(employee, B_ClientName);

        lblConfirmMsg.Text = "Employee Resignation Details saved successfully and email notification is sent.";

        lblMessage.Visible = true;
    }
    /// <summary>
    /// Handles the Click event of the btnSave control.
    /// </summary>
    /// <param name="sender">The source of the event.</param>
    /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
    protected void btnSave_Click(object sender, EventArgs e)
    {
        try
        {
            if (ValidateControls())
            {
                Boolean Flag, B_ClientName = false;
                string  ClientName = string.Empty;
                employee = (BusinessEntities.Employee)Session[Common.SessionNames.EMPLOYEEDETAILS];

                if (Request.QueryString[QueryStringConstants.EMPID] != null)
                {
                    employee.EMPId = Convert.ToInt32(DecryptQueryString(QueryStringConstants.EMPID).ToString());
                }
                if (employee != null)
                {
                    Rave.HR.BusinessLayer.Employee.Employee addEmployeeBAL = new Rave.HR.BusinessLayer.Employee.Employee();
                    AuthorizationManager authoriseduser = new AuthorizationManager();

                    if (ucDatePickerLastWorkDay.Visible)
                    {
                        if (employee.StatusId != Convert.ToInt32(ddlStatus.SelectedItem.Value.ToString()) || employee.ResignationDate.ToString("dd/MM/yyyy") != ucDatePickerResignationDate.Text || employee.ResignationReason != txtResignationReason.Text || employee.LastWorkingDay.ToString("dd/MM/yyyy") != ucDatePickerLastWorkDay.Text)
                        {
                            Flag = true;
                        }
                    }
                    else if (employee.StatusId != Convert.ToInt32(ddlStatus.SelectedItem.Value.ToString()) || employee.ResignationDate.ToString("dd/MM/yyyy") != ucDatePickerResignationDate.Text || employee.ResignationReason != txtResignationReason.Text)
                    {
                        Flag = true;
                    }
                    Flag = true;

                    if (Flag)
                    {
                        objParameter.EMailID          = UserMailId;
                        employee.StatusId             = Convert.ToInt32(ddlStatus.SelectedItem.Value.ToString());
                        employee.LastWorkingDay       = ucDatePickerLastWorkDay.Text.Trim() == string.Empty ? DateTime.MinValue : Convert.ToDateTime(ucDatePickerLastWorkDay.Text);
                        employee.ResignationDate      = ucDatePickerResignationDate.Text.Trim() == string.Empty ? DateTime.MinValue : Convert.ToDateTime(ucDatePickerResignationDate.Text);
                        employee.ResignationReason    = txtResignationReason.Text.Trim();
                        employee.LastModifiedByMailId = UserMailId;
                        employee.LastModifiedDate     = DateTime.Now.Date;
                        employee.FullName             = employee.FirstName.Trim() + " " + employee.LastName.Trim();

                        //update the session values for an employee.
                        Session[SessionNames.EMPLOYEEDETAILS] = employee;

                        //Siddharth 23-02-2015
                        //Get Projects allocated of resigned Employee
                        RaveHRCollection raveHRCollection = new RaveHRCollection();
                        Rave.HR.BusinessLayer.Employee.Employee employeeBL = new Rave.HR.BusinessLayer.Employee.Employee();
                        //Get the allocated project details of employee
                        raveHRCollection = employeeBL.GetEmployeesAllocation(employee);
                        B_ClientName     = false;

                        if (raveHRCollection != null)
                        {
                            if (raveHRCollection.Count > 0)
                            {
                                for (int i = 0; i < raveHRCollection.Count; i++)
                                {
                                    ClientName = ((BusinessEntities.Employee)(raveHRCollection.Item(i))).ClientName;
                                    if (ClientName.ToUpper().Contains("NPS") || ClientName.ToUpper().Contains("NORTHGATE"))
                                    {
                                        B_ClientName = true;
                                    }
                                }
                            }
                        }

                        //--Get mailIds
                        if (ddlStatus.SelectedItem.Text == "Active")
                        {
                            addEmployeeBAL.UpdateEmployeeResignationDetails(employee);

                            addEmployeeBAL.SendMailEmployeeSeperationFromCompany(employee, B_ClientName);

                            lblConfirmMsg.Text = "Employee Resignation Details saved successfully and email notification is sent.";

                            lblMessage.Visible = true;
                        }
                        if (ddlStatus.SelectedItem.Text == "InActive")
                        {
                            ExitEmployee(employee, B_ClientName);
                        }
                        btnRollBack.Visible = true;
                    }
                }
            }
        }
        catch (RaveHRException ex)
        {
            LogErrorMessage(ex);
        }
        catch (Exception ex)
        {
            RaveHRException objEx = new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, "btnUpdate_Click", EventIDConstants.RAVE_HR_EMPLOYEE_PRESENTATION_LAYER);
            LogErrorMessage(objEx);
        }
    }
Exemplo n.º 18
0
    /// <summary>
    /// Raise the Head count for MRF
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnOK_Click(object sender, EventArgs e)
    {
        try
        {
            string mrfIdGroup = string.Empty;
            //Get the Recruitment Manager Id
            string recruitmentManagerId = ddlRecruitmentManager.SelectedValue;
            //Aarohi : Issue 30885 : 14/12/2011 : Start
            if ((Session[SessionNames.PURPOSE] != null) && (ddlPurpose.SelectedValue == Convert.ToString((int)Common.MasterEnum.MRFPurpose.Replacement)) || (ddlPurpose.SelectedValue == Convert.ToString((int)Common.MasterEnum.MRFPurpose.SubstituteForMaternityLeave)))
            {
                //Issue Id : 34331 START : Mahendra
                //commented following and added new code to map Arraylist elements
                //txtPurpose.Text = Session[SessionNames.PURPOSE].ToString();
                System.Collections.ArrayList name = (System.Collections.ArrayList)Session[SessionNames.PURPOSE];
                foreach (var item in name)
                {
                    txtPurpose.Text = item.ToString();
                }
                //Issue Id : 34331 END
            }
            //Aarohi : Issue 30885 : 14/12/2011 : End

            //On Click, Change the status of respetive MRF
            if (recruitmentManagerId != CommonConstants.SELECT)
            {
                BusinessEntities.MRFDetail          mrfDetail = new BusinessEntities.MRFDetail();
                Rave.HR.BusinessLayer.MRF.MRFDetail objMrf    = new Rave.HR.BusinessLayer.MRF.MRFDetail();

                //Check if wheather any need of approval of head count.means approver id for this deprtment is 0.
                string mailTo = GetEmailIdForDeptWiseHeadCountApprovalMailTo(hidDepartment.Value);

                //if no approver id found then directly goes for pending external allocation.
                //For Rave consultant department no approval is required.mail is directly sent to Recruiment.
                if (string.IsNullOrEmpty(mailTo))
                {
                    mrfDetail.Status = CommonConstants.MRFStatus_PendingExternalAllocation;
                }
                else
                {
                    //Sent For Finance to approve the head count.
                    mrfDetail.Status = CommonConstants.MRFStatus_PendingHeadCountApprovalOfFinance;

                    //Goes for head count approval & make status Peding Approval Of HeadCount.
                    // mrfDetail.Status = CommonConstants.MRFStatus_PedingApprovalOfHeadCount;
                }
                mrfDetail.EmployeeId          = int.Parse(recruitmentManagerId);
                mrfDetail.ExpectedClosureDate = txtTargetDate.Text;
                mrfDetail.RecruitmentManager  = ddlRecruitmentManager.SelectedItem.Text;
                mrfDetail.MRFCode             = hidMrfCode.Value;
                mrfDetail.ProjectName         = txtProjectName.Text;
                mrfDetail.DepartmentName      = hidDepartment.Value;
                mrfDetail.Role = txtRole.Text;
                mrfDetail.ExpectedClosureDate = txtTargetDate.Text;
                mrfDetail.RecruitersId        = ddlRecruitmentManager.SelectedValue;
                // 57877-Venkatesh-  29042016 : Start
                // Add sai email if while raising headcount for nis projects
                if (HfldProjectId.Value != "SELECT")
                {
                    mrfDetail.ProjectId = Convert.ToInt32(HfldProjectId.Value);
                }
                // 57877-Venkatesh-  29042016 : End
                //Adding Purpose and PurposeDescription fileds

                if (ddlPurpose.SelectedItem.Text != Common.CommonConstants.SELECT)
                {
                    mrfDetail.MRFPurposeId = Convert.ToInt32(ddlPurpose.SelectedValue);
                }
                else
                {
                    mrfDetail.MRFPurposeId = CommonConstants.ZERO;
                }

                if (mrfDetail.MRFPurposeId == Convert.ToInt32(MasterEnum.MRFPurpose.MarketResearchfeasibility))
                {
                    mrfDetail.Status = CommonConstants.MRFStatus_PendingExternalAllocation;
                }

                if (txtPurpose.Visible == true && !string.IsNullOrEmpty(txtPurpose.Text))
                {
                    mrfDetail.MRFPurposeDescription = txtPurpose.Text.Trim();
                }
                if (ddlDepartment.Visible == true && ddlDepartment.SelectedIndex > 0)
                {
                    mrfDetail.MRFPurposeDescription = ddlDepartment.SelectedItem.Text;
                }

                // Rakesh -  Issue : 57942  to Set Dropdown Value to Object
                if (ddlPurpose.SelectedItem != null)
                {
                    mrfDetail.MRFPurpose = ddlPurpose.SelectedItem.Text;
                }
                //end

                if (Session[SessionNames.MRFRaiseHeadCOuntGroup] != null)
                {
                    mrfIdGroup = Session[SessionNames.MRFRaiseHeadCOuntGroup].ToString();
                }
                string[] newMrfId = mrfIdGroup.Split(',');

                // Rajan Kumar : Issue 46252: 10/02/2014 : Starts
                // Desc : In MRF history need to implemented in all cases in RMS.
                //Pass Email to know who is going to modified the data
                AuthorizationManager authoriseduser = new AuthorizationManager();
                mrfDetail.LoggedInUserEmail = authoriseduser.getLoggedInUserEmailId();
                // Rajan Kumar : Issue 46252: 10/02/2014 : END



                //Rakesh : Actual vs Budget 06/06/2016 Begin
                if (!string.IsNullOrEmpty(ddlCostCode.SelectedValue) && ddlCostCode.SelectedValue != CommonConstants.SELECT)
                {
                    mrfDetail.CostCodeId = ddlCostCode.SelectedValue.CastToInt32();
                }
                //End


                //If Session is not null Means multiple values selected from pending allocation page.
                if (Session[SessionNames.MRFRaiseHeadCOuntGroup] != null)
                {
                    for (int i = 0; i < newMrfId.Length; i++)
                    {
                        bool isMailInGroup = false;
                        if (newMrfId.Length == 1)
                        {
                            isMailInGroup = true;
                        }

                        mrfDetail.MRFId = Convert.ToInt32(newMrfId[i]);

                        BusinessEntities.RaveHRCollection raveHRCollection = new RaveHRCollection();
                        raveHRCollection = objMrf.CopyMRFBL(Convert.ToInt32(newMrfId[i]));
                        foreach (BusinessEntities.MRFDetail currentMrfDetails in raveHRCollection)
                        {
                            mrfDetail.MRFCode = currentMrfDetails.MRFCode;
                        }


                        //update MRF Status
                        //Last parameter set to mail should not send for group. it would be in shot.
                        //for that code is written below.
                        objMrf.UpdateMrfStatus(mrfDetail, mailTo, newMrfId, isMailInGroup);
                    }

                    //For rave consultant send mail in one shot for all selected MRF.
                    if (string.IsNullOrEmpty(mailTo) && newMrfId.Length > 1)
                    {
                        objMrf.SendMailForRaiseHeadCountWithouApprovalInGroup(mrfDetail, newMrfId);
                    }
                }
                else
                {
                    mrfDetail.MRFId = int.Parse(hidMrfId.Value);
                    objMrf.UpdateMrfStatus(mrfDetail, mailTo, newMrfId, true);
                }

                Session[SessionNames.CONFIRMATION_MESSAGE] = "Request for head count is raised successfully, email notification is sent for approval.";
                Session[SessionNames.RAISE_HEAD_COUNT]     = "True";

                if (Session[SessionNames.MRFRaiseHeadCOuntGroup] != null)
                {
                    Session.Remove(SessionNames.MRFRaiseHeadCOuntGroup);
                    //Close the window
                    //Page.ClientScript.RegisterStartupScript(this.GetType(), "close", " window.opener.location.href='MrfPendingAllocation.aspx'; window.close();", true);
                    //Umesh: Issue 'Modal Popup issue in chrome' Starts
                    ScriptManager.RegisterClientScriptBlock(this, typeof(Page), "CloseJS", "jQuery.modalDialog.getCurrent().close();", true);
                    //Umesh: Issue 'Modal Popup issue in chrome' Ends
                }
                else
                {
                    //Umesh: Issue 'Modal Popup issue in chrome' Starts
                    ScriptManager.RegisterClientScriptBlock(this, typeof(Page), "CloseJS", "jQuery.modalDialog.getCurrent().close();", true);
                    //Umesh: Issue 'Modal Popup issue in chrome' Ends
                }
            }
        }
        //catches RaveHRException exception
        catch (RaveHRException ex)
        {
            LogErrorMessage(ex);
        }
        catch (Exception ex)
        {
            RaveHRException objEx = new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME_MRFRAISEHEADCOUNT, "btnOK_Click", EventIDConstants.RAVE_HR_MRF_PRESENTATION_LAYER);
            LogErrorMessage(objEx);
        }
    }
Exemplo n.º 19
0
        /// <summary>
        /// Edit project Details.
        /// </summary>
        /// <param name="contractDetails"></param>
        /// <param name="contractProject"></param>
        /// <returns></returns>
        private bool EditProjects(BusinessEntities.Contract contractDetails,
                                  DataTable contractProject, RaveHRCollection CRDetailsCollection)
        {
            int  counter = 0;
            bool sucess  = true;

            Rave.HR.BusinessLayer.Contracts.ContractProject editContractProject = new Rave.HR.BusinessLayer.Contracts.ContractProject();
            List <BusinessEntities.ContractProject>         listProjectData     = new List <BusinessEntities.ContractProject>();
            StringBuilder    allProjectsName          = new StringBuilder(string.Empty);
            RaveHRCollection AddedCRDetailsCollection = new RaveHRCollection();

            foreach (DataRow dr in contractProject.Rows)
            {
                counter++;

                BusinessEntities.ContractProject ProjectData = new BusinessEntities.ContractProject();

                ProjectData.ContractID          = contractDetails.ContractID;
                ProjectData.ProjectType         = dr[DbTableColumn.ProjectType].ToString();
                ProjectData.ProjectStartDate    = Convert.ToDateTime(dr[DbTableColumn.ProjectStartDate]);
                ProjectData.ProjectEndDate      = Convert.ToDateTime(dr[DbTableColumn.ProjectEndDate]);
                ProjectData.ProjectName         = dr[DbTableColumn.Con_ProjectName].ToString();
                ProjectData.NoOfResources       = Convert.ToDecimal(dr[DbTableColumn.NoOfResources]);
                ProjectData.ProjectsDescription = dr[DbTableColumn.Description].ToString();
                ProjectData.ProjectCategoryID   = Convert.ToInt32(dr[DbTableColumn.Con_ProjectCategoryID]);
                // Mohamed : Issue 49791 : 15/09/2014 : Starts
                // Desc : Add project group in Contract page
                ProjectData.ProjectGroup = dr[DbTableColumn.ProjectGroup].ToString();
                // Mohamed : Issue 49791 : 15/09/2014 : Ends

                // Mohamed : Issue  : 23/09/2014 : Starts
                // Desc : Add Division, Business Area, Business Segment, Project Alias in Contract page -- NIS-RMS
                ProjectData.ProjectDivision         = Convert.ToInt32(dr[DbTableColumn.ProjectDivision].ToString());
                ProjectData.ProjectBussinessArea    = Convert.ToInt32(dr[DbTableColumn.ProjectBusinessArea].ToString());
                ProjectData.ProjectBussinessSegment = Convert.ToInt32(dr[DbTableColumn.ProjectBusinessSegment].ToString());
                //ProjectData.ProjectAlias = dr[DbTableColumn.ProjectAlias].ToString();
                // Mohamed : Issue  : 23/09/2014 : Ends

                //Siddharth 13 March 2015 Start

                //Note the below line is commented bcoz in session First time Project model is not stored
                //ProjectData.ProjectModel = dr[DbTableColumn.ProjectModel].ToString();
                ProjectData.ProjectModel = dr[DbTableColumn.ProjectModel].ToString();
                //Siddharth 13 March 2015 End

                //Siddharth 9 Sept 2015 Start
                ProjectData.BusinessVertical = dr[DbTableColumn.BusinessVertical].ToString();
                //Siddharth 9 Sept 2015 End


                //Added by Shrinivas for implementing new project code
                if (!string.IsNullOrEmpty(dr[DbTableColumn.ProjectCode].ToString()))
                {
                    ProjectData.ProjectCode = dr[DbTableColumn.ProjectCode].ToString();
                }
                else
                {
                    ProjectData.ProjectCode = contractDetails.ClinetAbbrivation + "_" + contractDetails.ProjectAbbrivation + "_" + contractDetails.Phase;
                }

                //Edit only those have project code.
                if (dr[DbTableColumn.ProjectCode].ToString() != string.Empty)
                {
                    sucess = editContractProject.Edit(ProjectData, null);
                }
                listProjectData.Add(ProjectData);

                if (counter == 1)
                {
                    allProjectsName.Append(",Project:");
                }
                //append all projects name to dispaly in Email.
                allProjectsName.Append(",");
                allProjectsName.Append(ProjectData.ProjectName);
            }

            foreach (BusinessEntities.Contract CRdetails in CRDetailsCollection)
            {
                if (CRdetails.Mode == "1")
                {
                    AddedCRDetailsCollection.Add(CRdetails);
                }
            }

            if (sucess)
            {
                SendMailForEditContract(contractDetails, listProjectData, allProjectsName.ToString(), AddedCRDetailsCollection);
            }
            return(sucess);
        }
Exemplo n.º 20
0
    //Ishwar 26022015 : Start --Desc : Report is not required
    #region Note : implementation format to be changed
    //protected void btnPractiseTeamReport_Click(object sender, EventArgs e)
    //{
    //    StringBuilder strbHTML = new StringBuilder("");
    //    strbHTML.Append("<table border = '0' cellpadding = '0' cellspacing = '0' style='border-color:Black;' width = '100%'>");
    //    strbHTML.Append("<tr><td>&nbsp;</td></tr>");
    //    #region Header Content
    //    strbHTML.Append("<tr>");
    //    strbHTML.Append("<td width = '80%'>");

    //    strbHTML.Append("<table border = '2' cellpadding = '0' cellspacing = '0' style='border-color:Black;' width = '100%'>");
    //    strbHTML.Append("<tr>");
    //    strbHTML.Append("<td style='" + strHeaderStyle + "' align = 'center' width = '10%'>Dept</td>");
    //    strbHTML.Append("<td style='" + strHeaderStyle + "' align = 'center' width = '10%'>Designation</td>");
    //    strbHTML.Append("<td width = '80%'>");

    //    #region Weekly Content

    //    strbHTML.Append("<table border = '2' cellpadding = '0' cellspacing = '0' style='border-color:Black;' width = '80%'>");
    //    strbHTML.Append("<tr><td style='" + strHeaderStyle + "' align = 'center'>" + GetFirdayDateForCurrentWeek() + "</td></tr>");
    //    strbHTML.Append("<tr>");
    //    strbHTML.Append("<td align = 'center'>");

    //    #region Allocation Details

    //    strbHTML.Append("<table border = '2' cellpadding = '0' cellspacing = '0' style='border-color:Black;' width = '80%'>");
    //    strbHTML.Append("<tr>");
    //    strbHTML.Append("<td align = 'center' style='" + strHeaderStyle + "' width = '40%'>Project Name</td>");
    //    strbHTML.Append("<td align = 'center' style='" + strHeaderStyle + "' width = '30%'>No of days utilized</td>");
    //    strbHTML.Append("<td align = 'center' style='" + strHeaderStyle + "' width = '30%'>No of days billed</td>");
    //    strbHTML.Append("</tr>");
    //    strbHTML.Append("</table>");

    //    #endregion Allocation Details

    //    strbHTML.Append("</td>");
    //    strbHTML.Append("</tr>");
    //    strbHTML.Append("</table>");

    //    #endregion Weekly Content

    //    strbHTML.Append("</td>");

    //    #region *****************Total

    //    //strbHTML.Append("<td>");

    //    //#region Weekly Content

    //    //strbHTML.Append("<table border = '2' cellpadding = '0' cellspacing = '0' style='border-color:Black;' width = '100%'>");
    //    //strbHTML.Append("<tr><td style='" + strHeaderStyle + "' align = 'center'>Total</td></tr>");
    //    //strbHTML.Append("<tr>");
    //    //strbHTML.Append("<td style='" + strHeaderStyle + "' align = 'center'>");

    //    //#region Allocation Details

    //    //strbHTML.Append("<table border = '2' cellpadding = '0' cellspacing = '0' style='border-color:Black;' width = '100%'>");
    //    //strbHTML.Append("<tr>");
    //    //strbHTML.Append("<td align = 'center' style='" + strHeaderStyle + "'>Total No of days utilized</td>");
    //    //strbHTML.Append("<td align = 'center' style='" + strHeaderStyle + "'>Total No of days billed</td>");
    //    //strbHTML.Append("</tr>");
    //    //strbHTML.Append("</table>");

    //    //#endregion Allocation Details

    //    //strbHTML.Append("</td>");
    //    //strbHTML.Append("</tr>");
    //    //strbHTML.Append("</table>");

    //    //#endregion Weekly Content

    //    //strbHTML.Append("</td>");

    //    #endregion *************Total

    //    strbHTML.Append("</tr>");
    //    strbHTML.Append("</table>");

    //    strbHTML.Append("</td>");
    //    strbHTML.Append("</tr>");
    //    #endregion Header Content

    //    #region Main Content

    //    //-----------------Row Details

    //    strbHTML = getDetails(strbHTML);
    //    //-----------------Row Details

    //    #endregion Main Content

    //    strbHTML.Append("</table>");

    //    //--
    //    GetExcel("Practice_Team", strbHTML.ToString());
    //}
    //Ishwar 26022015 : End

    private StringBuilder getDetails(StringBuilder strbHTML)
    {
        #region Get the allocation details

        RaveHRCollection objEmployeeAllocation = new RaveHRCollection();
        objEmployeeAllocation = GetAllocatedResourceByProjectId();

        ArrayList objDept = new ArrayList();
        foreach (BusinessEntities.Employee objEmployee in objEmployeeAllocation)
        {
            if (!objDept.Contains(objEmployee.Department))
            {
                //--Add dept to arr
                objDept.Add(objEmployee.Department);

                strbHTML.Append("<tr>");
                strbHTML.Append("<td style='" + strRowStyle + "' align = 'left' colspan = '3'><b>" + objEmployee.Department + "</b></td>");
                strbHTML.Append("</tr>");
            }


            #region Header Content
            strbHTML.Append("<tr>");
            strbHTML.Append("<td width = '100%'>");

            strbHTML.Append("<table border = '2' cellpadding = '0' cellspacing = '0' style='border-color:Black;' width = '100%'>");
            strbHTML.Append("<tr>");
            strbHTML.Append("<td style='" + strRowStyle + "' align = 'left' width = '10%'>" + objEmployee.FullName + "</td>");
            strbHTML.Append("<td style='" + strRowStyle + "' align = 'left' width = '10%'>" + objEmployee.Designation + "</td>");
            strbHTML.Append("<td width = '80%'>");

            #region Weekly Content

            strbHTML.Append("<table border = '2' cellpadding = '0' cellspacing = '0' style='border-color:Black;' width = '100%'>");
            strbHTML.Append("<tr>");
            strbHTML.Append("<td  align = 'center'>");

            #region Allocation Details

            strbHTML.Append("<table border = '2' cellpadding = '0' cellspacing = '0' style='border-color:Black;' width = '100%'>");
            strbHTML.Append("<tr>");
            strbHTML.Append("<td align = 'left' style='" + strRowStyle + "'>" + objEmployee.ProjectName + "</td>");
            strbHTML.Append("<td align = 'right' style='" + strRowStyle + "'>" + objEmployee.NoOfDaysUtilised + "</td>");
            strbHTML.Append("<td align = 'right' style='" + strRowStyle + "'>" + objEmployee.NoOfDaysBilled + "</td>");
            strbHTML.Append("</tr>");
            strbHTML.Append("</table>");

            #endregion Allocation Details

            strbHTML.Append("</td>");
            strbHTML.Append("</tr>");
            strbHTML.Append("</table>");

            #endregion Weekly Content

            strbHTML.Append("</td>");

            #region *****************Total

            //strbHTML.Append("<td>");

            //#region Weekly Content

            //strbHTML.Append("<table border = '2' cellpadding = '0' cellspacing = '0' style='border-color:Black;' width = '100%'>");
            //strbHTML.Append("<tr>");
            //strbHTML.Append("<td align = 'center'>");

            //#region Allocation Details

            //strbHTML.Append("<table border = '2' cellpadding = '0' cellspacing = '0' style='border-color:Black;' width = '100%'>");
            //strbHTML.Append("<tr>");
            //strbHTML.Append("<td align = 'right' style='" + strRowStyle + "'>" + objEmployee.TotalNoOfDaysUtilised + "</td>");
            //strbHTML.Append("<td align = 'right' style='" + strRowStyle + "'>" + objEmployee.TotalNoOfDaysBilled + "</td>");
            //strbHTML.Append("</tr>");
            //strbHTML.Append("</table>");

            //#endregion Allocation Details

            //strbHTML.Append("</td>");
            //strbHTML.Append("</tr>");
            //strbHTML.Append("</table>");

            //#endregion Weekly Content

            //strbHTML.Append("</td>");

            #endregion *************Total

            strbHTML.Append("</tr>");
            strbHTML.Append("</table>");

            strbHTML.Append("</td>");
            strbHTML.Append("</tr>");

            #endregion Header Content
        }

        #endregion Get the allocation details

        return(strbHTML);
    }
Exemplo n.º 21
0
    /// <summary>
    /// Sorts grid view
    /// </summary>
    /// <param name="sortExpression">Sort expression</param>
    /// <param name="direction">Sorts in Ascending or Descending order</param>
    private void SortGridView(string sortExpression, string direction)
    {
        try
        {
            if (sortExpression == CommonConstants.MRF_CODE)
            {
                objParameterCriteria.SortExpressionAndDirection = sortExpression + direction;
            }
            else
            {
                objParameterCriteria.SortExpressionAndDirection = sortExpression + direction;
            }
            objListSort = GetMRFDetailsForApprovalOfHeadCount();

            if ((int.Parse(Session[PAGE_COUNT].ToString()) == 1) && (objListSort.Count == 1))
            {
                grdvListofPendingApproveRejectHeadCount.AllowSorting = false;
            }
            else
            {
                grdvListofPendingApproveRejectHeadCount.AllowSorting = true;
            }

            if (objListSort.Count == 0)
            {
                grdvListofPendingApproveRejectHeadCount.DataSource = objListSort;
                grdvListofPendingApproveRejectHeadCount.DataBind();

                //grdvListofPendingApproveRejectHeadCount.Columns[0].Visible = false;
                ShowHeaderWhenEmptyGrid(objListSort);
            }
            else
            {
                //Bind the Grid View in Sorted order
                grdvListofPendingApproveRejectHeadCount.DataSource = objListSort;
                grdvListofPendingApproveRejectHeadCount.DataBind();
                //grdvListofPendingApproveRejectHeadCount.Columns[0].Visible = false;
            }

            //Finds the Paging Text Box, Previous and Next Link Buttons in Grid Views Pagning Templet
            GridViewRow gvrPager = grdvListofPendingApproveRejectHeadCount.BottomPagerRow;
            TextBox     txtPages = (TextBox)gvrPager.Cells[0].FindControl(TXT_PAGES);

            LinkButton lbtnPrevious = (LinkButton)gvrPager.Cells[0].FindControl(LBL_BTN_PREVIOUS);
            LinkButton lbtnNext     = (LinkButton)gvrPager.Cells[0].FindControl(LBL_BTN_NEXT);

            if (pageCount > 1)
            {
                grdvListofPendingApproveRejectHeadCount.BottomPagerRow.Visible = true;
            }

            //Don't allow any character other than Number in paging text box
            txtPages.Attributes.Add(CommonConstants.EVENT_ONKEYPRESS, "return isNumberKey(event)");

            //Enable Prvious and Disable Next when Paging Text box contains last paging number
            if (Convert.ToInt32(txtPages.Text) == pageCount)
            {
                lbtnPrevious.Enabled = true;
                lbtnNext.Enabled     = false;
            }
            //Enable Next and Disable Previous when Paging Text box contains First paging number i.e. 1
            if (Convert.ToInt32(txtPages.Text) == 1)
            {
                lbtnPrevious.Enabled = false;
                lbtnNext.Enabled     = true;
            }
            //Enable both Next and Previous when Paging Text box contains paging number between 1 and Last page number
            if ((Convert.ToInt32(txtPages.Text) > 1) && (Convert.ToInt32(txtPages.Text) < pageCount))
            {
                lbtnPrevious.Enabled = true;
                lbtnNext.Enabled     = true;;
            }
        }
        //catches RaveHRException exception
        catch (RaveHRException ex)
        {
            throw ex;
        }
        catch (Exception ex)
        {
            throw new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, SORT_GRID_VIEW, EventIDConstants.RAVE_HR_RP_PRESENTATION_LAYER);
        }
    }
Exemplo n.º 22
0
        /// <summary>
        /// This method is used for editing the contract details
        /// </summary>
        /// <param name="contractAdd"></param>
        /// <returns></returns>
        public bool Edit(BusinessEntities.Contract contractAdd, DataTable contractProject, RaveHRCollection CRDetailsCollection)
        {
            bool result = false;

            try
            {
                //Defines a bl layer object.
                Rave.HR.DataAccessLayer.Contracts.Contract EditContractDL = new Rave.HR.DataAccessLayer.Contracts.Contract();

                // Calls the data layer function for editing the contract details.
                result = EditContractDL.edit(contractAdd);

                if (result)
                {
                    result = EditProjects(contractAdd, contractProject, CRDetailsCollection);
                }
                return(result);
            }
            catch (RaveHRException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw new RaveHRException(ex.Message, ex, Sources.BusinessLayer, CONTRACT, EDIT, EventIDConstants.RAVE_HR_CONTRACT_BUSNIESS_LAYER);
            }
        }
    /// <summary>
    /// Sort GridView
    /// </summary>
    private void SortGridView(string sortExpression, string direction)
    {
        try
        {
            if (sortExpression == RESOURCE_NAME)
            {
                objParameterCriteria.SortExpressionAndDirection = sortExpression + direction;
            }
            else
            {
                objParameterCriteria.SortExpressionAndDirection = sortExpression + direction;
            }
            objListSort = GetListOfInternalResource();
            if (Session[PAGE_COUNT] != null)
            {
                if ((int.Parse(Session[PAGE_COUNT].ToString()) == 1) && (objListSort.Count == 1))
                {
                    grdvListofInternalResource.AllowSorting = false;
                }
                else
                {
                    grdvListofInternalResource.AllowSorting = true;
                }
            }

            if (objListSort.Count == 0)
            {
                grdvListofInternalResource.DataSource = objListSort;
                grdvListofInternalResource.DataBind();
                ShowHeaderWhenEmptyGrid(objListSort);
            }
            else
            {
                //Bind the Grid View in Sorted order
                grdvListofInternalResource.DataSource = objListSort;
                grdvListofInternalResource.DataBind();
            }

            //Finds the Paging Text Box, Previous and Next Link Buttons in Grid Views Pagning Templet
            GridViewRow gvrPager     = grdvListofInternalResource.BottomPagerRow;
            TextBox     txtPages     = (TextBox)gvrPager.Cells[0].FindControl("txtPages");
            LinkButton  lbtnPrevious = (LinkButton)gvrPager.Cells[0].FindControl("lbtnPrevious");
            LinkButton  lbtnNext     = (LinkButton)gvrPager.Cells[0].FindControl("lbtnNext");

            if (pageCount > 1)
            {
                grdvListofInternalResource.BottomPagerRow.Visible = true;
            }

            //Don't allow any character other than Number in paging text box
            txtPages.Attributes.Add("onkeypress", "return isNumberKey(event)");

            //Enable Prvious and Disable Next when Paging Text box contains last paging number
            if (Convert.ToInt32(txtPages.Text) == pageCount)
            {
                lbtnPrevious.Enabled = true;
                lbtnNext.Enabled     = false;
            }
            //Enable Next and Disable Previous when Paging Text box contains First paging number i.e. 1
            if (Convert.ToInt32(txtPages.Text) == 1)
            {
                lbtnPrevious.Enabled = false;
                lbtnNext.Enabled     = true;
            }
            //Enable both Next and Previous when Paging Text box contains paging number between 1 and Last page number
            if ((Convert.ToInt32(txtPages.Text) > 1) && (Convert.ToInt32(txtPages.Text) < pageCount))
            {
                lbtnPrevious.Enabled = true;
                lbtnNext.Enabled     = true;;
            }
        }
        //catches RaveHRException exception
        catch (RaveHRException ex)
        {
            throw ex;
        }
        catch (Exception ex)
        {
            throw new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, "SortGridView", EventIDConstants.RAVE_HR_RP_PRESENTATION_LAYER);
        }
    }