public IList <CMNMDEventStatusEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression)
        {
            IList <CMNMDEventStatusEntity> cMNMDEventStatusEntityList = new List <CMNMDEventStatusEntity>();

            try
            {
                if (pageSize == -1)
                {
                    pageSize = 1000000000;
                }

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = CMNMDEventStatusEntity.FLD_NAME_EventStatusID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

                startRowIndex = Convert.ToInt32(startRowIndex / pageSize) + 1;

                cMNMDEventStatusEntityList = FCCCMNMDEventStatus.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

                if (cMNMDEventStatusEntityList != null && cMNMDEventStatusEntityList.Count > 0)
                {
                    totalRowCount = cMNMDEventStatusEntityList[0].TotalRowCount;
                }
            }
            catch (Exception ex)
            {
            }

            return(cMNMDEventStatusEntityList ?? new List <CMNMDEventStatusEntity>());
        }
        private void SaveCMNMDEventStatusEntity()
        {
            if (IsValid)
            {
                try
                {
                    CMNMDEventStatusEntity cMNMDEventStatusEntity = BuildCMNMDEventStatusEntity();

                    Int64 result = -1;

                    if (cMNMDEventStatusEntity.IsNew)
                    {
                        result = FCCCMNMDEventStatus.GetFacadeCreate().Add(cMNMDEventStatusEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(CMNMDEventStatusEntity.FLD_NAME_EventStatusID, cMNMDEventStatusEntity.EventStatusID.ToString(), SQLMatchType.Equal);
                        result = FCCCMNMDEventStatus.GetFacadeCreate().Update(cMNMDEventStatusEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _EventStatusID          = 0;
                        _CMNMDEventStatusEntity = new CMNMDEventStatusEntity();
                        PrepareInitialView();
                        BindCMNMDEventStatusList();

                        if (cMNMDEventStatusEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "C MNEvent Status Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "C MNEvent Status Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (cMNMDEventStatusEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add C MNEvent Status Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update C MNEvent Status Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
        protected void lvCMNMDEventStatus_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 EventStatusID;

            Int64.TryParse(e.CommandArgument.ToString(), out EventStatusID);

            if (EventStatusID > 0)
            {
                if (string.Equals(e.CommandName, "EditItem"))
                {
                    _EventStatusID = EventStatusID;

                    PrepareEditView();

                    cpeEditor.Collapsed   = false;
                    cpeEditor.ClientState = "false";
                }
                else if (string.Equals(e.CommandName, "DeleteItem"))
                {
                    try
                    {
                        Int64 result = -1;

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(CMNMDEventStatusEntity.FLD_NAME_EventStatusID, EventStatusID.ToString(), SQLMatchType.Equal);

                        CMNMDEventStatusEntity cMNMDEventStatusEntity = new CMNMDEventStatusEntity();


                        result = FCCCMNMDEventStatus.GetFacadeCreate().Delete(cMNMDEventStatusEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _EventStatusID          = 0;
                            _CMNMDEventStatusEntity = new CMNMDEventStatusEntity();
                            PrepareInitialView();
                            BindCMNMDEventStatusList();

                            MiscUtil.ShowMessage(lblMessage, "C MNEvent Status has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete C MNEvent Status.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }
        public IList <CMNMDEventStatusEntity> GetData()
        {
            IList <CMNMDEventStatusEntity> cMNMDEventStatusEntityList = new List <CMNMDEventStatusEntity>();

            try
            {
                cMNMDEventStatusEntityList = FCCCMNMDEventStatus.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

                if (cMNMDEventStatusEntityList != null && cMNMDEventStatusEntityList.Count > 0)
                {
                    totalRowCount = cMNMDEventStatusEntityList[0].TotalRowCount;
                }
            }
            catch (Exception ex)
            {
            }

            return(cMNMDEventStatusEntityList ?? new List <CMNMDEventStatusEntity>());
        }