Beispiel #1
0
        public IList <KBMDUserTreeStatusEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression)
        {
            IList <KBMDUserTreeStatusEntity> kBMDUserTreeStatusEntityList = new List <KBMDUserTreeStatusEntity>();

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = KBMDUserTreeStatusEntity.FLD_NAME_UserTreeStatusID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                kBMDUserTreeStatusEntityList = FCCKBMDUserTreeStatus.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(kBMDUserTreeStatusEntityList ?? new List <KBMDUserTreeStatusEntity>());
        }
Beispiel #2
0
        private void SaveKBMDUserTreeStatusEntity()
        {
            if (IsValid)
            {
                try
                {
                    KBMDUserTreeStatusEntity kBMDUserTreeStatusEntity = BuildKBMDUserTreeStatusEntity();

                    Int64 result = -1;

                    if (kBMDUserTreeStatusEntity.IsNew)
                    {
                        result = FCCKBMDUserTreeStatus.GetFacadeCreate().Add(kBMDUserTreeStatusEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(KBMDUserTreeStatusEntity.FLD_NAME_UserTreeStatusID, kBMDUserTreeStatusEntity.UserTreeStatusID.ToString(), SQLMatchType.Equal);
                        result = FCCKBMDUserTreeStatus.GetFacadeCreate().Update(kBMDUserTreeStatusEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _UserTreeStatusID         = 0;
                        _KBMDUserTreeStatusEntity = new KBMDUserTreeStatusEntity();
                        PrepareInitialView();
                        BindKBMDUserTreeStatusList();

                        if (kBMDUserTreeStatusEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "K BUser Tree Status Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "K BUser Tree Status Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (kBMDUserTreeStatusEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add K BUser Tree Status Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update K BUser Tree Status Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
Beispiel #3
0
        protected void lvKBMDUserTreeStatus_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 UserTreeStatusID;

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(KBMDUserTreeStatusEntity.FLD_NAME_UserTreeStatusID, UserTreeStatusID.ToString(), SQLMatchType.Equal);

                        KBMDUserTreeStatusEntity kBMDUserTreeStatusEntity = new KBMDUserTreeStatusEntity();


                        result = FCCKBMDUserTreeStatus.GetFacadeCreate().Delete(kBMDUserTreeStatusEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _UserTreeStatusID         = 0;
                            _KBMDUserTreeStatusEntity = new KBMDUserTreeStatusEntity();
                            PrepareInitialView();
                            BindKBMDUserTreeStatusList();

                            MiscUtil.ShowMessage(lblMessage, "K BUser Tree Status has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete K BUser Tree Status.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }
Beispiel #4
0
        public IList <KBMDUserTreeStatusEntity> GetData()
        {
            IList <KBMDUserTreeStatusEntity> kBMDUserTreeStatusEntityList = new List <KBMDUserTreeStatusEntity>();

            try
            {
                kBMDUserTreeStatusEntityList = FCCKBMDUserTreeStatus.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(kBMDUserTreeStatusEntityList ?? new List <KBMDUserTreeStatusEntity>());
        }