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