protected void odsACBankAccountPayment_Selecting(object sender, ObjectDataSourceSelectingEventArgs e) { String fe = String.Empty; if (PageAPType.ToString().IsNotNullOrEmpty()) { if (PageAPType == MasterDataConstants.ACPaymentType.BANK_ACCOUNT_PAYMENT) { fe = "ACBankAccountPayment." + ACBankAccountPaymentEntity.FLD_NAME_BankAccountID + " <> 3"; //"3" Here works as Cash Account -- Should change if requires any change to cash account ID } else if (PageAPType == MasterDataConstants.ACPaymentType.CASH_PAYMENT) { fe = SqlExpressionBuilder.PrepareFilterExpression("ACBankAccountPayment." + ACBankAccountPaymentEntity.FLD_NAME_BankAccountID, "3", SQLMatchType.Equal); //"3" Here works as Cash Account -- Should change if requires any change to cash account ID } } if (chbxFilter.Checked) { String fe1 = SqlExpressionBuilder.PrepareFilterExpression("ACBankAccountPayment.Reference", txtSearchText.Text.ToString(), SQLMatchType.Equal); String fe2 = SqlExpressionBuilder.PrepareFilterExpression("ACBankAccount.BankAccountName", txtSearchText.Text.ToString(), SQLMatchType.LikeWithSuffixMath); String fe3 = SqlExpressionBuilder.PrepareFilterExpression(fe1, SQLJoinType.OR, fe2); String fe4 = SqlExpressionBuilder.PrepareFilterExpression("ACBankAccountPayment.Memo", txtSearchText.Text.ToString(), SQLMatchType.LikeWithBothMath); String fe5 = SqlExpressionBuilder.PrepareFilterExpression(fe3, SQLJoinType.OR, fe4); fe = SqlExpressionBuilder.PrepareFilterExpression(fe, SQLJoinType.AND, fe5); } if (ViewState["SearchString"] != null) { fe = (String)ViewState["SearchString"]; } e.InputParameters["filterExpression"] = fe; }
protected void odsHREmployeeEvaluation_Selecting(object sender, ObjectDataSourceSelectingEventArgs e) { String fe = String.Empty; if (PageAPType.ToString().IsNotNullOrEmpty()) { if (PageAPType == MasterDataConstants.MDEvaluationSessionCategory.HEALTH_CHECKUP) { fe = "MDEvaluationSessionCategory.SessionCategoryID " + " = " + MasterDataConstants.MDEvaluationSessionCategory.HEALTH_CHECKUP; } else if (PageAPType == MasterDataConstants.MDEvaluationSessionCategory.QUARTERLY_EVALUATIONS) { fe = "MDEvaluationSessionCategory.SessionCategoryID " + " <> " + MasterDataConstants.MDEvaluationSessionCategory.HEALTH_CHECKUP; } } String fe1 = SqlExpressionBuilder.PrepareFilterExpression("HREmployeeEvaluation.EmployeeID", MiscUtil.GetCurrentEmployeeByMemberID(CurrentMember).ToString(), SQLMatchType.Equal); String fe2 = SqlExpressionBuilder.PrepareFilterExpression("HREmployeeEvaluation.SupervisorEmployeeID", MiscUtil.GetCurrentEmployeeByMemberID(CurrentMember).ToString(), SQLMatchType.Equal); String fe3 = "HREmployeeEvaluation.EmployeeSubmitDate is not null"; String fe4 = SqlExpressionBuilder.PrepareFilterExpression(fe2, SQLJoinType.AND, fe3); String fe5 = SqlExpressionBuilder.PrepareFilterExpression(fe1, SQLJoinType.OR, fe4); fe = SqlExpressionBuilder.PrepareFilterExpression(fe, SQLJoinType.AND, fe5); if (chbxShowAll.Checked) { if (PageAPType.ToString().IsNotNullOrEmpty()) { if (PageAPType == MasterDataConstants.MDEvaluationSessionCategory.HEALTH_CHECKUP) { fe = "MDEvaluationSessionCategory.SessionCategoryID " + " = " + MasterDataConstants.MDEvaluationSessionCategory.HEALTH_CHECKUP; } else if (PageAPType == MasterDataConstants.MDEvaluationSessionCategory.QUARTERLY_EVALUATIONS) { fe = "MDEvaluationSessionCategory.SessionCategoryID " + " <> " + MasterDataConstants.MDEvaluationSessionCategory.HEALTH_CHECKUP; } } } if (chbxFilter.Checked) { if (txtSearchText.Text.Trim().IsNotNullOrEmpty()) { String fe55 = SqlExpressionBuilder.PrepareFilterExpression("HREmployeeEvaluation.SupervisorEmployeeCode", txtSearchText.Text.ToString(), SQLMatchType.Equal); String fe6 = SqlExpressionBuilder.PrepareFilterExpression("HREmployeeEvaluation.EmployeeCode", txtSearchText.Text.ToString(), SQLMatchType.Equal); String fe_code = SqlExpressionBuilder.PrepareFilterExpression(fe55, SQLJoinType.OR, fe6); if (fe.IsNotNullOrEmpty()) { fe = SqlExpressionBuilder.PrepareFilterExpression(fe, SQLJoinType.AND, fe_code); } else { fe = fe_code; } } } e.InputParameters["filterExpression"] = fe; }