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