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

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = KBMDUserTreeSettingEntity.FLD_NAME_UserTreeSettingID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                kBMDUserTreeSettingEntityList = FCCKBMDUserTreeSetting.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(kBMDUserTreeSettingEntityList ?? new List <KBMDUserTreeSettingEntity>());
        }
        private void SaveKBMDUserTreeSettingEntity()
        {
            if (IsValid)
            {
                try
                {
                    KBMDUserTreeSettingEntity kBMDUserTreeSettingEntity = BuildKBMDUserTreeSettingEntity();

                    Int64 result = -1;

                    if (kBMDUserTreeSettingEntity.IsNew)
                    {
                        result = FCCKBMDUserTreeSetting.GetFacadeCreate().Add(kBMDUserTreeSettingEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(KBMDUserTreeSettingEntity.FLD_NAME_UserTreeSettingID, kBMDUserTreeSettingEntity.UserTreeSettingID.ToString(), SQLMatchType.Equal);
                        result = FCCKBMDUserTreeSetting.GetFacadeCreate().Update(kBMDUserTreeSettingEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _UserTreeSettingID         = 0;
                        _KBMDUserTreeSettingEntity = new KBMDUserTreeSettingEntity();
                        PrepareInitialView();
                        BindKBMDUserTreeSettingList();

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

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(KBMDUserTreeSettingEntity.FLD_NAME_UserTreeSettingID, UserTreeSettingID.ToString(), SQLMatchType.Equal);

                        KBMDUserTreeSettingEntity kBMDUserTreeSettingEntity = new KBMDUserTreeSettingEntity();


                        result = FCCKBMDUserTreeSetting.GetFacadeCreate().Delete(kBMDUserTreeSettingEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _UserTreeSettingID         = 0;
                            _KBMDUserTreeSettingEntity = new KBMDUserTreeSettingEntity();
                            PrepareInitialView();
                            BindKBMDUserTreeSettingList();

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

            try
            {
                kBMDUserTreeSettingEntityList = FCCKBMDUserTreeSetting.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(kBMDUserTreeSettingEntityList ?? new List <KBMDUserTreeSettingEntity>());
        }