public IList <MDEmploymentStatusEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression) { IList <MDEmploymentStatusEntity> mDEmploymentStatusEntityList = new List <MDEmploymentStatusEntity>(); try { if (pageSize == -1) { pageSize = 1000000000; } if (String.IsNullOrEmpty(sortExpression)) { sortExpression = MDEmploymentStatusEntity.FLD_NAME_EmploymentStatusID + " " + SQLConstants.SORT_ORDER_DESCENDING; } startRowIndex = Convert.ToInt32(startRowIndex / pageSize) + 1; mDEmploymentStatusEntityList = FCCMDEmploymentStatus.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression); if (mDEmploymentStatusEntityList != null && mDEmploymentStatusEntityList.Count > 0) { totalRowCount = mDEmploymentStatusEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(mDEmploymentStatusEntityList ?? new List <MDEmploymentStatusEntity>()); }
private void SaveMDEmploymentStatusEntity() { if (IsValid) { try { MDEmploymentStatusEntity mDEmploymentStatusEntity = BuildMDEmploymentStatusEntity(); Int64 result = -1; if (mDEmploymentStatusEntity.IsNew) { result = FCCMDEmploymentStatus.GetFacadeCreate().Add(mDEmploymentStatusEntity, DatabaseOperationType.Add, TransactionRequired.No); } else { String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(MDEmploymentStatusEntity.FLD_NAME_EmploymentStatusID, mDEmploymentStatusEntity.EmploymentStatusID.ToString(), SQLMatchType.Equal); result = FCCMDEmploymentStatus.GetFacadeCreate().Update(mDEmploymentStatusEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No); } if (result > 0) { _EmploymentStatusID = 0; _MDEmploymentStatusEntity = new MDEmploymentStatusEntity(); PrepareInitialView(); BindMDEmploymentStatusList(); if (mDEmploymentStatusEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "Employment Status Information has been added successfully.", false); } else { MiscUtil.ShowMessage(lblMessage, "Employment Status Information has been updated successfully.", false); } } else { if (mDEmploymentStatusEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "Failed to add Employment Status Information.", false); } else { MiscUtil.ShowMessage(lblMessage, "Failed to update Employment Status Information.", false); } } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } }
protected void lvMDEmploymentStatus_ItemCommand(object sender, ListViewCommandEventArgs e) { Int64 EmploymentStatusID; Int64.TryParse(e.CommandArgument.ToString(), out EmploymentStatusID); if (EmploymentStatusID > 0) { if (string.Equals(e.CommandName, "EditItem")) { _EmploymentStatusID = EmploymentStatusID; PrepareEditView(); cpeEditor.Collapsed = false; cpeEditor.ClientState = "false"; } else if (string.Equals(e.CommandName, "DeleteItem")) { try { Int64 result = -1; String fe = SqlExpressionBuilder.PrepareFilterExpression(MDEmploymentStatusEntity.FLD_NAME_EmploymentStatusID, EmploymentStatusID.ToString(), SQLMatchType.Equal); MDEmploymentStatusEntity mDEmploymentStatusEntity = new MDEmploymentStatusEntity(); result = FCCMDEmploymentStatus.GetFacadeCreate().Delete(mDEmploymentStatusEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No); if (result == 0) { _EmploymentStatusID = 0; _MDEmploymentStatusEntity = new MDEmploymentStatusEntity(); PrepareInitialView(); BindMDEmploymentStatusList(); MiscUtil.ShowMessage(lblMessage, "Employment Status has been successfully deleted.", true); } else { MiscUtil.ShowMessage(lblMessage, "Failed to delete Employment Status.", true); } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } } }
public IList <MDEmploymentStatusEntity> GetData() { IList <MDEmploymentStatusEntity> mDEmploymentStatusEntityList = new List <MDEmploymentStatusEntity>(); try { mDEmploymentStatusEntityList = FCCMDEmploymentStatus.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load); if (mDEmploymentStatusEntityList != null && mDEmploymentStatusEntityList.Count > 0) { totalRowCount = mDEmploymentStatusEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(mDEmploymentStatusEntityList ?? new List <MDEmploymentStatusEntity>()); }