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