public IList <CMNMDEventIdentityCategoryEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression) { IList <CMNMDEventIdentityCategoryEntity> cMNMDEventIdentityCategoryEntityList = new List <CMNMDEventIdentityCategoryEntity>(); try { if (pageSize == -1) { pageSize = 1000000000; } if (String.IsNullOrEmpty(sortExpression)) { sortExpression = CMNMDEventIdentityCategoryEntity.FLD_NAME_EventIdentityCategoryID + " " + SQLConstants.SORT_ORDER_DESCENDING; } startRowIndex = Convert.ToInt32(startRowIndex / pageSize) + 1; cMNMDEventIdentityCategoryEntityList = FCCCMNMDEventIdentityCategory.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression); if (cMNMDEventIdentityCategoryEntityList != null && cMNMDEventIdentityCategoryEntityList.Count > 0) { totalRowCount = cMNMDEventIdentityCategoryEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(cMNMDEventIdentityCategoryEntityList ?? new List <CMNMDEventIdentityCategoryEntity>()); }
private void SaveCMNMDEventIdentityCategoryEntity() { if (IsValid) { try { CMNMDEventIdentityCategoryEntity cMNMDEventIdentityCategoryEntity = BuildCMNMDEventIdentityCategoryEntity(); Int64 result = -1; if (cMNMDEventIdentityCategoryEntity.IsNew) { result = FCCCMNMDEventIdentityCategory.GetFacadeCreate().Add(cMNMDEventIdentityCategoryEntity, DatabaseOperationType.Add, TransactionRequired.No); } else { String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(CMNMDEventIdentityCategoryEntity.FLD_NAME_EventIdentityCategoryID, cMNMDEventIdentityCategoryEntity.EventIdentityCategoryID.ToString(), SQLMatchType.Equal); result = FCCCMNMDEventIdentityCategory.GetFacadeCreate().Update(cMNMDEventIdentityCategoryEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No); } if (result > 0) { _EventIdentityCategoryID = 0; _CMNMDEventIdentityCategoryEntity = new CMNMDEventIdentityCategoryEntity(); PrepareInitialView(); BindCMNMDEventIdentityCategoryList(); if (cMNMDEventIdentityCategoryEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "C MNEvent Identity Category Information has been added successfully.", false); } else { MiscUtil.ShowMessage(lblMessage, "C MNEvent Identity Category Information has been updated successfully.", false); } } else { if (cMNMDEventIdentityCategoryEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "Failed to add C MNEvent Identity Category Information.", false); } else { MiscUtil.ShowMessage(lblMessage, "Failed to update C MNEvent Identity Category Information.", false); } } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } }
protected void lvCMNMDEventIdentityCategory_ItemCommand(object sender, ListViewCommandEventArgs e) { Int64 EventIdentityCategoryID; Int64.TryParse(e.CommandArgument.ToString(), out EventIdentityCategoryID); if (EventIdentityCategoryID > 0) { if (string.Equals(e.CommandName, "EditItem")) { _EventIdentityCategoryID = EventIdentityCategoryID; PrepareEditView(); cpeEditor.Collapsed = false; cpeEditor.ClientState = "false"; } else if (string.Equals(e.CommandName, "DeleteItem")) { try { Int64 result = -1; String fe = SqlExpressionBuilder.PrepareFilterExpression(CMNMDEventIdentityCategoryEntity.FLD_NAME_EventIdentityCategoryID, EventIdentityCategoryID.ToString(), SQLMatchType.Equal); CMNMDEventIdentityCategoryEntity cMNMDEventIdentityCategoryEntity = new CMNMDEventIdentityCategoryEntity(); result = FCCCMNMDEventIdentityCategory.GetFacadeCreate().Delete(cMNMDEventIdentityCategoryEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No); if (result == 0) { _EventIdentityCategoryID = 0; _CMNMDEventIdentityCategoryEntity = new CMNMDEventIdentityCategoryEntity(); PrepareInitialView(); BindCMNMDEventIdentityCategoryList(); MiscUtil.ShowMessage(lblMessage, "C MNEvent Identity Category has been successfully deleted.", true); } else { MiscUtil.ShowMessage(lblMessage, "Failed to delete C MNEvent Identity Category.", true); } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } } }
public IList <CMNMDEventIdentityCategoryEntity> GetData() { IList <CMNMDEventIdentityCategoryEntity> cMNMDEventIdentityCategoryEntityList = new List <CMNMDEventIdentityCategoryEntity>(); try { cMNMDEventIdentityCategoryEntityList = FCCCMNMDEventIdentityCategory.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load); if (cMNMDEventIdentityCategoryEntityList != null && cMNMDEventIdentityCategoryEntityList.Count > 0) { totalRowCount = cMNMDEventIdentityCategoryEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(cMNMDEventIdentityCategoryEntityList ?? new List <CMNMDEventIdentityCategoryEntity>()); }