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