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

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = CRMMDCommunicationStatusEntity.FLD_NAME_CommunicationStatusID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                cRMMDCommunicationStatusEntityList = FCCCRMMDCommunicationStatus.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(cRMMDCommunicationStatusEntityList ?? new List <CRMMDCommunicationStatusEntity>());
        }
        private void SaveCRMMDCommunicationStatusEntity()
        {
            if (IsValid)
            {
                try
                {
                    CRMMDCommunicationStatusEntity cRMMDCommunicationStatusEntity = BuildCRMMDCommunicationStatusEntity();

                    Int64 result = -1;

                    if (cRMMDCommunicationStatusEntity.IsNew)
                    {
                        result = FCCCRMMDCommunicationStatus.GetFacadeCreate().Add(cRMMDCommunicationStatusEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(CRMMDCommunicationStatusEntity.FLD_NAME_CommunicationStatusID, cRMMDCommunicationStatusEntity.CommunicationStatusID.ToString(), SQLMatchType.Equal);
                        result = FCCCRMMDCommunicationStatus.GetFacadeCreate().Update(cRMMDCommunicationStatusEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _CommunicationStatusID          = 0;
                        _CRMMDCommunicationStatusEntity = new CRMMDCommunicationStatusEntity();
                        PrepareInitialView();
                        BindCRMMDCommunicationStatusList();

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

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(CRMMDCommunicationStatusEntity.FLD_NAME_CommunicationStatusID, CommunicationStatusID.ToString(), SQLMatchType.Equal);

                        CRMMDCommunicationStatusEntity cRMMDCommunicationStatusEntity = new CRMMDCommunicationStatusEntity();


                        result = FCCCRMMDCommunicationStatus.GetFacadeCreate().Delete(cRMMDCommunicationStatusEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _CommunicationStatusID          = 0;
                            _CRMMDCommunicationStatusEntity = new CRMMDCommunicationStatusEntity();
                            PrepareInitialView();
                            BindCRMMDCommunicationStatusList();

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

            try
            {
                cRMMDCommunicationStatusEntityList = FCCCRMMDCommunicationStatus.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(cRMMDCommunicationStatusEntityList ?? new List <CRMMDCommunicationStatusEntity>());
        }