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

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = KBUserTreeModifiedHistoryEntity.FLD_NAME_UserTreeHistoryID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                kBUserTreeModifiedHistoryEntityList = FCCKBUserTreeModifiedHistory.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(kBUserTreeModifiedHistoryEntityList ?? new List <KBUserTreeModifiedHistoryEntity>());
        }
        private void SaveKBUserTreeModifiedHistoryEntity()
        {
            if (IsValid)
            {
                try
                {
                    KBUserTreeModifiedHistoryEntity kBUserTreeModifiedHistoryEntity = BuildKBUserTreeModifiedHistoryEntity();

                    Int64 result = -1;

                    if (kBUserTreeModifiedHistoryEntity.IsNew)
                    {
                        result = FCCKBUserTreeModifiedHistory.GetFacadeCreate().Add(kBUserTreeModifiedHistoryEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(KBUserTreeModifiedHistoryEntity.FLD_NAME_UserTreeHistoryID, kBUserTreeModifiedHistoryEntity.UserTreeHistoryID.ToString(), SQLMatchType.Equal);
                        result = FCCKBUserTreeModifiedHistory.GetFacadeCreate().Update(kBUserTreeModifiedHistoryEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _UserTreeHistoryID = 0;
                        _KBUserTreeModifiedHistoryEntity = new KBUserTreeModifiedHistoryEntity();
                        PrepareInitialView();
                        BindKBUserTreeModifiedHistoryList();

                        if (kBUserTreeModifiedHistoryEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "K BUser Tree Modified History Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "K BUser Tree Modified History Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (kBUserTreeModifiedHistoryEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add K BUser Tree Modified History Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update K BUser Tree Modified History Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
        protected void lvKBUserTreeModifiedHistory_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 UserTreeHistoryID;

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(KBUserTreeModifiedHistoryEntity.FLD_NAME_UserTreeHistoryID, UserTreeHistoryID.ToString(), SQLMatchType.Equal);

                        KBUserTreeModifiedHistoryEntity kBUserTreeModifiedHistoryEntity = new KBUserTreeModifiedHistoryEntity();


                        result = FCCKBUserTreeModifiedHistory.GetFacadeCreate().Delete(kBUserTreeModifiedHistoryEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _UserTreeHistoryID = 0;
                            _KBUserTreeModifiedHistoryEntity = new KBUserTreeModifiedHistoryEntity();
                            PrepareInitialView();
                            BindKBUserTreeModifiedHistoryList();

                            MiscUtil.ShowMessage(lblMessage, "K BUser Tree Modified History has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete K BUser Tree Modified History.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }
        public IList <KBUserTreeModifiedHistoryEntity> GetData()
        {
            IList <KBUserTreeModifiedHistoryEntity> kBUserTreeModifiedHistoryEntityList = new List <KBUserTreeModifiedHistoryEntity>();

            try
            {
                kBUserTreeModifiedHistoryEntityList = FCCKBUserTreeModifiedHistory.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(kBUserTreeModifiedHistoryEntityList ?? new List <KBUserTreeModifiedHistoryEntity>());
        }