//public int pSkillsID = 0; protected void Page_Load(object sender, EventArgs e) { try { if (!ValidateURL()) { Response.Redirect(CommonConstants.INVALIDURL, false); } else { btnSelect.Attributes.Add("onclick", "return Validate();"); if (!IsPostBack) { value = new StringBuilder(); PopulateData(); reportingToValue = null; //if (Request.QueryString["SkillsID"] != null) //{ // pSkillsID = Convert.ToInt32(Request.QueryString["SkillsID"]); //} if (Request.QueryString["PageName"] != null) { hidPageName.Value = Request.QueryString["PageName"]; } } } } catch (RaveHRException ex) { LogErrorMessage(ex); } catch (Exception ex) { RaveHRException objEx = new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, "Page_Load", EventIDConstants.RAVE_HR_MRF_PRESENTATION_LAYER); LogErrorMessage(objEx); } }
/// <summary> /// Converts generic List to DataTable /// </summary> /// <param name="objListSort">List</param> /// <returns>DataTable</returns> private DataTable GetDataTable(List <BusinessEntities.Projects> objListSort) { Type type = null; PropertyInfo[] pinfos = null; DataTable table = new DataTable(); try { foreach (object t in objListSort) { if (type == null) { type = t.GetType(); pinfos = type.GetProperties(); CreateColumns(pinfos, table); } DataRow row = table.NewRow(); foreach (DataColumn column in table.Columns) { object value = pinfos[column.Ordinal].GetValue(t, null); row[column.ColumnName] = value; } table.Rows.Add(row); } } catch (RaveHRException ex) { throw ex; } catch (Exception ex) { RaveHRException objEx = new RaveHRException(ex.Message, ex, Sources.PresentationLayer, PAGE_NAME, "GetDataTable", EventIDConstants.RAVE_HR_PROJECTS_PRESENTATION_LAYER); LogErrorMessage(objEx); } return(table); }
protected void grdvListofInternalResource_DataBound(object sender, EventArgs e) { try { GridViewRow gvrPager = grdvListofInternalResource.BottomPagerRow; if (gvrPager == null) { return; } //Get Text Box and Lable from the Grid View TextBox txtPages = (TextBox)gvrPager.Cells[0].FindControl(TXT_PAGES); Label lblPageCount = (Label)gvrPager.Cells[0].FindControl(LBL_PAGE_COUNT); //Assign current page index to text box if (Session[CURRENT_PAGE_INDEX] != null) { txtPages.Text = Session[CURRENT_PAGE_INDEX].ToString(); } //Assign total no of pages to label if (lblPageCount != null) { lblPageCount.Text = pageCount.ToString(); } } //catches RaveHRException exception catch (RaveHRException ex) { LogErrorMessage(ex); } catch (Exception ex) { RaveHRException objEx = new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, "grdvListofInternalResource_DataBound", EventIDConstants.RAVE_HR_MRF_PRESENTATION_LAYER); LogErrorMessage(objEx); } }
/// <summary> /// Does the data bind. /// </summary> private void BindGrid() { try { gvSkills.DataSource = SkillDetailsCollection; gvSkills.DataBind(); //Displaying grid header with NO record found message. if (gvSkills.Rows.Count == 0) { ShowHeaderWhenEmptyGrid(); } } catch (RaveHRException ex) { throw ex; } catch (Exception ex) { RaveHRException objEx = new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, "BindGrid", EventIDConstants.RAVE_HR_PROJECTS_PRESENTATION_LAYER); LogErrorMessage(objEx); } }
/// <summary> /// Project Category List /// </summary> /// <returns>void</returns> private void GetProjectCategory() { try { Rave.HR.BusinessLayer.Projects.Projects objCategoryBAL = new Rave.HR.BusinessLayer.Projects.Projects(); List <BusinessEntities.Category> objListCategory = new List <BusinessEntities.Category>(); objListCategory = objCategoryBAL.TechnologyCategory(); rpCategories.DataSource = objListCategory; //--bind repeater rpCategories.DataBind(); } catch (RaveHRException ex) { throw ex; } catch (Exception ex) { RaveHRException objEx = new RaveHRException(ex.Message, ex, Sources.PresentationLayer, PAGE_NAME, "GetProjectCategory", EventIDConstants.RAVE_HR_PROJECTS_PRESENTATION_LAYER); LogErrorMessage(objEx); } }
protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { GetMasterData_DivisionDropDown(); GetMasterData_BussinessAreaDropDown(); GetMasterData_BussinessSegmentDropDown(); this.BindGridHeadCount(); } } catch (RaveHRException ex) { LogErrorMessage(ex); } catch (Exception ex) { RaveHRException objEx = new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, "Page_Load", EventIDConstants.RAVE_HR_CONTRACT_PRESENTATION_LAYER); LogErrorMessage(objEx); } }
protected void btnSelect_Click(object sender, EventArgs e) { string selectedValue = Request.Form["rbEmailList"]; try { //Sanju:Issue Id 50201 //Passed value to window.opener in order to retieve it in another page (chrome issue) //Umesh: Issue 'Modal Popup issue in chrome' Starts ScriptManager.RegisterClientScriptBlock(this, typeof(Page), "SelectJS", "jQuery.modalDialog.getCurrent().postMessageToParent('" + selectedValue + "');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, "EmployeesEmailList.aspx.cs", "btnSelect_Click", EventIDConstants.RAVE_HR_EMPLOYEE_PRESENTATION_LAYER); LogErrorMessage(objEx); } }
protected void grdvListofPendingApproveRejectHeadCount_PageIndexChanging(object sender, GridViewPageEventArgs e) { try { //Change the page index on page index changing event and bind the grid if (e.NewPageIndex != -1) { grdvListofPendingApproveRejectHeadCount.PageIndex = e.NewPageIndex; } BindGrid(); } //catches RaveHRException exception catch (RaveHRException ex) { LogErrorMessage(ex); } catch (Exception ex) { RaveHRException objEx = new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, GRID_PAGE_INDEX_CHANGING, EventIDConstants.RAVE_HR_MRF_PRESENTATION_LAYER); LogErrorMessage(objEx); } }
private List <string> CheckAccessRights(string emailId) { lstRights = new List <string> { }; try { int loginEmpId = 0; Rave.HR.BusinessLayer.FourC.FourC fourCBAL = new Rave.HR.BusinessLayer.FourC.FourC(); lstRights = fourCBAL.Check4CLoginRights(emailId, ref loginEmpId); ViewState["LoginEmpId"] = loginEmpId; return(lstRights); } catch (RaveHRException ex) { LogErrorMessage(ex); } catch (Exception ex) { RaveHRException objEx = new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, "CheckAccessRights", EventIDConstants.RAVE_HR_RP_PRESENTATION_LAYER); LogErrorMessage(objEx); } return(lstRights); }
protected void BtnClear_Click(object sender, EventArgs e) { try { ddlDivision.SelectedIndex = 0; ddlBusinessArea.SelectedIndex = 0; ddlBusinessSegment.SelectedIndex = 0; ddlBusinessArea.Enabled = false; ddlBusinessSegment.Enabled = false; this.BindGridHeadCount(); } catch (RaveHRException ex) { LogErrorMessage(ex); } catch (Exception ex) { RaveHRException objEx = new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, "BtnClear_Click", EventIDConstants.RAVE_HR_CONTRACT_PRESENTATION_LAYER); LogErrorMessage(objEx); } }
/// <summary> /// gridview rowCreated event handler /// </summary> protected void grdvListofProjects_RowCreated(object sender, GridViewRowEventArgs e) { try { if (e.Row.RowType == DataControlRowType.Header) { if (((Session["pagecount"] != null) && (int.Parse(Session["pagecount"].ToString()) > 1)) || ((objListSort.Count > 1))) { //Add sort Images to Grid View Header AddSortImage(e.Row); } } } catch (RaveHRException ex) { LogErrorMessage(ex); } catch (Exception ex) { RaveHRException objEx = new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, "grdvListofProjects_RowCreated", EventIDConstants.RAVE_HR_PROJECTS_PRESENTATION_LAYER); LogErrorMessage(objEx); } }
/// <summary> /// Binds grid in sorted order in given direction /// </summary> private void BindGrid() { try { if (GridViewSortDirection == SortDirection.Ascending) { SortGridView(sortExpression, ASCENDING); } else { SortGridView(sortExpression, DESCENDING); } } catch (RaveHRException ex) { throw ex; } catch (Exception ex) { RaveHRException objEx = new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, "BindGrid", EventIDConstants.RAVE_HR_PROJECTS_PRESENTATION_LAYER); LogErrorMessage(objEx); } }
/// <summary> /// grdvListofInternalResource_PageIndexChanging Event Handler /// </summary> protected void grdvListofInternalResource_PageIndexChanging(object sender, GridViewPageEventArgs e) { try { //Change the page index on page index changing event and bind the grid if (e.NewPageIndex != -1) { grdvListofInternalResource.PageIndex = e.NewPageIndex; } BindGrid(); } //catches RaveHRException exception catch (RaveHRException ex) { LogErrorMessage(ex); } catch (Exception ex) { RaveHRException objEx = new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, "grdvListofInternalResource_PageIndexChanging", EventIDConstants.RAVE_HR_MRF_PRESENTATION_LAYER); LogErrorMessage(objEx); } }
private BusinessEntities.Employee GetEmployee(BusinessEntities.Employee employeeObj) { BusinessEntities.Employee empPar = null; empPar = new BusinessEntities.Employee(); BusinessEntities.Employee employee = new BusinessEntities.Employee(); Rave.HR.BusinessLayer.Employee.Employee employeeBL = new Rave.HR.BusinessLayer.Employee.Employee(); try { employee = employeeBL.GetEmployee(employeeObj); } catch (RaveHRException ex) { LogErrorMessage(ex); } catch (Exception ex) { RaveHRException objEx = new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, "GetEmployee", EventIDConstants.RAVE_HR_EMPLOYEE_PRESENTATION_LAYER); LogErrorMessage(objEx); } return(employee); }
/// <summary> /// Display Header When GridView Empty with proper message /// </summary> /// <param name="objListSort">EmptyList</param> private void ShowHeaderWhenEmptyGrid(List <BusinessEntities.Projects> objListSort) { try { //set header visible grdvListofProjects.ShowHeader = true; grdvListofProjects.AllowSorting = false; //Create empty datasource for Grid view and bind objListSort.Add(new BusinessEntities.Projects()); grdvListofProjects.DataSource = objListSort; grdvListofProjects.DataBind(); //Calculate number of columns in Grid view used for column Span int columnsCount = grdvListofProjects.Columns.Count; //clear all the cells in the row grdvListofProjects.Rows[0].Cells.Clear(); //add a new blank cell grdvListofProjects.Rows[0].Cells.Add(new TableCell()); grdvListofProjects.Rows[0].Cells[0].Text = NO_RECORDS_FOUND_MESSAGE; grdvListofProjects.Rows[0].Cells[0].Wrap = false; grdvListofProjects.Rows[0].Cells[0].Width = Unit.Percentage(10); grdvListofProjects.Rows[0].Attributes.Remove("onclick"); grdvListofProjects.Rows[0].Attributes.Remove("onmouseover"); } catch (RaveHRException ex) { throw ex; } catch (Exception ex) { RaveHRException objEx = new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, "ShowHeaderWhenEmptyGrid", EventIDConstants.RAVE_HR_PROJECTS_PRESENTATION_LAYER); LogErrorMessage(objEx); } }
private void SortGridView() { try { dt = new DataTable(); dt = GetSkillSearchDetails("EmployeeName ASC"); if (dt.Rows.Count > 0) { btnExport.Visible = true; lblError.Text = string.Empty; grdvListofEmployees.AllowSorting = true; grdvListofEmployees.DataSource = dt; Session["EmployeeSkillSearchCount"] = Convert.ToInt32(dt.Rows.Count); grdvListofEmployees.DataBind(); } else { ShowHeaderWhenEmptyGrid(dt); //Siddharth 30 April 2015 Start - Clear the Session Session[SessionNames.PREVIOUS_SORT_EXPRESSION_EMP] = null; Session[SessionNames.SORT_DIRECTION_EMP] = null; //Siddharth 30 April 2015 End btnExport.Visible = false; lblError.Text = string.Empty; } } catch (RaveHRException ex) { throw ex; } catch (Exception ex) { RaveHRException objEx = new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, "SortGridView", EventIDConstants.RAVE_EMP_SKILL_SEARCH_PRESENTATION_LAYER); LogErrorMessage(objEx); } }
protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { DefaultGridView(); //Poonam : Issue : 54921 : Starts //Desc: Validation for Skills Dropdown BtnSearch.Attributes.Add("OnClick", "return ValidateSearchBtn()"); //Poonam : Issue : 54921 : Ends } lblError.Text = string.Empty; } catch (RaveHRException ex) { LogErrorMessage(ex); } catch (Exception ex) { RaveHRException objEx = new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, "Page_Load", EventIDConstants.RAVE_HR_CONTRACT_PRESENTATION_LAYER); LogErrorMessage(objEx); } }
protected void grdvCreatorApprover_PageIndexChanging(Object sender, GridViewPageEventArgs e) { try { grdvCreatorApprover.PageIndex = e.NewPageIndex; if (rblAdminSelectionOption.SelectedIndex == 0) { FillCreatorApproverData(); } else { getEmployeeData(); } } catch (RaveHRException ex) { LogErrorMessage(ex); } catch (Exception ex) { RaveHRException objEx = new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, "grdvCreatorApprover_PageIndexChanging", EventIDConstants.RAVE_HR_RP_PRESENTATION_LAYER); LogErrorMessage(objEx); } }
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); } }
//Siddharth 26 March 2015 End //Siddharth 30 March 2015 Start protected void grdvHeadCount_RowCreated(object sender, GridViewRowEventArgs e) { try { if (e.Row.RowType == DataControlRowType.Header) { if (((Session["HeadCountReport"] != null) && (int.Parse(Session["HeadCountReport"].ToString()) > 1)) || ((raveHRCollection.Count > 1))) { //Add sort Images to Grid View Header AddSortImage(e.Row); } } } //catches RaveHRException exception catch (RaveHRException ex) { LogErrorMessage(ex); } catch (Exception ex) { RaveHRException objEx = new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, "gvListOfMrf_RowCreated", EventIDConstants.RAVE_HR_MRF_PRESENTATION_LAYER); LogErrorMessage(objEx); } }
protected void grdvListofEmployees_PageIndexChanging(object sender, GridViewPageEventArgs e) { try { //Change the page index on page index changing event and bind the grid if (e.NewPageIndex != -1) { grdvListofEmployees.PageIndex = e.NewPageIndex; } PopulateData(); //if (Session["SelectedEmployeeId"] != null) //{ // reportingToValue = Session["SelectedEmployeeId"].ToString(); //} if (ViewState["SelectedEmployeeId"] != null) { reportingToValue = ViewState["SelectedEmployeeId"].ToString(); } if (reportingToValue != null && reportingToValue != string.Empty && reportingToValue.Length > 0) { this.SelectCheckedEmployee(reportingToValue); } } catch (RaveHRException ex) { LogErrorMessage(ex); } catch (Exception ex) { RaveHRException objEx = new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, "grdvListofEmployees_PageIndexChanging", EventIDConstants.RAVE_HR_EMPLOYEE_PRESENTATION_LAYER); LogErrorMessage(objEx); } }
protected void GVResourcesReleased_RowCreated(object sender, GridViewRowEventArgs e) { try { if (e.Row.RowType == DataControlRowType.Header) { if (((Session["GVResourcesReleased"] != null) && (int.Parse(Session["GVResourcesReleased"].ToString()) > 1))) { //Add sort Images to Grid View Header AddSortImageforGVResourcesReleased(e.Row); } } } catch (RaveHRException ex) { throw ex; } catch (Exception ex) { RaveHRException objEx = new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, "GetConsolidated", EventIDConstants.RAVE_HR_EMPLOYEE_PRESENTATION_LAYER); LogErrorMessage(objEx); } }
/// <summary> /// The RowCreated event is raised when each row in the GridView control is created /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void gvPendingApprovalOfMrf_RowCreated(object sender, GridViewRowEventArgs e) { try { if (e.Row.RowType == DataControlRowType.Header) { if (((Session[SessionNames.PAGE_COUNT_APPREJMRF] != null) && (int.Parse(Session[SessionNames.PAGE_COUNT_APPREJMRF].ToString()) > 1)) || ((raveHRCollection.Count > 1))) { //Add sort Images to Grid View Header AddSortImage(e.Row); } } else if (e.Row.RowType == DataControlRowType.DataRow) { if (e.Row.DataItem != null) { hashTable.Add(e.Row.RowIndex, DataBinder.Eval(e.Row.DataItem, "MRFID").ToString()); } } if (hashTable.Keys.Count != 0) { Session[SessionNames.MRFVIEWINDEX] = hashTable; } } //catches RaveHRException exception catch (RaveHRException ex) { LogErrorMessage(ex); } catch (Exception ex) { RaveHRException objEx = new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME_MRFPENDINGAPPROVAL, "gvPendingApprovalOfMrf_RowCreated", EventIDConstants.RAVE_HR_MRF_PRESENTATION_LAYER); LogErrorMessage(objEx); } }
/// <summary> /// When data is bound to datarow in gridview /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void gvPendingApprovalOfMrf_DataBound(object sender, EventArgs e) { try { GridViewRow gvrPager = gvPendingApprovalOfMrf.BottomPagerRow; if (gvrPager == null) { return; } //Get Text Box and Lable from the Grid View TextBox txtPages = (TextBox)gvrPager.Cells[0].FindControl("txtPages"); Label lblPageCount = (Label)gvrPager.Cells[0].FindControl("lblPageCount"); //Assign current page index to text box txtPages.Text = Session[SessionNames.CURRENT_PAGE_INDEX_APPREJMRF].ToString(); //Assign total no of pages to label if (lblPageCount != null) { lblPageCount.Text = pageCount.ToString(); } } //catches RaveHRException exception catch (RaveHRException ex) { LogErrorMessage(ex); } catch (Exception ex) { RaveHRException objEx = new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME_MRFPENDINGAPPROVAL, "gvPendingApprovalOfMrf_DataBound", EventIDConstants.RAVE_HR_MRF_PRESENTATION_LAYER); LogErrorMessage(objEx); } }
/// <summary> /// Change the page on click of Previous or Next linkbutton and bind grid. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void ChangePage(object sender, CommandEventArgs e) { try { GridViewRow gvrPager = gvPendingApprovalOfMrf.BottomPagerRow; TextBox txtPages = (TextBox)gvrPager.Cells[0].FindControl("txtPages"); switch (e.CommandName) { //Previous button is clicked case PREVIOUS: Session[SessionNames.CURRENT_PAGE_INDEX_APPREJMRF] = Convert.ToInt32(txtPages.Text) - 1; txtPages.Text = Convert.ToString(Convert.ToInt32(txtPages.Text) - 1); break; //Next button is clicked case NEXT: Session[SessionNames.CURRENT_PAGE_INDEX_APPREJMRF] = Convert.ToInt32(txtPages.Text) + 1; txtPages.Text = Convert.ToString(Convert.ToInt32(txtPages.Text) + 1); break; } // Bind the grid on paging. BindGridApproveRejectMrf(); } //catches RaveHRException exception catch (RaveHRException ex) { LogErrorMessage(ex); } catch (Exception ex) { RaveHRException objEx = new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME_MRFPENDINGAPPROVAL, "ChangePage", EventIDConstants.RAVE_HR_MRF_PRESENTATION_LAYER); LogErrorMessage(objEx); } }
private void GetCostCodes() { try { AuthorizationManager objRaveHRAuthorizationManager = new AuthorizationManager(); UserRaveDomainId = objRaveHRAuthorizationManager.getLoggedInUser(); UserRaveDomainId = UserRaveDomainId.Replace("co.in", "com"); //Declaring COllection class object BusinessEntities.RaveHRCollection raveHrColl = new BusinessEntities.RaveHRCollection(); //Declaring Master Class Object Rave.HR.BusinessLayer.Employee.Employee employee = new Rave.HR.BusinessLayer.Employee.Employee(); //Calling Fill dropdown Business layer method to fill //the dropdown from Employee Business class. raveHrColl = employee.FillProjectCostCodeDropDowns(); //raveHrColl = employee.FillProjectCostCodeDropDowns(UserRaveDomainId, objParameter.Role); ddlProject.Items.Clear(); ddlProject.DataSource = raveHrColl; ddlProject.DataTextField = Common.CommonConstants.DDL_DataTextField; ddlProject.DataValueField = Common.CommonConstants.DDL_DataValueField; ddlProject.DataBind(); //ddlProject.Items.Insert(CommonConstants.ZERO, CommonConstants.SELECT); } catch (RaveHRException ex) { throw ex; } catch (Exception ex) { RaveHRException objEx = new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, "GetConsolidated", EventIDConstants.RAVE_HR_EMPLOYEE_PRESENTATION_LAYER); LogErrorMessage(objEx); } }
private void SelectCheckedEmployee(string empid) { try { if (empid != "") { string[] empidarray = empid.Split(','); for (int i = 0; i < empidarray.Length; i++) { string tempEmpId = empidarray[i]; for (int j = 0; j < grdvListofEmployees.Rows.Count; j++) { //Get the EmployeeID string EmdID = grdvListofEmployees.Rows[j].Cells[1].Text; if (tempEmpId.Trim() == EmdID.Trim()) { CheckBox chk = (CheckBox)grdvListofEmployees.Rows[j].Cells[0].FindControl("chkSelect"); chk.Checked = true; } } } } } //catches RaveHRException exception catch (RaveHRException ex) { LogErrorMessage(ex); } catch (Exception ex) { RaveHRException objEx = new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, "SelectCheckedEmployee", EventIDConstants.RAVE_HR_EMPLOYEE_PRESENTATION_LAYER); LogErrorMessage(objEx); } }
/// <summary> /// Select checked project & close the pop up window. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnOK_Click(object sender, EventArgs e) { try { string projectCode = Request.Form["CommonRow"]; //get the project code in session to display data in add project page. Session[SessionNames.CONTRACT_SELECETED_PROJECT] = projectCode; //Close the window. //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 } catch (RaveHRException ex) { LogErrorMessage(ex); } catch (Exception ex) { RaveHRException objEx = new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME_LISTOFPROJECT, "btnOK_Click", EventIDConstants.RAVE_HR_CONTRACT_PRESENTATION_LAYER); LogErrorMessage(objEx); } }
/// <summary> /// Handles the Load event of the Page 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 Page_Load(object sender, EventArgs e) { try { //Clearing the error label lblMessage.Text = string.Empty; lblConfirmMsg.Text = string.Empty; btnSave.Attributes.Add(Common.CommonConstants.EVENT_ONCLICK, "return ButtonClickValidate();"); //26137-Ambar-Start //btnRollBack.Attributes.Add(Common.CommonConstants.EVENT_ONCLICK, "return ConfirmForRollBackResign();"); //26137-Ambar-End //Poonam : Issue : Disable Button : Starts btnSave.OnClientClick = "if(ButtonClickValidate()){" + ClientScript.GetPostBackEventReference(btnSave, null) + "}"; btnRollBack.OnClientClick = "if(ConfirmForRollBackResign()){" + ClientScript.GetPostBackEventReference(btnRollBack, null) + "}"; //Poonam : Issue : Disable Button : Ends //btnRMFM.Attributes.Add(CommonConstants.EVENT_ONCLICK, "return SelectProjectDetails();"); Rave.HR.BusinessLayer.MRF.MRFRoles mrfRoles = new Rave.HR.BusinessLayer.MRF.MRFRoles(); // Get logged-in user's email id AuthorizationManager objRaveHRAuthorizationManager = new AuthorizationManager(); UserRaveDomainId = objRaveHRAuthorizationManager.getLoggedInUser(); UserMailId = UserRaveDomainId.Replace("co.in", "com"); AuthorizationManager RaveHRAuthorizationManager = new AuthorizationManager(); //ArrayList arrRolesForUser = RaveHRAuthorizationManager.getRolesForUser(objRaveHRAuthorizationManager.getLoggedInUser()); arrRolesForUser = RaveHRAuthorizationManager.getRolesForUser(objRaveHRAuthorizationManager.getLoggedInUser()); if (!ValidateURL()) { Response.Redirect(CommonConstants.INVALIDURL, false); } if (Session[Common.SessionNames.EMPLOYEEDETAILS] != null) { employee = (BusinessEntities.Employee)Session[Common.SessionNames.EMPLOYEEDETAILS]; } if (employee != null) { employeeID = employee.EMPId; lblempName.Text = employee.FirstName.ToUpper() + " " + employee.LastName.ToUpper(); } if (!IsPostBack) { #region Modified By Mohamed Dangra // Mohamed : Issue 50959 : 16/05/2014 : Starts // Desc : Roll back button should invisible for Inactive employee if (employee.StatusId == 142) { //31145-Subhra-Start if (employee.ResignationReason != string.Empty) { btnRollBack.Visible = true; } //31145-Subhra-end } // Mohamed : Issue 50959 : 16/05/2014 : Ends #endregion Modified By Mohamed Dangra this.GetEmployeeStatus(); this.PopulateControls(); //Ishwar 20022015 : NIS RMS : Start string strUserIdentity = string.Empty; strUserIdentity = HttpContext.Current.ApplicationInstance.Session["WindowsUsername"].ToString().Trim(); BusinessEntities.Employee Employee = new BusinessEntities.Employee(); Rave.HR.BusinessLayer.Employee.Employee employeeBL = new Rave.HR.BusinessLayer.Employee.Employee(); Employee = employeeBL.GetNISEmployeeList(strUserIdentity); if (!String.IsNullOrEmpty(Employee.WindowsUserName)) { pnlResignationDetails.Enabled = false; btnRMFMHTML.Visible = false; btnSave.Visible = false; btnRollBack.Visible = false; } //Ishwar 20022015 : NIS RMS : End } SavedControlVirtualPath = "~/EmployeeMenuUC.ascx"; ReloadControl(); } catch (RaveHRException ex) { LogErrorMessage(ex); } catch (Exception ex) { RaveHRException objEx = new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, "Page_Load", EventIDConstants.RAVE_HR_CONTRACT_PRESENTATION_LAYER); LogErrorMessage(objEx); } }
/// <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); } }