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

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = OTIssueWatchListEntity.FLD_NAME_IssueWatchListID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                oTIssueWatchListEntityList = FCCOTIssueWatchList.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(oTIssueWatchListEntityList ?? new List <OTIssueWatchListEntity>());
        }
        private void SaveOTIssueWatchListEntity()
        {
            if (IsValid)
            {
                try
                {
                    OTIssueWatchListEntity oTIssueWatchListEntity = BuildOTIssueWatchListEntity();

                    Int64 result = -1;

                    if (oTIssueWatchListEntity.IsNew)
                    {
                        result = FCCOTIssueWatchList.GetFacadeCreate().Add(oTIssueWatchListEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(OTIssueWatchListEntity.FLD_NAME_IssueWatchListID, oTIssueWatchListEntity.IssueWatchListID.ToString(), SQLMatchType.Equal);
                        result = FCCOTIssueWatchList.GetFacadeCreate().Update(oTIssueWatchListEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _IssueWatchListID       = 0;
                        _OTIssueWatchListEntity = new OTIssueWatchListEntity();
                        PrepareInitialView();
                        BindOTIssueWatchListList();

                        if (oTIssueWatchListEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "O TIssue Watch Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "O TIssue Watch Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (oTIssueWatchListEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add O TIssue Watch Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update O TIssue Watch Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
        protected void lvOTIssueWatchList_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 IssueWatchListID;

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(OTIssueWatchListEntity.FLD_NAME_IssueWatchListID, IssueWatchListID.ToString(), SQLMatchType.Equal);

                        OTIssueWatchListEntity oTIssueWatchListEntity = new OTIssueWatchListEntity();


                        result = FCCOTIssueWatchList.GetFacadeCreate().Delete(oTIssueWatchListEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _IssueWatchListID       = 0;
                            _OTIssueWatchListEntity = new OTIssueWatchListEntity();
                            PrepareInitialView();
                            BindOTIssueWatchListList();

                            MiscUtil.ShowMessage(lblMessage, "O TIssue Watch has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete O TIssue Watch.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }
        public IList <OTIssueWatchListEntity> GetData()
        {
            IList <OTIssueWatchListEntity> oTIssueWatchListEntityList = new List <OTIssueWatchListEntity>();

            try
            {
                oTIssueWatchListEntityList = FCCOTIssueWatchList.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(oTIssueWatchListEntityList ?? new List <OTIssueWatchListEntity>());
        }