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