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

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = KBUserTreeSharedEntity.FLD_NAME_UserTreeSharedID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                kBUserTreeSharedEntityList = FCCKBUserTreeShared.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(kBUserTreeSharedEntityList ?? new List <KBUserTreeSharedEntity>());
        }
        private void SaveKBUserTreeSharedEntity()
        {
            if (IsValid)
            {
                try
                {
                    KBUserTreeSharedEntity kBUserTreeSharedEntity = BuildKBUserTreeSharedEntity();

                    Int64 result = -1;

                    if (kBUserTreeSharedEntity.IsNew)
                    {
                        result = FCCKBUserTreeShared.GetFacadeCreate().Add(kBUserTreeSharedEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(KBUserTreeSharedEntity.FLD_NAME_UserTreeSharedID, kBUserTreeSharedEntity.UserTreeSharedID.ToString(), SQLMatchType.Equal);
                        result = FCCKBUserTreeShared.GetFacadeCreate().Update(kBUserTreeSharedEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _UserTreeSharedID       = 0;
                        _KBUserTreeSharedEntity = new KBUserTreeSharedEntity();
                        PrepareInitialView();
                        BindKBUserTreeSharedList();

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

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(KBUserTreeSharedEntity.FLD_NAME_UserTreeSharedID, UserTreeSharedID.ToString(), SQLMatchType.Equal);

                        KBUserTreeSharedEntity kBUserTreeSharedEntity = new KBUserTreeSharedEntity();


                        result = FCCKBUserTreeShared.GetFacadeCreate().Delete(kBUserTreeSharedEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _UserTreeSharedID       = 0;
                            _KBUserTreeSharedEntity = new KBUserTreeSharedEntity();
                            PrepareInitialView();
                            BindKBUserTreeSharedList();

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

            try
            {
                kBUserTreeSharedEntityList = FCCKBUserTreeShared.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(kBUserTreeSharedEntityList ?? new List <KBUserTreeSharedEntity>());
        }