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