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