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