public IList <HREmployeeExperienceEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression) { IList <HREmployeeExperienceEntity> hREmployeeExperienceEntityList = new List <HREmployeeExperienceEntity>(); try { if (pageSize == -1) { pageSize = 1000000000; } if (String.IsNullOrEmpty(sortExpression)) { sortExpression = HREmployeeExperienceEntity.FLD_NAME_EmployeeExperienceID + " " + SQLConstants.SORT_ORDER_DESCENDING; } startRowIndex = Convert.ToInt32(startRowIndex / pageSize) + 1; hREmployeeExperienceEntityList = FCCHREmployeeExperience.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression); if (hREmployeeExperienceEntityList != null && hREmployeeExperienceEntityList.Count > 0) { totalRowCount = hREmployeeExperienceEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(hREmployeeExperienceEntityList ?? new List <HREmployeeExperienceEntity>()); }
private void SaveHREmployeeExperienceEntity() { if (IsValid) { try { HREmployeeExperienceEntity hREmployeeExperienceEntity = BuildHREmployeeExperienceEntity(); Int64 result = -1; if (hREmployeeExperienceEntity.IsNew) { result = FCCHREmployeeExperience.GetFacadeCreate().Add(hREmployeeExperienceEntity, DatabaseOperationType.Add, TransactionRequired.No); } else { String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(HREmployeeExperienceEntity.FLD_NAME_EmployeeExperienceID, hREmployeeExperienceEntity.EmployeeExperienceID.ToString(), SQLMatchType.Equal); result = FCCHREmployeeExperience.GetFacadeCreate().Update(hREmployeeExperienceEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No); } if (result > 0) { _EmployeeExperienceID = 0; _HREmployeeExperienceEntity = new HREmployeeExperienceEntity(); PrepareInitialView(); BindHREmployeeExperienceList(); if (hREmployeeExperienceEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "Employee Experience Information has been added successfully.", false); } else { MiscUtil.ShowMessage(lblMessage, "Employee Experience Information has been updated successfully.", false); } } else { if (hREmployeeExperienceEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "Failed to add Employee Experience Information.", false); } else { MiscUtil.ShowMessage(lblMessage, "Failed to update Employee Experience Information.", false); } } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } }
protected void lvHREmployeeExperience_ItemCommand(object sender, ListViewCommandEventArgs e) { Int64 EmployeeExperienceID; Int64.TryParse(e.CommandArgument.ToString(), out EmployeeExperienceID); if (EmployeeExperienceID > 0) { if (string.Equals(e.CommandName, "EditItem")) { _EmployeeExperienceID = EmployeeExperienceID; PrepareEditView(); cpeEditor.Collapsed = false; cpeEditor.ClientState = "false"; } else if (string.Equals(e.CommandName, "DeleteItem")) { try { Int64 result = -1; String fe = SqlExpressionBuilder.PrepareFilterExpression(HREmployeeExperienceEntity.FLD_NAME_EmployeeExperienceID, EmployeeExperienceID.ToString(), SQLMatchType.Equal); HREmployeeExperienceEntity hREmployeeExperienceEntity = new HREmployeeExperienceEntity(); result = FCCHREmployeeExperience.GetFacadeCreate().Delete(hREmployeeExperienceEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No); if (result == 0) { _EmployeeExperienceID = 0; _HREmployeeExperienceEntity = new HREmployeeExperienceEntity(); PrepareInitialView(); BindHREmployeeExperienceList(); MiscUtil.ShowMessage(lblMessage, "Employee Experience has been successfully deleted.", true); } else { MiscUtil.ShowMessage(lblMessage, "Failed to delete Employee Experience.", true); } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } } }
public IList <HREmployeeExperienceEntity> GetData() { IList <HREmployeeExperienceEntity> hREmployeeExperienceEntityList = new List <HREmployeeExperienceEntity>(); try { hREmployeeExperienceEntityList = FCCHREmployeeExperience.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load); if (hREmployeeExperienceEntityList != null && hREmployeeExperienceEntityList.Count > 0) { totalRowCount = hREmployeeExperienceEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(hREmployeeExperienceEntityList ?? new List <HREmployeeExperienceEntity>()); }