/// <summary> /// Fill DropDown Method /// </summary> private void FillDropDown() { //Declaring Master Class Object Rave.HR.BusinessLayer.Common.Master master = new Rave.HR.BusinessLayer.Common.Master(); try { BusinessEntities.MRFDetail mrfDetailobj = new BusinessEntities.MRFDetail(); if (Session[SessionNames.MRFPREVIOUSVALUE] != null) { mrfDetailobj = (BusinessEntities.MRFDetail)Session[SessionNames.MRFPREVIOUSVALUE]; } int testingDeparmentId = mrfDetailobj.DepartmentId; //Calling Business layer FillDropDown Method if (testingDeparmentId == (int)MasterEnum.MRFDepartment.Testing) { raveHRCollection = master.FillDropDownsBL(testingDeparmentId); } else { //Calling Business layer FillDropDown Method raveHRCollection = master.FillDropDownsBL(Convert.ToInt32(Common.EnumsConstants.Category.PrimarySkills)); } //Check Collection is null or not if (raveHRCollection != null) { //Assign DataSOurce to Collection ddlSkillCategory.DataSource = raveHRCollection; //Assign DataText Filed to DropDown ddlSkillCategory.DataTextField = CommonConstants.DDL_DataTextField; //Assign DataValue Field to Dropdown ddlSkillCategory.DataValueField = CommonConstants.DDL_DataValueField; //Bind Dropdown ddlSkillCategory.DataBind(); //Insert Select as a item for dropdown ddlSkillCategory.Items.Insert(CommonConstants.ZERO, CommonConstants.SELECT); raveHRCollection.Clear(); } } catch (RaveHRException ex) { throw ex; } catch (Exception ex) { throw new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME_RAISEMRF_NEXT, "FillDropDown", EventIDConstants.RAVE_HR_MRF_PRESENTATION_LAYER); } }
/// <summary> /// Function will Fill Dropdowns of all the Master Data /// </summary> private void FillDropDowns() { try { //Declaring Master Class Object Rave.HR.BusinessLayer.Common.Master master = new Rave.HR.BusinessLayer.Common.Master(); //Calling Fill dropdown Business layer method to fill the dropdown raveHRCollection = master.FillDepartmentDropDownBL(); //Check Collection object is null or not if (raveHRCollection != null) { //Assign DataSource to dropdown ddlDepartment.DataSource = raveHRCollection; //Assign DataText Field to dropdown ddlDepartment.DataTextField = CommonConstants.DDL_DataTextField; //Assign Data Value field to dropdown ddlDepartment.DataValueField = CommonConstants.DDL_DataValueField; //Bind Dropdown ddlDepartment.DataBind(); //Insert Select as a Item for Dropdown ddlDepartment.Items.Insert(CommonConstants.ZERO, CommonConstants.SELECT); raveHRCollection.Clear(); } } catch (RaveHRException ex) { throw ex; } catch (Exception ex) { throw new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, "FillDropDowns", EventIDConstants.RAVE_HR_MRF_PRESENTATION_LAYER); } }
/// <summary> /// Fill DropDown Method /// </summary> private void GetPurposeDetails() { //Declaring Master Class Object Rave.HR.BusinessLayer.Common.Master master = new Rave.HR.BusinessLayer.Common.Master(); try { //Calling Business layer FillDropDown Method raveHRCollection = master.FillDropDownsBL(Convert.ToInt32(Common.EnumsConstants.Category.MRFPurpose)); //Check Collection is null or not if (raveHRCollection != null) { //Assign DataSOurce to Collection ddlPurpose.DataSource = raveHRCollection; //Assign DataText Filed to DropDown ddlPurpose.DataTextField = CommonConstants.DDL_DataTextField; //Assign DataValue Field to Dropdown ddlPurpose.DataValueField = CommonConstants.DDL_DataValueField; //Bind Dropdown ddlPurpose.DataBind(); //Insert Select as a item for dropdown ddlPurpose.Items.Insert(CommonConstants.ZERO, CommonConstants.SELECT); raveHRCollection.Clear(); } } catch (RaveHRException ex) { throw ex; } catch (Exception ex) { throw new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME_MRFRAISEHEADCOUNT, "FillDropDown", EventIDConstants.RAVE_HR_MRF_PRESENTATION_LAYER); } }
/// <summary> /// Sort the gridview as per SortExpression and SortDirection /// </summary> /// <param name="sortExpression"></param> /// <param name="direction"></param> private void SortGridView(string sortExpression, string direction) { try { if (sortExpression == CommonConstants.MRF_CODE) { objParameter.SortExpressionAndDirection = sortExpression + direction; } else { objParameter.SortExpressionAndDirection = sortExpression + direction; } raveHRCollection = GetApproveRejectMrf(); if ((int.Parse(Session[SessionNames.PAGE_COUNT_APPREJMRF].ToString()) == 1) && (raveHRCollection.Count == 1)) { gvPendingApprovalOfMrf.AllowSorting = false; } else { gvPendingApprovalOfMrf.AllowSorting = true; } if (raveHRCollection.Count == 0) { gvPendingApprovalOfMrf.DataSource = raveHRCollection; gvPendingApprovalOfMrf.DataBind(); ShowHeaderWhenEmptyGrid(raveHRCollection); } else { gvPendingApprovalOfMrf.DataSource = raveHRCollection; gvPendingApprovalOfMrf.DataBind(); raveHRCollection.Clear(); } //Finds the Paging Text Box, Previous and Next Link Buttons in Grid Views Pagning Templet GridViewRow gvrPager = gvPendingApprovalOfMrf.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) { gvPendingApprovalOfMrf.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_MRFPENDINGAPPROVAL, "SortGridView", EventIDConstants.RAVE_HR_RP_PRESENTATION_LAYER); } }